OSDN Git Service

FIX:メンバーごとの管理エリア用スキンが反映されていなかったので修正
[nucleus-jp/nucleus-next.git] / nucleus / libs / ACTIONS.php
index 78820f5..8e86f6f 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
-/*\r
+/**\r
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2009 The Nucleus Group\r
+ * Copyright (C) 2002-2012 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
  * This class contains the functions that get called by using\r
  * the special tags in the skins\r
  *\r
- * The allowed tags for a type of skinpart are defined by the\r
- * SKIN::getAllowedActionsForType($type) method\r
- *\r
  * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
- * @version $Id: ACTIONS.php 1624 2012-01-09 11:36:20Z sakamocchi $\r
+ * @copyright Copyright (C) 2002-2012 The Nucleus Group\r
+ * @version $Id: ACTIONS.php 1863 2012-05-19 10:50:27Z sakamocchi $
  */\r
 \r
-class ACTIONS extends BaseActions {\r
-\r
+class Actions extends BaseActions\r
+{\r
        // part of the skin currently being parsed ('index', 'item', 'archive',\r
        // 'archivelist', 'member', 'search', 'error', 'imagepopup')\r
-       var $skintype;\r
-\r
+       private $skintype;\r
+       \r
        // contains an assoc array with parameters that need to be included when\r
        // generating links to items/archives/... (e.g. catid)\r
-       var $linkparams;\r
-\r
-       // reference to the skin object for which a part is being parsed\r
-       var $skin;\r
-\r
+       private $linkparams;\r
+       \r
        // used when including templated forms from the include/ dir. The $formdata var\r
        // contains the values to fill out in there (assoc array name -> value)\r
-       var $formdata;\r
-\r
+       private $formdata;\r
+       \r
        // filled out with the number of displayed items after calling one of the\r
        // (other)blog/(other)searchresults skinvars.\r
-       var $amountfound;\r
-\r
+       private $amountfound;\r
+       \r
        /**\r
-        * Constructor for a new ACTIONS object\r
+        * Actions::$default_actions\r
+        * list of whole action names with which this class can deal\r
+        */\r
+       static private $default_actions = array(\r
+               'addlink',\r
+               'addpopupcode',\r
+               'adminurl',\r
+               'archivelink',\r
+               'bloglist',\r
+               'category',\r
+               'loginform',\r
+               'member',\r
+               'nucleusbutton',\r
+               'otherarchivedaylist',\r
+               'otherarchivelist',\r
+               'otherarchiveyearlist',\r
+               'otherblog',\r
+               'plugin',\r
+               'referer',\r
+               'searchform',\r
+               'self',\r
+               'sitevar',\r
+               'skinname',\r
+               'sticky',\r
+               'todaylink',\r
+               'version',\r
+               // deprecated (Nucleus v2.0)\r
+               /* TODO: remove this */\r
+               'ifcat'\r
+       );\r
+       \r
+       /**\r
+        * Actions::$skin_type_friendly_names\r
+        * friendly name for wrapped page types\r
+        */\r
+       static public $default_skin_types = array(\r
+               'index'                 => _SKIN_PART_MAIN,\r
+               'item'                  => _SKIN_PART_ITEM,\r
+               'archivelist'   => _SKIN_PART_ALIST,\r
+               'archive'               => _SKIN_PART_ARCHIVE,\r
+               'search'                => _SKIN_PART_SEARCH,\r
+               'error'                 => _SKIN_PART_ERROR,\r
+               'member'                => _SKIN_PART_MEMBER,\r
+               'imagepopup'    => _SKIN_PART_POPUP\r
+       );\r
+       \r
+       /**\r
+        * Actions::getAvailableSkinTypes()\r
+        * \r
+        * @static\r
+        * @param       void\r
+        * @return      array   list of friendly names for page actions\r
+        */\r
+       static public function getAvailableSkinTypes()\r
+       {\r
+               return self::$default_skin_types;\r
+       }\r
+       \r
+       /**\r
+        * Actions::__construct()\r
+        * Constructor for a new Actions object\r
+        * \r
+        * @param       string  $type\r
+        * @return      void\r
         */\r
-       function ACTIONS($type) {\r
+       public function __construct($type)\r
+       {\r
+               global $catid;\r
+               \r
                // call constructor of superclass first\r
-               $this->BaseActions();\r
-\r
+               parent::__construct();\r
                $this->skintype = $type;\r
-\r
-               global $catid;\r
-               if ($catid)\r
+               \r
+               if ( $catid )\r
+               {\r
                        $this->linkparams = array('catid' => $catid);\r
+               }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-        *  Set the skin\r
+        * Actions::getAvailableActions()\r
+        * \r
+        * @param       void\r
+        * @return      array   allowed actions for the page type\r
         */\r
-       function setSkin(&$skin) {\r
-               $this->skin =& $skin;\r
+       public function getAvailableActions()\r
+       {\r
+               $extra_actions = array();\r
+               \r
+               switch ( $this->skintype )\r
+               {\r
+                       case 'index':\r
+                               $extra_actions = array(\r
+                                       'blog',\r
+                                       'blogsetting',\r
+                                       'preview',\r
+                                       'additemform',\r
+                                       'categorylist',\r
+                                       'archivelist',\r
+                                       'archivedaylist',\r
+                                       'archiveyearlist',\r
+                                       'nextlink',\r
+                                       'prevlink'\r
+                               );\r
+                               break;\r
+                       case 'archive':\r
+                               $extra_actions = array(\r
+                                       'blog',\r
+                                       'archive',\r
+                                       'otherarchive',\r
+                                       'categorylist',\r
+                                       'archivelist',\r
+                                       'archivedaylist',\r
+                                       'archiveyearlist',\r
+                                       'blogsetting',\r
+                                       'archivedate',\r
+                                       'nextarchive',\r
+                                       'prevarchive',\r
+                                       'nextlink',\r
+                                       'prevlink',\r
+                                       'archivetype'\r
+                               );\r
+                               break;\r
+                       case 'archivelist':\r
+                               $extra_actions = array(\r
+                                       'blog',\r
+                                       'archivelist',\r
+                                       'archivedaylist',\r
+                                       'archiveyearlist',\r
+                                       'categorylist',\r
+                                       'blogsetting'\r
+                               );\r
+                               break;\r
+                       case 'search':\r
+                               $extra_actions = array(\r
+                                       'blog',\r
+                                       'archivelist',\r
+                                       'archivedaylist',\r
+                                       'archiveyearlist',\r
+                                       'categorylist',\r
+                                       'searchresults',\r
+                                       'othersearchresults',\r
+                                       'blogsetting',\r
+                                       'query',\r
+                                       'nextlink',\r
+                                       'prevlink'\r
+                               );\r
+                               break;\r
+                       case 'imagepopup':\r
+                               $extra_actions = array(\r
+                                       'image',\r
+                                       // deprecated (Nucleus v2.0)\r
+                                       /* TODO: remove this */\r
+                                       'imagetext'\r
+                               );\r
+                               break;\r
+                       case 'member':\r
+                               $extra_actions = array(\r
+                                       'membermailform',\r
+                                       'blogsetting',\r
+                                       'nucleusbutton',\r
+                                       'categorylist'\r
+                               );\r
+                               break;\r
+                       case 'item':\r
+                               $extra_actions = array(\r
+                                       'blog',\r
+                                       'item',\r
+                                       'comments',\r
+                                       'commentform',\r
+                                       'vars',\r
+                                       'blogsetting',\r
+                                       'nextitem',\r
+                                       'previtem',\r
+                                       'nextlink',\r
+                                       'prevlink',\r
+                                       'nextitemtitle',\r
+                                       'previtemtitle',\r
+                                       'categorylist',\r
+                                       'archivelist',\r
+                                       'archivedaylist',\r
+                                       'archiveyearlist',\r
+                                       'itemtitle',\r
+                                       'itemid',\r
+                                       'itemlink'\r
+                               );\r
+                               break;\r
+                       case 'error':\r
+                               $extra_actions = array(\r
+                                       'errormessage',\r
+                                       'categorylist'\r
+                               );\r
+                               break;\r
+                       default:\r
+                                       $extra_actions = array(\r
+                                               'blog',\r
+                                               'blogsetting',\r
+                                               'preview',\r
+                                               'additemform',\r
+                                               'categorylist',\r
+                                               'archivelist',\r
+                                               'archivedaylist',\r
+                                               'archiveyearlist',\r
+                                               'nextlink',\r
+                                               'prevlink',\r
+                                               'membermailform',\r
+                                               'nucleusbutton',\r
+                                               'categorylist'\r
+                                       );\r
+                               break;\r
+               }\r
+               \r
+               $defined_actions = array_merge(self::$default_actions, $extra_actions);\r
+               \r
+               return array_merge($defined_actions, parent::getAvailableActions());\r
        }\r
-\r
+       \r
        /**\r
-        *  Set the parser\r
+        * Actions::doForm()\r
+        * Forms get parsedincluded now, using an extra <formdata> skinvar\r
+        *\r
+        * @param       string  $filename\r
+        * @return      void\r
         */\r
-       function setParser(&$parser) {\r
-               $this->parser =& $parser;\r
-       }\r
-\r
-       /**\r
-        *      Forms get parsedincluded now, using an extra <formdata> skinvar\r
-       */\r
-       function doForm($filename) {\r
+       public function doForm($filename)\r
+       {\r
                global $DIR_NUCLEUS;\r
-               array_push($this->parser->actions,'formdata','text','callback','errordiv','ticket');\r
-               $oldIncludeMode = PARSER::getProperty('IncludeMode');\r
-               $oldIncludePrefix = PARSER::getProperty('IncludePrefix');\r
-               PARSER::setProperty('IncludeMode','normal');\r
-               PARSER::setProperty('IncludePrefix','');\r
+               array_push($this->parser->actions,'formdata', 'callback','errordiv','ticket');\r
+               \r
+               $oldIncludeMode = Parser::getProperty('IncludeMode');\r
+               $oldIncludePrefix = Parser::getProperty('IncludePrefix');\r
+               Parser::setProperty('IncludeMode','normal');\r
+               Parser::setProperty('IncludePrefix','');\r
+               \r
                $this->parse_parsedinclude($DIR_NUCLEUS . 'forms/' . $filename . '.template');\r
-               PARSER::setProperty('IncludeMode',$oldIncludeMode);\r
-               PARSER::setProperty('IncludePrefix',$oldIncludePrefix);\r
-               array_pop($this->parser->actions);              // errordiv\r
-               array_pop($this->parser->actions);              // callback\r
-               array_pop($this->parser->actions);              // text\r
-               array_pop($this->parser->actions);              // formdata\r
-               array_pop($this->parser->actions);              // ticket\r
+               Parser::setProperty('IncludeMode',$oldIncludeMode);\r
+               Parser::setProperty('IncludePrefix',$oldIncludePrefix);\r
+               \r
+               array_pop($this->parser->actions);      // errordiv\r
+               array_pop($this->parser->actions);      // callback\r
+               array_pop($this->parser->actions);      // formdata\r
+               array_pop($this->parser->actions);      // ticket\r
+               return;\r
        }\r
 \r
        /**\r
+        * Actions::checkCondition()\r
         * Checks conditions for if statements\r
         *\r
-        * @param string $field type of <%if%>\r
-        * @param string $name property of field\r
-        * @param string $value value of property\r
+        * @param       string  $field  type of <%if%>\r
+        * @param       string  $name   property of field\r
+        * @param       string  $value  value of property\r
+        * @return      boolean condition\r
         */\r
-       function checkCondition($field, $name='', $value = '') {\r
+       protected function checkCondition($field, $name='', $value = '')\r
+       {\r
                global $catid, $blog, $member, $itemidnext, $itemidprev, $manager, $archiveprevexists, $archivenextexists;\r
-\r
+               \r
                $condition = 0;\r
-               switch($field) {\r
+               switch ( $field )\r
+               {\r
                        case 'category':\r
-                               $condition = ($blog && $this->_ifCategory($name,$value));\r
+                               $condition = ($blog && $this->ifCategory($name,$value));\r
                                break;\r
                        case 'blogsetting':\r
                                $condition = ($blog && ($blog->getSetting($name) == $value));\r
@@ -112,10 +309,10 @@ class ACTIONS extends BaseActions {
                                $condition = $member->isLoggedIn();\r
                                break;\r
                        case 'onteam':\r
-                               $condition = $member->isLoggedIn() && $this->_ifOnTeam($name);\r
+                               $condition = $member->isLoggedIn() && $this->ifOnTeam($name);\r
                                break;\r
                        case 'admin':\r
-                               $condition = $member->isLoggedIn() && $this->_ifAdmin($name);\r
+                               $condition = $member->isLoggedIn() && $this->ifAdmin($name);\r
                                break;\r
                        case 'nextitem':\r
                                $condition = ($itemidnext != '');\r
@@ -130,40 +327,54 @@ class ACTIONS extends BaseActions {
                                $condition = ($archivenextexists == true);\r
                                break;\r
                        case 'skintype':\r
-                               $condition = ($name == $this->skintype);\r
+                               $condition = (($name == $this->skintype) || ($name == requestVar('action')));\r
                                break;\r
                        case 'hasplugin':\r
-                               $condition = $this->_ifHasPlugin($name, $value);\r
+                               $condition = $this->ifHasPlugin($name, $value);\r
                                break;\r
                        default:\r
-                               $condition = $manager->pluginInstalled('NP_' . $field) && $this->_ifPlugin($field, $name, $value);\r
+                               $condition = $manager->pluginInstalled("NP_{$field}") && $this->ifPlugin($field, $name, $value);\r
                                break;\r
                }\r
                return $condition;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::_ifHasPlugin()\r
         *      hasplugin,PlugName\r
         *         -> checks if plugin exists\r
         *      hasplugin,PlugName,OptionName\r
         *         -> checks if the option OptionName from plugin PlugName is not set to 'no'\r
         *      hasplugin,PlugName,OptionName=value\r
         *         -> checks if the option OptionName from plugin PlugName is set to value\r
+        *\r
+        * @param       string  $name   name of plugin\r
+        * @param       string  $value  \r
+        * @return      \r
         */\r
-       function _ifHasPlugin($name, $value) {\r
+       private function ifHasPlugin($name, $value)\r
+       {\r
                global $manager;\r
                $condition = false;\r
                // (pluginInstalled method won't write a message in the actionlog on failure)\r
-               if ($manager->pluginInstalled('NP_'.$name)) {\r
-                       $plugin =& $manager->getPlugin('NP_' . $name);\r
-                       if ($plugin != NULL) {\r
-                               if ($value == "") {\r
+               if ( $manager->pluginInstalled("NP_{$name}") )\r
+               {\r
+                       $plugin =& $manager->getPlugin("NP_{$name}");\r
+                       if ( $plugin != NULL )\r
+                       {\r
+                               if ( $value == "" )\r
+                               {\r
                                        $condition = true;\r
-                               } else {\r
-                                       list($name2, $value2) = i18n::explode('=', $value, 2);\r
-                                       if ($value2 == "" && $plugin->getOption($name2) != 'no') {\r
+                               }\r
+                               else\r
+                               {\r
+                                       list($name2, $value2) = preg_split('#=#', $value, 2);\r
+                                       if ( $value2 == "" && $plugin->getOption($name2) != 'no' )\r
+                                       {\r
                                                $condition = true;\r
-                                       } else if ($plugin->getOption($name2) == $value2) {\r
+                                       }\r
+                                       else if ( $plugin->getOption($name2) == $value2 )\r
+                                       {\r
                                                $condition = true;\r
                                        }\r
                                }\r
@@ -171,105 +382,160 @@ class ACTIONS extends BaseActions {
                }\r
                return $condition;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::ifPlugin()\r
         * Checks if a plugin exists and call its doIf function\r
+        * \r
+        * @param       string  $name   name of plugin\r
+        * @param       string  $key    name of plugin option\r
+        * @param       string  $value  value of plugin option\r
+        * @return      void\r
         */\r
-       function _ifPlugin($name, $key = '', $value = '') {\r
+       private function ifPlugin($name, $key = '', $value = '')\r
+       {\r
                global $manager;\r
-\r
-               $plugin =& $manager->getPlugin('NP_' . $name);\r
-               if (!$plugin) return;\r
-\r
+               \r
+               $plugin =& $manager->getPlugin("NP_{$name}");\r
+               if ( !$plugin )\r
+               {\r
+                       return;\r
+               }\r
+               \r
                $params = func_get_args();\r
                array_shift($params);\r
-\r
+               \r
                return call_user_func_array(array(&$plugin, 'doIf'), $params);\r
        }\r
-\r
+       \r
        /**\r
-        *  Different checks for a category\r
+        * Actions::ifCategory()\r
+        * Different checks for a category\r
+        * \r
+        * @param       string  $name   \r
+        * @param       string  $value  \r
+        * @return      boolean \r
         */\r
-       function _ifCategory($name = '', $value='') {\r
+       private function ifCategory($name = '', $value='')\r
+       {\r
                global $blog, $catid;\r
-\r
+               \r
                // when no parameter is defined, just check if a category is selected\r
-               if (($name != 'catname' && $name != 'catid') || ($value == ''))\r
+               if ( ($name != 'catname' && $name != 'catid') || ($value == '') )\r
+               {\r
                        return $blog->isValidCategory($catid);\r
-\r
+               }\r
+               \r
                // check category name\r
-               if ($name == 'catname') {\r
+               else if ( $name == 'catname' )
+               {\r
                        $value = $blog->getCategoryIdFromName($value);\r
-                       if ($value == $catid)\r
+                       if ( $value == $catid )\r
+                       {\r
                                return $blog->isValidCategory($catid);\r
+                       }\r
                }\r
-\r
+               \r
                // check category id\r
-               if (($name == 'catid') && ($value == $catid))\r
+               else if ( ($name == 'catid') && ($value == $catid) )
+               {\r
                        return $blog->isValidCategory($catid);\r
-\r
-               return false;\r
+               }\r
+               return FALSE;\r
        }\r
-\r
+       \r
        /**\r
-        *  Checks if a member is on the team of a blog and return his rights\r
+        * Actions::ifOnTeam()\r
+        * Checks if a member is on the team of a blog and return his rights\r
+        * \r
+        * @param       string  $blogName       name of weblog\r
+        * @return      mixed\r
         */\r
-       function _ifOnTeam($blogName = '') {\r
+       private function ifOnTeam($blogName = '')\r
+       {\r
                global $blog, $member, $manager;\r
-\r
+               \r
                // when no blog found\r
-               if (($blogName == '') && (!is_object($blog)))\r
+               if ( ($blogName == '') && !is_object($blog) )\r
+               {\r
                        return 0;\r
-\r
+               }\r
+               \r
                // explicit blog selection\r
-               if ($blogName != '')\r
+               if ( $blogName != '' )\r
+               {\r
                        $blogid = getBlogIDFromName($blogName);\r
-\r
-               if (($blogName == '') || !$manager->existsBlogID($blogid))\r
+               }\r
+               \r
+               if ( ($blogName == '') || !$manager->existsBlogID($blogid) )\r
+               {\r
                        // use current blog\r
                        $blogid = $blog->getID();\r
-\r
+               }\r
+               \r
                return $member->teamRights($blogid);\r
        }\r
 \r
        /**\r
-        *  Checks if a member is admin of a blog\r
+        * Actions::ifAdmin()\r
+        * Checks if a member is admin of a blog\r
+        * \r
+        * @param       string  $blogName       name of weblog\r
+        * @return      mixed\r
         */\r
-       function _ifAdmin($blogName = '') {\r
+       private function ifAdmin($blogName = '')\r
+       {\r
                global $blog, $member, $manager;\r
-\r
+               \r
                // when no blog found\r
-               if (($blogName == '') && (!is_object($blog)))\r
+               if ( ($blogName == '') && (!is_object($blog)) )\r
+               {\r
                        return 0;\r
-\r
+               }\r
+               \r
                // explicit blog selection\r
-               if ($blogName != '')\r
+               if ( $blogName != '' )\r
+               {\r
                        $blogid = getBlogIDFromName($blogName);\r
-\r
-               if (($blogName == '') || !$manager->existsBlogID($blogid))\r
+               }\r
+               \r
+               if ( ($blogName == '') || !$manager->existsBlogID($blogid) )\r
+               {\r
                        // use current blog\r
                        $blogid = $blog->getID();\r
-\r
+               }\r
+               \r
                return $member->isBlogAdmin($blogid);\r
        }\r
        \r
        /**\r
+        * Actions::link()\r
         * returns either\r
-        *              - a raw link (html/xml encoded) when no linktext is provided\r
-        *              - a (x)html <a href... link when a text is present (text htmlencoded)\r
+        *      - a raw link (html/xml encoded) when no linktext is provided\r
+        *      - a (x)html <a href... link when a text is present (text htmlencoded)\r
+        * \r
+        * @param       string  $url            URL for href attribute of anchor element\r
+        * @param       string  $linktext       content of anchor element\r
+        * @return      \r
         */\r
-       function _link($url, $linktext = '')\r
+       private function link($url, $linktext = '')\r
        {\r
-               $u = ENTITY::hsc($url);\r
-               $u = preg_replace("/&amp;amp;/",'&amp;',$u); // fix URLs that already had encoded ampersands\r
-               if ($linktext != '') \r
-                       $l = '<a href="' . $u .'">'.ENTITY::hsc($linktext).'</a>';\r
+               $u = Entity::hsc($url);\r
+               // fix URLs that already had encoded ampersands\r
+               $u = preg_replace("#&amp;amp;#", '&amp;', $u);\r
+               if ( $linktext != '' )\r
+               {\r
+                       $l = '<a href="' . $u .'">' . Entity::hsc($linktext) . '</a>';\r
+               }\r
                else\r
+               {\r
                        $l = $u;\r
+               }\r
                return $l;\r
        }\r
        \r
        /**\r
+        * Actions::searchlink()\r
         * Outputs a next/prev link\r
         *\r
         * @param $maxresults\r
@@ -282,94 +548,106 @@ class ACTIONS extends BaseActions {
         *              When present, the output will be a full <a href...> link. When empty,\r
         *              only a raw link will be outputted\r
         */\r
-       function _searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '') {\r
+       private function searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '')\r
+       {\r
                global $CONF, $blog, $query, $amount;\r
                // TODO: Move request uri to linkparams. this is ugly. sorry for that.\r
-               $startpos       = intval($startpos);            // will be 0 when empty.\r
+               $startpos       = (integer) $startpos;\r
                $parsed         = parse_url(serverVar('REQUEST_URI'));\r
-               $path           = $parsed['path'];\r
-               $parsed         = $parsed['query'];\r
+               $path           = ( in_array('path', $parsed) ) ? $parsed['path'] : '';\r
+               $parsed         = ( in_array('query', $parsed) ) ? $parsed['query'] : '';\r
                $url            = '';\r
                \r
-               switch ($direction) {\r
-                       case 'prev':\r
-                               if ( intval($startpos) - intval($maxresults) >= 0) {\r
-                                       $startpos       = intval($startpos) - intval($maxresults);\r
-                                       //$url          = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);\r
-                                       switch ($this->skintype)\r
-                                       {\r
-                                               case 'index':\r
-                                                       $url = $path;\r
-                                                       break;\r
-                                               case 'search':\r
-                                                       $url = $CONF['SearchURL'];\r
-                                                       break;\r
-                                       }\r
-                                       $url .= '?'.alterQueryStr($parsed,'startpos',$startpos);\r
-                               }\r
-                               \r
-                               break;\r
-                       case 'next':\r
-                               global $navigationItems;\r
-                               if (!isset($navigationItems)) $navigationItems = 0;\r
-                               \r
-                               if ($recount)\r
-                                       $iAmountOnPage = 0;\r
-                               else \r
-                                       $iAmountOnPage = $this->amountfound;\r
+               if ( $direction == 'prev' )\r
+               {\r
+                       if ( intval($startpos) - intval($maxresults) >= 0 )\r
+                       {\r
+                               $startpos       = intval($startpos) - intval($maxresults);\r
                                \r
-                               if (intval($navigationItems) > 0) {\r
-                                       $iAmountOnPage = intval($navigationItems) - intval($startpos);\r
+                               if ( $this->skintype == 'index' )\r
+                               {\r
+                                       $url = $path;\r
                                }\r
-                               elseif ($iAmountOnPage == 0)\r
+                               else if ( $this->skintype == 'search' )\r
                                {\r
-                                       // [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]\r
-                                       // try a count query\r
-                                       switch ($this->skintype)\r
-                                       {\r
-                                               case 'index':\r
-                                                       $sqlquery = $blog->getSqlBlog('', 'count');\r
-                                                       $url = $path;\r
-                                                       break;\r
-                                               case 'search':\r
-                                                       $unused_highlight = '';\r
-                                                       $sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');\r
-                                                       $url = $CONF['SearchURL'];\r
-                                                       break;\r
-                                       }\r
-                                       if ($sqlquery)\r
-                                               $iAmountOnPage = intval(quickQuery($sqlquery)) - intval($startpos);\r
+                                       $url = $CONF['SearchURL'];\r
                                }\r
-                               \r
-                               if (intval($iAmountOnPage) >= intval($maxresults)) {\r
-                                       $startpos       = intval($startpos) + intval($maxresults);\r
-                                       //$url          = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);\r
-                                       $url            .= '?'.alterQueryStr($parsed,'startpos',$startpos);\r
+                               $url .= '?' . alterQueryStr($parsed, 'startpos', $startpos);\r
+                       }\r
+               }\r
+               else if ( $direction == 'next' )\r
+               {\r
+                       global $navigationItems;\r
+                       if ( !isset($navigationItems) )\r
+                       {\r
+                               $navigationItems = 0;\r
+                       }\r
+                       \r
+                       if ( $recount )\r
+                       {\r
+                               $iAmountOnPage = 0;\r
+                       }\r
+                       else \r
+                       {\r
+                               $iAmountOnPage = $this->amountfound;\r
+                       }\r
+                       \r
+                       if ( intval($navigationItems) > 0 )\r
+                       {\r
+                               $iAmountOnPage = intval($navigationItems) - intval($startpos);\r
+                       }\r
+                       elseif ( $iAmountOnPage == 0 )\r
+                       {\r
+                               /*\r
+                                * [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]\r
+                                * try a count query\r
+                                */\r
+                               if ( $this->skintype == 'index' )\r
+                               {\r
+                                       $sqlquery = $blog->getSqlBlog('', 'count');\r
+                                       $url = $path;\r
                                }\r
-                               else $url = '';\r
-                               break;\r
-                       default:\r
-                               break;\r
-               } // switch($direction)\r
-\r
-               if ($url != '')\r
-                       echo $this->_link($url, $linktext);\r
+                               else if ( $this->skintype == 'search' )\r
+                               {\r
+                                       $unused_highlight = '';\r
+                                       $sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');\r
+                                       $url = $CONF['SearchURL'];\r
+                               }\r
+                               if ( $sqlquery )\r
+                               {\r
+                                       $iAmountOnPage = intval(DB::getValue($sqlquery)) - intval($startpos);\r
+                               }\r
+                       }\r
+                       \r
+                       $url = '';\r
+                       if ( intval($iAmountOnPage) >= intval($maxresults) )\r
+                       {\r
+                               $startpos        = intval($startpos) + intval($maxresults);\r
+                               $url            .= '?' . alterQueryStr($parsed, 'startpos', $startpos);\r
+                       }\r
+               }\r
+               \r
+               if ( $url != '' )\r
+               {\r
+                       echo $this->link($url, $linktext);\r
+               }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-        * ACTIONS::_itemlink()\r
+        * Actions::itemlink()\r
         * Creates an item link and if no id is given a todaylink \r
         * \r
-        * @param       Integer $id     id for link\r
-        * @param       String  $linktext       text for link\r
-        * @return      Void\r
+        * @param       integer $id     id for link\r
+        * @param       string  $linktext       text for link\r
+        * @return      void\r
         */\r
-       function _itemlink($id, $linktext = '')\r
+       private function itemlink($id, $linktext = '')\r
        {\r
                global $CONF;\r
-               if ( $id )\r
+               if ( $id != 0 )\r
                {\r
-                       echo $this->_link(LINK::create_item_link($id, $this->linkparams), $linktext);\r
+                       echo $this->link(Link::create_item_link($id, $this->linkparams), $linktext);\r
                }\r
                else\r
                {\r
@@ -379,19 +657,19 @@ class ACTIONS extends BaseActions {
        }\r
        \r
        /**\r
-        * ACTIONS::_archivelink)\r
+        * Actions::archivelink)\r
         * Creates an archive link and if no id is given a todaylink \r
         * \r
-        * @param       Integer $id     id for link\r
-        * @param       String  $linktext       text for link\r
-        * @return      Void\r
+        * @param       integer $id     id for link\r
+        * @param       string  $linktext       text for link\r
+        * @return      void\r
         */\r
-       function _archivelink($id, $linktext = '')\r
+       private function archivelink($id, $linktext = '')\r
        {\r
                global $CONF, $blog;\r
-               if ( $id )\r
+               if ( $id != 0 )\r
                {\r
-                       echo $this->_link(LINK::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);\r
+                       echo $this->link(Link::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);\r
                }\r
                else\r
                {\r
@@ -401,114 +679,160 @@ class ACTIONS extends BaseActions {
        }\r
        \r
        /**\r
-         * Helper function that sets the category that a blog will need to use\r
-         *\r
-         * @param $blog\r
-         *             An object of the blog class, passed by reference (we want to make changes to it)\r
-         * @param $catname\r
-         *             The name of the category to use\r
-         */\r
-       function _setBlogCategory(&$blog, $catname) {\r
+        * Actions:setBlogCategory()\r
+        * Helper function that sets the category that a blog will need to use\r
+        *\r
+        * @param       string  $blog           An object of the blog class, passed by reference (we want to make changes to it)\r
+        * @param       string  $catname        The name of the category to use\r
+        * @return      void\r
+        */\r
+       private function setBlogCategory(&$blog, $catname)\r
+       {\r
                global $catid;\r
-               if ($catname != '')\r
+               if ( $catname != '' )\r
+               {\r
                        $blog->setSelectedCategoryByName($catname);\r
+               }\r
                else\r
+               {\r
                        $blog->setSelectedCategory($catid);\r
+               }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-        *  Notifies the Manager that a PreBlogContent event occurs\r
+        * Actions::preBlogContent()\r
+        * Notifies the Manager that a PreBlogContent event occurs\r
+        * \r
+        * @param       string  $type   type of skin\r
+        * @param       object  $blog   an instance of Blog class\r
+        * @return      void\r
         */\r
-       function _preBlogContent($type, &$blog) {\r
+       private function preBlogContent($type, &$blog)\r
+       {\r
                global $manager;\r
                $manager->notify('PreBlogContent',array('blog' => &$blog, 'type' => $type));\r
+               return;\r
        }\r
 \r
        /**\r
-        *  Notifies the Manager that a PostBlogContent event occurs\r
+        * Actions::postBlogContent()\r
+        * Notifies the Manager that a PostBlogContent event occurs\r
+        * \r
+        * @param       string  $type   type of skin\r
+        * @param       objecct $blog   an instance of Blog class\r
+        * @return      void\r
         */\r
-       function _postBlogContent($type, &$blog) {\r
+       private function postBlogContent($type, &$blog)\r
+       {\r
                global $manager;\r
-               $manager->notify('PostBlogContent',array('blog' => &$blog, 'type' => $type));\r
+               $manager->notify('PostBlogContent', array('blog' => &$blog, 'type' => $type));\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_additemform()\r
         * Parse skinvar additemform\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_additemform() {\r
+       public function parse_additemform()\r
+       {\r
                global $blog, $CONF;\r
                $this->formdata = array(\r
-                       'adminurl' => ENTITY::hsc($CONF['AdminURL']),\r
-                       'catid' => $blog->getDefaultCategory()\r
+                       'adminurl'      => Entity::hsc($CONF['AdminURL']),\r
+                       'catid'         => $blog->getDefaultCategory()\r
                );\r
                $blog->InsertJavaScriptInfo();\r
                $this->doForm('additemform');\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_addlink()\r
         * Parse skinvar addlink\r
         * A Link that allows to open a bookmarklet to add an item\r
         */\r
-       function parse_addlink() {\r
+       public function parse_addlink()\r
+       {\r
                global $CONF, $member, $blog;\r
-               if ($member->isLoggedIn() && $member->isTeamMember($blog->blogid) ) {\r
+               if ( $member->isLoggedIn() && $member->isTeamMember($blog->blogid) )\r
+               {\r
                        echo $CONF['AdminURL'].'bookmarklet.php?blogid='.$blog->blogid;\r
                }\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_addpopupcode()\r
         * Parse skinvar addpopupcode\r
         * Code that opens a bookmarklet in an popup window\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_addpopupcode() {\r
+       public function parse_addpopupcode()\r
+       {\r
                echo "if (event &amp;&amp; event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";\r
+               return;\r
        }\r
        \r
        /**\r
         * Parse skinvar adminurl\r
-        * (shortcut for admin url)      \r
+        * (shortcut for admin url)\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_adminurl() {\r
+       public function parse_adminurl()\r
+       {\r
                $this->parse_sitevar('adminurl');\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_archive()\r
         * Parse skinvar archive\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @return      \r
         */\r
-       function parse_archive($template, $category = '') {\r
+       public function parse_archive($template, $category = '')\r
+       {\r
                global $blog, $archive;\r
                // can be used with either yyyy-mm or yyyy-mm-dd\r
-               sscanf($archive,'%d-%d-%d',$y,$m,$d);\r
-               $this->_setBlogCategory($blog, $category);\r
-               $this->_preBlogContent('achive',$blog);\r
+               sscanf($archive,'%d-%d-%d', $y, $m, $d);\r
+               $this->setBlogCategory($blog, $category);\r
+               $this->preBlogContent('achive',$blog);\r
                $blog->showArchive($template, $y, $m, $d);\r
-               $this->_postBlogContent('achive',$blog);\r
-\r
+               $this->postBlogContent('achive',$blog);\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-        * ACTIONS::parse_archivedate()\r
+        * Actions::parse_archivedate()\r
         * %archivedate(locale,date format)%\r
         * \r
-        * @paramstring $locale\r
+        * @param       string  $locale\r
         * @return      void\r
-        * \r
-         */\r
-       function parse_archivedate($locale = '-def-')\r
+        */\r
+       public function parse_archivedate($locale = '-def-')\r
        {\r
                global $archive;\r
                \r
                /* \r
-                * these lines are no meaning because there is no $template.\r
-                */\r
+                * TODO: these lines are no meaning because there is no $template.\r
                if ( $locale == '-def-' )\r
                {\r
-                       setlocale(LC_TIME,$template['LOCALE']);\r
+                       setlocale(LC_TIME, $template['LOCALE']);\r
                }\r
                else\r
                {\r
-                       setlocale(LC_TIME,$locale);\r
+                       setlocale(LC_TIME, $locale);\r
                }\r
+                */\r
                \r
                // get archive date\r
                sscanf($archive,'%d-%d-%d',$y,$m,$d);\r
@@ -535,135 +859,212 @@ class ACTIONS extends BaseActions {
                {\r
                        $format = '%d %B %Y';\r
                }\r
-               echo i18n::formatted_timedate($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));\r
+               echo i18n::formatted_datetime($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));\r
                return;\r
        }\r
-\r
+       \r
        /**\r
-        *  Parse skinvar archivedaylist\r
-        */             \r
-       function parse_archivedaylist($template, $category = 'all', $limit = 0) {\r
+        * Actions::parse_archivedaylist()\r
+        * Parse skinvar archivedaylist\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @param       integer $limit          the number of items in a display\r
+        * @return      void\r
+        */\r
+       public function parse_archivedaylist($template, $category = 'all', $limit = 0)\r
+       {\r
                global $blog;\r
-               if ($category == 'all') $category = '';\r
-               $this->_preBlogContent('archivelist',$blog);\r
-               $this->_setBlogCategory($blog, $category);\r
+               if ( $category == 'all' )\r
+               {\r
+                       $category = '';\r
+               }\r
+               $this->preBlogContent('archivelist',$blog);\r
+               $this->setBlogCategory($blog, $category);\r
                $blog->showArchiveList($template, 'day', $limit);\r
-               $this->_postBlogContent('archivelist',$blog);\r
+               $this->postBlogContent('archivelist',$blog);\r
+               return;\r
        }\r
        \r
        /**\r
-        * ACTIONS::parse_archivelink()\r
-        *      A link to the archives for the current blog (or for default blog)\r
-        *\r
-        * @param       String  $linktext       text for link\r
-        * @return      Void\r
+        * Actions::parse_archivelink()\r
+        * A link to the archives for the current blog (or for default blog)\r
+        * \r
+        * @param       string  $linktext       text for link\r
+        * @return      void\r
         */\r
-       function parse_archivelink($linktext = '')\r
+       public function parse_archivelink($linktext = '')\r
        {\r
                global $blog, $CONF;\r
                if ( $blog )\r
                {\r
-                       echo $this->_link(LINK::create_archivelist_link($blog->getID(),$this->linkparams), $linktext);\r
+                       echo $this->link(Link::create_archivelist_link($blog->getID(), $this->linkparams), $linktext);\r
                }\r
                else\r
                {\r
-                       echo $this->_link(LINK::create_archivelist_link(), $linktext);\r
+                       echo $this->link(Link::create_archivelist_link(), $linktext);\r
                }\r
                return;\r
        }\r
        \r
-       function parse_archivelist($template, $category = 'all', $limit = 0) {\r
+       /**\r
+        * Actions::parse_archivelist()\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @param       integer $limit          the number of items in a display\r
+        * @return      void\r
+        */\r
+       public function parse_archivelist($template, $category = 'all', $limit = 0)\r
+       {\r
                global $blog;\r
-               if ($category == 'all') $category = '';\r
-               $this->_preBlogContent('archivelist',$blog);\r
-               $this->_setBlogCategory($blog, $category);\r
+               if ( $category == 'all' )\r
+               {\r
+                       $category = '';\r
+               }\r
+               $this->preBlogContent('archivelist',$blog);\r
+               $this->setBlogCategory($blog, $category);\r
                $blog->showArchiveList($template, 'month', $limit);\r
-               $this->_postBlogContent('archivelist',$blog);\r
+               $this->postBlogContent('archivelist',$blog);\r
+               return;\r
        }\r
-               \r
-       function parse_archiveyearlist($template, $category = 'all', $limit = 0) {\r
+       \r
+       /**\r
+        * Actions::parse_archiveyearlist()\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @param       integer $limit          the number of items in a display\r
+        */\r
+       public function parse_archiveyearlist($template, $category = 'all', $limit = 0)\r
+       {\r
                global $blog;\r
-               if ($category == 'all') $category = '';\r
-               $this->_preBlogContent('archivelist',$blog);\r
-               $this->_setBlogCategory($blog, $category);\r
+               if ( $category == 'all' )\r
+               {\r
+                       $category = '';\r
+               }\r
+               $this->preBlogContent('archivelist',$blog);\r
+               $this->setBlogCategory($blog, $category);\r
                $blog->showArchiveList($template, 'year', $limit);\r
-               $this->_postBlogContent('archivelist',$blog);\r
+               $this->postBlogContent('archivelist',$blog);\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_archivetype()\r
         * Parse skinvar archivetype\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_archivetype() {\r
+       public function parse_archivetype()\r
+       {\r
                global $archivetype;\r
                echo $archivetype;\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_blog()\r
         * Parse skinvar blog\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @param       mixed   $amount         the number of items in a display, in case it includes the beginning\r
+        * @param       string  $category       name of category\r
+        * @return      void\r
         */\r
-       function parse_blog($template, $amount = 10, $category = '') {\r
+       public function parse_blog($template, $amount = 10, $category = '')\r
+       {\r
                global $blog, $startpos;\r
-\r
+               \r
                list($limit, $offset) = sscanf($amount, '%d(%d)');\r
-               $this->_setBlogCategory($blog, $category);\r
-               $this->_preBlogContent('blog',$blog);\r
+               $this->setBlogCategory($blog, $category);\r
+               $this->preBlogContent('blog',$blog);\r
                $this->amountfound = $blog->readLog($template, $limit, $offset, $startpos);\r
-               $this->_postBlogContent('blog',$blog);\r
+               $this->postBlogContent('blog',$blog);\r
+               return;\r
        }\r
        \r
-       /*\r
-       *       Parse skinvar bloglist\r
-       *       Shows a list of all blogs\r
-       *       bnametype: whether 'name' or 'shortname' is used for the link text        \r
-       *       orderby: order criteria\r
-       *       direction: order ascending or descending                  \r
-       */\r
-       function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc') {\r
-               BLOG::showBlogList($template, $bnametype, $orderby, $direction);\r
+       /**\r
+        * Actions::parse_bloglist()\r
+        * Parse skinvar bloglist\r
+        * Shows a list of all blogs\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @param       string  $bnametype      whether 'name' or 'shortname' is used for the link text\r
+        * @param       string  $orderby        order criteria\r
+        * @param       string  $direction      order ascending or descending             \r
+        * @return      void\r
+        */\r
+       public function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc')\r
+       {\r
+               Blog::showBlogList($template, $bnametype, $orderby, $direction);\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_blogsetting()\r
         * Parse skinvar blogsetting\r
+        * \r
+        * @param       string  $which  key of weblog settings\r
+        * @return      void\r
         */\r
-       function parse_blogsetting($which) {\r
+       public function parse_blogsetting($which)\r
+       {\r
                global $blog;\r
-               switch($which) {\r
+               switch( $which )\r
+               {\r
                        case 'id':\r
-                               echo ENTITY::hsc($blog->getID());\r
+                               echo Entity::hsc($blog->getID());\r
                                break;\r
                        case 'url':\r
-                               echo ENTITY::hsc($blog->getURL());\r
+                               echo Entity::hsc($blog->getURL());\r
                                break;\r
                        case 'name':\r
-                               echo ENTITY::hsc($blog->getName());\r
+                               echo Entity::hsc($blog->getName());\r
                                break;\r
                        case 'desc':\r
-                               echo ENTITY::hsc($blog->getDescription());\r
+                               echo Entity::hsc($blog->getDescription());\r
                                break;\r
                        case 'short':\r
-                               echo ENTITY::hsc($blog->getShortName());\r
+                               echo Entity::hsc($blog->getShortName());\r
                                break;\r
                }\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_callback()\r
         * Parse callback\r
+        * \r
+        * @param       string  $eventName      name of event\r
+        * @param       string  $type   type of skin\r
+        * @return      void\r
         */\r
-       function parse_callback($eventName, $type)\r
+       public function parse_callback($eventName, $type)\r
        {\r
                global $manager;\r
                $manager->notify($eventName, array('type' => $type));\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_category()\r
         * Parse skinvar category\r
+        * \r
+        * @param       string  $type   key of category settings\r
+        * @return      void\r
         */\r
-       function parse_category($type = 'name') {\r
+       public function parse_category($type = 'name')\r
+       {\r
                global $catid, $blog;\r
-               if (!$blog->isValidCategory($catid))\r
+               if ( !$blog->isValidCategory($catid) )\r
+               {\r
                        return;\r
-\r
-               switch($type) {\r
+               }\r
+               \r
+               switch ( $type )\r
+               {\r
                        case 'name':\r
                                echo $blog->getCategoryName($catid);\r
                                break;\r
@@ -674,45 +1075,51 @@ class ACTIONS extends BaseActions {
                                echo $catid;\r
                                break;\r
                }\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_categorylist()\r
         * Parse categorylist\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @param       string  $blogname       name of weblog\r
+        * @return      void\r
         */\r
-       function parse_categorylist($template, $blogname = '') {\r
+       public function parse_categorylist($template, $blogname = '')\r
+       {\r
                global $blog, $manager;\r
-\r
+               \r
                // when no blog found\r
-               if (($blogname == '') && (!is_object($blog)))\r
+               if ( ($blogname == '') && (!is_object($blog)) )\r
+               {\r
                        return 0;\r
+               }\r
                        \r
-               if ($blogname == '') {\r
-                       $this->_preBlogContent('categorylist',$blog);\r
+               if ( $blogname == '' )\r
+               {\r
+                       $this->preBlogContent('categorylist',$blog);\r
                        $blog->showCategoryList($template);\r
-                       $this->_postBlogContent('categorylist',$blog);\r
-               } else {\r
+                       $this->postBlogContent('categorylist',$blog);\r
+               }\r
+               else\r
+               {\r
                        $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-                       $this->_preBlogContent('categorylist',$b);\r
+                       $this->preBlogContent('categorylist',$b);\r
                        $b->showCategoryList($template);\r
-                       $this->_postBlogContent('categorylist',$b);\r
+                       $this->postBlogContent('categorylist',$b);\r
                }\r
+               return;\r
        }\r
        \r
        /**\r
-        * Parse skinvar charset\r
-        */\r
-       function parse_charset() {\r
-               echo i18n::get_current_charset();\r
-       }\r
-       \r
-       /**\r
-        * ACTIONS::parse_commentform()\r
+        * Actions::parse_commentform()\r
         * Parse skinvar commentform\r
         * \r
-        * @param       String  $destinationurl URI for redirection\r
-        * @return      Void\r
+        * @param       string  $destinationurl URI for redirection\r
+        * @return      void\r
         */\r
-       function parse_commentform($destinationurl = '')\r
+       public function parse_commentform($destinationurl = '')\r
        {\r
                global $blog, $itemid, $member, $CONF, $manager, $DIR_LIBS, $errormessage;\r
                \r
@@ -721,7 +1128,7 @@ class ACTIONS extends BaseActions {
                {\r
                        $args = func_get_args();\r
                        $destinationurl = $args[1];\r
-                       ACTIONLOG::add(WARNING,_ACTIONURL_NOTLONGER_PARAMATER);\r
+                       ActionLog::add(WARNING,_ACTIONURL_NOTLONGER_PARAMATER);\r
                }\r
                \r
                $actionurl = $CONF['ActionURL'];\r
@@ -743,7 +1150,7 @@ class ACTIONS extends BaseActions {
                if ( !$destinationurl )\r
                {\r
                        // note: createLink returns an HTML encoded URL\r
-                       $destinationurl = LINK::create_link(\r
+                       $destinationurl = Link::create_link(\r
                                'item',\r
                                array(\r
                                        'itemid' => $itemid,\r
@@ -756,7 +1163,7 @@ class ACTIONS extends BaseActions {
                else\r
                {\r
                        // HTML encode URL\r
-                       $destinationurl = ENTITY::hsc($destinationurl);\r
+                       $destinationurl = Entity::hsc($destinationurl);\r
                }\r
                \r
                // values to prefill\r
@@ -782,12 +1189,12 @@ class ACTIONS extends BaseActions {
                \r
                $this->formdata = array(\r
                        'destinationurl' => $destinationurl,    // url is already HTML encoded\r
-                       'actionurl' => ENTITY::hsc($actionurl),\r
+                       'actionurl' => Entity::hsc($actionurl),\r
                        'itemid' => $itemid,\r
-                       'user' => ENTITY::hsc($user),\r
-                       'userid' => ENTITY::hsc($userid),\r
-                       'email' => ENTITY::hsc($email),\r
-                       'body' => ENTITY::hsc($body),\r
+                       'user' => Entity::hsc($user),\r
+                       'userid' => Entity::hsc($userid),\r
+                       'email' => Entity::hsc($email),\r
+                       'body' => Entity::hsc($body),\r
                        'membername' => $member->getDisplayName(),\r
                        'rememberchecked' => cookieVar($CONF['CookiePrefix'] .'comment_user')?'checked="checked"':''\r
                );\r
@@ -804,78 +1211,122 @@ class ACTIONS extends BaseActions {
        }\r
        \r
        /**\r
+        * Actions::parse_comments()\r
         * Parse skinvar comments\r
-        * include comments for one item         \r
+        * include comments for one item\r
+        * \r
+        * @param       string  $template       name of template\r
+        * @return      void\r
         */\r
-       function parse_comments($template) {\r
-               global $itemid, $manager, $blog, $highlight;\r
+       public function parse_comments($template)\r
+       {\r
+               global $manager, $blog, $highlight, $itemid;\r
+               \r
                $template =& $manager->getTemplate($template);\r
-\r
+               $item =& $manager->getitem($itemid, 0, 0);\r
+               \r
                // create parser object & action handler\r
-               $actions = new ITEMACTIONS($blog);\r
-               $parser = new PARSER($actions->getDefinedActions(),$actions);\r
-               $actions->setTemplate($template);\r
-               $actions->setParser($parser);\r
-               $item = ITEM::getitem($itemid, 0, 0);\r
-               $actions->setCurrentItem($item);\r
-\r
-               $comments = new COMMENTS($itemid);\r
-               $comments->setItemActions($actions);\r
-               $comments->showComments($template, -1, 1, $highlight);  // shows ALL comments\r
+               $handler = new ItemActions($blog);\r
+               $handler->setTemplate($template);\r
+               $handler->setCurrentItem($item);\r
+               \r
+               $parser = new Parser($handler);\r
+               \r
+               $comments = new Comments($itemid);\r
+               $comments->setItemActions($handler);\r
+               // shows ALL comments\r
+               $comments->showComments($template, -1, 1, $highlight);\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_errordiv()\r
         * Parse errordiv\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_errordiv() {\r
+       public function parse_errordiv()\r
+       {\r
                global $errormessage;\r
-               if ($errormessage)\r
-                       echo '<div class="error">', ENTITY::hsc($errormessage),'</div>';\r
+               if ( $errormessage )\r
+               {\r
+                       echo '<div class="error">' . Entity::hsc($errormessage) . "</div>\n";\r
+               }\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_errormessage()\r
         * Parse skinvar errormessage\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_errormessage() {\r
+       public function parse_errormessage()\r
+       {\r
                global $errormessage;\r
                echo $errormessage;\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_formdata()\r
         * Parse formdata\r
+        * \r
+        * @param       string  $what   key of format data\r
+        * @return      void\r
         */\r
-       function parse_formdata($what) {\r
+       public function parse_formdata($what)\r
+       {\r
                echo $this->formdata[$what];\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_ifcat()\r
         * Parse ifcat\r
+        * \r
+        * @param       string  $text\r
+        * @return      void\r
         */\r
-       function parse_ifcat($text = '') {\r
-               if ($text == '') {\r
+       public function parse_ifcat($text = '')\r
+       {\r
+               if ( $text == '' )\r
+               {\r
                        // new behaviour\r
                        $this->parse_if('category');\r
-               } else {\r
+               }\r
+               else\r
+               {\r
                        // old behaviour\r
                        global $catid, $blog;\r
-                       if ($blog->isValidCategory($catid))\r
+                       if ( $blog->isValidCategory($catid) )\r
+                       {\r
                                echo $text;\r
+                       }\r
                }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_image()\r
         * Parse skinvar image\r
+        * \r
+        * @param       string  $what   name of tag\r
+        * @return      void\r
         */\r
-       function parse_image($what = 'imgtag') {\r
+       public function parse_image($what = 'imgtag')\r
+       {\r
                global $CONF;\r
-\r
-               $imagetext      = ENTITY::hsc(requestVar('imagetext'));\r
+               \r
+               $imagetext      = Entity::hsc(requestVar('imagetext'));\r
                $imagepopup = requestVar('imagepopup');\r
                $width          = intRequestVar('width');\r
                $height         = intRequestVar('height');\r
-               $fullurl        = ENTITY::hsc($CONF['MediaURL'] . $imagepopup);\r
-\r
-               switch($what)\r
+               $fullurl        = Entity::hsc($CONF['MediaURL'] . $imagepopup);\r
+               \r
+               switch ( $what )\r
                {\r
                        case 'url':\r
                                echo $fullurl;\r
@@ -895,117 +1346,162 @@ class ACTIONS extends BaseActions {
                                echo "<img src=\"$fullurl\" width=\"$width\" height=\"$height\" alt=\"$imagetext\" title=\"$imagetext\" />";\r
                                break;\r
                }\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_imagetext()\r
         * Parse skinvar imagetext\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_imagetext() {\r
-               echo ENTITY::hsc(requestVar('imagetext'));\r
+       public function parse_imagetext()\r
+       {\r
+               $this->parse_image('imagetext');\r
+               return;\r
        }\r
 \r
        /**\r
+        * Actions::parse_item()\r
         * Parse skinvar item\r
-        * include one item (no comments)        \r
+        * include one item (no comments)\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_item($template) {\r
+       public function parse_item($template)\r
+       {\r
                global $blog, $itemid, $highlight;\r
-               $this->_setBlogCategory($blog, '');     // need this to select default category\r
-               $this->_preBlogContent('item',$blog);\r
+               \r
+               // need this to select default category\r
+               $this->setBlogCategory($blog, '');\r
+               $this->preBlogContent('item',$blog);\r
                $r = $blog->showOneitem($itemid, $template, $highlight);\r
-               if ($r == 0)\r
+               if ( $r == 0 )\r
+               {\r
                        echo _ERROR_NOSUCHITEM;\r
-               $this->_postBlogContent('item',$blog);\r
+               }\r
+               $this->postBlogContent('item',$blog);\r
+               return;\r
        }\r
 \r
        /**\r
+        * Actions::parse_itemid()\r
         * Parse skinvar itemid\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_itemid() {\r
+       public function parse_itemid()\r
+       {\r
                global $itemid;\r
                echo $itemid;\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parseitemlink()\r
         * Parse skinvar itemlink\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_itemlink($linktext = '') {\r
+       public function parse_itemlink($linktext = '')\r
+       {\r
                global $itemid;\r
-               $this->_itemlink($itemid, $linktext);\r
+               $this->itemlink($itemid, $linktext);\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_itemtitle()\r
         * Parse itemtitle\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_itemtitle($format = '') {\r
+       public function parse_itemtitle($format = '')\r
+       {\r
                global $manager, $itemid;\r
-               $item =& $manager->getItem($itemid,0,0);\r
-\r
-               switch ($format) {\r
+               $item =& $manager->getItem($itemid, 1, 1);\r
+               \r
+               switch ( $format )\r
+               {\r
                        case 'xml':\r
-                               echo ENTITY::hen($item['title']);\r
+                               echo Entity::hen($item['title']);\r
                                break;\r
                        case 'raw':\r
                                echo $item['title'];\r
                                break;\r
                        case 'attribute':\r
                        default:\r
-                               echo ENTITY::hsc(strip_tags($item['title']));\r
+                               echo Entity::hsc(strip_tags($item['title']));\r
                                break;\r
                }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_loginform()\r
         * Parse skinvar loginform\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_loginform() {\r
+       public function parse_loginform()\r
+       {\r
                global $member, $CONF;\r
-               if (!$member->isLoggedIn()) {\r
+               if ( !$member->isLoggedIn() )\r
+               {\r
                        $filename = 'loginform-notloggedin';\r
                        $this->formdata = array();\r
-               } else {\r
+               }\r
+               else\r
+               {\r
                        $filename = 'loginform-loggedin';\r
                        $this->formdata = array(\r
                                'membername' => $member->getDisplayName(),\r
                        );\r
                }\r
                $this->doForm($filename);\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-        * ACTIONS::parse_member()\r
+        * Actions::parse_member()\r
         * Parse skinvar member\r
         * (includes a member info thingie)\r
         * \r
-        * @param       String  $what   which memberdata is needed\r
-        * @return      Void\r
+        * @param       string  $what   which memberdata is needed\r
+        * @return      void\r
         */\r
-       function parse_member($what)\r
+       public function parse_member($what)\r
        {\r
                global $memberinfo, $member, $CONF;\r
                \r
                // 1. only allow the member-details-page specific variables on member pages\r
-               if ($this->skintype == 'member')\r
+               if ( $this->skintype == 'member' )\r
                {\r
                        switch( $what )\r
                        {\r
                                case 'name':\r
-                                       echo ENTITY::hsc($memberinfo->getDisplayName());\r
+                                       echo Entity::hsc($memberinfo->getDisplayName());\r
                                        break;\r
                                case 'realname':\r
-                                       echo ENTITY::hsc($memberinfo->getRealName());\r
+                                       echo Entity::hsc($memberinfo->getRealName());\r
                                        break;\r
                                case 'notes':\r
-                                       echo ENTITY::hsc($memberinfo->getNotes());\r
+                                       echo Entity::hsc($memberinfo->getNotes());\r
                                        break;\r
                                case 'url':\r
-                                       echo ENTITY::hsc($memberinfo->getURL());\r
+                                       echo Entity::hsc($memberinfo->getURL());\r
                                        break;\r
                                case 'email':\r
-                                       echo ENTITY::hsc($memberinfo->getEmail());\r
+                                       echo Entity::hsc($memberinfo->getEmail());\r
                                        break;\r
                                case 'id':\r
-                                       echo ENTITY::hsc($memberinfo->getID());\r
+                                       echo Entity::hsc($memberinfo->getID());\r
                                        break;\r
                        }\r
                }\r
@@ -1035,25 +1531,25 @@ class ACTIONS extends BaseActions {
                                        break;\r
                                case 'yourprofileurl':\r
                                        if ($CONF['URLMode'] == 'pathinfo')\r
-                                               echo LINK::create_member_link($member->getID());\r
+                                               echo Link::create_member_link($member->getID());\r
                                        else\r
-                                               echo $CONF['IndexURL'] . LINK::create_member_link($member->getID());\r
+                                               echo $CONF['IndexURL'] . Link::create_member_link($member->getID());\r
                                        break;\r
                        }\r
                }\r
                return;\r
        }\r
-\r
+       \r
        /**\r
-        * LINK::parse_membermailform()\r
+        * Link::parse_membermailform()\r
         * Parse skinvar membermailform\r
         * \r
-        * @param       Integer $rows   the height for textarea\r
-        * @param       Integer $cols   the width for textarea\r
-        * @param       String  $desturl        URI to redirect\r
-        * @return      Void\r
+        * @param       integer $rows   the height for textarea\r
+        * @param       integer $cols   the width for textarea\r
+        * @param       string  $desturl        URI to redirect\r
+        * @return      void\r
         */\r
-       function parse_membermailform($rows = 10, $cols = 40, $desturl = '')\r
+       public function parse_membermailform($rows = 10, $cols = 40, $desturl = '')\r
        {\r
                global $member, $CONF, $memberid;\r
                \r
@@ -1061,11 +1557,11 @@ class ACTIONS extends BaseActions {
                {\r
                        if ( $CONF['URLMode'] == 'pathinfo' )\r
                        {\r
-                               $desturl = LINK::create_member_link($memberid);\r
+                               $desturl = Link::create_member_link($memberid);\r
                        }\r
                        else\r
                        {\r
-                               $desturl = $CONF['IndexURL'] . LINK::create_member_link($memberid);\r
+                               $desturl = $CONF['IndexURL'] . Link::create_member_link($memberid);\r
                        }\r
                }\r
                \r
@@ -1073,13 +1569,13 @@ class ACTIONS extends BaseActions {
                $frommail = postVar('frommail');\r
                \r
                $this->formdata = array(\r
-                       'url' => ENTITY::hsc($desturl),\r
-                       'actionurl' => ENTITY::hsc($CONF['ActionURL']),\r
+                       'url' => Entity::hsc($desturl),\r
+                       'actionurl' => Entity::hsc($CONF['ActionURL']),\r
                        'memberid' => $memberid,\r
                        'rows' => $rows,\r
                        'cols' => $cols,\r
-                       'message' => ENTITY::hsc($message),\r
-                       'frommail' => ENTITY::hsc($frommail)\r
+                       'message' => Entity::hsc($message),\r
+                       'frommail' => Entity::hsc($frommail)\r
                );\r
                \r
                if ( $member->isLoggedIn() )\r
@@ -1098,325 +1594,504 @@ class ACTIONS extends BaseActions {
        }\r
        \r
        /**\r
+        * Actions::parse_nextarchive()\r
         * Parse skinvar nextarchive\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_nextarchive() {\r
+       public function parse_nextarchive()\r
+       {\r
                global $archivenext;\r
                echo $archivenext;\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
         * Parse skinvar nextitem\r
         * (include itemid of next item)\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_nextitem() {\r
+       public function parse_nextitem()\r
+       {\r
                global $itemidnext;\r
-               if (isset($itemidnext)) echo (int)$itemidnext;\r
+               if ( isset($itemidnext) )\r
+               {\r
+                       echo (int)$itemidnext;\r
+               }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_nextitemtitle()\r
         * Parse skinvar nextitemtitle\r
         * (include itemtitle of next item)\r
+        * \r
+        * @param       string  $format format of text\r
+        * @return      void\r
         */\r
-       function parse_nextitemtitle($format = '') {\r
+       public function parse_nextitemtitle($format = '')\r
+       {\r
                global $itemtitlenext;\r
-\r
+               \r
                switch ( $format )\r
                {\r
                        case 'xml':\r
-                               echo ENTITY::hen($itemtitlenext);\r
+                               echo Entity::hen($itemtitlenext);\r
                                break;\r
                        case 'raw':\r
                                echo $itemtitlenext;\r
                                break;\r
                        case 'attribute':\r
                        default:\r
-                               echo ENTITY::hsc($itemtitlenext);\r
+                               echo Entity::hsc($itemtitlenext);\r
                                break;\r
                }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_nextlink()\r
         * Parse skinvar nextlink\r
+        * \r
+        * @param       string  $linktext       text for content of anchor element\r
+        * @param       integer $amount         the amount of items in a display\r
+        * @param       integer $recount        increment from this value\r
+        * @return      void\r
         */\r
-       function parse_nextlink($linktext = '', $amount = 10, $recount = '') {\r
+       public function parse_nextlink($linktext = '', $amount = 10, $recount = '')\r
+       {\r
                global $itemidnext, $archivenext, $startpos;\r
-               if ($this->skintype == 'item')\r
-                       $this->_itemlink($itemidnext, $linktext);\r
-               else if ($this->skintype == 'search' || $this->skintype == 'index')\r
-                       $this->_searchlink($amount, $startpos, 'next', $linktext, $recount);\r
+               if ( $this->skintype == 'item' )\r
+               {\r
+                       $this->itemlink($itemidnext, $linktext);\r
+               }\r
+               else if ( $this->skintype == 'search' || $this->skintype == 'index' )\r
+               {\r
+                       $this->searchlink($amount, $startpos, 'next', $linktext, $recount);\r
+               }\r
                else\r
-                       $this->_archivelink($archivenext, $linktext);\r
+               {\r
+                       $this->archivelink($archivenext, $linktext);\r
+               }\r
+               return;\r
        }\r
 \r
        /**\r
+        * Actions::parse_nucleusbutton()\r
         * Parse skinvar nucleusbutton\r
+        * \r
+        * @param       string  $imgurl URL  for image\r
+        * @param       integer $imgwidth       width of image\r
+        * @param       integer $imgheidht      height of image\r
         */\r
-       function parse_nucleusbutton($imgurl = '',\r
-                                                                $imgwidth = '85',\r
-                                                                $imgheight = '31') {\r
+       public function parse_nucleusbutton($imgurl = '', $imgwidth = '85', $imgheight = '31')\r
+       {\r
                global $CONF;\r
-               if ($imgurl == '') {\r
+               if ( $imgurl == '' )\r
+               {\r
                        $imgurl = $CONF['AdminURL'] . 'nucleus.gif';\r
-               } else if (PARSER::getProperty('IncludeMode') == 'skindir'){\r
+               }\r
+               else if ( Parser::getProperty('IncludeMode') == 'skindir' )\r
+               {\r
                        // when skindit IncludeMode is used: start from skindir\r
-                       $imgurl = $CONF['SkinsURL'] . PARSER::getProperty('IncludePrefix') . $imgurl;\r
+                       $imgurl = $CONF['SkinsURL'] . Parser::getProperty('IncludePrefix') . $imgurl;\r
                }\r
-\r
+               \r
                $this->formdata = array(\r
                        'imgurl' => $imgurl,\r
                        'imgwidth' => $imgwidth,\r
                        'imgheight' => $imgheight,\r
                );\r
                $this->doForm('nucleusbutton');\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_otherarchive()\r
         * Parse skinvar otherarchive\r
+        * \r
+        * @param       string  $blogname       name of weblog\r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @return      void\r
         */     \r
-       function parse_otherarchive($blogname, $template, $category = '') {\r
+       public function parse_otherarchive($blogname, $template, $category = '')\r
+       {\r
                global $archive, $manager;\r
                sscanf($archive,'%d-%d-%d',$y,$m,$d);\r
                $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               $this->_setBlogCategory($b, $category);\r
-               $this->_preBlogContent('otherachive',$b);\r
+               $this->setBlogCategory($b, $category);\r
+               $this->preBlogContent('otherachive',$b);\r
                $b->showArchive($template, $y, $m, $d);\r
-               $this->_postBlogContent('otherachive',$b);\r
+               $this->postBlogContent('otherachive',$b);\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_otherarchivedaylist()\r
         * Parse skinvar otherarchivedaylist\r
+        * \r
+        * @param       string  $blogname       name of weblog\r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @param       integer $limit          the amount of items in a display\r
+        * @return      void\r
         */\r
-       function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0) {\r
+       public function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0)\r
+       {\r
                global $manager;\r
-               if ($category == 'all') $category = '';\r
+               if ( $category == 'all')\r
+               {\r
+                       $category = '';\r
+               }\r
                $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               $this->_setBlogCategory($b, $category);\r
-               $this->_preBlogContent('otherarchivelist',$b);\r
+               $this->setBlogCategory($b, $category);\r
+               $this->preBlogContent('otherarchivelist',$b);\r
                $b->showArchiveList($template, 'day', $limit);\r
-               $this->_postBlogContent('otherarchivelist',$b);\r
+               $this->postBlogContent('otherarchivelist',$b);\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_otherarchivelist()\r
         * Parse skinvar otherarchivelist\r
+        * \r
+        * @param       string  $blogname       name of weblog\r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @param       integer $limit          the amount of items in a display\r
+        * @return      void\r
         */\r
-       function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0) {\r
+       public function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0)\r
+       {\r
                global $manager;\r
-               if ($category == 'all') $category = '';\r
+               if ( $category == 'all' )\r
+               {\r
+                       $category = '';\r
+               }\r
                $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               $this->_setBlogCategory($b, $category);\r
-               $this->_preBlogContent('otherarchivelist',$b);\r
+               $this->setBlogCategory($b, $category);\r
+               $this->preBlogContent('otherarchivelist',$b);\r
                $b->showArchiveList($template, 'month', $limit);\r
-               $this->_postBlogContent('otherarchivelist',$b);\r
+               $this->postBlogContent('otherarchivelist',$b);\r
+               return;\r
        }\r
-               \r
+       \r
        /**\r
+        * Actions::parse_otherarchiveyearlist()\r
         * Parse skinvar otherarchiveyearlist\r
+        * \r
+        * @param       string  $blogname       name of weblog\r
+        * @param       string  $template       name of template\r
+        * @param       string  $category       name of category\r
+        * @limit       integer $limit          the amount of items in a display\r
         */\r
-       function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0) {\r
+       public function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0)\r
+       {\r
                global $manager;\r
-               if ($category == 'all') $category = '';\r
+               if ( $category == 'all' )\r
+               {\r
+                       $category = '';\r
+               }\r
                $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               $this->_setBlogCategory($b, $category);\r
-               $this->_preBlogContent('otherarchivelist',$b);\r
+               $this->setBlogCategory($b, $category);\r
+               $this->preBlogContent('otherarchivelist',$b);\r
                $b->showArchiveList($template, 'year', $limit);\r
-               $this->_postBlogContent('otherarchivelist',$b);\r
-       }       \r
+               $this->postBlogContent('otherarchivelist',$b);\r
+               return;\r
+       }\r
        \r
        /**\r
+        * Actions::parse_otherblog()\r
         * Parse skinvar otherblog\r
+        * \r
+        * @param       string  $blogname       name of weblog\r
+        * @param       string  $template       name of template\r
+        * @param       mixed   $amount         the amount of items, in case it includes the beginning\r
+        * @param       string  $category       name of category\r
+        * @return      void\r
         */\r
-       function parse_otherblog($blogname, $template, $amount = 10, $category = '') {\r
+       public function parse_otherblog($blogname, $template, $amount = 10, $category = '')\r
+       {\r
                global $manager;\r
-\r
+               \r
                list($limit, $offset) = sscanf($amount, '%d(%d)');\r
-\r
+               \r
                $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               $this->_setBlogCategory($b, $category);\r
-               $this->_preBlogContent('otherblog',$b);\r
+               $this->setBlogCategory($b, $category);\r
+               $this->preBlogContent('otherblog',$b);\r
                $this->amountfound = $b->readLog($template, $limit, $offset);\r
-               $this->_postBlogContent('otherblog',$b);\r
+               $this->postBlogContent('otherblog',$b);\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_othersearchresults()\r
         * Parse skinvar othersearchresults\r
+        * \r
+        * @param       string  $blogname       name of weblog\r
+        * @param       string  $template       name of template\r
+        * @param       integer $maxresults     the amount of results\r
+        * @return      void\r
         */\r
-       function parse_othersearchresults($blogname, $template, $maxresults = 50) {\r
+       public function parse_othersearchresults($blogname, $template, $maxresults = 50)\r
+       {\r
                global $query, $amount, $manager, $startpos;\r
                $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               $this->_setBlogCategory($b, '');        // need this to select default category\r
-               $this->_preBlogContent('othersearchresults',$b);\r
+               // need this to select default category\r
+               $this->setBlogCategory($b, '');\r
+               $this->preBlogContent('othersearchresults',$b);\r
                $b->search($query, $template, $amount, $maxresults, $startpos);\r
-               $this->_postBlogContent('othersearchresults',$b);\r
+               $this->postBlogContent('othersearchresults',$b);\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-         * Executes a plugin skinvar\r
-         *\r
-         * @param pluginName name of plugin (without the NP_)\r
-         *\r
-         * extra parameters can be added\r
-         */\r
-       function parse_plugin($pluginName) {\r
+        * Actions::parse_plugin()\r
+        * Executes a plugin skinvar\r
+        * extra parameters can be added\r
+        * \r
+        * @param       string  $pluginName     name of plugin (without the NP_)\r
+        * @return      void\r
+        */\r
+       public function parse_plugin($pluginName)\r
+       {\r
                global $manager;\r
-\r
-               // should be already tested from the parser (PARSER.php)\r
-               // only continue when the plugin is really installed\r
-               /*if (!$manager->pluginInstalled('NP_' . $pluginName))\r
-                       return;*/\r
-\r
+               \r
                $plugin =& $manager->getPlugin('NP_' . $pluginName);\r
-               if (!$plugin) return;\r
-\r
+               if ( !$plugin )\r
+               {\r
+                       return;\r
+               }\r
+               \r
                // get arguments\r
                $params = func_get_args();\r
-\r
+               \r
                // remove plugin name\r
                array_shift($params);\r
-\r
+               \r
                // add skin type on front\r
                array_unshift($params, $this->skintype);\r
-\r
+               \r
                call_user_func_array(array(&$plugin,'doSkinVar'), $params);\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_prevarchive()\r
         * Parse skinvar prevarchive\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_prevarchive() {\r
+       public function parse_prevarchive()\r
+       {\r
                global $archiveprev;\r
                echo $archiveprev;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_preview()\r
         * Parse skinvar preview\r
+        * \r
+        * @param       string  $template       name of tempalte\r
+        * @return      void\r
         */\r
-       function parse_preview($template) {\r
+       public function parse_preview($template)\r
+       {\r
                global $blog, $CONF, $manager;\r
-\r
+               \r
                $template =& $manager->getTemplate($template);\r
+               \r
                $row['body'] = '<span id="prevbody"></span>';\r
                $row['title'] = '<span id="prevtitle"></span>';\r
                $row['more'] = '<span id="prevmore"></span>';\r
                $row['itemlink'] = '';\r
                $row['itemid'] = 0; $row['blogid'] = $blog->getID();\r
-               echo TEMPLATE::fill($template['ITEM_HEADER'],$row);\r
-               echo TEMPLATE::fill($template['ITEM'],$row);\r
-               echo TEMPLATE::fill($template['ITEM_FOOTER'],$row);\r
+               \r
+               echo Template::fill($template['ITEM_HEADER'],$row);\r
+               echo Template::fill($template['ITEM'],$row);\r
+               echo Template::fill($template['ITEM_FOOTER'],$row);\r
+               return;\r
        }\r
-\r
-       /*\r
+       \r
+       /**\r
+        * Actions::parse_previtem()\r
         * Parse skinvar previtem\r
-        * (include itemid of prev item)                 \r
+        * (include itemid of prev item)\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_previtem() {\r
+       public function parse_previtem()\r
+       {\r
                global $itemidprev;\r
-               if (isset($itemidprev)) echo (int)$itemidprev;\r
+               if ( isset($itemidprev) )\r
+               {\r
+                       echo (integer) $itemidprev;\r
+               }\r
+               return;\r
        }\r
        \r
        /**\r
-        * ACTIONS::parse_previtemtitle()\r
+        * Actions::parse_previtemtitle()\r
         * Parse skinvar previtemtitle\r
         * (include itemtitle of prev item)\r
         * \r
         * @param       String  $format string format\r
         * @return      String  formatted string\r
         */\r
-       function parse_previtemtitle($format = '')\r
+       public function parse_previtemtitle($format = '')\r
        {\r
                global $itemtitleprev;\r
                \r
                switch ( $format )\r
                {\r
                        case 'xml':\r
-                               echo ENTITY::hen($itemtitleprev);\r
+                               echo Entity::hen($itemtitleprev);\r
                                break;\r
                        case 'raw':\r
                                echo $itemtitleprev;\r
                                break;\r
                        case 'attribute':\r
                        default:\r
-                               echo ENTITY::hsc($itemtitleprev);\r
+                               echo Entity::hsc($itemtitleprev);\r
                                break;\r
                }\r
                return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_prevlink()\r
         * Parse skinvar prevlink\r
+        * \r
+        * @param       string  $linktext       text as a content of anchor element\r
+        * @param       integer the amount of links\r
+        * @return      void\r
         */\r
-       function parse_prevlink($linktext = '', $amount = 10) {\r
+       public function parse_prevlink($linktext = '', $amount = 10)\r
+       {\r
                global $itemidprev, $archiveprev, $startpos;\r
-\r
-               if ($this->skintype == 'item')\r
-                       $this->_itemlink($itemidprev, $linktext);\r
-               else if ($this->skintype == 'search' || $this->skintype == 'index')\r
-                       $this->_searchlink($amount, $startpos, 'prev', $linktext);\r
+               \r
+               if ( $this->skintype == 'item' )\r
+               {\r
+                       $this->itemlink($itemidprev, $linktext);\r
+               }\r
+               else if ( $this->skintype == 'search' || $this->skintype == 'index' )\r
+               {\r
+                       $this->searchlink($amount, $startpos, 'prev', $linktext);\r
+               }\r
                else\r
-                       $this->_archivelink($archiveprev, $linktext);\r
+               {\r
+                       $this->archivelink($archiveprev, $linktext);\r
+               }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_query()\r
         * Parse skinvar query\r
         * (includes the search query)   \r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_query() {\r
+       public function parse_query()\r
+       {\r
                global $query;\r
-               echo ENTITY::hsc($query);\r
+               echo Entity::hsc($query);\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_referer()\r
         * Parse skinvar referer\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_referer() {\r
-               echo ENTITY::hsc(serverVar('HTTP_REFERER'));\r
+       public function parse_referer()\r
+       {\r
+               echo Entity::hsc(serverVar('HTTP_REFERER'));\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_searchform()\r
         * Parse skinvar searchform\r
+        * \r
+        * @param       string  $blogname       name of weblog\r
+        * @return      void\r
         */\r
-       function parse_searchform($blogname = '') {\r
+       public function parse_searchform($blogname = '')\r
+       {\r
                global $CONF, $manager, $maxresults;\r
-               if ($blogname) {\r
+               if ( $blogname )\r
+               {\r
                        $blog =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               } else {\r
+               }\r
+               else\r
+               {\r
                        global $blog;\r
                }\r
                // use default blog when no blog is selected\r
                $this->formdata = array(\r
-                       'id' => $blog?$blog->getID():$CONF['DefaultBlog'],\r
-                       'query' => ENTITY::hsc(getVar('query')),\r
+                       'id'    => $blog?$blog->getID():$CONF['DefaultBlog'],\r
+                       'query' => Entity::hsc(getVar('query')),\r
                );\r
                $this->doForm('searchform');\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_searchresults()\r
         * Parse skinvar searchresults\r
+        * \r
+        * @param       string  $template       name of tempalte\r
+        * @param       integer $maxresults     searched items in a display\r
+        * @return      void;\r
         */\r
-       function parse_searchresults($template, $maxresults = 50 ) {\r
+       public function parse_searchresults($template, $maxresults = 50 )\r
+       {\r
                global $blog, $query, $amount, $startpos;\r
-\r
-               $this->_setBlogCategory($blog, '');     // need this to select default category\r
-               $this->_preBlogContent('searchresults',$blog);\r
+               \r
+               $this->setBlogCategory($blog, '');      // need this to select default category\r
+               $this->preBlogContent('searchresults',$blog);\r
                $this->amountfound = $blog->search($query, $template, $amount, $maxresults, $startpos);\r
-               $this->_postBlogContent('searchresults',$blog);\r
+               $this->postBlogContent('searchresults',$blog);\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_self()\r
         * Parse skinvar self\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_self() {\r
+       public function parse_self()\r
+       {\r
                global $CONF;\r
                echo $CONF['Self'];\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_sitevar()\r
         * Parse skinvar sitevar\r
-        * (include a sitevar)   \r
+        * (include a sitevar)\r
+        * \r
+        * @param       string  $which\r
+        * @return      void\r
         */\r
-       function parse_sitevar($which) {\r
+       public function parse_sitevar($which)\r
+       {\r
                global $CONF;\r
-               switch($which) {\r
+               switch ( $which )\r
+               {\r
                        case 'url':\r
                                echo $CONF['IndexURL'];\r
                                break;\r
@@ -1429,58 +2104,67 @@ class ACTIONS extends BaseActions {
                        case 'adminurl':\r
                                echo $CONF['AdminURL'];\r
                }\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_skinname()\r
         * Parse skinname\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_skinname() {\r
-               echo $this->skin->getName();\r
+       public function parse_skinname()\r
+       {\r
+               echo $this->parser->skin->getName();\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_skintype()\r
         * Parse skintype (experimental)\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_skintype() {\r
+       public function parse_skintype()\r
+       {\r
                echo $this->skintype;\r
-       }\r
-\r
-       /**\r
-        * Parse text\r
-        */\r
-       function parse_text($which) {\r
-               // constant($which) only available from 4.0.4 :(\r
-               if (defined($which)) {\r
-                       eval("echo $which;");\r
-               }\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_ticket()\r
         * Parse ticket\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_ticket() {\r
+       public function parse_ticket()\r
+       {\r
                global $manager;\r
                $manager->addTicketHidden();\r
+               return;\r
        }\r
 \r
        /**\r
-        * ACTIONS::parse_todaylink()\r
+        * Actions::parse_todaylink()\r
         * Parse skinvar todaylink\r
         * A link to the today page (depending on selected blog, etc...)\r
         *\r
-        * @param       String  $linktext       text for link\r
-        * @return      Void\r
+        * @param       string  $linktext       text for link\r
+        * @return      void\r
         */\r
-       function parse_todaylink($linktext = '')\r
+       public function parse_todaylink($linktext = '')\r
        {\r
                global $blog, $CONF;\r
                if ( $blog )\r
                {\r
-                       echo $this->_link(LINK::create_blogid_link($blog->getID(),$this->linkparams), $linktext);\r
+                       echo $this->link(Link::create_blogid_link($blog->getID(),$this->linkparams), $linktext);\r
                }\r
                else\r
                {\r
-                       echo $this->_link($CONF['SiteUrl'], $linktext);\r
+                       echo $this->link($CONF['SiteUrl'], $linktext);\r
                }\r
                return;\r
        }\r
@@ -1488,35 +2172,53 @@ class ACTIONS extends BaseActions {
        /**\r
         * Parse vars\r
         * When commentform is not used, to include a hidden field with itemid   \r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_vars() {\r
+       public function parse_vars()\r
+       {\r
                global $itemid;\r
-               echo '<input type="hidden" name="itemid" value="'.$itemid.'" />';\r
+               echo '<input type="hidden" name="itemid" value="'.$itemid.'" />' . "\n";\r
+               return;\r
        }\r
 \r
        /**\r
+        * Actions::parse_version()\r
         * Parse skinvar version\r
         * (include nucleus versionnumber)       \r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_version() {\r
+       public function parse_version()\r
+       {\r
                global $nucleus;\r
                echo 'Nucleus CMS ' . $nucleus['version'];\r
+               return;\r
        }\r
        \r
        /**\r
+        * Actions::parse_sticky()\r
         * Parse skinvar sticky\r
+        * \r
+        * @param       integer $itemnumber     id of item\r
+        * @param       string  $template       name of template\r
+        * @return      void\r
         */\r
-       function parse_sticky($itemnumber = 0, $template = '') {\r
+       public function parse_sticky($itemid = 0, $template = '')\r
+       {\r
                global $manager;\r
                \r
-               $itemnumber = intval($itemnumber);\r
-               $itemarray = array($itemnumber);\r
-\r
-               $b =& $manager->getBlog(getBlogIDFromItemID($itemnumber));\r
-               $this->_preBlogContent('sticky',$b);\r
-               $this->amountfound = $b->readLogFromList($itemarray, $template);\r
-               $this->_postBlogContent('sticky',$b);\r
+               $itemid = (integer) $itemid;\r
+               $itemarray = array($itemid);\r
+               \r
+               $item =& $manager->getItem($post['itemid'], 1, 1);\r
+               $blog =& $manager->getBlog($item['blogid']);\r
+               \r
+               $this->preBlogContent('sticky', $blog);\r
+               $this->amountfound = $blog->readLogFromList($itemarray, $template);\r
+               $this->postBlogContent('sticky', $blog);\r
+               return;\r
        }\r
-\r
-\r
 }\r