X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Ftoplevel%2Fplugins.php;fp=htdocs%2Ftoplevel%2Fplugins.php;h=c874d4d0eecc65623126265480da6a57c438d82b;hb=6855525e48fad5de270500a5445c4f4ff85d8bda;hp=0000000000000000000000000000000000000000;hpb=e69709aa8ee6108a1197e46b45367ba8dab55a52;p=diogenes.git diff --git a/htdocs/toplevel/plugins.php b/htdocs/toplevel/plugins.php new file mode 100644 index 0000000..c874d4d --- /dev/null +++ b/htdocs/toplevel/plugins.php @@ -0,0 +1,60 @@ +toplevel(true); +$page->assign('post',$page->script_self()); + +$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; +$barrel = isset($_REQUEST['plug_barrel']) ? $_REQUEST['plug_barrel'] : ''; + +if ($action == "clean") +{ + $globals->plugins->clean_database($page); +} + +if ($barrel) +{ + $page->assign('greeting',__("Barrel plugins") . " - $barrel"); +} else { + $page->assign('greeting',__("Global plugin settings")); +} + +/* plugin editor */ +$editor = new Diogenes_Plugin_Editor($barrel, 0); +$editor->hide_params(1); +$editor->run($page,'editor_content'); + +// if necessary, rebuild site plugin caches +if ($action == "update" && !$barrel) +{ + $res = $globals->db->query("select alias,flags from diogenes_site"); + while (list($p_alias, $p_flags) = mysql_fetch_row($res)) + { + $flags = new flagset($p_flags); + if ($p_alias && $flags->hasFlag('plug')) + { + $page->info(sprintf( __("Rebuilding plugin cache for barrel '%s'"), $p_alias)); + $cachefile = $globals->plugins->cacheFile($p_alias); + $globals->plugins->compileCache($cachefile, $p_alias); + } + } + mysql_free_result($res); +} + +// translations +$page->assign('msg_clean_database', __('Clean plugins database')); +$page->assign('msg_clean_database_text', __("If you are having problems with references to plugins that no longer exist, you can have Diogenes remove such entries from the database.")); +$page->assign('msg_clean', __("Clean")); + +$page->assign('msg_enable_disable', __('Enable or disable plugins')); +if ($barrel) +{ + $page->assign('msg_enable_disable_text', __("You can select the plugins you want to enable for this barrel.")); +} else { + $page->assign('msg_enable_disable_text', __("You can select the plugins you want to enable or disable globally, that is the plugins that can be used in the different barrels. Please note that for a plugin to be accessible from a barrel, you will need to activate that plugin for the barrel. To do this, from the List of sites click on 'plugins' next to the barrel of your choice.")); +} +$page->display('toplevel-plugins.tpl'); + +?>