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['buildxml_id']) && in_array($_POST['buildxml_id'], $plugins)) { $xml_content = tweakStores::generateXML($_POST['buildxml_id'], $modules[$_POST['buildxml_id']], $file_pattern); } if (!empty($_POST['write_xml'])) { if (empty($_POST['your_pwd']) || !$core->auth->checkPassword($_POST['your_pwd'])) { $core->error->add(__('Password verification failed')); } else { $ret = tweakStores::writeXML($_POST['buildxml_id'], $modules[$_POST['buildxml_id']], $file_pattern); if (!empty(tweakStores::$failed)) { $core->error->add(implode(' ', tweakStores::$failed)); } } } echo '
' . __('You must configure zip file pattern to complete xml code automaticaly.') . '
'; } echo '