X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2FBarrel.php;h=aab8e3f4ef2dba9ae5d5a1c946eb559fff373557;hb=7aff44b2a3193e43aedfd7bf7fc3801bcffcf3e0;hp=cc41014e676df1eaa7ee2eaa87b7b1edc077091b;hpb=6855525e48fad5de270500a5445c4f4ff85d8bda;p=diogenes.git diff --git a/include/Barrel.php b/include/Barrel.php index cc41014..aab8e3f 100644 --- a/include/Barrel.php +++ b/include/Barrel.php @@ -21,6 +21,7 @@ require_once 'Barrel/Page.php'; require_once 'Barrel/Options.php'; require_once 'diogenes/diogenes.flagset.inc.php'; +require_once 'Plugin/Skel.php'; /** This class describes a Diogenes Barrel. @@ -244,24 +245,6 @@ class Diogenes_Barrel } - /** List the plugins that are active in a given context - * - * @param $page - */ - function getPlugins($page = 0) - { - $plugins = array(); - foreach ($this->pluginsCache as $plug) - { - if ($plug['page'] == $page) - { - array_push($plugins, $plug); - } - } - return $plugins; - } - - /** Check whether the barrel has a given flag * * @param $flag @@ -326,7 +309,7 @@ class Diogenes_Barrel } - /** Load all plugins for the specified page. + /** Load all active plugins for the specified page. * * @param $bpage */ @@ -334,12 +317,11 @@ class Diogenes_Barrel { global $globals; - $plugins = $this->getPlugins($bpage->props['PID']); - + $plugins = $globals->plugins->cacheGetActive($this->pluginsCache, $this->alias, $page); $loaded = array(); - foreach ($plugins as $plugentry) + foreach ($plugins as $plugname => $plugentry) { - $loaded[$plugentry['plugin']] =& $globals->plugins->load($plugentry); + $loaded[$plugname] =& $globals->plugins->load($plugname, $plugentry); } return $loaded; }