X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Ftoplevel%2Fplugins.php;h=c874d4d0eecc65623126265480da6a57c438d82b;hb=fcc3110e8eee6ce903281d41f0e4b24e45f986dd;hp=e449f168bad0da28fcfd14f6cdf0d22fc1d08e6f;hpb=7aff44b2a3193e43aedfd7bf7fc3801bcffcf3e0;p=diogenes.git diff --git a/htdocs/toplevel/plugins.php b/htdocs/toplevel/plugins.php index e449f16..c874d4d 100644 --- a/htdocs/toplevel/plugins.php +++ b/htdocs/toplevel/plugins.php @@ -23,9 +23,26 @@ if ($barrel) /* plugin editor */ $editor = new Diogenes_Plugin_Editor($barrel, 0); -$editor->set_mode(MODE_ROOT); +$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."));