separation of the GUI
[old-projects.git] / philter / philter / include / philter.inc.php
index 8874dcd..74ef94d 100644 (file)
@@ -10,6 +10,7 @@
 require_once("include/core.inc.php");
 
 function i18n($_index) { global $philter; echo $philter->i18n($_index); }
+function _i18n($_index) { global $philter; return $philter->i18n($_index); }
 
 /** Philter base configuration class
  * This is the base class of Philter.
@@ -29,12 +30,16 @@ class Philter {
             'path'    => array('procmail', 'spool'),
             'match_plugins' => array(),
             'action_plugins' => array(),
-            'global_plugin' => array(),
+            'global_plugins' => array(),
             'i18n' => array()
         );
         $this->err = "";
     }
 
+    function set_advanced() { $_SESSION['philter_adv'] = true; }
+    function del_advanced() { unset($_SESSION['philter_adv']); }
+    function is_advanced() { return isset($_SESSION['philter_adv']); }
+
     /** returns the i18n string
      * @param   $_index   the index of the string
      * @returns the string or false
@@ -132,12 +137,12 @@ class Philter {
                 return false;
             }
             
-            if(isset($this->config['global_plugin'][$rtti])) {
+            if(isset($this->config['global_plugins'][$rtti])) {
                 $this->err = "Philter::register_global_plugin : a plugin is already registerd";
                 return false;
             }
             
-            $this->config['global_plugin'][$rtti] = $_plugin;
+            $this->config['global_plugins'][$rtti] = $_plugin;
             return true;
         }