more work on the plugins system
[diogenes.git] / include / Plugin / Skel.php
index f457c5d..19c58a8 100644 (file)
@@ -25,6 +25,7 @@ require_once 'Tree/Node.php';
 define('PLUG_DISABLED', 0);
 define('PLUG_ACTIVE', 1);
 define('PLUG_LOCK', 2);
+define('PLUG_SET', 4);
 
 /** Recursive stripslashes.
  *
@@ -62,7 +63,7 @@ class Diogenes_Plugin_Skel {
   
   /** The plugin status (disabled, available, active) */
   var $status = PLUG_DISABLED;
-  
   /** Is the plugin allowed with respect to a given write permission on a page ?
    *
    * @param $wperms
@@ -77,7 +78,7 @@ class Diogenes_Plugin_Skel {
    */
   function declareParam($key, $val)
   {
-    $this->params[$key] = $val;
+    $this->params[$key]['value'] = $val;
   }
 
 
@@ -93,7 +94,7 @@ class Diogenes_Plugin_Skel {
    */
   function getParamValue($key)
   {
-    return isset($this->params[$key]) ? $this->params[$key] : '';
+    return isset($this->params[$key]['value']) ? $this->params[$key]['value'] : '';
   }
 
 
@@ -101,9 +102,8 @@ class Diogenes_Plugin_Skel {
    */
   function setParamValue($key, $val)
   {
-    if (isset($this->params[$key])) {
-      $this->params[$key] = $val; 
-    } else {
+    if (isset($this->params[$key]['value'])) {
+      $this->params[$key]['value'] = $val; 
     }
   }
 
@@ -136,7 +136,7 @@ class Diogenes_Plugin_Skel {
       $this->status = $plugentry['status'];
       foreach ($plugentry['params'] as $key => $val)
       {
-        $this->setParamValue($key, $val);
+        $this->setParamValue($key, $val['value']);
       }
   }