OSDN Git Service

FIX: リファレンスにまつわるコードを修正
[nucleus-jp/nucleus-next.git] / nucleus / libs / ACTIONS.php
index 622d444..5e865a5 100644 (file)
-<?php\r
-/**\r
- * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2012 The Nucleus Group\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- * (see nucleus/documentation/index.html#license for more info)\r
- */\r
-/**\r
- * This class contains the functions that get called by using\r
- * the special tags in the skins\r
- *\r
- * The allowed tags for a type of skinpart are defined by the\r
- * Skin::getAllowedActionsForType($type) method\r
- *\r
- * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2012 The Nucleus Group\r
- * @version $Id: ACTIONS.php 1784 2012-04-22 04:28:30Z sakamocchi $\r
- */\r
-\r
-class Actions extends BaseActions\r
-{\r
-       // part of the skin currently being parsed ('index', 'item', 'archive',\r
-       // 'archivelist', 'member', 'search', 'error', 'imagepopup')\r
-       private $skintype;\r
-       \r
-       // contains an assoc array with parameters that need to be included when\r
-       // generating links to items/archives/... (e.g. catid)\r
-       private $linkparams;\r
-       \r
-       // reference to the skin object for which a part is being parsed\r
-       private $skin;\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
-       private $formdata;\r
-       \r
-       // filled out with the number of displayed items after calling one of the\r
-       // (other)blog/(other)searchresults skinvars.\r
-       private $amountfound;\r
-       \r
-       /**\r
-        * Actions::$default_actions\r
-        * list of whole action names with which this class can deal\r
-        */\r
-       static private $default_actions = array(\r
-               'addlink',\r
-               'addpopupcode',\r
-               'adminurl',\r
-               'archivelink',\r
-               'bloglist',\r
-               'category',\r
-               'charset',\r
-               'loginform',\r
-               'member',\r
-               'nucleusbutton',\r
-               'otherarchivedaylist',\r
-               'otherarchivelist',\r
-               'otherarchiveyearlist',\r
-               'otherblog',\r
-               'plugin',\r
-               'referer',\r
-               'searchform',\r
-               'self',\r
-               'sitevar',\r
-               'skinname',\r
-               'sticky',\r
-               'todaylink',\r
-               'version',\r
-               // deprecated (Nucleus v2.0)\r
-               /* TODO: remove this */\r
-               'ifcat'\r
-       );\r
-       \r
-       /**\r
-        * Actions::$skin_type_friendly_names\r
-        * friendly name for wrapped page types\r
-        */\r
-       static public $default_skin_types = array(\r
-               'index'                 => _SKIN_PART_MAIN,\r
-               'item'                  => _SKIN_PART_ITEM,\r
-               'archivelist'   => _SKIN_PART_ALIST,\r
-               'archive'               => _SKIN_PART_ARCHIVE,\r
-               'search'                => _SKIN_PART_SEARCH,\r
-               'error'                 => _SKIN_PART_ERROR,\r
-               'member'                => _SKIN_PART_MEMBER,\r
-               'imagepopup'    => _SKIN_PART_POPUP\r
-       );\r
-       \r
-       /**\r
-        * Actions::getDefinedActions()\r
-        * \r
-        * @static\r
-        * @param       string  $type   page type\r
-        * @return      array   allowed actions for the page type\r
-        */\r
-       static public function getDefinedActions($type='')\r
-       {\r
-               $extra_actions = array();\r
-               \r
-               switch ( $type )\r
-               {\r
-                       case 'index':\r
-                               $extra_actions = array(\r
-                                       'blog',\r
-                                       'blogsetting',\r
-                                       'preview',\r
-                                       'additemform',\r
-                                       'categorylist',\r
-                                       'archivelist',\r
-                                       'archivedaylist',\r
-                                       'archiveyearlist',\r
-                                       'nextlink',\r
-                                       'prevlink'\r
-                               );\r
-                               break;\r
-                       case 'archive':\r
-                               $extra_actions = array(\r
-                                       'blog',\r
-                                       'archive',\r
-                                       'otherarchive',\r
-                                       'categorylist',\r
-                                       'archivelist',\r
-                                       'archivedaylist',\r
-                                       'archiveyearlist',\r
-                                       'blogsetting',\r
-                                       'archivedate',\r
-                                       'nextarchive',\r
-                                       'prevarchive',\r
-                                       'nextlink',\r
-                                       'prevlink',\r
-                                       'archivetype'\r
-                               );\r
-                               break;\r
-                       case 'archivelist':\r
-                               $extra_actions = array(\r
-                                       'blog',\r
-                                       'archivelist',\r
-                                       'archivedaylist',\r
-                                       'archiveyearlist',\r
-                                       'categorylist',\r
-                                       'blogsetting'\r
-                               );\r
-                               break;\r
-                       case 'search':\r
-                               $extra_actions = array(\r
-                                       'blog',\r
-                                       'archivelist',\r
-                                       'archivedaylist',\r
-                                       'archiveyearlist',\r
-                                       'categorylist',\r
-                                       'searchresults',\r
-                                       'othersearchresults',\r
-                                       'blogsetting',\r
-                                       'query',\r
-                                       'nextlink',\r
-                                       'prevlink'\r
-                               );\r
-                               break;\r
-                       case 'imagepopup':\r
-                               $extra_actions = array(\r
-                                       'image',\r
-                                       // deprecated (Nucleus v2.0)\r
-                                       /* TODO: remove this */\r
-                                       'imagetext'\r
-                               );\r
-                               break;\r
-                       case 'member':\r
-                               $extra_actions = array(\r
-                                       'membermailform',\r
-                                       'blogsetting',\r
-                                       'nucleusbutton',\r
-                                       'categorylist'\r
-                               );\r
-                               break;\r
-                       case 'item':\r
-                               $extra_actions = array(\r
-                                       'blog',\r
-                                       'item',\r
-                                       'comments',\r
-                                       'commentform',\r
-                                       'vars',\r
-                                       'blogsetting',\r
-                                       'nextitem',\r
-                                       'previtem',\r
-                                       'nextlink',\r
-                                       'prevlink',\r
-                                       'nextitemtitle',\r
-                                       'previtemtitle',\r
-                                       'categorylist',\r
-                                       'archivelist',\r
-                                       'archivedaylist',\r
-                                       'archiveyearlist',\r
-                                       'itemtitle',\r
-                                       'itemid',\r
-                                       'itemlink'\r
-                               );\r
-                               break;\r
-                       case 'error':\r
-                               $extra_actions = array(\r
-                                       'errormessage',\r
-                                       'categorylist'\r
-                               );\r
-                               break;\r
-                       default:\r
-                                       $extra_actions = array(\r
-                                               'blog',\r
-                                               'blogsetting',\r
-                                               'preview',\r
-                                               'additemform',\r
-                                               'categorylist',\r
-                                               'archivelist',\r
-                                               'archivedaylist',\r
-                                               'archiveyearlist',\r
-                                               'nextlink',\r
-                                               'prevlink',\r
-                                               'membermailform',\r
-                                               'nucleusbutton',\r
-                                               'categorylist'\r
-                                       );\r
-                               break;\r
-               }\r
-               \r
-               $defined_actions = array_merge(self::$default_actions, $extra_actions);\r
-               \r
-               return array_merge($defined_actions, parent::getDefinedActions());\r
-       }\r
-       \r
-       /**\r
-        * Actions::getDefaultSkinTypes()\r
-        * \r
-        * @static\r
-        * @param       void\r
-        * @return      array   list of friendly names for page actions\r
-        */\r
-       static public function getDefaultSkinTypes()\r
-       {\r
-               return self::$default_skin_types;\r
-       }\r
-       \r
-       /**\r
-        * Actions::__construct()\r
-        * Constructor for a new Actions object\r
-        * \r
-        * @param       string  $type\r
-        * @return      void\r
-        */\r
-       public function __construct($type)\r
-       {\r
-               global $catid;\r
-               \r
-               // call constructor of superclass first\r
-               parent::__construct();\r
-               $this->skintype = $type;\r
-               \r
-               if ( $catid )\r
-               {\r
-                       $this->linkparams = array('catid' => $catid);\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::setSkin()\r
-        * Set the skin\r
-        * @param       object  $skin   an instance of Skin class\r
-        * @return      void\r
-        */\r
-       public function setSkin(&$skin)\r
-       {\r
-               $this->skin =& $skin;\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::setParser()\r
-        * Set the parser\r
-        * \r
-        * @param       object  $parser an instance of Parser class\r
-        * @return      void\r
-        */\r
-       public function setParser(&$parser)\r
-       {\r
-               $this->parser =& $parser;\r
-               return;\r
-       }\r
-       \r
-       /**\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', '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
-               \r
-               array_pop($this->parser->actions);      // errordiv\r
-               array_pop($this->parser->actions);      // callback\r
-               array_pop($this->parser->actions);      // formdata\r
-               array_pop($this->parser->actions);      // ticket\r
-               return;\r
-       }\r
-\r
-       /**\r
-        * Actions::checkCondition()\r
-        * Checks conditions for if statements\r
-        *\r
-        * @param       string  $field  type of <%if%>\r
-        * @param       string  $name   property of field\r
-        * @param       string  $value  value of property\r
-        * @return      boolean condition\r
-        */\r
-       protected function checkCondition($field, $name='', $value = '')\r
-       {\r
-               global $catid, $blog, $member, $itemidnext, $itemidprev, $manager, $archiveprevexists, $archivenextexists;\r
-               \r
-               $condition = 0;\r
-               switch ( $field )\r
-               {\r
-                       case 'category':\r
-                               $condition = ($blog && $this->ifCategory($name,$value));\r
-                               break;\r
-                       case 'blogsetting':\r
-                               $condition = ($blog && ($blog->getSetting($name) == $value));\r
-                               break;\r
-                       case 'loggedin':\r
-                               $condition = $member->isLoggedIn();\r
-                               break;\r
-                       case 'onteam':\r
-                               $condition = $member->isLoggedIn() && $this->ifOnTeam($name);\r
-                               break;\r
-                       case 'admin':\r
-                               $condition = $member->isLoggedIn() && $this->ifAdmin($name);\r
-                               break;\r
-                       case 'nextitem':\r
-                               $condition = ($itemidnext != '');\r
-                               break;\r
-                       case 'previtem':\r
-                               $condition = ($itemidprev != '');\r
-                               break;\r
-                       case 'archiveprevexists':\r
-                               $condition = ($archiveprevexists == true);\r
-                               break;\r
-                       case 'archivenextexists':\r
-                               $condition = ($archivenextexists == true);\r
-                               break;\r
-                       case 'skintype':\r
-                               $condition = (($name == $this->skintype) || ($name == requestVar('action')));\r
-                               break;\r
-                       case 'hasplugin':\r
-                               $condition = $this->ifHasPlugin($name, $value);\r
-                               break;\r
-                       default:\r
-                               $condition = $manager->pluginInstalled("NP_{$field}") && $this->ifPlugin($field, $name, $value);\r
-                               break;\r
-               }\r
-               return $condition;\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
-       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
-               {\r
-                       $plugin =& $manager->getPlugin("NP_{$name}");\r
-                       if ( $plugin != NULL )\r
-                       {\r
-                               if ( $value == "" )\r
-                               {\r
-                                       $condition = true;\r
-                               }\r
-                               else\r
-                               {\r
-                                       list($name2, $value2) = preg_split('#=#', $value, 2);\r
-                                       if ( $value2 == "" && $plugin->getOption($name2) != 'no' )\r
-                                       {\r
-                                               $condition = true;\r
-                                       }\r
-                                       else if ( $plugin->getOption($name2) == $value2 )\r
-                                       {\r
-                                               $condition = true;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               return $condition;\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
-       private function ifPlugin($name, $key = '', $value = '')\r
-       {\r
-               global $manager;\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
-               return call_user_func_array(array(&$plugin, 'doIf'), $params);\r
-       }\r
-       \r
-       /**\r
-        * Actions::ifCategory()\r
-        * Different checks for a category\r
-        * \r
-        * @param       string  $name   \r
-        * @param       string  $value  \r
-        * @return      boolean \r
-        */\r
-       private function ifCategory($name = '', $value='')\r
-       {\r
-               global $blog, $catid;\r
-               \r
-               // when no parameter is defined, just check if a category is selected\r
-               if ( ($name != 'catname' && $name != 'catid') || ($value == '') )\r
-               {\r
-                       return $blog->isValidCategory($catid);\r
-               }\r
-               \r
-               // check category name\r
-               if ( $name == 'catname' )\r
-               {\r
-                       $value = $blog->getCategoryIdFromName($value);\r
-                       if ( $value == $catid )\r
-                       {\r
-                               return $blog->isValidCategory($catid);\r
-                       }\r
-               }\r
-               \r
-               // check category id\r
-               if ( ($name == 'catid') && ($value == $catid) )\r
-               {\r
-                       return $blog->isValidCategory($catid);\r
-               }\r
-               return FALSE;\r
-       }\r
-       \r
-       /**\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
-       private function ifOnTeam($blogName = '')\r
-       {\r
-               global $blog, $member, $manager;\r
-               \r
-               // when no blog found\r
-               if ( ($blogName == '') && !is_object($blog) )\r
-               {\r
-                       return 0;\r
-               }\r
-               \r
-               // explicit blog selection\r
-               if ( $blogName != '' )\r
-               {\r
-                       $blogid = getBlogIDFromName($blogName);\r
-               }\r
-               \r
-               if ( ($blogName == '') || !$manager->existsBlogID($blogid) )\r
-               {\r
-                       // use current blog\r
-                       $blogid = $blog->getID();\r
-               }\r
-               \r
-               return $member->teamRights($blogid);\r
-       }\r
-\r
-       /**\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
-       private function ifAdmin($blogName = '')\r
-       {\r
-               global $blog, $member, $manager;\r
-               \r
-               // when no blog found\r
-               if ( ($blogName == '') && (!is_object($blog)) )\r
-               {\r
-                       return 0;\r
-               }\r
-               \r
-               // explicit blog selection\r
-               if ( $blogName != '' )\r
-               {\r
-                       $blogid = getBlogIDFromName($blogName);\r
-               }\r
-               \r
-               if ( ($blogName == '') || !$manager->existsBlogID($blogid) )\r
-               {\r
-                       // use current blog\r
-                       $blogid = $blog->getID();\r
-               }\r
-               \r
-               return $member->isBlogAdmin($blogid);\r
-       }\r
-       \r
-       /**\r
-        * Actions::link()\r
-        * returns either\r
-        *      - a raw link (html/xml encoded) when no linktext is provided\r
-        *      - a (x)html <a href... link when a text is present (text htmlencoded)\r
-        * \r
-        * @param       string  $url            URL for href attribute of anchor element\r
-        * @param       string  $linktext       content of anchor element\r
-        * @return      \r
-        */\r
-       private function link($url, $linktext = '')\r
-       {\r
-               $u = Entity::hsc($url);\r
-               // fix URLs that already had encoded ampersands\r
-               $u = preg_replace("#&amp;amp;#", '&amp;', $u);\r
-               if ( $linktext != '' )\r
-               {\r
-                       $l = '<a href="' . $u .'">' . Entity::hsc($linktext) . '</a>';\r
-               }\r
-               else\r
-               {\r
-                       $l = $u;\r
-               }\r
-               return $l;\r
-       }\r
-       \r
-       /**\r
-        * Actions::searchlink()\r
-        * Outputs a next/prev link\r
-        *\r
-        * @param $maxresults\r
-        *              The maximum amount of items shown per page (e.g. 10)\r
-        * @param $startpos\r
-        *              Current start position (requestVar('startpos'))\r
-        * @param $direction\r
-        *              either 'prev' or 'next'\r
-        * @param $linktext\r
-        *              When present, the output will be a full <a href...> link. When empty,\r
-        *              only a raw link will be outputted\r
-        */\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       = (integer) $startpos;\r
-               $parsed         = parse_url(serverVar('REQUEST_URI'));\r
-               $path           = $parsed['path'];\r
-               $parsed         = $parsed['query'];\r
-               $url            = '';\r
-               \r
-               if ( $direction == 'prev' )\r
-               {\r
-                       if ( intval($startpos) - intval($maxresults) >= 0 )\r
-                       {\r
-                               $startpos       = intval($startpos) - intval($maxresults);\r
-                               \r
-                               if ( $this->skintype == 'index' )\r
-                               {\r
-                                       $url = $path;\r
-                               }\r
-                               else if ( $this->skintype == 'search' )\r
-                               {\r
-                                       $url = $CONF['SearchURL'];\r
-                               }\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 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
-        * 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
-        */\r
-       private function itemlink($id, $linktext = '')\r
-       {\r
-               global $CONF;\r
-               if ( $id != 0 )\r
-               {\r
-                       echo $this->link(Link::create_item_link($id, $this->linkparams), $linktext);\r
-               }\r
-               else\r
-               {\r
-                       $this->parse_todaylink($linktext);\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
-        */\r
-       private function archivelink($id, $linktext = '')\r
-       {\r
-               global $CONF, $blog;\r
-               if ( $id != 0 )\r
-               {\r
-                       echo $this->link(Link::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);\r
-               }\r
-               else\r
-               {\r
-                       $this->parse_todaylink($linktext);\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\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::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
-       private function preBlogContent($type, &$blog)\r
-       {\r
-               global $manager;\r
-               $manager->notify('PreBlogContent',array('blog' => &$blog, 'type' => $type));\r
-               return;\r
-       }\r
-\r
-       /**\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
-       private function postBlogContent($type, &$blog)\r
-       {\r
-               global $manager;\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
-       public function parse_additemform()\r
-       {\r
-               global $blog, $CONF;\r
-               $this->formdata = array(\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
-       public function parse_addlink()\r
-       {\r
-               global $CONF, $member, $blog;\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
-       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
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_adminurl()\r
-       {\r
-               $this->parse_sitevar('adminurl');\r
-               return;\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
-       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
-               $blog->showArchive($template, $y, $m, $d);\r
-               $this->postBlogContent('achive',$blog);\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_archivedate()\r
-        * %archivedate(locale,date format)%\r
-        * \r
-        * @param       string  $locale\r
-        * @return      void\r
-        */\r
-       public function parse_archivedate($locale = '-def-')\r
-       {\r
-               global $archive;\r
-               \r
-               /* \r
-                * TODO: these lines are no meaning because there is no $template.\r
-               if ( $locale == '-def-' )\r
-               {\r
-                       setlocale(LC_TIME, $template['LOCALE']);\r
-               }\r
-               else\r
-               {\r
-                       setlocale(LC_TIME, $locale);\r
-               }\r
-                */\r
-               \r
-               // get archive date\r
-               sscanf($archive,'%d-%d-%d',$y,$m,$d);\r
-               \r
-               // get format\r
-               $args = func_get_args();\r
-               // format can be spread over multiple parameters\r
-               if ( sizeof($args) > 1 )\r
-               {\r
-                       // take away locale\r
-                       array_shift($args);\r
-                       // implode\r
-                       $format=implode(',',$args);\r
-               }\r
-               elseif ( $d == 0 && $m !=0 )\r
-               {\r
-                       $format = '%B %Y';\r
-               }\r
-               elseif ( $m == 0 )\r
-               {\r
-                       $format = '%Y';\r
-               }\r
-               else\r
-               {\r
-                       $format = '%d %B %Y';\r
-               }\r
-               echo i18n::formatted_datetime($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));\r
-               return;\r
-       }\r
-       \r
-       /**\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' )\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
-               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
-        */\r
-       public function parse_archivelink($linktext = '')\r
-       {\r
-               global $blog, $CONF;\r
-               if ( $blog )\r
-               {\r
-                       echo $this->link(Link::create_archivelist_link($blog->getID(), $this->linkparams), $linktext);\r
-               }\r
-               else\r
-               {\r
-                       echo $this->link(Link::create_archivelist_link(), $linktext);\r
-               }\r
-               return;\r
-       }\r
-       \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' )\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
-               return;\r
-       }\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' )\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
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_archivetype()\r
-        * Parse skinvar archivetype\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_archivetype()\r
-       {\r
-               global $archivetype;\r
-               echo $archivetype;\r
-               return;\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
-       public function parse_blog($template, $amount = 10, $category = '')\r
-       {\r
-               global $blog, $startpos;\r
-               \r
-               list($limit, $offset) = sscanf($amount, '%d(%d)');\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
-               return;\r
-       }\r
-       \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
-       public function parse_blogsetting($which)\r
-       {\r
-               global $blog;\r
-               switch( $which )\r
-               {\r
-                       case 'id':\r
-                               echo Entity::hsc($blog->getID());\r
-                               break;\r
-                       case 'url':\r
-                               echo Entity::hsc($blog->getURL());\r
-                               break;\r
-                       case 'name':\r
-                               echo Entity::hsc($blog->getName());\r
-                               break;\r
-                       case 'desc':\r
-                               echo Entity::hsc($blog->getDescription());\r
-                               break;\r
-                       case 'short':\r
-                               echo Entity::hsc($blog->getShortName());\r
-                               break;\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_callback()\r
-        * Parse callback\r
-        * \r
-        * @param       string  $eventName      name of event\r
-        * @param       string  $type   type of skin\r
-        * @return      void\r
-        */\r
-       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
-       public function parse_category($type = 'name')\r
-       {\r
-               global $catid, $blog;\r
-               if ( !$blog->isValidCategory($catid) )\r
-               {\r
-                       return;\r
-               }\r
-               \r
-               switch ( $type )\r
-               {\r
-                       case 'name':\r
-                               echo $blog->getCategoryName($catid);\r
-                               break;\r
-                       case 'desc':\r
-                               echo $blog->getCategoryDesc($catid);\r
-                               break;\r
-                       case 'id':\r
-                               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
-       public function parse_categorylist($template, $blogname = '')\r
-       {\r
-               global $blog, $manager;\r
-               \r
-               // when no blog found\r
-               if ( ($blogname == '') && (!is_object($blog)) )\r
-               {\r
-                       return 0;\r
-               }\r
-                       \r
-               if ( $blogname == '' )\r
-               {\r
-                       $this->preBlogContent('categorylist',$blog);\r
-                       $blog->showCategoryList($template);\r
-                       $this->postBlogContent('categorylist',$blog);\r
-               }\r
-               else\r
-               {\r
-                       $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-                       $this->preBlogContent('categorylist',$b);\r
-                       $b->showCategoryList($template);\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
-       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
-        */\r
-       public function parse_commentform($destinationurl = '')\r
-       {\r
-               global $blog, $itemid, $member, $CONF, $manager, $DIR_LIBS, $errormessage;\r
-               \r
-               // warn when trying to provide a actionurl (used to be a parameter in Nucleus <2.0)\r
-               if ( stristr($destinationurl, 'action.php') )\r
-               {\r
-                       $args = func_get_args();\r
-                       $destinationurl = $args[1];\r
-                       ActionLog::add(WARNING,_ACTIONURL_NOTLONGER_PARAMATER);\r
-               }\r
-               \r
-               $actionurl = $CONF['ActionURL'];\r
-               \r
-               // if item is closed, show message and do nothing\r
-               $item =& $manager->getItem($itemid,0,0);\r
-               if ( $item['closed'] || !$blog->commentsEnabled() )\r
-               {\r
-                       $this->doForm('commentform-closed');\r
-                       return;\r
-               }\r
-               \r
-               if ( !$blog->isPublic() && !$member->isLoggedIn() )\r
-               {\r
-                       $this->doForm('commentform-closedtopublic');\r
-                       return;\r
-               }\r
-               \r
-               if ( !$destinationurl )\r
-               {\r
-                       // note: createLink returns an HTML encoded URL\r
-                       $destinationurl = Link::create_link(\r
-                               'item',\r
-                               array(\r
-                                       'itemid' => $itemid,\r
-                                       'title' => $item['title'],\r
-                                       'timestamp' => $item['timestamp'],\r
-                                       'extra' => $this->linkparams\r
-                               )\r
-                       );\r
-               }\r
-               else\r
-               {\r
-                       // HTML encode URL\r
-                       $destinationurl = Entity::hsc($destinationurl);\r
-               }\r
-               \r
-               // values to prefill\r
-               $user = cookieVar($CONF['CookiePrefix'] .'comment_user');\r
-               if ( !$user )\r
-               {\r
-                       $user = postVar('user');\r
-               }\r
-               \r
-               $userid = cookieVar($CONF['CookiePrefix'] .'comment_userid');\r
-               if ( !$userid )\r
-               {\r
-                       $userid = postVar('userid');\r
-               }\r
-               \r
-               $email = cookieVar($CONF['CookiePrefix'] .'comment_email');\r
-               if (!$email)\r
-               {\r
-                       $email = postVar('email');\r
-               }\r
-               \r
-               $body = postVar('body');\r
-               \r
-               $this->formdata = array(\r
-                       'destinationurl' => $destinationurl,    // url is already HTML encoded\r
-                       'actionurl' => Entity::hsc($actionurl),\r
-                       'itemid' => $itemid,\r
-                       'user' => Entity::hsc($user),\r
-                       'userid' => Entity::hsc($userid),\r
-                       'email' => Entity::hsc($email),\r
-                       'body' => Entity::hsc($body),\r
-                       'membername' => $member->getDisplayName(),\r
-                       'rememberchecked' => cookieVar($CONF['CookiePrefix'] .'comment_user')?'checked="checked"':''\r
-               );\r
-               \r
-               if ( !$member->isLoggedIn() )\r
-               {\r
-                       $this->doForm('commentform-notloggedin');\r
-               }\r
-               else\r
-               {\r
-                       $this->doForm('commentform-loggedin');\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_comments()\r
-        * Parse skinvar comments\r
-        * include comments for one item\r
-        * \r
-        * @param       string  $template       name of template\r
-        * @return      void\r
-        */\r
-       public function parse_comments($template)\r
-       {\r
-               global $itemid, $manager, $blog, $highlight;\r
-               $template =& $manager->getTemplate($template);\r
-               \r
-               // create parser object & action handler\r
-               $handler = new ItemActions($blog);\r
-               $parser = new Parser($handler->getDefinedActions(),$handler);\r
-               $handler->setTemplate($template);\r
-               $handler->setParser($parser);\r
-               $item = Item::getitem($itemid, 0, 0);\r
-               $handler->setCurrentItem($item);\r
-               \r
-               $comments = new Comments($itemid);\r
-               $comments->setItemActions($handler);\r
-               // shows ALL comments\r
-               $comments->showComments($template, -1, 1, $highlight);\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_errordiv()\r
-        * Parse errordiv\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_errordiv()\r
-       {\r
-               global $errormessage;\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
-       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
-       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
-       public function parse_ifcat($text = '')\r
-       {\r
-               if ( $text == '' )\r
-               {\r
-                       // new behaviour\r
-                       $this->parse_if('category');\r
-               }\r
-               else\r
-               {\r
-                       // old behaviour\r
-                       global $catid, $blog;\r
-                       if ( $blog->isValidCategory($catid) )\r
-                       {\r
-                               echo $text;\r
-                       }\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_image()\r
-        * Parse skinvar image\r
-        * \r
-        * @param       string  $what   name of tag\r
-        * @return      void\r
-        */\r
-       public function parse_image($what = 'imgtag')\r
-       {\r
-               global $CONF;\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
-                       case 'url':\r
-                               echo $fullurl;\r
-                               break;\r
-                       case 'width':\r
-                               echo $width;\r
-                               break;\r
-                       case 'height':\r
-                               echo $height;\r
-                               break;\r
-                       case 'caption':\r
-                       case 'text':\r
-                               echo $imagetext;\r
-                               break;\r
-                       case 'imgtag':\r
-                       default:\r
-                               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
-       public function parse_imagetext()\r
-       {\r
-               $this->parse_image('imagetext');\r
-               return;\r
-       }\r
-\r
-       /**\r
-        * Actions::parse_item()\r
-        * Parse skinvar item\r
-        * include one item (no comments)\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_item($template)\r
-       {\r
-               global $blog, $itemid, $highlight;\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
-               {\r
-                       echo _ERROR_NOSUCHITEM;\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
-       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
-       public function parse_itemlink($linktext = '')\r
-       {\r
-               global $itemid;\r
-               $this->itemlink($itemid, $linktext);\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_itemtitle()\r
-        * Parse itemtitle\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_itemtitle($format = '')\r
-       {\r
-               global $manager, $itemid;\r
-               $item =& $manager->getItem($itemid,0,0);\r
-               \r
-               switch ( $format )\r
-               {\r
-                       case 'xml':\r
-                               echo Entity::hen($item['title']);\r
-                               break;\r
-                       case 'raw':\r
-                               echo $item['title'];\r
-                               break;\r
-                       case 'attribute':\r
-                       default:\r
-                               echo Entity::hsc(strip_tags($item['title']));\r
-                               break;\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_loginform()\r
-        * Parse skinvar loginform\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_loginform()\r
-       {\r
-               global $member, $CONF;\r
-               if ( !$member->isLoggedIn() )\r
-               {\r
-                       $filename = 'loginform-notloggedin';\r
-                       $this->formdata = array();\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
-        * 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
-        */\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
-               {\r
-                       switch( $what )\r
-                       {\r
-                               case 'name':\r
-                                       echo Entity::hsc($memberinfo->getDisplayName());\r
-                                       break;\r
-                               case 'realname':\r
-                                       echo Entity::hsc($memberinfo->getRealName());\r
-                                       break;\r
-                               case 'notes':\r
-                                       echo Entity::hsc($memberinfo->getNotes());\r
-                                       break;\r
-                               case 'url':\r
-                                       echo Entity::hsc($memberinfo->getURL());\r
-                                       break;\r
-                               case 'email':\r
-                                       echo Entity::hsc($memberinfo->getEmail());\r
-                                       break;\r
-                               case 'id':\r
-                                       echo Entity::hsc($memberinfo->getID());\r
-                                       break;\r
-                       }\r
-               }\r
-               \r
-               // 2. the next bunch of options is available everywhere, as long as the user is logged in\r
-               if ( $member->isLoggedIn() )\r
-               {\r
-                       switch( $what )\r
-                       {\r
-                               case 'yourname':\r
-                                       echo $member->getDisplayName();\r
-                                       break;\r
-                               case 'yourrealname':\r
-                                       echo $member->getRealName();\r
-                                       break;\r
-                               case 'yournotes':\r
-                                       echo $member->getNotes();\r
-                                       break;\r
-                               case 'yoururl':\r
-                                       echo $member->getURL();\r
-                                       break;\r
-                               case 'youremail':\r
-                                       echo $member->getEmail();\r
-                                       break;\r
-                               case 'yourid':\r
-                                       echo $member->getID();\r
-                                       break;\r
-                               case 'yourprofileurl':\r
-                                       if ($CONF['URLMode'] == 'pathinfo')\r
-                                               echo Link::create_member_link($member->getID());\r
-                                       else\r
-                                               echo $CONF['IndexURL'] . Link::create_member_link($member->getID());\r
-                                       break;\r
-                       }\r
-               }\r
-               return;\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
-        */\r
-       public function parse_membermailform($rows = 10, $cols = 40, $desturl = '')\r
-       {\r
-               global $member, $CONF, $memberid;\r
-               \r
-               if ( $desturl == '' )\r
-               {\r
-                       if ( $CONF['URLMode'] == 'pathinfo' )\r
-                       {\r
-                               $desturl = Link::create_member_link($memberid);\r
-                       }\r
-                       else\r
-                       {\r
-                               $desturl = $CONF['IndexURL'] . Link::create_member_link($memberid);\r
-                       }\r
-               }\r
-               \r
-               $message = postVar('message');\r
-               $frommail = postVar('frommail');\r
-               \r
-               $this->formdata = array(\r
-                       'url' => Entity::hsc($desturl),\r
-                       'actionurl' => Entity::hsc($CONF['ActionURL']),\r
-                       'memberid' => $memberid,\r
-                       'rows' => $rows,\r
-                       'cols' => $cols,\r
-                       'message' => Entity::hsc($message),\r
-                       'frommail' => Entity::hsc($frommail)\r
-               );\r
-               \r
-               if ( $member->isLoggedIn() )\r
-               {\r
-                       $this->doForm('membermailform-loggedin');\r
-               }\r
-               else if ( $CONF['NonmemberMail'] )\r
-               {\r
-                       $this->doForm('membermailform-notloggedin');\r
-               }\r
-               else\r
-               {\r
-                       $this->doForm('membermailform-disallowed');\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_nextarchive()\r
-        * Parse skinvar nextarchive\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_nextarchive()\r
-       {\r
-               global $archivenext;\r
-               echo $archivenext;\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Parse skinvar nextitem\r
-        * (include itemid of next item)\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_nextitem()\r
-       {\r
-               global $itemidnext;\r
-               if ( isset($itemidnext) )\r
-               {\r
-                       echo (int)$itemidnext;\r
-               }\r
-               return;\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
-       public function parse_nextitemtitle($format = '')\r
-       {\r
-               global $itemtitlenext;\r
-               \r
-               switch ( $format )\r
-               {\r
-                       case 'xml':\r
-                               echo Entity::hen($itemtitlenext);\r
-                               break;\r
-                       case 'raw':\r
-                               echo $itemtitlenext;\r
-                               break;\r
-                       case 'attribute':\r
-                       default:\r
-                               echo Entity::hsc($itemtitlenext);\r
-                               break;\r
-               }\r
-               return;\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
-       public function parse_nextlink($linktext = '', $amount = 10, $recount = '')\r
-       {\r
-               global $itemidnext, $archivenext, $startpos;\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
-               {\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
-       public function parse_nucleusbutton($imgurl = '', $imgwidth = '85', $imgheight = '31')\r
-       {\r
-               global $CONF;\r
-               if ( $imgurl == '' )\r
-               {\r
-                       $imgurl = $CONF['AdminURL'] . 'nucleus.gif';\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
-               $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
-       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
-               $b->showArchive($template, $y, $m, $d);\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
-       public function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0)\r
-       {\r
-               global $manager;\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
-               $b->showArchiveList($template, 'day', $limit);\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
-       public function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0)\r
-       {\r
-               global $manager;\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
-               $b->showArchiveList($template, 'month', $limit);\r
-               $this->postBlogContent('otherarchivelist',$b);\r
-               return;\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
-       public function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0)\r
-       {\r
-               global $manager;\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
-               $b->showArchiveList($template, 'year', $limit);\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
-       public function parse_otherblog($blogname, $template, $amount = 10, $category = '')\r
-       {\r
-               global $manager;\r
-               \r
-               list($limit, $offset) = sscanf($amount, '%d(%d)');\r
-               \r
-               $b =& $manager->getBlog(getBlogIDFromName($blogname));\r
-               $this->setBlogCategory($b, $category);\r
-               $this->preBlogContent('otherblog',$b);\r
-               $this->amountfound = $b->readLog($template, $limit, $offset);\r
-               $this->postBlogContent('otherblog',$b);\r
-               return;\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
-       public function parse_othersearchresults($blogname, $template, $maxresults = 50)\r
-       {\r
-               global $query, $amount, $manager, $startpos;\r
-               $b =& $manager->getBlog(getBlogIDFromName($blogname));\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
-               return;\r
-       }\r
-       \r
-       /**\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
-               $plugin =& $manager->getPlugin('NP_' . $pluginName);\r
-               if ( !$plugin )\r
-               {\r
-                       return;\r
-               }\r
-               \r
-               // get arguments\r
-               $params = func_get_args();\r
-               \r
-               // remove plugin name\r
-               array_shift($params);\r
-               \r
-               // add skin type on front\r
-               array_unshift($params, $this->skintype);\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
-       public function parse_prevarchive()\r
-       {\r
-               global $archiveprev;\r
-               echo $archiveprev;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_preview()\r
-        * Parse skinvar preview\r
-        * \r
-        * @param       string  $template       name of tempalte\r
-        * @return      void\r
-        */\r
-       public function parse_preview($template)\r
-       {\r
-               global $blog, $CONF, $manager;\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
-        * Actions::parse_previtem()\r
-        * Parse skinvar previtem\r
-        * (include itemid of prev item)\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_previtem()\r
-       {\r
-               global $itemidprev;\r
-               if ( isset($itemidprev) )\r
-               {\r
-                       echo (integer) $itemidprev;\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_previtemtitle()\r
-        * Parse skinvar previtemtitle\r
-        * (include itemtitle of prev item)\r
-        * \r
-        * @param       String  $format string format\r
-        * @return      String  formatted string\r
-        */\r
-       public function parse_previtemtitle($format = '')\r
-       {\r
-               global $itemtitleprev;\r
-               \r
-               switch ( $format )\r
-               {\r
-                       case 'xml':\r
-                               echo Entity::hen($itemtitleprev);\r
-                               break;\r
-                       case 'raw':\r
-                               echo $itemtitleprev;\r
-                               break;\r
-                       case 'attribute':\r
-                       default:\r
-                               echo Entity::hsc($itemtitleprev);\r
-                               break;\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_prevlink()\r
-        * Parse skinvar prevlink\r
-        * \r
-        * @param       string  $linktext       text as a content of anchor element\r
-        * @param       integer the amount of links\r
-        * @return      void\r
-        */\r
-       public function parse_prevlink($linktext = '', $amount = 10)\r
-       {\r
-               global $itemidprev, $archiveprev, $startpos;\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
-               {\r
-                       $this->archivelink($archiveprev, $linktext);\r
-               }\r
-               return;\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
-       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
-       public function parse_referer()\r
-       {\r
-               echo Entity::hsc(serverVar('HTTP_REFERER'));\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_searchform()\r
-        * Parse skinvar searchform\r
-        * \r
-        * @param       string  $blogname       name of weblog\r
-        * @return      void\r
-        */\r
-       public function parse_searchform($blogname = '')\r
-       {\r
-               global $CONF, $manager, $maxresults;\r
-               if ( $blogname )\r
-               {\r
-                       $blog =& $manager->getBlog(getBlogIDFromName($blogname));\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
-               );\r
-               $this->doForm('searchform');\r
-               return;\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
-       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
-               $this->amountfound = $blog->search($query, $template, $amount, $maxresults, $startpos);\r
-               $this->postBlogContent('searchresults',$blog);\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_self()\r
-        * Parse skinvar self\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_self()\r
-       {\r
-               global $CONF;\r
-               echo $CONF['Self'];\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_sitevar()\r
-        * Parse skinvar sitevar\r
-        * (include a sitevar)\r
-        * \r
-        * @param       string  $which\r
-        * @return      void\r
-        */\r
-       public function parse_sitevar($which)\r
-       {\r
-               global $CONF;\r
-               switch ( $which )\r
-               {\r
-                       case 'url':\r
-                               echo $CONF['IndexURL'];\r
-                               break;\r
-                       case 'name':\r
-                               echo $CONF['SiteName'];\r
-                               break;\r
-                       case 'admin':\r
-                               echo $CONF['AdminEmail'];\r
-                               break;\r
-                       case 'adminurl':\r
-                               echo $CONF['AdminURL'];\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_skinname()\r
-        * Parse skinname\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\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
-       public function parse_skintype()\r
-       {\r
-               echo $this->skintype;\r
-               return;\r
-       }\r
-       \r
-       /**\r
-        * Actions::parse_ticket()\r
-        * Parse ticket\r
-        * \r
-        * @param       void\r
-        * @return      void\r
-        */\r
-       public function parse_ticket()\r
-       {\r
-               global $manager;\r
-               $manager->addTicketHidden();\r
-               return;\r
-       }\r
-\r
-       /**\r
-        * Actions::parse_todaylink()\r
-        * Parse skinvar todaylink\r
-        * A link to the today page (depending on selected blog, etc...)\r
-        *\r
-        * @param       string  $linktext       text for link\r
-        * @return      void\r
-        */\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
-               }\r
-               else\r
-               {\r
-                       echo $this->link($CONF['SiteUrl'], $linktext);\r
-               }\r
-               return;\r
-       }\r
-       \r
-       /**\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
-       public function parse_vars()\r
-       {\r
-               global $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
-       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
-       public function parse_sticky($itemnumber = 0, $template = '')\r
-       {\r
-               global $manager;\r
-               \r
-               $itemnumber = intval($itemnumber);\r
-               $itemarray = array($itemnumber);\r
-               \r
-               $b =& $manager->getBlog(getBlogIDFromItemID($itemnumber));\r
-               $this->preBlogContent('sticky',$b);\r
-               $this->amountfound = $b->readLogFromList($itemarray, $template);\r
-               $this->postBlogContent('sticky',$b);\r
-               return;\r
-       }\r
-}
\ No newline at end of file
+<?php
+/**
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2012 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * This class contains the functions that get called by using
+ * the special tags in the skins
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2012 The Nucleus Group
+ * @version $Id: ACTIONS.php 1886 2012-06-17 08:27:27Z sakamocchi $
+ */
+
+class Actions extends BaseActions
+{
+       // part of the skin currently being parsed ('index', 'item', 'archive',
+       // 'archivelist', 'member', 'search', 'error', 'imagepopup')
+       private $skintype;
+       
+       // contains an assoc array with parameters that need to be included when
+       // generating links to items/archives/... (e.g. catid)
+       private $linkparams;
+       
+       // used when including templated forms from the include/ dir. The $formdata var
+       // contains the values to fill out in there (assoc array name -> value)
+       private $formdata;
+       
+       // filled out with the number of displayed items after calling one of the
+       // (other)blog/(other)searchresults skinvars.
+       private $amountfound;
+       
+       /**
+        * Actions::$default_actions
+        * list of whole action names with which this class can deal
+        */
+       static private $default_actions = array(
+               'addlink',
+               'addpopupcode',
+               'adminurl',
+               'archivelink',
+               'bloglist',
+               'category',
+               'loginform',
+               'member',
+               'nucleusbutton',
+               'otherarchivedaylist',
+               'otherarchivelist',
+               'otherarchiveyearlist',
+               'otherblog',
+               'plugin',
+               'referer',
+               'searchform',
+               'self',
+               'sitevar',
+               'skinname',
+               'sticky',
+               'todaylink',
+               'version',
+               // deprecated (Nucleus v2.0)
+               /* TODO: remove this */
+               'ifcat'
+       );
+       
+       /**
+        * Actions::$normal_skin_types
+        * friendly name for wrapped page types
+        */
+       static public $normal_skin_types = array(
+               'index'                 => _SKIN_PART_MAIN,
+               'item'                  => _SKIN_PART_ITEM,
+               'archivelist'   => _SKIN_PART_ALIST,
+               'archive'               => _SKIN_PART_ARCHIVE,
+               'search'                => _SKIN_PART_SEARCH,
+               'error'                 => _SKIN_PART_ERROR,
+               'member'                => _SKIN_PART_MEMBER,
+               'imagepopup'    => _SKIN_PART_POPUP
+       );
+       
+       /**
+        * Actions::getNormalSkinTypes()
+        * 
+        * @static
+        * @param       void
+        * @return      array   list of friendly names for page actions
+        */
+       static public function getNormalSkinTypes()
+       {
+               return self::$normal_skin_types;
+       }
+       
+       /**
+        * Actions::__construct()
+        * Constructor for a new Actions object
+        * 
+        * @param       string  $type
+        * @return      void
+        */
+       public function __construct($type)
+       {
+               global $catid;
+               
+               // call constructor of superclass first
+               parent::__construct();
+               $this->skintype = $type;
+               
+               if ( $catid )
+               {
+                       $this->linkparams = array('catid' => $catid);
+               }
+               return;
+       }
+       
+       /**
+        * Actions::getAvailableActions()
+        * 
+        * @param       void
+        * @return      array   allowed actions for the page type
+        */
+       public function getAvailableActions()
+       {
+               $extra_actions = array();
+               
+               switch ( $this->skintype )
+               {
+                       case 'index':
+                               $extra_actions = array(
+                                       'blog',
+                                       'blogsetting',
+                                       'preview',
+                                       'additemform',
+                                       'categorylist',
+                                       'archivelist',
+                                       'archivedaylist',
+                                       'archiveyearlist',
+                                       'nextlink',
+                                       'prevlink'
+                               );
+                               break;
+                       case 'archive':
+                               $extra_actions = array(
+                                       'blog',
+                                       'archive',
+                                       'otherarchive',
+                                       'categorylist',
+                                       'archivelist',
+                                       'archivedaylist',
+                                       'archiveyearlist',
+                                       'blogsetting',
+                                       'archivedate',
+                                       'nextarchive',
+                                       'prevarchive',
+                                       'nextlink',
+                                       'prevlink',
+                                       'archivetype'
+                               );
+                               break;
+                       case 'archivelist':
+                               $extra_actions = array(
+                                       'blog',
+                                       'archivelist',
+                                       'archivedaylist',
+                                       'archiveyearlist',
+                                       'categorylist',
+                                       'blogsetting'
+                               );
+                               break;
+                       case 'search':
+                               $extra_actions = array(
+                                       'blog',
+                                       'archivelist',
+                                       'archivedaylist',
+                                       'archiveyearlist',
+                                       'categorylist',
+                                       'searchresults',
+                                       'othersearchresults',
+                                       'blogsetting',
+                                       'query',
+                                       'nextlink',
+                                       'prevlink'
+                               );
+                               break;
+                       case 'imagepopup':
+                               $extra_actions = array(
+                                       'image',
+                                       // deprecated (Nucleus v2.0)
+                                       /* TODO: remove this */
+                                       'imagetext'
+                               );
+                               break;
+                       case 'member':
+                               $extra_actions = array(
+                                       'membermailform',
+                                       'blogsetting',
+                                       'nucleusbutton',
+                                       'categorylist'
+                               );
+                               break;
+                       case 'item':
+                               $extra_actions = array(
+                                       'blog',
+                                       'item',
+                                       'comments',
+                                       'commentform',
+                                       'vars',
+                                       'blogsetting',
+                                       'nextitem',
+                                       'previtem',
+                                       'nextlink',
+                                       'prevlink',
+                                       'nextitemtitle',
+                                       'previtemtitle',
+                                       'categorylist',
+                                       'archivelist',
+                                       'archivedaylist',
+                                       'archiveyearlist',
+                                       'itemtitle',
+                                       'itemid',
+                                       'itemlink'
+                               );
+                               break;
+                       case 'error':
+                               $extra_actions = array(
+                                       'errormessage',
+                                       'categorylist'
+                               );
+                               break;
+                       default:
+                                       $extra_actions = array(
+                                               'blog',
+                                               'blogsetting',
+                                               'preview',
+                                               'additemform',
+                                               'categorylist',
+                                               'archivelist',
+                                               'archivedaylist',
+                                               'archiveyearlist',
+                                               'nextlink',
+                                               'prevlink',
+                                               'membermailform',
+                                               'nucleusbutton',
+                                               'categorylist'
+                                       );
+                               break;
+               }
+               
+               $defined_actions = array_merge(self::$default_actions, $extra_actions);
+               
+               return array_merge($defined_actions, parent::getAvailableActions());
+       }
+       
+       /**
+        * Actions::doForm()
+        * Forms get parsedincluded now, using an extra <formdata> skinvar
+        *
+        * @param       string  $filename
+        * @return      void
+        */
+       public function doForm($filename)
+       {
+               global $DIR_NUCLEUS;
+               array_push($this->parser->actions,'formdata', 'callback','errordiv','ticket');
+               
+               $oldIncludeMode = Parser::getProperty('IncludeMode');
+               $oldIncludePrefix = Parser::getProperty('IncludePrefix');
+               Parser::setProperty('IncludeMode','normal');
+               Parser::setProperty('IncludePrefix','');
+               
+               $this->parse_parsedinclude($DIR_NUCLEUS . 'forms/' . $filename . '.template');
+               Parser::setProperty('IncludeMode',$oldIncludeMode);
+               Parser::setProperty('IncludePrefix',$oldIncludePrefix);
+               
+               array_pop($this->parser->actions);      // errordiv
+               array_pop($this->parser->actions);      // callback
+               array_pop($this->parser->actions);      // formdata
+               array_pop($this->parser->actions);      // ticket
+               return;
+       }
+
+       /**
+        * Actions::checkCondition()
+        * Checks conditions for if statements
+        *
+        * @param       string  $field  type of <%if%>
+        * @param       string  $name   property of field
+        * @param       string  $value  value of property
+        * @return      boolean condition
+        */
+       protected function checkCondition($field, $name='', $value = '')
+       {
+               global $catid, $blog, $member, $itemidnext, $itemidprev, $manager, $archiveprevexists, $archivenextexists;
+               
+               $condition = 0;
+               switch ( $field )
+               {
+                       case 'category':
+                               $condition = ($blog && $this->ifCategory($name,$value));
+                               break;
+                       case 'blogsetting':
+                               $condition = ($blog && ($blog->getSetting($name) == $value));
+                               break;
+                       case 'loggedin':
+                               $condition = $member->isLoggedIn();
+                               break;
+                       case 'onteam':
+                               $condition = $member->isLoggedIn() && $this->ifOnTeam($name);
+                               break;
+                       case 'admin':
+                               $condition = $member->isLoggedIn() && $this->ifAdmin($name);
+                               break;
+                       case 'nextitem':
+                               $condition = ($itemidnext != '');
+                               break;
+                       case 'previtem':
+                               $condition = ($itemidprev != '');
+                               break;
+                       case 'archiveprevexists':
+                               $condition = ($archiveprevexists == true);
+                               break;
+                       case 'archivenextexists':
+                               $condition = ($archivenextexists == true);
+                               break;
+                       case 'skintype':
+                               $condition = (($name == $this->skintype) || ($name == requestVar('action')));
+                               break;
+                       case 'hasplugin':
+                               $condition = $this->ifHasPlugin($name, $value);
+                               break;
+                       default:
+                               $condition = $manager->pluginInstalled("NP_{$field}") && $this->ifPlugin($field, $name, $value);
+                               break;
+               }
+               return $condition;
+       }
+       
+       /**
+        * Actions::_ifHasPlugin()
+        *      hasplugin,PlugName
+        *         -> checks if plugin exists
+        *      hasplugin,PlugName,OptionName
+        *         -> checks if the option OptionName from plugin PlugName is not set to 'no'
+        *      hasplugin,PlugName,OptionName=value
+        *         -> checks if the option OptionName from plugin PlugName is set to value
+        *
+        * @param       string  $name   name of plugin
+        * @param       string  $value  
+        * @return      
+        */
+       private function ifHasPlugin($name, $value)
+       {
+               global $manager;
+               $condition = false;
+               // (pluginInstalled method won't write a message in the actionlog on failure)
+               if ( $manager->pluginInstalled("NP_{$name}") )
+               {
+                       $plugin =& $manager->getPlugin("NP_{$name}");
+                       if ( $plugin != NULL )
+                       {
+                               if ( $value == "" )
+                               {
+                                       $condition = true;
+                               }
+                               else
+                               {
+                                       list($name2, $value2) = preg_split('#=#', $value, 2);
+                                       if ( $value2 == "" && $plugin->getOption($name2) != 'no' )
+                                       {
+                                               $condition = true;
+                                       }
+                                       else if ( $plugin->getOption($name2) == $value2 )
+                                       {
+                                               $condition = true;
+                                       }
+                               }
+                       }
+               }
+               return $condition;
+       }
+       
+       /**
+        * Actions::ifPlugin()
+        * Checks if a plugin exists and call its doIf function
+        * 
+        * @param       string  $name   name of plugin
+        * @param       string  $key    name of plugin option
+        * @param       string  $value  value of plugin option
+        * @return      void
+        */
+       private function ifPlugin($name, $key = '', $value = '')
+       {
+               global $manager;
+               
+               $plugin =& $manager->getPlugin("NP_{$name}");
+               if ( !$plugin )
+               {
+                       return;
+               }
+               
+               $params = func_get_args();
+               array_shift($params);
+               
+               return call_user_func_array(array($plugin, 'doIf'), $params);
+       }
+       
+       /**
+        * Actions::ifCategory()
+        * Different checks for a category
+        * 
+        * @param       string  $name   
+        * @param       string  $value  
+        * @return      boolean 
+        */
+       private function ifCategory($name = '', $value='')
+       {
+               global $blog, $catid;
+               
+               // when no parameter is defined, just check if a category is selected
+               if ( ($name != 'catname' && $name != 'catid') || ($value == '') )
+               {
+                       return $blog->isValidCategory($catid);
+               }
+               // check category name
+               else if ( $name == 'catname' )
+               {
+                       $value = $blog->getCategoryIdFromName($value);
+                       if ( $value == $catid )
+                       {
+                               return $blog->isValidCategory($catid);
+                       }
+               }
+               // check category id
+               else if ( ($name == 'catid') && ($value == $catid) )
+               {
+                       return $blog->isValidCategory($catid);
+               }
+               return FALSE;
+       }
+       
+       /**
+        * Actions::ifOnTeam()
+        * Checks if a member is on the team of a blog and return his rights
+        * 
+        * @param       string  $blogName       name of weblog
+        * @return      mixed
+        */
+       private function ifOnTeam($blogName = '')
+       {
+               global $blog, $member, $manager;
+               
+               // when no blog found
+               if ( ($blogName == '') && !is_object($blog) )
+               {
+                       return 0;
+               }
+               
+               // explicit blog selection
+               if ( $blogName != '' )
+               {
+                       $blogid = getBlogIDFromName($blogName);
+               }
+               
+               if ( ($blogName == '') || !$manager->existsBlogID($blogid) )
+               {
+                       // use current blog
+                       $blogid = $blog->getID();
+               }
+               
+               return $member->teamRights($blogid);
+       }
+
+       /**
+        * Actions::ifAdmin()
+        * Checks if a member is admin of a blog
+        * 
+        * @param       string  $blogName       name of weblog
+        * @return      mixed
+        */
+       private function ifAdmin($blogName = '')
+       {
+               global $blog, $member, $manager;
+               
+               // when no blog found
+               if ( ($blogName == '') && (!is_object($blog)) )
+               {
+                       return 0;
+               }
+               
+               // explicit blog selection
+               if ( $blogName != '' )
+               {
+                       $blogid = getBlogIDFromName($blogName);
+               }
+               
+               if ( ($blogName == '') || !$manager->existsBlogID($blogid) )
+               {
+                       // use current blog
+                       $blogid = $blog->getID();
+               }
+               
+               return $member->isBlogAdmin($blogid);
+       }
+       
+       /**
+        * Actions::link()
+        * returns either
+        *      - a raw link (html/xml encoded) when no linktext is provided
+        *      - a (x)html <a href... link when a text is present (text htmlencoded)
+        * 
+        * @param       string  $url            URL for href attribute of anchor element
+        * @param       string  $linktext       content of anchor element
+        * @return      
+        */
+       private function link($url, $linktext = '')
+       {
+               $u = Entity::hsc($url);
+               // fix URLs that already had encoded ampersands
+               $u = preg_replace("#&amp;amp;#", '&amp;', $u);
+               if ( $linktext != '' )
+               {
+                       $l = '<a href="' . $u .'">' . Entity::hsc($linktext) . '</a>';
+               }
+               else
+               {
+                       $l = $u;
+               }
+               return $l;
+       }
+       
+       /**
+        * Actions::searchlink()
+        * Outputs a next/prev link
+        *
+        * @param $maxresults
+        *              The maximum amount of items shown per page (e.g. 10)
+        * @param $startpos
+        *              Current start position (requestVar('startpos'))
+        * @param $direction
+        *              either 'prev' or 'next'
+        * @param $linktext
+        *              When present, the output will be a full <a href...> link. When empty,
+        *              only a raw link will be outputted
+        */
+       private function searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '')
+       {
+               global $CONF, $blog, $query, $amount;
+               // TODO: Move request uri to linkparams. this is ugly. sorry for that.
+               $startpos       = (integer) $startpos;
+               $parsed         = parse_url(serverVar('REQUEST_URI'));
+               $path           = ( in_array('path', $parsed) ) ? $parsed['path'] : '';
+               $parsed         = ( in_array('query', $parsed) ) ? $parsed['query'] : '';
+               $url            = '';
+               
+               if ( $direction == 'prev' )
+               {
+                       if ( intval($startpos) - intval($maxresults) >= 0 )
+                       {
+                               $startpos       = intval($startpos) - intval($maxresults);
+                               
+                               if ( $this->skintype == 'index' )
+                               {
+                                       $url = $path;
+                               }
+                               else if ( $this->skintype == 'search' )
+                               {
+                                       $url = $CONF['SearchURL'];
+                               }
+                               $url .= '?' . alterQueryStr($parsed,'startpos',$startpos);
+                       }
+               }
+               else if ( $direction == 'next' )
+               {
+                       global $navigationItems;
+                       if ( !isset($navigationItems) )
+                       {
+                               $navigationItems = 0;
+                       }
+                       
+                       if ( $recount )
+                       {
+                               $iAmountOnPage = 0;
+                       }
+                       else 
+                       {
+                               $iAmountOnPage = $this->amountfound;
+                       }
+                       
+                       if ( intval($navigationItems) > 0 )
+                       {
+                               $iAmountOnPage = intval($navigationItems) - intval($startpos);
+                       }
+                       elseif ( $iAmountOnPage == 0 )
+                       {
+                               /*
+                                * [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]
+                                * try a count query
+                                */
+                               if ( $this->skintype == 'index' )
+                               {
+                                       $sqlquery = $blog->getSqlBlog('', 'count');
+                                       $url = $path;
+                               }
+                               else if ( $this->skintype == 'search' )
+                               {
+                                       $unused_highlight = '';
+                                       $sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');
+                                       $url = $CONF['SearchURL'];
+                               }
+                               if ( $sqlquery )
+                               {
+                                       $iAmountOnPage = intval(DB::getValue($sqlquery)) - intval($startpos);
+                               }
+                       }
+                       
+                       $url = '';
+                       if ( intval($iAmountOnPage) >= intval($maxresults) )
+                       {
+                               $startpos        = intval($startpos) + intval($maxresults);
+                               $url            .= '?' . alterQueryStr($parsed, 'startpos', $startpos);
+                       }
+               }
+               
+               if ( $url != '' )
+               {
+                       echo $this->link($url, $linktext);
+               }
+               return;
+       }
+       
+       /**
+        * Actions::itemlink()
+        * Creates an item link and if no id is given a todaylink 
+        * 
+        * @param       integer $id     id for link
+        * @param       string  $linktext       text for link
+        * @return      void
+        */
+       private function itemlink($id, $linktext = '')
+       {
+               global $CONF;
+               if ( $id != 0 )
+               {
+                       echo $this->link(Link::create_item_link($id, $this->linkparams), $linktext);
+               }
+               else
+               {
+                       $this->parse_todaylink($linktext);
+               }
+               return;
+       }
+       
+       /**
+        * Actions::archivelink)
+        * Creates an archive link and if no id is given a todaylink 
+        * 
+        * @param       integer $id     id for link
+        * @param       string  $linktext       text for link
+        * @return      void
+        */
+       private function archivelink($id, $linktext = '')
+       {
+               global $CONF, $blog;
+               if ( $id != 0 )
+               {
+                       echo $this->link(Link::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);
+               }
+               else
+               {
+                       $this->parse_todaylink($linktext);
+               }
+               return;
+       }
+       
+       /**
+        * Actions:setBlogCategory()
+        * Helper function that sets the category that a blog will need to use
+        *
+        * @param       string  $blog           An object of the blog class, passed by reference (we want to make changes to it)
+        * @param       string  $catname        The name of the category to use
+        * @return      void
+        */
+       private function setBlogCategory(&$blog, $catname)
+       {
+               global $catid;
+               if ( $catname != '' )
+               {
+                       $blog->setSelectedCategoryByName($catname);
+               }
+               else
+               {
+                       $blog->setSelectedCategory($catid);
+               }
+               return;
+       }
+       
+       /**
+        * Actions::preBlogContent()
+        * Notifies the Manager that a PreBlogContent event occurs
+        * 
+        * @param       string  $type   type of skin
+        * @param       object  $blog   an instance of Blog class
+        * @return      void
+        */
+       private function preBlogContent($type, &$blog)
+       {
+               global $manager;
+               $data = array('blog' => &$blog, 'type' => $type);
+               $manager->notify('PreBlogContent', $data);
+               return;
+       }
+
+       /**
+        * Actions::postBlogContent()
+        * Notifies the Manager that a PostBlogContent event occurs
+        * 
+        * @param       string  $type   type of skin
+        * @param       objecct $blog   an instance of Blog class
+        * @return      void
+        */
+       private function postBlogContent($type, &$blog)
+       {
+               global $manager;
+               $data = array('blog' => &$blog, 'type' => $type);
+               $manager->notify('PostBlogContent', $data);
+               return;
+       }
+       
+       /**
+        * Actions::parse_additemform()
+        * Parse skinvar additemform
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_additemform()
+       {
+               global $blog, $CONF;
+               $this->formdata = array(
+                       'adminurl'      => Entity::hsc($CONF['AdminURL']),
+                       'catid'         => $blog->getDefaultCategory()
+               );
+               $blog->InsertJavaScriptInfo();
+               $this->doForm('additemform');
+               return;
+       }
+       
+       /**
+        * Actions::parse_addlink()
+        * Parse skinvar addlink
+        * A Link that allows to open a bookmarklet to add an item
+        */
+       public function parse_addlink()
+       {
+               global $CONF, $member, $blog;
+               if ( $member->isLoggedIn() && $member->isTeamMember($blog->blogid) )
+               {
+                       echo $CONF['AdminURL'].'bookmarklet.php?blogid='.$blog->blogid;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_addpopupcode()
+        * Parse skinvar addpopupcode
+        * Code that opens a bookmarklet in an popup window
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_addpopupcode()
+       {
+               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;";
+               return;
+       }
+       
+       /**
+        * Parse skinvar adminurl
+        * (shortcut for admin url)
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_adminurl()
+       {
+               $this->parse_sitevar('adminurl');
+               return;
+       }
+       
+       /**
+        * Actions::parse_archive()
+        * Parse skinvar archive
+        * 
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @return      
+        */
+       public function parse_archive($template, $category = '')
+       {
+               global $blog, $archive;
+               // can be used with either yyyy-mm or yyyy-mm-dd
+               sscanf($archive,'%d-%d-%d', $y, $m, $d);
+               $this->setBlogCategory($blog, $category);
+               $this->preBlogContent('achive',$blog);
+               $blog->showArchive($template, $y, $m, $d);
+               $this->postBlogContent('achive',$blog);
+               return;
+       }
+       
+       /**
+        * Actions::parse_archivedate()
+        * %archivedate(locale,date format)%
+        * 
+        * @param       deprecated      $locale 
+        * @return      void
+        */
+       public function parse_archivedate($locale='')
+       {
+               global $archive;
+               
+               // get archive date
+               sscanf($archive,'%d-%d-%d',$y,$m,$d);
+               
+               // get format
+               $args = func_get_args();
+               // format can be spread over multiple parameters
+               if ( sizeof($args) > 1 )
+               {
+                       // take away locale
+                       array_shift($args);
+                       // implode
+                       $format=implode(',',$args);
+               }
+               elseif ( $d == 0 && $m !=0 )
+               {
+                       $format = '%B %Y';
+               }
+               elseif ( $m == 0 )
+               {
+                       $format = '%Y';
+               }
+               else
+               {
+                       $format = '%d %B %Y';
+               }
+               echo i18n::formatted_datetime($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));
+               return;
+       }
+       
+       /**
+        * Actions::parse_archivedaylist()
+        * Parse skinvar archivedaylist
+        * 
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @param       integer $limit          the number of items in a display
+        * @return      void
+        */
+       public function parse_archivedaylist($template, $category = 'all', $limit = 0)
+       {
+               global $blog;
+               if ( $category == 'all' )
+               {
+                       $category = '';
+               }
+               $this->preBlogContent('archivelist',$blog);
+               $this->setBlogCategory($blog, $category);
+               $blog->showArchiveList($template, 'day', $limit);
+               $this->postBlogContent('archivelist',$blog);
+               return;
+       }
+       
+       /**
+        * Actions::parse_archivelink()
+        * A link to the archives for the current blog (or for default blog)
+        * 
+        * @param       string  $linktext       text for link
+        * @return      void
+        */
+       public function parse_archivelink($linktext = '')
+       {
+               global $blog, $CONF;
+               if ( $blog )
+               {
+                       echo $this->link(Link::create_archivelist_link($blog->getID(), $this->linkparams), $linktext);
+               }
+               else
+               {
+                       echo $this->link(Link::create_archivelist_link(), $linktext);
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_archivelist()
+        * 
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @param       integer $limit          the number of items in a display
+        * @return      void
+        */
+       public function parse_archivelist($template, $category = 'all', $limit = 0)
+       {
+               global $blog;
+               if ( $category == 'all' )
+               {
+                       $category = '';
+               }
+               $this->preBlogContent('archivelist',$blog);
+               $this->setBlogCategory($blog, $category);
+               $blog->showArchiveList($template, 'month', $limit);
+               $this->postBlogContent('archivelist',$blog);
+               return;
+       }
+       
+       /**
+        * Actions::parse_archiveyearlist()
+        * 
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @param       integer $limit          the number of items in a display
+        */
+       public function parse_archiveyearlist($template, $category = 'all', $limit = 0)
+       {
+               global $blog;
+               if ( $category == 'all' )
+               {
+                       $category = '';
+               }
+               $this->preBlogContent('archivelist',$blog);
+               $this->setBlogCategory($blog, $category);
+               $blog->showArchiveList($template, 'year', $limit);
+               $this->postBlogContent('archivelist',$blog);
+               return;
+       }
+       
+       /**
+        * Actions::parse_archivetype()
+        * Parse skinvar archivetype
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_archivetype()
+       {
+               global $archivetype;
+               echo $archivetype;
+               return;
+       }
+       
+       /**
+        * Actions::parse_blog()
+        * Parse skinvar blog
+        * 
+        * @param       string  $template       name of template
+        * @param       mixed   $amount         the number of items in a display, in case it includes the beginning
+        * @param       string  $category       name of category
+        * @return      void
+        */
+       public function parse_blog($template, $amount = 10, $category = '')
+       {
+               global $blog, $startpos;
+               
+               list($limit, $offset) = sscanf($amount, '%d(%d)');
+               $this->setBlogCategory($blog, $category);
+               $this->preBlogContent('blog',$blog);
+               $this->amountfound = $blog->readLog($template, $limit, $offset, $startpos);
+               $this->postBlogContent('blog',$blog);
+               return;
+       }
+       
+       /**
+        * Actions::parse_bloglist()
+        * Parse skinvar bloglist
+        * Shows a list of all blogs
+        * 
+        * @param       string  $template       name of template
+        * @param       string  $bnametype      whether 'name' or 'shortname' is used for the link text
+        * @param       string  $orderby        order criteria
+        * @param       string  $direction      order ascending or descending             
+        * @return      void
+        */
+       public function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc')
+       {
+               Blog::showBlogList($template, $bnametype, $orderby, $direction);
+               return;
+       }
+       
+       /**
+        * Actions::parse_blogsetting()
+        * Parse skinvar blogsetting
+        * 
+        * @param       string  $which  key of weblog settings
+        * @return      void
+        */
+       public function parse_blogsetting($which)
+       {
+               global $blog;
+               switch( $which )
+               {
+                       case 'id':
+                               echo Entity::hsc($blog->getID());
+                               break;
+                       case 'url':
+                               echo Entity::hsc($blog->getURL());
+                               break;
+                       case 'name':
+                               echo Entity::hsc($blog->getName());
+                               break;
+                       case 'desc':
+                               echo Entity::hsc($blog->getDescription());
+                               break;
+                       case 'short':
+                               echo Entity::hsc($blog->getShortName());
+                               break;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_callback()
+        * Parse callback
+        * 
+        * @param       string  $eventName      name of event
+        * @param       string  $type   type of skin
+        * @return      void
+        */
+       public function parse_callback($eventName, $type)
+       {
+               global $manager;
+               $data = array('type' => $type);
+               $manager->notify($eventName, $data);
+               return;
+       }
+       
+       /**
+        * Actions::parse_category()
+        * Parse skinvar category
+        * 
+        * @param       string  $type   key of category settings
+        * @return      void
+        */
+       public function parse_category($type = 'name')
+       {
+               global $catid, $blog;
+               if ( !$blog->isValidCategory($catid) )
+               {
+                       return;
+               }
+               
+               switch ( $type )
+               {
+                       case 'name':
+                               echo $blog->getCategoryName($catid);
+                               break;
+                       case 'desc':
+                               echo $blog->getCategoryDesc($catid);
+                               break;
+                       case 'id':
+                               echo $catid;
+                               break;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_categorylist()
+        * Parse categorylist
+        * 
+        * @param       string  $template       name of template
+        * @param       string  $blogname       name of weblog
+        * @return      void
+        */
+       public function parse_categorylist($template, $blogname = '')
+       {
+               global $blog, $manager;
+               
+               // when no blog found
+               if ( ($blogname == '') && (!is_object($blog)) )
+               {
+                       return 0;
+               }
+                       
+               if ( $blogname == '' )
+               {
+                       $this->preBlogContent('categorylist',$blog);
+                       $blog->showCategoryList($template);
+                       $this->postBlogContent('categorylist',$blog);
+               }
+               else
+               {
+                       $b =& $manager->getBlog(getBlogIDFromName($blogname));
+                       $this->preBlogContent('categorylist',$b);
+                       $b->showCategoryList($template);
+                       $this->postBlogContent('categorylist',$b);
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_commentform()
+        * Parse skinvar commentform
+        * 
+        * @param       string  $destinationurl URI for redirection
+        * @return      void
+        */
+       public function parse_commentform($destinationurl = '')
+       {
+               global $blog, $itemid, $member, $CONF, $manager, $DIR_LIBS, $errormessage;
+               
+               // warn when trying to provide a actionurl (used to be a parameter in Nucleus <2.0)
+               if ( stristr($destinationurl, 'action.php') )
+               {
+                       $args = func_get_args();
+                       $destinationurl = $args[1];
+                       ActionLog::add(WARNING,_ACTIONURL_NOTLONGER_PARAMATER);
+               }
+               
+               $actionurl = $CONF['ActionURL'];
+               
+               // if item is closed, show message and do nothing
+               $item =& $manager->getItem($itemid,0,0);
+               if ( $item['closed'] || !$blog->commentsEnabled() )
+               {
+                       $this->doForm('commentform-closed');
+                       return;
+               }
+               
+               if ( !$blog->isPublic() && !$member->isLoggedIn() )
+               {
+                       $this->doForm('commentform-closedtopublic');
+                       return;
+               }
+               
+               if ( !$destinationurl )
+               {
+                       // note: createLink returns an HTML encoded URL
+                       $destinationurl = Link::create_link(
+                               'item',
+                               array(
+                                       'itemid' => $itemid,
+                                       'title' => $item['title'],
+                                       'timestamp' => $item['timestamp'],
+                                       'extra' => $this->linkparams
+                               )
+                       );
+               }
+               else
+               {
+                       // HTML encode URL
+                       $destinationurl = Entity::hsc($destinationurl);
+               }
+               
+               // values to prefill
+               $user = cookieVar($CONF['CookiePrefix'] .'comment_user');
+               if ( !$user )
+               {
+                       $user = postVar('user');
+               }
+               
+               $userid = cookieVar($CONF['CookiePrefix'] .'comment_userid');
+               if ( !$userid )
+               {
+                       $userid = postVar('userid');
+               }
+               
+               $email = cookieVar($CONF['CookiePrefix'] .'comment_email');
+               if (!$email)
+               {
+                       $email = postVar('email');
+               }
+               
+               $body = postVar('body');
+               
+               $this->formdata = array(
+                       'destinationurl' => $destinationurl,    // url is already HTML encoded
+                       'actionurl' => Entity::hsc($actionurl),
+                       'itemid' => $itemid,
+                       'user' => Entity::hsc($user),
+                       'userid' => Entity::hsc($userid),
+                       'email' => Entity::hsc($email),
+                       'body' => Entity::hsc($body),
+                       'membername' => $member->getDisplayName(),
+                       'rememberchecked' => cookieVar($CONF['CookiePrefix'] .'comment_user')?'checked="checked"':''
+               );
+               
+               if ( !$member->isLoggedIn() )
+               {
+                       $this->doForm('commentform-notloggedin');
+               }
+               else
+               {
+                       $this->doForm('commentform-loggedin');
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_comments()
+        * Parse skinvar comments
+        * include comments for one item
+        * 
+        * @param       string  $template       name of template
+        * @return      void
+        */
+       public function parse_comments($template)
+       {
+               global $manager, $blog, $highlight, $itemid;
+               
+               $template =& $manager->getTemplate($template);
+               $item =& $manager->getitem($itemid, 0, 0);
+               
+               // create parser object & action handler
+               $handler = new ItemActions($blog);
+               $handler->setTemplate($template);
+               $handler->setCurrentItem($item);
+               
+               $parser = new Parser($handler);
+               
+               $comments = new Comments($itemid);
+               $comments->setItemActions($handler);
+               // shows ALL comments
+               $comments->showComments($template, -1, 1, $highlight);
+               return;
+       }
+       
+       /**
+        * Actions::parse_errordiv()
+        * Parse errordiv
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_errordiv()
+       {
+               global $errormessage;
+               if ( $errormessage )
+               {
+                       echo '<div class="error">' . Entity::hsc($errormessage) . "</div>\n";
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_errormessage()
+        * Parse skinvar errormessage
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_errormessage()
+       {
+               global $errormessage;
+               echo $errormessage;
+               return;
+       }
+       
+       /**
+        * Actions::parse_formdata()
+        * Parse formdata
+        * 
+        * @param       string  $what   key of format data
+        * @return      void
+        */
+       public function parse_formdata($what)
+       {
+               echo $this->formdata[$what];
+               return;
+       }
+       
+       /**
+        * Actions::parse_ifcat()
+        * Parse ifcat
+        * 
+        * @param       string  $text
+        * @return      void
+        */
+       public function parse_ifcat($text = '')
+       {
+               if ( $text == '' )
+               {
+                       // new behaviour
+                       $this->parse_if('category');
+               }
+               else
+               {
+                       // old behaviour
+                       global $catid, $blog;
+                       if ( $blog->isValidCategory($catid) )
+                       {
+                               echo $text;
+                       }
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_image()
+        * Parse skinvar image
+        * 
+        * @param       string  $what   name of tag
+        * @return      void
+        */
+       public function parse_image($what = 'imgtag')
+       {
+               global $CONF;
+               
+               $imagetext      = Entity::hsc(requestVar('imagetext'));
+               $imagepopup = requestVar('imagepopup');
+               $width          = intRequestVar('width');
+               $height         = intRequestVar('height');
+               $fullurl        = Entity::hsc($CONF['MediaURL'] . $imagepopup);
+               
+               switch ( $what )
+               {
+                       case 'url':
+                               echo $fullurl;
+                               break;
+                       case 'width':
+                               echo $width;
+                               break;
+                       case 'height':
+                               echo $height;
+                               break;
+                       case 'caption':
+                       case 'text':
+                               echo $imagetext;
+                               break;
+                       case 'imgtag':
+                       default:
+                               echo "<img src=\"$fullurl\" width=\"$width\" height=\"$height\" alt=\"$imagetext\" title=\"$imagetext\" />";
+                               break;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_imagetext()
+        * Parse skinvar imagetext
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_imagetext()
+       {
+               $this->parse_image('imagetext');
+               return;
+       }
+
+       /**
+        * Actions::parse_item()
+        * Parse skinvar item
+        * include one item (no comments)
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_item($template)
+       {
+               global $blog, $itemid, $highlight;
+               
+               // need this to select default category
+               $this->setBlogCategory($blog, '');
+               $this->preBlogContent('item',$blog);
+               $r = $blog->showOneitem($itemid, $template, $highlight);
+               if ( $r == 0 )
+               {
+                       echo _ERROR_NOSUCHITEM;
+               }
+               $this->postBlogContent('item',$blog);
+               return;
+       }
+
+       /**
+        * Actions::parse_itemid()
+        * Parse skinvar itemid
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_itemid()
+       {
+               global $itemid;
+               echo $itemid;
+               return;
+       }
+       
+       /**
+        * Actions::parseitemlink()
+        * Parse skinvar itemlink
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_itemlink($linktext = '')
+       {
+               global $itemid;
+               $this->itemlink($itemid, $linktext);
+               return;
+       }
+       
+       /**
+        * Actions::parse_itemtitle()
+        * Parse itemtitle
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_itemtitle($format = '')
+       {
+               global $manager, $itemid;
+               $item =& $manager->getItem($itemid, 1, 1);
+               
+               switch ( $format )
+               {
+                       case 'xml':
+                               echo Entity::hen($item['title']);
+                               break;
+                       case 'raw':
+                               echo $item['title'];
+                               break;
+                       case 'attribute':
+                       default:
+                               echo Entity::hsc(strip_tags($item['title']));
+                               break;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_loginform()
+        * Parse skinvar loginform
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_loginform()
+       {
+               global $member, $CONF;
+               if ( !$member->isLoggedIn() )
+               {
+                       $filename = 'loginform-notloggedin';
+                       $this->formdata = array();
+               }
+               else
+               {
+                       $filename = 'loginform-loggedin';
+                       $this->formdata = array(
+                               'membername' => $member->getDisplayName(),
+                       );
+               }
+               $this->doForm($filename);
+               return;
+       }
+       
+       /**
+        * Actions::parse_member()
+        * Parse skinvar member
+        * (includes a member info thingie)
+        * 
+        * @param       string  $what   which memberdata is needed
+        * @return      void
+        */
+       public function parse_member($what)
+       {
+               global $memberinfo, $member, $CONF;
+               
+               // 1. only allow the member-details-page specific variables on member pages
+               if ( $this->skintype == 'member' )
+               {
+                       switch( $what )
+                       {
+                               case 'name':
+                                       echo Entity::hsc($memberinfo->getDisplayName());
+                                       break;
+                               case 'realname':
+                                       echo Entity::hsc($memberinfo->getRealName());
+                                       break;
+                               case 'notes':
+                                       echo Entity::hsc($memberinfo->getNotes());
+                                       break;
+                               case 'url':
+                                       echo Entity::hsc($memberinfo->getURL());
+                                       break;
+                               case 'email':
+                                       echo Entity::hsc($memberinfo->getEmail());
+                                       break;
+                               case 'id':
+                                       echo Entity::hsc($memberinfo->getID());
+                                       break;
+                       }
+               }
+               
+               // 2. the next bunch of options is available everywhere, as long as the user is logged in
+               if ( $member->isLoggedIn() )
+               {
+                       switch( $what )
+                       {
+                               case 'yourname':
+                                       echo $member->getDisplayName();
+                                       break;
+                               case 'yourrealname':
+                                       echo $member->getRealName();
+                                       break;
+                               case 'yournotes':
+                                       echo $member->getNotes();
+                                       break;
+                               case 'yoururl':
+                                       echo $member->getURL();
+                                       break;
+                               case 'youremail':
+                                       echo $member->getEmail();
+                                       break;
+                               case 'yourid':
+                                       echo $member->getID();
+                                       break;
+                               case 'yourprofileurl':
+                                       if ($CONF['URLMode'] == 'pathinfo')
+                                               echo Link::create_member_link($member->getID());
+                                       else
+                                               echo $CONF['IndexURL'] . Link::create_member_link($member->getID());
+                                       break;
+                       }
+               }
+               return;
+       }
+       
+       /**
+        * Link::parse_membermailform()
+        * Parse skinvar membermailform
+        * 
+        * @param       integer $rows   the height for textarea
+        * @param       integer $cols   the width for textarea
+        * @param       string  $desturl        URI to redirect
+        * @return      void
+        */
+       public function parse_membermailform($rows = 10, $cols = 40, $desturl = '')
+       {
+               global $member, $CONF, $memberid;
+               
+               if ( $desturl == '' )
+               {
+                       if ( $CONF['URLMode'] == 'pathinfo' )
+                       {
+                               $desturl = Link::create_member_link($memberid);
+                       }
+                       else
+                       {
+                               $desturl = $CONF['IndexURL'] . Link::create_member_link($memberid);
+                       }
+               }
+               
+               $message = postVar('message');
+               $frommail = postVar('frommail');
+               
+               $this->formdata = array(
+                       'url' => Entity::hsc($desturl),
+                       'actionurl' => Entity::hsc($CONF['ActionURL']),
+                       'memberid' => $memberid,
+                       'rows' => $rows,
+                       'cols' => $cols,
+                       'message' => Entity::hsc($message),
+                       'frommail' => Entity::hsc($frommail)
+               );
+               
+               if ( $member->isLoggedIn() )
+               {
+                       $this->doForm('membermailform-loggedin');
+               }
+               else if ( $CONF['NonmemberMail'] )
+               {
+                       $this->doForm('membermailform-notloggedin');
+               }
+               else
+               {
+                       $this->doForm('membermailform-disallowed');
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_nextarchive()
+        * Parse skinvar nextarchive
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_nextarchive()
+       {
+               global $archivenext;
+               echo $archivenext;
+               return;
+       }
+       
+       /**
+        * Parse skinvar nextitem
+        * (include itemid of next item)
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_nextitem()
+       {
+               global $itemidnext;
+               if ( isset($itemidnext) )
+               {
+                       echo (int)$itemidnext;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_nextitemtitle()
+        * Parse skinvar nextitemtitle
+        * (include itemtitle of next item)
+        * 
+        * @param       string  $format format of text
+        * @return      void
+        */
+       public function parse_nextitemtitle($format = '')
+       {
+               global $itemtitlenext;
+               
+               switch ( $format )
+               {
+                       case 'xml':
+                               echo Entity::hen($itemtitlenext);
+                               break;
+                       case 'raw':
+                               echo $itemtitlenext;
+                               break;
+                       case 'attribute':
+                       default:
+                               echo Entity::hsc($itemtitlenext);
+                               break;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_nextlink()
+        * Parse skinvar nextlink
+        * 
+        * @param       string  $linktext       text for content of anchor element
+        * @param       integer $amount         the amount of items in a display
+        * @param       integer $recount        increment from this value
+        * @return      void
+        */
+       public function parse_nextlink($linktext = '', $amount = 10, $recount = '')
+       {
+               global $itemidnext, $archivenext, $startpos;
+               if ( $this->skintype == 'item' )
+               {
+                       $this->itemlink($itemidnext, $linktext);
+               }
+               else if ( $this->skintype == 'search' || $this->skintype == 'index' )
+               {
+                       $this->searchlink($amount, $startpos, 'next', $linktext, $recount);
+               }
+               else
+               {
+                       $this->archivelink($archivenext, $linktext);
+               }
+               return;
+       }
+
+       /**
+        * Actions::parse_nucleusbutton()
+        * Parse skinvar nucleusbutton
+        * 
+        * @param       string  $imgurl URL  for image
+        * @param       integer $imgwidth       width of image
+        * @param       integer $imgheidht      height of image
+        */
+       public function parse_nucleusbutton($imgurl = '', $imgwidth = '85', $imgheight = '31')
+       {
+               global $CONF;
+               if ( $imgurl == '' )
+               {
+                       $imgurl = $CONF['AdminURL'] . 'nucleus.gif';
+               }
+               else if ( Parser::getProperty('IncludeMode') == 'skindir' )
+               {
+                       // when skindit IncludeMode is used: start from skindir
+                       $imgurl = $CONF['SkinsURL'] . Parser::getProperty('IncludePrefix') . $imgurl;
+               }
+               
+               $this->formdata = array(
+                       'imgurl' => $imgurl,
+                       'imgwidth' => $imgwidth,
+                       'imgheight' => $imgheight,
+               );
+               $this->doForm('nucleusbutton');
+               return;
+       }
+       
+       /**
+        * Actions::parse_otherarchive()
+        * Parse skinvar otherarchive
+        * 
+        * @param       string  $blogname       name of weblog
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @return      void
+        */     
+       public function parse_otherarchive($blogname, $template, $category = '')
+       {
+               global $archive, $manager;
+               sscanf($archive,'%d-%d-%d',$y,$m,$d);
+               $b =& $manager->getBlog(getBlogIDFromName($blogname));
+               $this->setBlogCategory($b, $category);
+               $this->preBlogContent('otherachive',$b);
+               $b->showArchive($template, $y, $m, $d);
+               $this->postBlogContent('otherachive',$b);
+               return;
+       }
+       
+       /**
+        * Actions::parse_otherarchivedaylist()
+        * Parse skinvar otherarchivedaylist
+        * 
+        * @param       string  $blogname       name of weblog
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @param       integer $limit          the amount of items in a display
+        * @return      void
+        */
+       public function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0)
+       {
+               global $manager;
+               if ( $category == 'all')
+               {
+                       $category = '';
+               }
+               $b =& $manager->getBlog(getBlogIDFromName($blogname));
+               $this->setBlogCategory($b, $category);
+               $this->preBlogContent('otherarchivelist',$b);
+               $b->showArchiveList($template, 'day', $limit);
+               $this->postBlogContent('otherarchivelist',$b);
+               return;
+       }
+       
+       /**
+        * Actions::parse_otherarchivelist()
+        * Parse skinvar otherarchivelist
+        * 
+        * @param       string  $blogname       name of weblog
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @param       integer $limit          the amount of items in a display
+        * @return      void
+        */
+       public function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0)
+       {
+               global $manager;
+               if ( $category == 'all' )
+               {
+                       $category = '';
+               }
+               $b =& $manager->getBlog(getBlogIDFromName($blogname));
+               $this->setBlogCategory($b, $category);
+               $this->preBlogContent('otherarchivelist',$b);
+               $b->showArchiveList($template, 'month', $limit);
+               $this->postBlogContent('otherarchivelist',$b);
+               return;
+       }
+       
+       /**
+        * Actions::parse_otherarchiveyearlist()
+        * Parse skinvar otherarchiveyearlist
+        * 
+        * @param       string  $blogname       name of weblog
+        * @param       string  $template       name of template
+        * @param       string  $category       name of category
+        * @limit       integer $limit          the amount of items in a display
+        */
+       public function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0)
+       {
+               global $manager;
+               if ( $category == 'all' )
+               {
+                       $category = '';
+               }
+               $b =& $manager->getBlog(getBlogIDFromName($blogname));
+               $this->setBlogCategory($b, $category);
+               $this->preBlogContent('otherarchivelist',$b);
+               $b->showArchiveList($template, 'year', $limit);
+               $this->postBlogContent('otherarchivelist',$b);
+               return;
+       }
+       
+       /**
+        * Actions::parse_otherblog()
+        * Parse skinvar otherblog
+        * 
+        * @param       string  $blogname       name of weblog
+        * @param       string  $template       name of template
+        * @param       mixed   $amount         the amount of items, in case it includes the beginning
+        * @param       string  $category       name of category
+        * @return      void
+        */
+       public function parse_otherblog($blogname, $template, $amount = 10, $category = '')
+       {
+               global $manager;
+               
+               list($limit, $offset) = sscanf($amount, '%d(%d)');
+               
+               $b =& $manager->getBlog(getBlogIDFromName($blogname));
+               $this->setBlogCategory($b, $category);
+               $this->preBlogContent('otherblog',$b);
+               $this->amountfound = $b->readLog($template, $limit, $offset);
+               $this->postBlogContent('otherblog',$b);
+               return;
+       }
+       
+       /**
+        * Actions::parse_othersearchresults()
+        * Parse skinvar othersearchresults
+        * 
+        * @param       string  $blogname       name of weblog
+        * @param       string  $template       name of template
+        * @param       integer $maxresults     the amount of results
+        * @return      void
+        */
+       public function parse_othersearchresults($blogname, $template, $maxresults = 50)
+       {
+               global $query, $amount, $manager, $startpos;
+               $b =& $manager->getBlog(getBlogIDFromName($blogname));
+               // need this to select default category
+               $this->setBlogCategory($b, '');
+               $this->preBlogContent('othersearchresults',$b);
+               $b->search($query, $template, $amount, $maxresults, $startpos);
+               $this->postBlogContent('othersearchresults',$b);
+               return;
+       }
+       
+       /**
+        * Actions::parse_plugin()
+        * Executes a plugin skinvar
+        * extra parameters can be added
+        * 
+        * @param       string  $pluginName     name of plugin (without the NP_)
+        * @return      void
+        */
+       public function parse_plugin($pluginName)
+       {
+               global $manager;
+               
+               $plugin =& $manager->getPlugin('NP_' . $pluginName);
+               if ( !$plugin )
+               {
+                       return;
+               }
+               
+               // get arguments
+               $params = func_get_args();
+               
+               // remove plugin name
+               array_shift($params);
+               
+               // add skin type on front
+               array_unshift($params, $this->skintype);
+               
+               call_user_func_array(array($plugin,'doSkinVar'), $params);
+               return;
+       }
+       
+       /**
+        * Actions::parse_prevarchive()
+        * Parse skinvar prevarchive
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_prevarchive()
+       {
+               global $archiveprev;
+               echo $archiveprev;
+       }
+       
+       /**
+        * Actions::parse_preview()
+        * Parse skinvar preview
+        * 
+        * @param       string  $template       name of tempalte
+        * @return      void
+        */
+       public function parse_preview($template)
+       {
+               global $blog, $CONF, $manager;
+               
+               $template =& $manager->getTemplate($template);
+               
+               $row['body'] = '<span id="prevbody"></span>';
+               $row['title'] = '<span id="prevtitle"></span>';
+               $row['more'] = '<span id="prevmore"></span>';
+               $row['itemlink'] = '';
+               $row['itemid'] = 0; $row['blogid'] = $blog->getID();
+               
+               echo Template::fill($template['ITEM_HEADER'],$row);
+               echo Template::fill($template['ITEM'],$row);
+               echo Template::fill($template['ITEM_FOOTER'],$row);
+               return;
+       }
+       
+       /**
+        * Actions::parse_previtem()
+        * Parse skinvar previtem
+        * (include itemid of prev item)
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_previtem()
+       {
+               global $itemidprev;
+               if ( isset($itemidprev) )
+               {
+                       echo (integer) $itemidprev;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_previtemtitle()
+        * Parse skinvar previtemtitle
+        * (include itemtitle of prev item)
+        * 
+        * @param       String  $format string format
+        * @return      String  formatted string
+        */
+       public function parse_previtemtitle($format = '')
+       {
+               global $itemtitleprev;
+               
+               switch ( $format )
+               {
+                       case 'xml':
+                               echo Entity::hen($itemtitleprev);
+                               break;
+                       case 'raw':
+                               echo $itemtitleprev;
+                               break;
+                       case 'attribute':
+                       default:
+                               echo Entity::hsc($itemtitleprev);
+                               break;
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_prevlink()
+        * Parse skinvar prevlink
+        * 
+        * @param       string  $linktext       text as a content of anchor element
+        * @param       integer the amount of links
+        * @return      void
+        */
+       public function parse_prevlink($linktext = '', $amount = 10)
+       {
+               global $itemidprev, $archiveprev, $startpos;
+               
+               if ( $this->skintype == 'item' )
+               {
+                       $this->itemlink($itemidprev, $linktext);
+               }
+               else if ( $this->skintype == 'search' || $this->skintype == 'index' )
+               {
+                       $this->searchlink($amount, $startpos, 'prev', $linktext);
+               }
+               else
+               {
+                       $this->archivelink($archiveprev, $linktext);
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_query()
+        * Parse skinvar query
+        * (includes the search query)   
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_query()
+       {
+               global $query;
+               echo Entity::hsc($query);
+               return;
+       }
+       
+       /**
+        * Actions::parse_referer()
+        * Parse skinvar referer
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_referer()
+       {
+               echo Entity::hsc(serverVar('HTTP_REFERER'));
+               return;
+       }
+       
+       /**
+        * Actions::parse_searchform()
+        * Parse skinvar searchform
+        * 
+        * @param       string  $blogname       name of weblog
+        * @return      void
+        */
+       public function parse_searchform($blogname = '')
+       {
+               global $CONF, $manager, $maxresults;
+               if ( $blogname )
+               {
+                       $blog =& $manager->getBlog(getBlogIDFromName($blogname));
+               }
+               else
+               {
+                       global $blog;
+               }
+               // use default blog when no blog is selected
+               $this->formdata = array(
+                       'id'    => $blog?$blog->getID():$CONF['DefaultBlog'],
+                       'query' => Entity::hsc(getVar('query')),
+               );
+               $this->doForm('searchform');
+               return;
+       }
+       
+       /**
+        * Actions::parse_searchresults()
+        * Parse skinvar searchresults
+        * 
+        * @param       string  $template       name of tempalte
+        * @param       integer $maxresults     searched items in a display
+        * @return      void;
+        */
+       public function parse_searchresults($template, $maxresults = 50 )
+       {
+               global $blog, $query, $amount, $startpos;
+               
+               $this->setBlogCategory($blog, '');      // need this to select default category
+               $this->preBlogContent('searchresults',$blog);
+               $this->amountfound = $blog->search($query, $template, $amount, $maxresults, $startpos);
+               $this->postBlogContent('searchresults',$blog);
+               return;
+       }
+       
+       /**
+        * Actions::parse_self()
+        * Parse skinvar self
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_self()
+       {
+               global $CONF;
+               echo $CONF['Self'];
+               return;
+       }
+       
+       /**
+        * Actions::parse_sitevar()
+        * Parse skinvar sitevar
+        * (include a sitevar)
+        * 
+        * @param       string  $which
+        * @return      void
+        */
+       public function parse_sitevar($which)
+       {
+               global $CONF;
+               switch ( $which )
+               {
+                       case 'url':
+                               echo $CONF['IndexURL'];
+                               break;
+                       case 'name':
+                               echo $CONF['SiteName'];
+                               break;
+                       case 'admin':
+                               echo $CONF['AdminEmail'];
+                               break;
+                       case 'adminurl':
+                               echo $CONF['AdminURL'];
+               }
+               return;
+       }
+       
+       /**
+        * Actions::parse_skinname()
+        * Parse skinname
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_skinname()
+       {
+               echo $this->parser->skin->getName();
+               return;
+       }
+       
+       /**
+        * Actions::parse_skintype()
+        * Parse skintype (experimental)
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_skintype()
+       {
+               echo $this->skintype;
+               return;
+       }
+       
+       /**
+        * Actions::parse_ticket()
+        * Parse ticket
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_ticket()
+       {
+               global $manager;
+               $manager->addTicketHidden();
+               return;
+       }
+
+       /**
+        * Actions::parse_todaylink()
+        * Parse skinvar todaylink
+        * A link to the today page (depending on selected blog, etc...)
+        *
+        * @param       string  $linktext       text for link
+        * @return      void
+        */
+       public function parse_todaylink($linktext = '')
+       {
+               global $blog, $CONF;
+               if ( $blog )
+               {
+                       echo $this->link(Link::create_blogid_link($blog->getID(),$this->linkparams), $linktext);
+               }
+               else
+               {
+                       echo $this->link($CONF['SiteUrl'], $linktext);
+               }
+               return;
+       }
+       
+       /**
+        * Parse vars
+        * When commentform is not used, to include a hidden field with itemid   
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_vars()
+       {
+               global $itemid;
+               echo '<input type="hidden" name="itemid" value="'.$itemid.'" />' . "\n";
+               return;
+       }
+
+       /**
+        * Actions::parse_version()
+        * Parse skinvar version
+        * (include nucleus versionnumber)       
+        * 
+        * @param       void
+        * @return      void
+        */
+       public function parse_version()
+       {
+               global $nucleus;
+               echo 'Nucleus CMS ' . $nucleus['version'];
+               return;
+       }
+       
+       /**
+        * Actions::parse_sticky()
+        * Parse skinvar sticky
+        * 
+        * @param       integer $itemnumber     id of item
+        * @param       string  $template       name of template
+        * @return      void
+        */
+       public function parse_sticky($itemid = 0, $template = '')
+       {
+               global $manager;
+               
+               $itemid = (integer) $itemid;
+               $itemarray = array($itemid);
+               
+               $item =& $manager->getItem($post['itemid'], 1, 1);
+               $blog =& $manager->getBlog($item['blogid']);
+               
+               $this->preBlogContent('sticky', $blog);
+               $this->amountfound = $blog->readLogFromList($itemarray, $template);
+               $this->postBlogContent('sticky', $blog);
+               return;
+       }
+}