00001 <?php
00002 require_once 'diogenes.common.inc.php';
00003 require_once 'diogenes.toplevel.inc.php';
00004 require_once 'Plugin/Editor.php';
00005
00006 $page = new $globals->toplevel(true);
00007 $page->assign('post',$page->script_self());
00008
00009 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
00010 $barrel = isset($_REQUEST['plug_barrel']) ? $_REQUEST['plug_barrel'] : '';
00011
00012 if ($action == "clean")
00013 {
00014 $globals->plugins->clean_database($page);
00015 }
00016
00017 if ($barrel)
00018 {
00019 $page->assign('greeting',__("Barrel plugins") . " - $barrel");
00020 } else {
00021 $page->assign('greeting',__("Global plugin settings"));
00022 }
00023
00024
00025 $editor = new Diogenes_Plugin_Editor($barrel, 0);
00026 $editor->hide_params(1);
00027 $editor->run($page,'editor_content');
00028
00029
00030 if ($action == "update" && !$barrel)
00031 {
00032 $res = $globals->db->query("select alias,flags from diogenes_site");
00033 while (list($p_alias, $p_flags) = mysql_fetch_row($res))
00034 {
00035 $flags = new flagset($p_flags);
00036 if ($p_alias && $flags->hasFlag('plug'))
00037 {
00038 $page->info(sprintf( __("Rebuilding plugin cache for barrel '%s'"), $p_alias));
00039 $cachefile = $globals->plugins->cacheFile($p_alias);
00040 $globals->plugins->compileCache($cachefile, $p_alias);
00041 }
00042 }
00043 mysql_free_result($res);
00044 }
00045
00046
00047 $page->assign('msg_clean_database', __('Clean plugins database'));
00048 $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."));
00049 $page->assign('msg_clean', __("Clean"));
00050
00051 $page->assign('msg_enable_disable', __('Enable or disable plugins'));
00052 if ($barrel)
00053 {
00054 $page->assign('msg_enable_disable_text', __("You can select the plugins you want to enable for this barrel."));
00055 } else {
00056 $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 <i>List of sites</i> click on 'plugins' next to the barrel of your choice."));
00057 }
00058 $page->display('toplevel-plugins.tpl');
00059
00060 ?>