X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2FPlugins.php;h=120e22c9376628f8ad23ed6be44cbd26952f1ed8;hb=7aff44b2a3193e43aedfd7bf7fc3801bcffcf3e0;hp=c998925fe572a691f2d794f9305c561fe138da49;hpb=16807ba08214124b17b1f14226be12cdd646adc1;p=diogenes.git diff --git a/include/Plugins.php b/include/Plugins.php index c998925..120e22c 100644 --- a/include/Plugins.php +++ b/include/Plugins.php @@ -61,6 +61,7 @@ class Diogenes_Plugins return $cachefile; } + /** Return the cache entry for specified plugin * * @param $cache @@ -75,27 +76,6 @@ class Diogenes_Plugins } - /** Return the cache entry for a plugin at a specified position - * - * @param $cache - * @param $barrel - * @param $page - * @param $pos - */ - function cacheGetAtPos($cache, $barrel, $page, $pos) - { - $p_node = $this->cacheGetPageNode($cache, $barrel, $page); - foreach ($p_node->data as $plugname => $plugentry) - { - if ($plugentry['pos'] == $pos) - { - $plugentry['plugin'] = $plugname; - return $plugentry; - } - } - } - - /** Return the cache entry for specified plugin * * @param $cache @@ -120,16 +100,16 @@ class Diogenes_Plugins * @param $barrel * @param $page */ - function cachedActive($cache, $barrel, $page) + function cacheGetActive($cache, $barrel, $page) { $p_node = $this->cacheGetPageNode($cache, $barrel, $page); $plugins = array(); foreach ($p_node->data as $plugname => $plugentry) { - //echo "cachedEditable : examining $plugname (status {$plugentry['status']})
\n"; + //echo "cacheGetActive : examining $plugname (status {$plugentry['status']})
\n"; if ($plugentry['status'] & PLUG_ACTIVE) { - //echo "cachedActive : adding $plugname
\n"; + //echo "cacheGetActive : adding $plugname
\n"; $plugins[$plugname] = $plugentry; } } @@ -144,23 +124,10 @@ class Diogenes_Plugins * @param $barrel * @param $page */ - function cachedVisible($cache, $barrel, $page) + function cacheGetVisible($cache, $barrel, $page) { $p_node = $this->cacheGetPageNode($cache, $barrel, $page); return $p_node->data; -/* - $available = array(); - foreach ($p_node->data as $plugname => $plugentry) - { - //echo "cachedEditable : examining $plugname (status {$plugentry['status']})
\n"; - if (!($plugentry['status'] & PLUG_LOCK) || !$barrel) - { - //echo "cachedEditable : adding $plugname
\n"; - $available[$plugname] = $plugentry; - // } - } - return $available; -*/ } @@ -197,10 +164,9 @@ class Diogenes_Plugins { //echo "* plugin '$plugin' not locked off parent level
\n"; $outval = $parentval; - if (is_array($node->data[$plugin])) + if ((is_array($node->data[$plugin])) && ($node->data[$plugin]['status'] & PLUG_SET)) { //echo "** plugin set at current level
\n"; - $outval['pos'] = $node->data[$plugin]['pos']; $outval['params'] = $node->data[$plugin]['params']; if (!($parentval['status'] & PLUG_LOCK)) { //echo "*** plugin status set to DB-specified value
\n"; @@ -262,7 +228,7 @@ class Diogenes_Plugins $dbcache = array(); $sql_limit = $barrel ? " where barrel='{$barrel}' or barrel=''" : ""; - $sql = "select barrel, page, plugin, status, pos, params from diogenes_plugin" . $sql_limit; + $sql = "select barrel, page, plugin, status, params from diogenes_plugin" . $sql_limit; $res = $this->dbh->query($sql); while($row = mysql_fetch_row($res)) { @@ -271,8 +237,7 @@ class Diogenes_Plugins $plugin = array_shift($row); $plugentry = array( 'status' => $row[0], - 'pos' => $row[1], - 'params' => ($row[2] ? var_decode_bin($row[2]) : array()) + 'params' => ($row[1] ? var_decode_bin($row[1]) : array()) ); $plug_h = $this->load($plugin, $plugentry); //echo "Got params from DB for '$plugin', barrel '$c_barrel', page '$c_page' : ".$row[2]."
"; @@ -373,9 +338,6 @@ class Diogenes_Plugins $trclass = $odd ? ' class="odd"' : ''; $out .= "{$val['name']} v{$val['version']}\n"; $out .= "status{$val['status']}\n"; - if (isset($val['pos'])) { - $out .= "position{$val['pos']}\n"; - } $out .= "type{$val['type']}\n"; $out .= "description{$val['description']}\n"; if (!empty($val['params'])) {