OSDN Git Service

ActionsクラスにskinnableActonsクラスのメソッドの大部分を移植。
authorsakamocchi <o-takashi@sakamocchi.jp>
Wed, 4 Apr 2012 23:21:05 +0000 (08:21 +0900)
committersakamocchi <o-takashi@sakamocchi.jp>
Wed, 4 Apr 2012 23:21:05 +0000 (08:21 +0900)
まだすべて移植し終えてない。

nucleus/libs/ACTIONS.php

index d415aef..eb83203 100644 (file)
@@ -1,5 +1,5 @@
 <?php\r
-/*\r
+/**\r
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
  * Copyright (C) 2002-2012 The Nucleus Group\r
  *\r
@@ -26,84 +26,116 @@ class Actions extends BaseActions
        // part of the skin currently being parsed ('index', 'item', 'archive',\r
        // 'archivelist', 'member', 'search', 'error', 'imagepopup')\r
        var $skintype;\r
-\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
+       \r
        // reference to the skin object for which a part is being parsed\r
        var $skin;\r
-\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
+       \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
+       \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
                $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::setSkin()\r
+        * Set the skin\r
+        * @param       object  $skin   an instance of Skin class\r
+        * @return      void\r
         */\r
-       function setSkin(&$skin) {\r
+       public function setSkin(&$skin)\r
+       {\r
                $this->skin =& $skin;\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-        *  Set the parser\r
+        * Actions::setParser()\r
+        * Set the parser\r
+        * \r
+        * @param       object  $parser an instance of Parser class\r
+        * @return      void\r
         */\r
-       function setParser(&$parser) {\r
+       public function setParser(&$parser)\r
+       {\r
                $this->parser =& $parser;\r
+               return;\r
        }\r
-\r
+       \r
        /**\r
-        *      Forms get parsedincluded now, using an extra <formdata> skinvar\r
-       */\r
-       function doForm($filename) {\r
+        * Actions::doForm()\r
+        * Forms get parsedincluded now, using an extra <formdata> skinvar\r
+        *\r
+        * @param       string  $filename\r
+        * @return      void\r
+        */\r
+       public function doForm($filename)\r
+       {\r
                global $DIR_NUCLEUS;\r
                array_push($this->parser->actions,'formdata','text','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
+               \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
+               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
+       public 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 +144,16 @@ 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 'superadmin':\r
+                               $condition = $member->isLoggedIn() && $member->isAdmin();\r
+                               break;\r
+                       case 'allowloginedit':\r
+                               $condition = $member->isLoggedIn() && ($CONF['AllowLoginEdit'] || $member->isAdmin());\r
                                break;\r
                        case 'nextitem':\r
                                $condition = ($itemidnext != '');\r
@@ -130,40 +168,75 @@ 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
+                       case 'adminaction':\r
+                               $condition = ($this->objAdmin->action == $name);\r
+                               break;\r
+                       case 'adminoldaction':\r
+                               $condition = ($this->objAdmin->action == $name);\r
+                               break;\r
+                       case 'addresschange':\r
+                               $condition = ($this->_ifAddresscange());\r
+                               break;\r
+                       case 'bechangepass':\r
+                               $condition = ($this->_beChangePassword());\r
+                               break;\r
+                       case 'skincandidates':\r
+                               $condition = ($this->_ifSkincandidates());\r
+                               break;\r
+                       case 'nameclashes':\r
+                               $condition = requestVar('nameclashes');\r
+                               break;\r
+                       case 'existsnewplugin':\r
+                               $condition = ($this->_existsNewPlugin());\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 +244,216 @@ class Actions extends BaseActions
                }\r
                return $condition;\r
        }\r
-\r
+       \r
+       /**\r
+        * Actions::beChangePassword()\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       function beChangePassword()\r
+       {\r
+               return intRequestVar('bNeedsPasswordChange');\r
+       }\r
+       \r
+       /**\r
+        * Actions::ifSkincandidates()\r
+        * Checks if a plugin exists and call its doIf function\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       private function ifSkincandidates()\r
+       {\r
+               global $DIR_SKINS;\r
+               $candidates = SKINIMPORT::searchForCandidates($DIR_SKINS);\r
+               return (count($candidates) > 0);\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
+               if ( $name == 'catname' )\r
+               {\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
+               if ( ($name == 'catid') && ($value == $catid) )\r
+               {\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::ifAddresscange()\r
+        * Check e-Mail address is changed\r
+        * \r
+        * @param       void\r
+        * @return      boolean\r
+        */\r
+       private function ifAddresscange()\r
+       {\r
+               $key = $this->objAdmin->sessionVar("{$CONF['CookiePrefix']}ackey");\r
+               if ( !$key )\r
+               {\r
+                       return FALSE;\r
+               }\r
+               $info = MEMBER::getActivationInfo($key);\r
+               if ( !$info )\r
+               {\r
+                       return FALSE;\r
+               }\r
+               $mem  = MEMBER::createFromId($info->vmember);\r
+               if ( !$mem )\r
+               {\r
+                       return FALSE;\r
+               }\r
+               if ( $info->vtype == 'addresschange' )\r
+               {\r
+                       return TRUE;\r
+               }\r
+               return FALSE;\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
+               // 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 +466,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
                $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(quickQuery($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
+       public 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::createitemlink($id, $this->linkparams), $linktext);\r
                }\r
                else\r
                {\r
@@ -379,19 +575,41 @@ class Actions extends BaseActions
        }\r
        \r
        /**\r
-        * Actions::_archivelink)\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
+               {\r
+                       $blog->setSelectedCategoryByName($catname);\r
+               }\r
+               else\r
+               {\r
+                       $blog->setSelectedCategory($catid);\r
+               }\r
+               return;\r
+       }\r
+\r
+       /**\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
+       public 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::createarchivelink($blog->getID(), $id, $this->linkparams), $linktext);\r
                }\r
                else\r
                {\r
@@ -401,113 +619,137 @@ 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
-               global $catid;\r
-               if ($catname != '')\r
-                       $blog->setSelectedCategoryByName($catname);\r
-               else\r
-                       $blog->setSelectedCategory($catid);\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
         * %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
+                * TODO: these lines are no meaning because there is no $template.\r
                 */\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
                // get archive date\r
@@ -538,96 +780,158 @@ class Actions extends BaseActions
                echo i18n::formatted_timedate($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::parsearchivelink()\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 parsearchivelink($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_archivelistlink($blog->getID(),$this->linkparams), $linktext);\r
                }\r
                else\r
                {\r
-                       echo $this->_link(Link::create_archivelist_link(), $linktext);\r
+                       echo $this->link(Link::create_archivelistlink(), $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
+       /**\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
                                break;\r
@@ -644,26 +948,95 @@ class Actions extends BaseActions
                                echo Entity::hsc($blog->getShortName());\r
                                break;\r
                }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_getblogsetting()\r
+        * Parse skinvar getblogsetting\r
+        */\r
+       function parse_getblogsetting($which)\r
+       {\r
+               global $blog;\r
+               if ( $blog )\r
+               {\r
+                       $b =& $blog;\r
+               }\r
+               elseif ( $bid = intRequestVar('blogid') )\r
+               {\r
+                       global $manager;\r
+                       $b = $manager->getBlog($bid);\r
+               }\r
+               else\r
+               {\r
+                       return;\r
+               }\r
+               \r
+               switch ( $which )\r
+               {\r
+                       case 'id':\r
+                               return Entity::hsc($b->getID());\r
+                               break;\r
+                       case 'url':\r
+                               return Entity::hsc($b->getURL());\r
+                               break;\r
+                       case 'name':\r
+                               return Entity::hsc($b->getName());\r
+                               break;\r
+                       case 'desc':\r
+                               return Entity::hsc($b->getDescription());\r
+                               break;\r
+                       case 'short':\r
+                               return Entity::hsc($b->getShortName());\r
+                               break;\r
+                       case 'notifyaddress':\r
+                               return Entity::hsc($b->getNotifyAddress());\r
+                               break;\r
+                       case 'maxcomments':\r
+                               return Entity::hsc($b->getMaxComments());\r
+                               break;\r
+                       case 'updatefile':\r
+                               return Entity::hsc($b->getUpdateFile());\r
+                               break;\r
+                       case 'timeoffset':\r
+                               return Entity::hsc($b->getTimeOffset());\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 +1047,64 @@ 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
+        * Actions::parse_charset()\r
         * Parse skinvar charset\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_charset() {\r
+       public function parse_charset()\r
+       {\r
                echo i18n::get_current_charset();\r
+               return;\r
        }\r
        \r
        /**\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
@@ -743,7 +1135,7 @@ class Actions extends BaseActions
                if ( !$destinationurl )\r
                {\r
                        // note: createLink returns an HTML encoded URL\r
-                       $destinationurl = Link::create_link(\r
+                       $destinationurl = Link::createlink(\r
                                'item',\r
                                array(\r
                                        'itemid' => $itemid,\r
@@ -804,13 +1196,18 @@ 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
+       public function parse_comments($template)\r
+       {\r
                global $itemid, $manager, $blog, $highlight;\r
                $template =& $manager->getTemplate($template);\r
-\r
+               \r
                // create parser object & action handler\r
                $actions = new ItemActions($blog);\r
                $parser = new Parser($actions->getDefinedActions(),$actions);\r
@@ -818,64 +1215,102 @@ class Actions extends BaseActions
                $actions->setParser($parser);\r
                $item = Item::getitem($itemid, 0, 0);\r
                $actions->setCurrentItem($item);\r
-\r
+               \r
                $comments = new Comments($itemid);\r
                $comments->setItemActions($actions);\r
-               $comments->showComments($template, -1, 1, $highlight);  // shows ALL comments\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
+               \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
+               \r
+               switch ( $what )\r
                {\r
                        case 'url':\r
                                echo $fullurl;\r
@@ -895,53 +1330,130 @@ 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
+       public function parse_imagetext()\r
+       {\r
                echo Entity::hsc(requestVar('imagetext'));\r
        }\r
+       \r
+       /**\r
+        * Actions::parse_skinfile()\r
+        * Inserts an url relative to the skindir (useful when doing import/export)\r
+        * e.g. <skinfile(default/myfile.sth)>\r
+        * \r
+        * @param       string  $filename       name of file\r
+        * @return      void\r
+        */\r
+       public function parse_skinfile($filename)\r
+       {\r
+               $base = NP_SkinableAdmin::getAdminSkinURL();\r
+               $pref = PARSER::getProperty('IncludePrefix');\r
+               echo "{$base}{$pref}{$filename}";\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_imagetext()\r
+        * Parse skinvar imagetext\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_imagetext()\r
+       {\r
+               $this->parse_image('imagetext');\r
+               return;\r
+       }\r
 \r
        /**\r
+        * Actions::parse_itemlink()\r
+        * Parse skinvar itemlink\r
+        * \r
+        * @param       string  $linktext       text for content of anchor element\r
+        * @return      void\r
+        */\r
+       function parse_itemlink($linktext = '')\r
+       {\r
+               global $itemid;\r
+               $this->itemlink($itemid, $linktext);\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 parseitemlink($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
+               \r
+               switch ( $format )\r
+               {\r
                        case 'xml':\r
                                echo Entity::hen($item['title']);\r
                                break;\r
@@ -953,39 +1465,49 @@ class Actions extends BaseActions
                                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
         * 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
@@ -1035,25 +1557,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_memberlink($member->getID());\r
                                        else\r
-                                               echo $CONF['IndexURL'] . Link::create_member_link($member->getID());\r
+                                               echo $CONF['IndexURL'] . Link::create_memberlink($member->getID());\r
                                        break;\r
                        }\r
                }\r
                return;\r
        }\r
-\r
+       \r
        /**\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 +1583,11 @@ class Actions extends BaseActions
                {\r
                        if ( $CONF['URLMode'] == 'pathinfo' )\r
                        {\r
-                               $desturl = Link::create_member_link($memberid);\r
+                               $desturl = Link::create_memberlink($memberid);\r
                        }\r
                        else\r
                        {\r
-                               $desturl = $CONF['IndexURL'] . Link::create_member_link($memberid);\r
+                               $desturl = $CONF['IndexURL'] . Link::create_memberlink($memberid);\r
                        }\r
                }\r
                \r
@@ -1098,29 +1620,48 @@ 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
-       function parse_nextitem() {\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\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
@@ -1134,184 +1675,291 @@ class Actions extends BaseActions
                                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
                }\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
+               \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
@@ -1322,7 +1970,7 @@ class Actions extends BaseActions
         * @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
@@ -1343,80 +1991,133 @@ class Actions extends BaseActions
        }\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
+               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
+       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,38 +2130,64 @@ 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
+       public function parse_skinname()\r
+       {\r
                echo $this->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
+               return;\r
        }\r
-\r
+       \r
        /**\r
+        * Actions::parse_text()\r
         * Parse text\r
+        * \r
+        * @param       void\r
+        * @return      void\r
         */\r
-       function parse_text($which) {\r
+       public function parse_text($which)\r
+       {\r
                // constant($which) only available from 4.0.4 :(\r
-               if (defined($which)) {\r
+               if ( defined($which) )\r
+               {\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
@@ -1468,19 +2195,19 @@ class Actions extends BaseActions
         * 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_blogidlink($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 +2215,1092 @@ 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($itemnumber = 0, $template = '')\r
+       {\r
                global $manager;\r
                \r
                $itemnumber = intval($itemnumber);\r
                $itemarray = array($itemnumber);\r
-\r
+               \r
                $b =& $manager->getBlog(getBlogIDFromItemID($itemnumber));\r
-               $this->_preBlogContent('sticky',$b);\r
+               $this->preBlogContent('sticky',$b);\r
                $this->amountfound = $b->readLogFromList($itemarray, $template);\r
-               $this->_postBlogContent('sticky',$b);\r
+               $this->postBlogContent('sticky',$b);\r
+               return;\r
        }\r
-\r
-\r
-}\r
+       \r
+       /* TODO: checking these new added methods */\r
+       \r
+       /**\r
+        * Actions::parse_adminbanlist()\r
+        * Parse skinvar adminbanlist\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_adminbanlist($templateName = '')\r
+       {\r
+               $blogid = intRequestVar('blogid');\r
+               $query = "SELECT * FROM %s WHERE blogid=%d ORDER BY iprange;";\r
+               $query = sprintf($query, sql_table('ban'), (integer) $blogid);\r
+               $template['content'] = 'banlist';\r
+               $amount = skinableShowlist($query, 'table', $template, $templateName);\r
+               if ( $amount == 0 )\r
+               {\r
+                       echo _BAN_NONE;\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminbatchaction()\r
+        * Parse skinvar adminbatchaction\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_adminbatchaction()\r
+       {\r
+               echo Entity::hsc(requestVar('batchaction'));\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminbatchlist()\r
+        * Parse skinvar adminbatchlist\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_adminbatchlist($templateName = '')\r
+       {\r
+               global $manager;\r
+               $templates = array();\r
+               if ( !empty($templateName) )\r
+               {\r
+                       $templates = skinableTEMPLATE::read($templateName);\r
+               }\r
+               if ( isset($templates['ADMIN_BATCHLIST']) || !empty($templates['ADMIN_BATCHLIST']) )\r
+               {\r
+                       $template = $templates['ADMIN_BATCHLIST'];\r
+               }\r
+               else\r
+               {\r
+                       $template = '<li><%text(_BATCH_EXECUTING)%><b><%adminbatchaction%></b>'\r
+                                         . '<%batchlisttype%> <b><%batchid%></b>...'\r
+                                         . '<b><%batchlistmsg%></b></li>' . "\n";\r
+               }\r
+               \r
+               $selected = requestIntArray('batch');\r
+               $action   = requestVar('batchaction');\r
+               \r
+               switch ( $this->skintype )\r
+               {\r
+                       case 'batchitem':\r
+                               $batchlisttype = _BATCH_ONITEM;\r
+                               $deleteaction  = 'deleteOneItem';\r
+                               $moveaction     = 'moveOneItem';\r
+                               $destid         = intRequestVar('destcatid');\r
+                               break;\r
+                       case 'batchcomment':\r
+                               $batchlisttype = _BATCH_ONCOMMENT;\r
+                               $deleteaction  = 'deleteOneComment';\r
+                               break;\r
+                       case 'batchmember':\r
+                               $batchlisttype = _BATCH_ONMEMBER;\r
+                               $deleteaction  = 'deleteOneMember';\r
+                               $setadminsql   = sql_table('member') . ' SET madmin = 1 WHERE mnumber = ';\r
+                               $unsetchksql   = 'SELECT * FROM ' . sql_table('member') . ' WHERE madmin = 1 AND mcanlogin = 1';\r
+                               $unsetupsql     = sql_table('member') . ' SET madmin = 0 WHERE mnumber = ';\r
+                               $unseterrmsg   = _ERROR_ATLEASTONEADMIN;\r
+                               break;\r
+                       case 'batchteam':\r
+                               $blogid         = intRequestVar('blogid');\r
+                               $batchlisttype = _BATCH_ONTEAM;\r
+                               $deleteaction  = 'deleteOneTeamMember';\r
+                               $setadminsql   = sql_table('team') . ' SET tadmin = 1 WHERE tblog = ' . $blogid . ' AND tmember = ';\r
+                               $unsetchksql   = 'SELECT * FROM ' . sql_table('team') . ' WHERE tadmin = 1 AND tblog = ' . $blogid;\r
+                               $unseterrmsg   = _ERROR_ATLEASTONEBLOGADMIN;\r
+                               $unsetupsql     = sql_table('team') . ' SET tadmin = 0 WHERE tblog = ' . $blogid . ' AND tmember = ';\r
+                               break;\r
+                       case 'batchcategory':\r
+                               $batchlisttype = _BATCH_ONCATEGORY;\r
+                               $deleteaction  = 'deleteOneCategory';\r
+                               $moveaction     = 'moveOneCategory';\r
+                               $destid         = intRequestVar('destblogid');\r
+                               break;\r
+               }\r
+               \r
+               // walk over all selectedids and perform action\r
+               foreach ( $selected as $selectedid )\r
+               {\r
+                       $error    = '';\r
+                       $selectedid = intval($selectedid);\r
+                       switch ( $action )\r
+                       {\r
+                               case 'delete':\r
+                                       if ( $this->skintype != 'batchteam' )\r
+                                       {\r
+                                               $error = $this->objAdmin->$deleteaction($selectedid);\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               $error  = $this->objAdmin->deleteOneTeamMember($blogid, $selectedid);\r
+                                       }\r
+                                       break;\r
+                               case 'move':\r
+                                       $error = $this->objAdmin->$moveaction($selectedid, $destid);\r
+                                       break;\r
+                               case 'setadmin':\r
+                                       // always succeeds\r
+                                       sql_query('UPDATE ' . $setadminsql . $selectedid);\r
+                                       $error = '';\r
+                                       break;\r
+                               case 'unsetadmin':\r
+                                       // there should always remain at least one super-admin\r
+                                       $r = sql_query($unsetchksql);\r
+                                       if ( sql_num_rows($r) < 2 )\r
+                                       {\r
+                                               $error = $unseterrmsg;\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               sql_query('UPDATE ' . $unsetupsql . $selectedid);\r
+                                       }\r
+                                       break;\r
+                               default:\r
+                                       $error = _BATCH_UNKNOWN . Entity::hsc($action);\r
+                       }\r
+                       $data = array(\r
+                               'batchid'                       => $selectedid,\r
+                               'batchlisttype'         => Entity::hsc($batchlisttype),\r
+                               'adminbatchaction'      => Entity::hsc($action),\r
+                               'batchlistmsg'          => $error ? $error : _BATCH_SUCCESS,\r
+                       );\r
+                       $handler = new skinableACTIONS('template', $template, new ADMIN);\r
+                       $parser  = new skinablePARSER($handler);\r
+                       \r
+                       ob_start();\r
+                       $parser->parse($template);\r
+                       $template = ob_get_contents();\r
+                       ob_end_clean();\r
+                       \r
+                       echo TEMPLATE::fill($template, $data);\r
+                       return;\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminbloglink()\r
+        * Parse skinvar adminbloglink\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_adminbloglink($templateName = '')\r
+       {\r
+               global $manager;\r
+               $blogid =  intRequestVar('blogid');\r
+               $blog   =& $manager->getBlog($blogid);\r
+               $templates = array();\r
+               \r
+               if ( !empty($templateName) )\r
+               {\r
+                       $templates = skinableTEMPLATE::read($templateName);\r
+               }\r
+               \r
+               if ( isset($templates['ADMIN_BLOGLINK']) || !empty($templates['ADMIN_BLOGLINK']) )\r
+               {\r
+                       $template = $templates['ADMIN_BLOGLINK'];\r
+               }\r
+               else\r
+               {\r
+                       $template = '<a href="<%url%>" title="<%adminbloglinktitle%>"><%blogname%></a>';\r
+               }\r
+               \r
+               $data = array(\r
+                       'url'                                   => Entity::hsc($blog->getURL()),\r
+                       'adminbloglinktitle'    => _BLOGLIST_TT_VISIT,\r
+                       'blogname'                              => Entity::hsc($blog->getName())\r
+               );\r
+               \r
+               echo TEMPLATE::fill($template, $data);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminerrormesg()\r
+        * Parse skinvar adminerrormesg\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_adminerrormesg()\r
+       {\r
+               global $CONF;\r
+               $message = '';\r
+               \r
+               if ( requestVar('errormessage') )\r
+               {\r
+                       $message = requestVar('errormessage');\r
+               }\r
+               elseif ( cookieVar($CONF['CookiePrefix'] . 'errormessage') )\r
+               {\r
+                       $message = cookieVar($CONF['CookiePrefix'] . 'errormessage');\r
+               }\r
+               elseif ( $this->objAdmin->sessionVar($CONF['CookiePrefix'] . 'errormessage') )\r
+               {\r
+                       $message = $this->objAdmin->sessionVar($CONF['CookiePrefix'] . 'errormessage');\r
+               }\r
+               echo Entity::hsc($message);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminparsedinclude()\r
+        * Parse skinvar adminparsedinclude\r
+        * \r
+        * @param       string  $filename       name of file\r
+        * @return      void\r
+        */\r
+       public function parse_adminparsedinclude($filename)\r
+       {\r
+               // check current level\r
+               if ( $this->level > 3)\r
+               {\r
+                       // max. depth reached (avoid endless loop)\r
+                       return;\r
+               }\r
+               \r
+               $skin = new skinableSKIN($this->skin->id);\r
+               $file = $this->getIncludeFileName($filename);\r
+               if ( !$skin->isValid && !file_exists($file) )\r
+               {\r
+                       return;\r
+               }\r
+               $contents = $skin->getContent($filename);\r
+               if ( !$contents )\r
+               {\r
+                       if ( !file_exists($file) )\r
+                       {\r
+                               return;\r
+                       }\r
+                       $contents = file_get_contents($file);\r
+                       if ( empty($contents) )\r
+                       {\r
+                               return;\r
+                       }\r
+               }\r
+               $this->level = $this->level + 1;\r
+               // parse file contents\r
+               $this->parser->parse($contents);\r
+               \r
+               $this->level = $this->level - 1;\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminskineditallowedlist()\r
+        * Parse skinvar adminskineditallowedlist\r
+        * \r
+        * @param       string  $type                   template/blog\r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_adminskineditallowedlist($type = 'template', $templateName = '')\r
+       {\r
+               switch ( $type )\r
+               {\r
+                       /* TODO: blog seems not to be used */\r
+                       case 'blog':\r
+                               $query = "SELECT bshortname, bname FROM %s";\r
+                               $query = sprintf($query, sql_table('blog'));\r
+                               $show  = array(\r
+                                       'content' => 'shortblognames'\r
+                               );\r
+                               break;\r
+                       case 'template':\r
+                               $query = "SELECT tdname as name, tddesc as description FROM %s;";\r
+                               $query = sprintf($query, sql_table('admintemplate_desc'));\r
+                               $show  = array(\r
+                                       'content' => 'shortnames'\r
+                               );\r
+                               break;\r
+               }\r
+               skinableShowlist($query, 'table', $show, $templateName);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminskinielist()\r
+        * Parse skinvar adminskinielist\r
+        * \r
+        * @param       string  $type                   skin/template\r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_adminskinielist($type, $templateName = '')\r
+       {\r
+               $templates = array();\r
+               if ( $templateName )\r
+               {\r
+                       $templates = skinableTEMPLATE::read($templateName);\r
+               }\r
+               if ( isset($templates['SKINIE_EXPORT_LIST']) && !empty($templates['SKINIE_EXPORT_LIST']) )\r
+               {\r
+                       $template = $templates['SKINIE_EXPORT_LIST'];\r
+               }\r
+               else\r
+               {\r
+                       $template = '<td><input type="checkbox" name="<%typeid%>"  id="<%expid%>" /><label for="<%expid%>"><%expname%></label></td>' . "\n"\r
+                                         . "<td><%expdesc%></td>\n"\r
+                                         . "</tr><tr>\n";\r
+               }\r
+               switch ( $type )\r
+               {\r
+                       case 'skin':\r
+                               $query = "SELECT * FROM %s;";\r
+                               $query = sprintf($query, sql_table('adminskin_desc'));\r
+                               $res = sql_query($query);\r
+                               \r
+                               while ( $skinObj = sql_fetch_object($res) )\r
+                               {\r
+                                       $data = array(\r
+                                               'typeid'        => 'skin[' . $skinObj->sdnumber . ']',\r
+                                               'expid'         => 'skinexp' . $skinObj->sdnumber,\r
+                                               'expname'       => Entity::hsc($skinObj->sdname),\r
+                                               'expdesc'       => Entity::hsc($skinObj->sddesc),\r
+                                       );\r
+                                       echo TEMPLATE::fill($template, $data);\r
+                               }\r
+                               break;\r
+                       case 'template':\r
+                               $query = "SELECT * FROM %s;";\r
+                               $query = sprintf($query, sql_table('admintemplate_desc'));\r
+                               $res = sql_query($query);\r
+                               while ( $templateObj = sql_fetch_object($res) )\r
+                               {\r
+                                       $data = array(\r
+                                               'typeid'        => 'template[' . $templateObj->tdnumber . ']',\r
+                                               'expid'         => 'templateexp' . $templateObj->tdnumber,\r
+                                               'expname'       => Entity::hsc($templateObj->tdname),\r
+                                               'expdesc'       => Entity::hsc($templateObj->tddesc),\r
+                                       );\r
+                                       echo TEMPLATE::fill($template, $data);\r
+                               }\r
+                               break;\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminskinoverview()\r
+        * Parse skinvar adminskinoverview\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_adminskinoverview($templateName = '')\r
+       {\r
+               $query = "SELECT * FROM %s ORDER BY sdname;";\r
+               $query = sprintf($query, sql_table('adminskin_desc'));\r
+               \r
+               $template['content']    = 'adminskinlist';\r
+               $template['tabindex']   = 10;\r
+               skinableShowlist($query, 'table', $template, $templateName);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminskinselectoptions()\r
+        * Parse skinvar adminskinselectoptions\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_adminskinselectoptions()\r
+       {\r
+               global $CONF;\r
+               $query = "SELECT sdname as text, sdnumber as value FROM %s;";\r
+               $query = sprintf($query, sql_table('adminskin_desc'));\r
+               \r
+               $template['name']        = 'adminskin';\r
+               $template['selected'] = $CONF['DefaultAdminSkin'];\r
+               $template['tabindex'] = 110;\r
+               skinableShowlist($query, 'select', $template, '');\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminspecialskinlist()\r
+        * Parse skinvar adminspecialskinlist\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        */\r
+       public function parse_adminspecialskinlist($templateName = '')\r
+       {\r
+               $templates = array();\r
+               if ( $templateName )\r
+               {\r
+                       $templates = skinableTEMPLATE::read($templateName);\r
+               }\r
+               \r
+               $nType  = skinableSKIN::getAdminskinDefaultTypes();\r
+               $skinid = intRequestVar('skinid');\r
+               \r
+               $query = "SELECT stype FROM  %s WHERE stype NOT IN (%s) AND sdesc=%d;";\r
+               $query = sprintf($query, sql_table('adminskin'), "'" . implode("', '", $nType) . "'", (integer) $skinid);\r
+               \r
+               $res    = sql_query($query);\r
+               if ( $res && sql_num_rows($res) > 0 )\r
+               {\r
+                       $data = array();\r
+                       if ( isset($templates['ADMIN_SPECIALSKINLIST_HEAD']) && !empty($templates['ADMIN_SPECIALSKINLIST_HEAD']) )\r
+                       {\r
+                               $template['head'] = $templates['ADMIN_SPECIALSKINLIST_HEAD'];\r
+                       }\r
+                       else\r
+                       {\r
+                               $template['head'] = "<ul>\n";\r
+                       }\r
+                       echo TEMPLATE::fill($template['head'], $data);\r
+                       if ( isset($templates['ADMIN_SPECIALSKINLIST_BODY']) && !empty($templates['ADMIN_SPECIALSKINLIST_BODY']) )\r
+                       {\r
+                               $template['body'] = $templates['ADMIN_SPECIALSKINLIST_BODY'];\r
+                       }\r
+                       else\r
+                       {\r
+                               $template['body'] = '<li><a tabindex="<%tabindex%>" href="index.php?action=adminskinedittype&amp;skinid=<%skinid%>'\r
+                                                                 . '&amp;type=<%skintype%>"><%skintype%></a> (<a tabindex="<%tabindex%>" href="index.php?'\r
+                                                                 . 'action=adminskinremovetype&amp;skinid=<%skinid%>&amp;type=<%skintype%>">remove</a>)</li>';\r
+                       }\r
+                       $tabstart = 120;\r
+                       while ( $row = sql_fetch_assoc($res) )\r
+                       {\r
+                               $data = array(\r
+                                       'tabindex'      => $tabstart++,\r
+                                       'skinid'        => $skinid,\r
+                                       'skintype'      => Entity::hsc(strtolower($row['stype']))\r
+                               );\r
+                               echo TEMPLATE::fill($template['body'], $data);\r
+                       }\r
+                       \r
+                       $data = array();\r
+                       if ( isset($templates['ADMIN_SPECIALSKINLIST_FOOT']) && !empty($templates['ADMIN_SPECIALSKINLIST_FOOT']) )\r
+                       {\r
+                               $template['foot'] = $templates['ADMIN_SPECIALSKINLIST_FOOT'];\r
+                       }\r
+                       else\r
+                       {\r
+                               $template['foot'] = "<ul>\n";\r
+                       }\r
+                       echo TEMPLATE::fill($template['foot'], $data);\r
+                       return;\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminstyleseets()\r
+        * Parse skinvar adminstyleseets\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_adminstyleseets()\r
+       {\r
+               global $CONF;\r
+               $includePrefix = $this->skin->includePrefix;\r
+               \r
+               if ( strlen($includePrefix) > 0 )\r
+               {\r
+                       $styleURL = Entity::hsc($CONF['AdminURL']) . 'adminskins/' . $includePrefix . 'admin_' . $CONF['AdminCSS'] . '.css';\r
+               }\r
+               else\r
+               {\r
+                       $styleURL = Entity::hsc($CONF['AdminURL']) . 'styles/admin_' . $CONF['AdminCSS'] . '.css';\r
+               }\r
+               echo $styleURL;\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_adminstyleselectoptions()\r
+        * Parse skinvar adminstyleselectoptions\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_adminstyleselectoptions()\r
+       {\r
+               global $CONF, $manager, $DIR_NUCLEUS;\r
+               if ( strlen($this->skin->includePrefix) > 0 )\r
+               {\r
+                       $scndir = $DIR_NUCLEUS . 'adminskins/' . $this->skin->includePrefix;\r
+               }\r
+               else\r
+               {\r
+                       $scndir = $DIR_NUCLEUS . 'styles/';\r
+               }\r
+               $files = scandir($scndir);\r
+               \r
+               foreach ( $files as $file )\r
+               {\r
+                       if ( !preg_match("#^admin_(.*)\.css$#", $file, $matches) )\r
+                       {\r
+                               continue;\r
+                       }\r
+                       \r
+                       $name = $matches[1];\r
+                       $opts = '<option value="' . $name . '"';\r
+                       if ( $name != $CONF['AdminCSS'] )\r
+                       {\r
+                               $opts .= "<option value=\"{$name}\">{$name}</option>\n";\r
+                       }\r
+                       else\r
+                       {\r
+                               $opts .= "<option value=\"{$name}\" selected=\"selected\">{$name}</option>\n";\r
+                       }\r
+                       echo $opts;\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_admintemplateoverview()\r
+        * Parse skinvar admintemplateoverview\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_admintemplateoverview($templateName = '')\r
+       {\r
+               $query  = "SELECT * FROM %s ORDER BY tdname;";\r
+               $query = sprintf($query, sql_table('admintemplate_desc'));\r
+               \r
+               $template['content']  = 'admintemplatelist';\r
+               $template['tabindex'] = 10;\r
+               \r
+               skinableShowlist($query, 'table', $template, $templateName);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_allowedadminskinactions()\r
+        * Parse skinvar allowedadminskinactions\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_allowedadminskinactions()\r
+       {\r
+               global $DIR_ADMINSKINS;\r
+               $skinType = strtolower(trim(requestVar('type')));\r
+               $actions  = skinableSKIN::getAllowedActionsForType($skinType);\r
+               sort($actions);\r
+               \r
+               while ( $current = array_shift($actions) )\r
+               {\r
+                       // skip deprecated vars\r
+                       if ($current == 'ifcat' || $current == 'imagetext' || $current == 'vars')\r
+                       {\r
+                               continue;\r
+                       }\r
+                       \r
+                       echo "<a href=\"{$DIR_ADMINSKINS}documentation/help.html#{$current}\" onclick=\"if (event &amp;&amp; event.preventDefault) event.preventDefault(); return help(this.href);\">{$current}</a>\n";\r
+                       \r
+                       if ( count($actions) != 0 )\r
+                       {\r
+                               echo ", ";\r
+                       }\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_allowedskinactions()\r
+        * Parse skinvar allowedskinactions\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_allowedskinactions()\r
+       {\r
+               $skinType = strtolower(trim(requestVar('type')));\r
+               $actions  = SKIN::getAllowedActionsForType($skinType);\r
+               sort($actions);\r
+               \r
+               while ( $current = array_shift($actions) )\r
+               {\r
+                       // skip deprecated vars\r
+                       if ( $current == 'ifcat' || $current == 'imagetext' || $current == 'vars' )\r
+                       {\r
+                               continue;\r
+                       }\r
+                       \r
+                       /* TODO: alternative function should be used or not?  */\r
+                       echo helplink("skinvar-{$current}") . "$current</a>\n";\r
+                       \r
+                       if ( count($actions) != 0 )\r
+                       {\r
+                               echo ", ";\r
+                       }\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Action::parse_banlistdeletedlist()\r
+        * Parse skinvar banlistdeletedlist\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_banlistdeletedlist($templateName = '')\r
+       {\r
+               global $manager;\r
+               $templates = array();\r
+               \r
+               if ( $templateName )\r
+               {\r
+                       $templates = skinableTEMPLATE::read($templateName);\r
+               }\r
+               if ( isset($templates['BANLIST_DELETED_LIST']) && !empty($templates['BANLIST_DELETED_LIST']) )\r
+               {\r
+                       $template = $templates['BANLIST_DELETED_LIST'];\r
+               }\r
+               else\r
+               {\r
+                       $template = "<li><%blogname%></li>\n";\r
+               }\r
+               $deleted = requestArray('delblogs');\r
+               foreach ( $deleted as $delblog )\r
+               {\r
+                       $blog =& $manager->getBlog($delblog);\r
+                       $data =  array(\r
+                               Entity::hsc($blog->getName())\r
+                       );\r
+                       TEMPLATE::fill($template, $data);\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_batchdeletelist()\r
+        * Parse skinvar batchdeletelist\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_batchdeletelist()\r
+       {\r
+               $selected = requestIntArray('batch');\r
+               $index  = 0;\r
+               \r
+               foreach ( $selected as $select )\r
+               {\r
+                       echo '<input type="hidden" name="batch[' . ($index++) . ']" value="' . intval($select) . "\" />\n";\r
+               }\r
+               // add hidden vars for team & comment\r
+               if ( requestVar('action') == 'batchteam' )\r
+               {\r
+                       echo '<input type="hidden" name="blogid" value="' . intRequestVar('blogid') . "\" />\n";\r
+               }\r
+               if ( requestVar('action') == 'batchcomment' )\r
+               {\r
+                       echo '<input type="hidden" name="itemid" value="' . intRequestVar('itemid') . "\" />\n";\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_batchdeletetype()\r
+        * Parse skinvar batchdeletetype\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       function parse_batchdeletetype()\r
+       {\r
+               echo Entity::hsc(requestVar('action'));\r
+               return;\r
+       }\r
+\r
+       /**\r
+        * Actions::parse_batchmovebtn()\r
+        * Parse skinvar batchmovebtn\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_batchmovebtn()\r
+       {\r
+               $actionType = requestVar('action');\r
+               switch ( $actionType )\r
+               {\r
+                       case 'batchitem':\r
+                               echo _MOVE_BTN;\r
+                               break;\r
+                       case 'batchcategory':\r
+                               echo _MOVECAT_BTN;\r
+                               break;\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_batchmovelist()\r
+        * Parse skinvar batchmovelist\r
+        * \r
+        * @param       void\r
+        * @param       void\r
+        */\r
+       public function parse_batchmovelist()\r
+       {\r
+               $selected = requestIntArray('batch');\r
+               foreach ( $selected as $select )\r
+               {\r
+                       echo '<input type="hidden" name="batch[' . ($select++) . ']" value="' . intval($select) . "\" />\n";\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_batchmovetitle()\r
+        * Parse skinvar batchmovetitle\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_batchmovetitle()\r
+       {\r
+               $actionType = requestVar('action');\r
+               switch ( $actionType )\r
+               {\r
+                       case 'batchitem':\r
+                               echo _MOVE_TITLE;\r
+                               break;\r
+                       case 'batchcategory':\r
+                               echo _MOVECAT_TITLE;\r
+                               break;\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_batchmovetype()\r
+        * Parse skinvar batchmovetype\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_batchmovetype()\r
+       {\r
+               echo Entity::hsc(requestVar('action'));\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_blogcatlist()\r
+        * Parse skinvar blogcatlist\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_blogcatlist()\r
+       {\r
+               global $manager;\r
+               $blogid = intRequestVar('blogid');\r
+               $query  = "SELECT * FROM %s WHERE cblog = %d ORDER BY cname;";\r
+               $query = sprintf($query, sql_table('category'), (integer) $blogid);\r
+               \r
+               $template['content']  = 'categorylist';\r
+               $template['tabindex'] = 200;\r
+               \r
+               $batch = new skinableBATCH('member');\r
+               $batch->showlist($query, 'table', $template);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_blognotifysetting()\r
+        * Parse skinvar blognotifysetting\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_blognotifysetting($type)\r
+       {\r
+               global $manager;\r
+               $blogid = intRequestVar('blogid');\r
+               $blog   = $manager->getBlog($blogid);\r
+               \r
+               switch ( $type )\r
+               {\r
+                       case 'comment':\r
+                               if ( !$blog->notifyOnComment() )\r
+                               {\r
+                                       return;\r
+                               }\r
+                               break;\r
+                       case 'vote':\r
+                               if ( !$blog->notifyOnVote() )\r
+                               {\r
+                                       return;\r
+                               }\r
+                               break;\r
+                       case 'newitem':\r
+                               if ( !$blog->notifyOnNewItem() )\r
+                               {\r
+                                       return;\r
+                               }\r
+                               break;\r
+               }\r
+               echo ' checked="checked"';\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_blogsetting()\r
+        * Parse skinvar blogsetting\r
+        * \r
+        * @param       string  $which  name of weblog setting\r
+        * @return      void\r
+        */\r
+       public function parse_blogsetting($which)\r
+       {\r
+               echo $this->parse_getblogsetting($which);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_blogsettingyesno()\r
+        * Parse skinvar blogsettingyesno\r
+        * \r
+        * @param       string  $type                   type of weblog setting\r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_blogsettingyesno($type, $templateName = '')\r
+       {\r
+               global $manager;\r
+               \r
+               $blogid = intRequestVar('blogid');\r
+               $blog   = $manager->getBlog($blogid);\r
+               \r
+               switch ( $type )\r
+               {\r
+                       case 'convertbreaks':\r
+                               $checkedval = $blog->convertBreaks();\r
+                               $tabindex   = 55;\r
+                               break;\r
+                       case 'allowpastposting':\r
+                               $checkedval = $blog->allowPastPosting();\r
+                               $tabindex   = 57;\r
+                               break;\r
+                       case 'comments':\r
+                               $checkedval = $blog->commentsEnabled();\r
+                               $tabindex   = 60;\r
+                               break;\r
+                       case 'public':\r
+                               $checkedval = $blog->isPublic();\r
+                               $tabindex   = 70;\r
+                               break;\r
+                       case 'reqemail':\r
+                               $checkedval = $blog->emailRequired();\r
+                               $tabindex   = 72;\r
+                               break;\r
+                       case 'searchable':\r
+                               $checkedval = $blog->getSearchable();\r
+                               $tabindex   = 122;\r
+                               break;\r
+               }\r
+               $this->parse_inputyesno($type, $checkedval, $tabindex, 1, 0, _YES, _NO, 0, $templateName);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_blogteamlist()\r
+        * Parse skinvar blogteamlist\r
+        * \r
+        * @param       string  $templateName   name of template to use\r
+        * @return      void\r
+        */\r
+       public function parse_blogteamlist($templateName = '')\r
+       {\r
+               global $manager;\r
+               $blogid = intRequestVar('blogid');\r
+               $query  = "SELECT tblog, tmember, mname, mrealname, memail, tadmin "\r
+                       . "FROM %s, %s "\r
+                       . "WHERE tmember=mnumber AND tblog= %d";\r
+               $query = sprintf($query, sql_table('member'), sql_table('team'), (integer) $blogid);\r
+               \r
+               $template['content']  = 'teamlist';\r
+               $template['tabindex'] = 10;\r
+\r
+               $batch = new skinableBATCH('team');\r
+               $batch->showlist($query, 'table', $template, _LISTS_NOMORE, $templateName);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_blogteammembers()\r
+        * Parse skinvar blogteammembers\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        */\r
+       public function parse_blogteammembers()\r
+       {\r
+               $blogid = intRequestVar('blogid');\r
+               $query  = "SELECT mname, mrealname "\r
+                               . "FROM %s, %s "\r
+                               . "WHERE mnumber=tmember AND tblog=%d;";\r
+               $query = sprintf($query, sql_table('member'), sql_table('team'), (integer) $blogid);\r
+               $res    = sql_query($query);\r
+               $memberNames = array();\r
+               while ($o = sql_fetch_object($res)) {\r
+                       $memberNames[] = Entity::hsc($o->mname) . ' (' . Entity::hsc($o->mrealname). ')';\r
+               }\r
+               echo implode(',', $memberNames);\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_blogtime()\r
+        * Parse skinvar blogtime\r
+        * \r
+        * @param       string  $type   type of time\r
+        * @param       string  $format format for time expression\r
+        * @param       integer $offset offset of time\r
+        * @return      void\r
+        */\r
+       public function parse_blogtime($type, $format = '%H:%M', $offset = 0)\r
+       {\r
+               global $manager;\r
+               \r
+               if ( $type != 'blogtime' )\r
+               {\r
+                       /* return server time */\r
+                       $timestamp = time() + $offset;\r
+               }\r
+               else\r
+               {\r
+                       $bid            = intRequestVar('blogid');\r
+                       $b                      = $manager->getBlog($bid);\r
+                       $timestamp      = $b->getCorrectTime() + $offset;\r
+               }\r
+               \r
+               echo i18n::formatted_datetime($format, $timestamp);\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_bookmarkletadmin()\r
+        * Parse skinvar bookmarkletadmin\r
+        * \r
+        * @param       string  $type   type of anchor element for bookmarklet\r
+        * @return      void\r
+        */\r
+       public function parse_bookmarkletadmin($type)\r
+       {\r
+               global $manager;\r
+               \r
+               $blogid = intRequestVar('blogid');\r
+               \r
+               if ( $type != 'regfile' )\r
+               {\r
+                       echo Entity::hsc(getBookmarklet($blogid));\r
+               }\r
+               else\r
+               {\r
+                       $url = 'index.php?action=regfile&blogid=' . intval($blogid);\r
+                       $url = $manager->addTicketToUrl($url);\r
+                       /* TODO: Shift-JIS is not always correct, I think... */\r
+                       echo Entity::hsc($url, 'SJIS');\r
+               }\r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_categorysetting()\r
+        * Parse skinvar categorysetting\r
+        * \r
+        * @param       string  $type   type in category setting\r
+        * @return      void\r
+        */\r
+       public function parse_categorysetting($type)\r
+       {\r
+               $catid  = intRequestVar('catid');\r
+               if ( $type == 'id' )\r
+               {\r
+                       echo $catid;\r
+                       return;\r
+               }\r
+               $blogid = intRequestVar('blogid');\r
+               $query  = "SELECT * FROM %s WHERE cblog = %d AND catid = %d;";\r
+               $query  = sprintf($query, sql_table('category'), (integer) $blogid, (integer) $catid);\r
+               $res    = sql_query($query);\r
+               $obj    = sql_fetch_object($res);\r
+               \r
+               if ( $type != desc )\r
+               {\r
+                       echo Entity::hsc($obj->cdesc);\r
+               }\r
+               else\r
+               {\r
+                       echo Entity::hsc($obj->cname);\r
+               }\r
+               \r
+               return;\r
+       }\r
+       \r
+       /**\r
+        * Actions::parse_codename()\r
+        * Parse templatevar codename\r
+        * \r
+        * @param       void\r
+        * @return      void\r
+        * \r
+        * TODO: is this need???\r
+        */\r
+       public function parse_codename()\r
+       {\r
+               global $nucleus;\r
+               echo $nucleus['codename'];\r
+               return;\r
+       }\r
+       \r
+}
\ No newline at end of file