auth->isSuperAdmin()) { return null; } $core->blog->settings->addNamespace('tweakStores'); if (!$core->blog->settings->tweakStores->active) { return null; } # Admin behaviors if ($core->blog->settings->tweakStores->packman) { $core->addBehavior('packmanBeforeCreatePackage', ['tweakStoresBehaviors', 'packmanBeforeCreatePackage']); } $core->addBehavior('pluginsToolsTabs', ['tweakStoresBehaviors', 'pluginsToolsTabs']); class tweakStoresBehaviors { public static function packmanBeforeCreatePackage(dcCore $core, $module) { tweakStores::writeXML($module['id'], $module, $core->blog->settings->tweakStores->file_pattern); } public static function pluginsToolsTabs(dcCore $core) { $file_pattern = $core->blog->settings->tweakStores->file_pattern; $distributed_modules = explode(',', DC_DISTRIB_PLUGINS); $plugins = [ __('Select a plugin') => '0']; $modules = $core->plugins->getModules(); foreach ($modules as $id => $module) { if (is_array($distributed_modules) && in_array($id, $distributed_modules)) { unset($modules[$id]); continue; } $plugins[$module['name'] . ' '. $module['version']] = $id; } if (!empty($_POST['build_xml']) && !empty($_POST['buildxml_id']) && in_array($_POST['buildxml_id'], $plugins)) { $xml_content = tweakStores::generateXML($_POST['buildxml_id'], $modules[$_POST['buildxml_id']], $file_pattern); } echo '