OSDN Git Service

REMOVE: Adminクラスの不要なメソッドを削除
[nucleus-jp/nucleus-next.git] / nucleus / libs / PARSER.php
index 0581e93..06f67cb 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 /*\r
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2012 The Nucleus Group\r
+ * Copyright (C) 2002-2009 The Nucleus Group\r
  *\r
  * This program is free software; you can redistribute it and/or\r
  * modify it under the terms of the GNU General Public License\r
@@ -11,8 +11,8 @@
  */\r
 /**\r
  * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2012 The Nucleus Group\r
- * @version $Id: PARSER.php 1728 2012-04-07 03:22:20Z sakamocchi $\r
+ * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
+ * @version $Id: PARSER.php 1757 2012-04-15 09:02:32Z sakamocchi $\r
  */\r
 \r
 if ( !function_exists('requestVar') )\r
@@ -33,6 +33,9 @@ class Parser
        // reference to actions handler\r
        public $handler;\r
        \r
+       // reference to an instance of Skin class\r
+       public $skin = NULL;\r
+       \r
        // delimiters that can be used for skin/templatevars\r
        public $delim;\r
        \r
@@ -47,18 +50,22 @@ class Parser
         * Creates a new parser object with the given allowed actions\r
         * and the given handler\r
         *\r
-        * @param $allowedActions array\r
         * @param $handler class object with functions for each action (reference)\r
         * @param $delim optional delimiter\r
         * @param $paramdelim optional parameterdelimiter\r
         */\r
-       public function __construct($allowedActions, &$handler, $delim = '(<%|%>)', $pdelim = ',')\r
+       public function __construct( &$handler, $delim = '(<%|%>)', $pdelim = ',')\r
        {\r
-               $this->actions  = $allowedActions;\r
-               $this->handler  =& $handler;\r
-               $this->delim    = $delim;\r
-               $this->pdelim   = $pdelim;\r
+               $this->handler  = &$handler;\r
+               $this->actions  =  $handler->getAvailableActions();\r
+               $this->delim    =  $delim;\r
+               $this->pdelim   =  $pdelim;\r
                $this->norestrictions = 0;      // set this to 1 to disable checking for allowedActions\r
+               \r
+               $this->skin             = NULL;\r
+               \r
+               $handler->setParser($this);\r
+               \r
                return;\r
        }\r
        \r
@@ -121,7 +128,7 @@ class Parser
                \r
                // skip execution of skinvars while inside an if condition which hides this part of the page\r
                $if_tags = array('else', 'elseif', 'endif', 'ifnot', 'elseifnot');\r
-               if ( !$this->handler->if_currentlevel\r
+               if ( !$this->handler->getTopIfCondition()\r
                  && !in_array($actionlc, $if_tags)\r
                  && (i18n::substr($actionlc, 0, 2) != 'if') )\r
                {\r
@@ -151,6 +158,18 @@ class Parser
        }\r
        \r
        /**\r
+        * Parser::setSkin()\r
+        * Set the skin\r
+        * @param       object  $skin   an instance of Skin class\r
+        * @return      void\r
+        */\r
+       public function setSkin(&$skin)\r
+       {\r
+               $this->skin = &$skin;\r
+               return;\r
+       }\r
+       \r
+       /**\r
         * Parser::setProperty()\r
         * Set a property of the parser in the manager\r
         * \r