<?php\r
-/*\r
+/**\r
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
* Copyright (C) 2002-2012 The Nucleus Group\r
*\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 1721 2012-03-31 10:18:25Z sakamocchi $\r
+ * @version $Id: ACTIONS.php 1725 2012-04-07 02:21:32Z sakamocchi $\r
*/\r
\r
class Actions extends BaseActions\r
// part of the skin currently being parsed ('index', 'item', 'archive',\r
// 'archivelist', 'member', 'search', 'error', 'imagepopup')\r
var $skintype;\r
-\r
+ \r
// contains an assoc array with parameters that need to be included when\r
// generating links to items/archives/... (e.g. catid)\r
var $linkparams;\r
-\r
+ \r
// reference to the skin object for which a part is being parsed\r
var $skin;\r
-\r
+ \r
// used when including templated forms from the include/ dir. The $formdata var\r
// contains the values to fill out in there (assoc array name -> value)\r
var $formdata;\r
-\r
+ \r
// filled out with the number of displayed items after calling one of the\r
// (other)blog/(other)searchresults skinvars.\r
var $amountfound;\r
-\r
+ \r
/**\r
+ * Actions::__construct()\r
* Constructor for a new Actions object\r
+ * \r
+ * @param string $type\r
+ * @return void\r
*/\r
- function Actions($type) {\r
+ public function __construct($type)\r
+ {\r
+ global $catid;\r
+ \r
// call constructor of superclass first\r
$this->BaseActions();\r
-\r
$this->skintype = $type;\r
-\r
- global $catid;\r
- if ($catid)\r
+ \r
+ if ( $catid )\r
+ {\r
$this->linkparams = array('catid' => $catid);\r
+ }\r
+ return;\r
}\r
-\r
+ \r
/**\r
- * Set the skin\r
+ * Actions::setSkin()\r
+ * Set the skin\r
+ * @param object $skin an instance of Skin class\r
+ * @return void\r
*/\r
- function setSkin(&$skin) {\r
+ public function setSkin(&$skin)\r
+ {\r
$this->skin =& $skin;\r
+ return;\r
}\r
-\r
+ \r
/**\r
- * Set the parser\r
+ * Actions::setParser()\r
+ * Set the parser\r
+ * \r
+ * @param object $parser an instance of Parser class\r
+ * @return void\r
*/\r
- function setParser(&$parser) {\r
+ public function setParser(&$parser)\r
+ {\r
$this->parser =& $parser;\r
+ return;\r
}\r
-\r
+ \r
/**\r
- * Forms get parsedincluded now, using an extra <formdata> skinvar\r
- */\r
- function doForm($filename) {\r
+ * Actions::doForm()\r
+ * Forms get parsedincluded now, using an extra <formdata> skinvar\r
+ *\r
+ * @param string $filename\r
+ * @return void\r
+ */\r
+ public function doForm($filename)\r
+ {\r
global $DIR_NUCLEUS;\r
array_push($this->parser->actions,'formdata','text','callback','errordiv','ticket');\r
+ \r
$oldIncludeMode = Parser::getProperty('IncludeMode');\r
$oldIncludePrefix = Parser::getProperty('IncludePrefix');\r
Parser::setProperty('IncludeMode','normal');\r
Parser::setProperty('IncludePrefix','');\r
+ \r
$this->parse_parsedinclude($DIR_NUCLEUS . 'forms/' . $filename . '.template');\r
Parser::setProperty('IncludeMode',$oldIncludeMode);\r
Parser::setProperty('IncludePrefix',$oldIncludePrefix);\r
- array_pop($this->parser->actions); // errordiv\r
- array_pop($this->parser->actions); // callback\r
- array_pop($this->parser->actions); // text\r
- array_pop($this->parser->actions); // formdata\r
- array_pop($this->parser->actions); // ticket\r
+ \r
+ array_pop($this->parser->actions); // errordiv\r
+ array_pop($this->parser->actions); // callback\r
+ array_pop($this->parser->actions); // text\r
+ array_pop($this->parser->actions); // formdata\r
+ array_pop($this->parser->actions); // ticket\r
+ return;\r
}\r
\r
/**\r
+ * Actions::checkCondition()\r
* Checks conditions for if statements\r
*\r
- * @param string $field type of <%if%>\r
- * @param string $name property of field\r
- * @param string $value value of property\r
+ * @param string $field type of <%if%>\r
+ * @param string $name property of field\r
+ * @param string $value value of property\r
+ * @return boolean condition\r
*/\r
- function checkCondition($field, $name='', $value = '') {\r
+ public function checkCondition($field, $name='', $value = '')\r
+ {\r
global $catid, $blog, $member, $itemidnext, $itemidprev, $manager, $archiveprevexists, $archivenextexists;\r
-\r
+ \r
$condition = 0;\r
- switch($field) {\r
+ switch ( $field )\r
+ {\r
case 'category':\r
- $condition = ($blog && $this->_ifCategory($name,$value));\r
+ $condition = ($blog && $this->ifCategory($name,$value));\r
break;\r
case 'blogsetting':\r
$condition = ($blog && ($blog->getSetting($name) == $value));\r
$condition = $member->isLoggedIn();\r
break;\r
case 'onteam':\r
- $condition = $member->isLoggedIn() && $this->_ifOnTeam($name);\r
+ $condition = $member->isLoggedIn() && $this->ifOnTeam($name);\r
break;\r
case 'admin':\r
- $condition = $member->isLoggedIn() && $this->_ifAdmin($name);\r
+ $condition = $member->isLoggedIn() && $this->ifAdmin($name);\r
+ break;\r
+ case 'superadmin':\r
+ $condition = $member->isLoggedIn() && $member->isAdmin();\r
+ break;\r
+ case 'allowloginedit':\r
+ $condition = $member->isLoggedIn() && ($CONF['AllowLoginEdit'] || $member->isAdmin());\r
break;\r
case 'nextitem':\r
$condition = ($itemidnext != '');\r
$condition = ($archivenextexists == true);\r
break;\r
case 'skintype':\r
- $condition = ($name == $this->skintype);\r
+ $condition = (($name == $this->skintype) || ($name == requestVar('action')));\r
break;\r
case 'hasplugin':\r
- $condition = $this->_ifHasPlugin($name, $value);\r
+ $condition = $this->ifHasPlugin($name, $value);\r
+ break;\r
+ case 'adminaction':\r
+ $condition = ($this->objAdmin->action == $name);\r
+ break;\r
+ case 'adminoldaction':\r
+ $condition = ($this->objAdmin->action == $name);\r
+ break;\r
+ case 'addresschange':\r
+ $condition = ($this->_ifAddresscange());\r
+ break;\r
+ case 'bechangepass':\r
+ $condition = ($this->_beChangePassword());\r
+ break;\r
+ case 'skincandidates':\r
+ $condition = ($this->_ifSkincandidates());\r
+ break;\r
+ case 'nameclashes':\r
+ $condition = requestVar('nameclashes');\r
+ break;\r
+ case 'existsnewplugin':\r
+ $condition = ($this->_existsNewPlugin());\r
break;\r
default:\r
- $condition = $manager->pluginInstalled('NP_' . $field) && $this->_ifPlugin($field, $name, $value);\r
+ $condition = $manager->pluginInstalled("NP_{$field}") && $this->ifPlugin($field, $name, $value);\r
break;\r
}\r
return $condition;\r
}\r
-\r
+ \r
/**\r
+ * Actions::_ifHasPlugin()\r
* hasplugin,PlugName\r
* -> checks if plugin exists\r
* hasplugin,PlugName,OptionName\r
* -> checks if the option OptionName from plugin PlugName is not set to 'no'\r
* hasplugin,PlugName,OptionName=value\r
* -> checks if the option OptionName from plugin PlugName is set to value\r
+ *\r
+ * @param string $name name of plugin\r
+ * @param string $value \r
+ * @return \r
*/\r
- function _ifHasPlugin($name, $value) {\r
+ private function ifHasPlugin($name, $value)\r
+ {\r
global $manager;\r
$condition = false;\r
// (pluginInstalled method won't write a message in the actionlog on failure)\r
- if ($manager->pluginInstalled('NP_'.$name)) {\r
- $plugin =& $manager->getPlugin('NP_' . $name);\r
- if ($plugin != NULL) {\r
- if ($value == "") {\r
+ if ( $manager->pluginInstalled("NP_{$name}") )\r
+ {\r
+ $plugin =& $manager->getPlugin("NP_{$name}");\r
+ if ( $plugin != NULL )\r
+ {\r
+ if ( $value == "" )\r
+ {\r
$condition = true;\r
- } else {\r
- list($name2, $value2) = i18n::explode('=', $value, 2);\r
- if ($value2 == "" && $plugin->getOption($name2) != 'no') {\r
+ }\r
+ else\r
+ {\r
+ list($name2, $value2) = preg_split('#=#', $value, 2);\r
+ if ( $value2 == "" && $plugin->getOption($name2) != 'no' )\r
+ {\r
$condition = true;\r
- } else if ($plugin->getOption($name2) == $value2) {\r
+ }\r
+ else if ( $plugin->getOption($name2) == $value2 )\r
+ {\r
$condition = true;\r
}\r
}\r
}\r
return $condition;\r
}\r
-\r
+ \r
/**\r
+ * Actions::ifPlugin()\r
* Checks if a plugin exists and call its doIf function\r
+ * \r
+ * @param string $name name of plugin\r
+ * @param string $key name of plugin option\r
+ * @param string $value value of plugin option\r
+ * @return void\r
*/\r
- function _ifPlugin($name, $key = '', $value = '') {\r
+ private function ifPlugin($name, $key = '', $value = '')\r
+ {\r
global $manager;\r
-\r
- $plugin =& $manager->getPlugin('NP_' . $name);\r
- if (!$plugin) return;\r
-\r
+ \r
+ $plugin =& $manager->getPlugin("NP_{$name}");\r
+ if ( !$plugin )\r
+ {\r
+ return;\r
+ }\r
+ \r
$params = func_get_args();\r
array_shift($params);\r
-\r
+ \r
return call_user_func_array(array(&$plugin, 'doIf'), $params);\r
}\r
-\r
+ \r
/**\r
- * Different checks for a category\r
+ * Actions::ifCategory()\r
+ * Different checks for a category\r
+ * \r
+ * @param string $name \r
+ * @param string $value \r
+ * @return boolean \r
*/\r
- function _ifCategory($name = '', $value='') {\r
+ private function ifCategory($name = '', $value='')\r
+ {\r
global $blog, $catid;\r
-\r
+ \r
// when no parameter is defined, just check if a category is selected\r
- if (($name != 'catname' && $name != 'catid') || ($value == ''))\r
+ if ( ($name != 'catname' && $name != 'catid') || ($value == '') )\r
+ {\r
return $blog->isValidCategory($catid);\r
-\r
+ }\r
+ \r
// check category name\r
- if ($name == 'catname') {\r
+ if ( $name == 'catname' )\r
+ {\r
$value = $blog->getCategoryIdFromName($value);\r
- if ($value == $catid)\r
+ if ( $value == $catid )\r
+ {\r
return $blog->isValidCategory($catid);\r
+ }\r
}\r
-\r
+ \r
// check category id\r
- if (($name == 'catid') && ($value == $catid))\r
+ if ( ($name == 'catid') && ($value == $catid) )\r
+ {\r
return $blog->isValidCategory($catid);\r
-\r
- return false;\r
+ }\r
+ return FALSE;\r
}\r
-\r
+ \r
/**\r
- * Checks if a member is on the team of a blog and return his rights\r
+ * Actions::ifOnTeam()\r
+ * Checks if a member is on the team of a blog and return his rights\r
+ * \r
+ * @param string $blogName name of weblog\r
+ * @return mixed\r
*/\r
- function _ifOnTeam($blogName = '') {\r
+ private function ifOnTeam($blogName = '')\r
+ {\r
global $blog, $member, $manager;\r
-\r
+ \r
// when no blog found\r
- if (($blogName == '') && (!is_object($blog)))\r
+ if ( ($blogName == '') && !is_object($blog) )\r
+ {\r
return 0;\r
-\r
+ }\r
+ \r
// explicit blog selection\r
- if ($blogName != '')\r
+ if ( $blogName != '' )\r
+ {\r
$blogid = getBlogIDFromName($blogName);\r
-\r
- if (($blogName == '') || !$manager->existsBlogID($blogid))\r
+ }\r
+ \r
+ if ( ($blogName == '') || !$manager->existsBlogID($blogid) )\r
+ {\r
// use current blog\r
$blogid = $blog->getID();\r
-\r
+ }\r
+ \r
return $member->teamRights($blogid);\r
}\r
\r
/**\r
- * Checks if a member is admin of a blog\r
+ * Actions::ifAdmin()\r
+ * Checks if a member is admin of a blog\r
+ * \r
+ * @param string $blogName name of weblog\r
+ * @return mixed\r
*/\r
- function _ifAdmin($blogName = '') {\r
+ private function ifAdmin($blogName = '')\r
+ {\r
global $blog, $member, $manager;\r
-\r
+ \r
// when no blog found\r
- if (($blogName == '') && (!is_object($blog)))\r
+ if ( ($blogName == '') && (!is_object($blog)) )\r
+ {\r
return 0;\r
-\r
+ }\r
+ \r
// explicit blog selection\r
- if ($blogName != '')\r
+ if ( $blogName != '' )\r
+ {\r
$blogid = getBlogIDFromName($blogName);\r
-\r
- if (($blogName == '') || !$manager->existsBlogID($blogid))\r
+ }\r
+ \r
+ if ( ($blogName == '') || !$manager->existsBlogID($blogid) )\r
+ {\r
// use current blog\r
$blogid = $blog->getID();\r
-\r
+ }\r
+ \r
return $member->isBlogAdmin($blogid);\r
}\r
\r
/**\r
+ * Actions::link()\r
* returns either\r
- * - a raw link (html/xml encoded) when no linktext is provided\r
- * - a (x)html <a href... link when a text is present (text htmlencoded)\r
+ * - a raw link (html/xml encoded) when no linktext is provided\r
+ * - a (x)html <a href... link when a text is present (text htmlencoded)\r
+ * \r
+ * @param string $url URL for href attribute of anchor element\r
+ * @param string $linktext content of anchor element\r
+ * @return \r
*/\r
- function _link($url, $linktext = '')\r
+ private function link($url, $linktext = '')\r
{\r
$u = Entity::hsc($url);\r
- $u = preg_replace("/&amp;/",'&',$u); // fix URLs that already had encoded ampersands\r
- if ($linktext != '') \r
- $l = '<a href="' . $u .'">'.Entity::hsc($linktext).'</a>';\r
+ // fix URLs that already had encoded ampersands\r
+ $u = preg_replace("#&amp;#", '&', $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
* When present, the output will be a full <a href...> link. When empty,\r
* only a raw link will be outputted\r
*/\r
- function _searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '') {\r
+ private function searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '')\r
+ {\r
global $CONF, $blog, $query, $amount;\r
// TODO: Move request uri to linkparams. this is ugly. sorry for that.\r
- $startpos = intval($startpos); // will be 0 when empty.\r
+ $startpos = (integer) $startpos;\r
$parsed = parse_url(serverVar('REQUEST_URI'));\r
$path = $parsed['path'];\r
$parsed = $parsed['query'];\r
$url = '';\r
\r
- switch ($direction) {\r
- case 'prev':\r
- if ( intval($startpos) - intval($maxresults) >= 0) {\r
- $startpos = intval($startpos) - intval($maxresults);\r
- //$url = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);\r
- switch ($this->skintype)\r
- {\r
- case 'index':\r
- $url = $path;\r
- break;\r
- case 'search':\r
- $url = $CONF['SearchURL'];\r
- break;\r
- }\r
- $url .= '?'.alterQueryStr($parsed,'startpos',$startpos);\r
- }\r
- \r
- break;\r
- case 'next':\r
- global $navigationItems;\r
- if (!isset($navigationItems)) $navigationItems = 0;\r
- \r
- if ($recount)\r
- $iAmountOnPage = 0;\r
- else \r
- $iAmountOnPage = $this->amountfound;\r
+ if ( $direction == 'prev' )\r
+ {\r
+ if ( intval($startpos) - intval($maxresults) >= 0 )\r
+ {\r
+ $startpos = intval($startpos) - intval($maxresults);\r
\r
- if (intval($navigationItems) > 0) {\r
- $iAmountOnPage = intval($navigationItems) - intval($startpos);\r
+ if ( $this->skintype == 'index' )\r
+ {\r
+ $url = $path;\r
}\r
- elseif ($iAmountOnPage == 0)\r
+ else if ( $this->skintype == 'search' )\r
{\r
- // [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]\r
- // try a count query\r
- switch ($this->skintype)\r
- {\r
- case 'index':\r
- $sqlquery = $blog->getSqlBlog('', 'count');\r
- $url = $path;\r
- break;\r
- case 'search':\r
- $unused_highlight = '';\r
- $sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');\r
- $url = $CONF['SearchURL'];\r
- break;\r
- }\r
- if ($sqlquery)\r
- $iAmountOnPage = intval(quickQuery($sqlquery)) - intval($startpos);\r
+ $url = $CONF['SearchURL'];\r
}\r
- \r
- if (intval($iAmountOnPage) >= intval($maxresults)) {\r
- $startpos = intval($startpos) + intval($maxresults);\r
- //$url = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);\r
- $url .= '?'.alterQueryStr($parsed,'startpos',$startpos);\r
+ $url .= '?' . alterQueryStr($parsed,'startpos',$startpos);\r
+ }\r
+ }\r
+ else if ( $direction == 'next' )\r
+ {\r
+ global $navigationItems;\r
+ if ( !isset($navigationItems) )\r
+ {\r
+ $navigationItems = 0;\r
+ }\r
+ \r
+ if ( $recount )\r
+ {\r
+ $iAmountOnPage = 0;\r
+ }\r
+ else \r
+ {\r
+ $iAmountOnPage = $this->amountfound;\r
+ }\r
+ \r
+ if ( intval($navigationItems) > 0 )\r
+ {\r
+ $iAmountOnPage = intval($navigationItems) - intval($startpos);\r
+ }\r
+ elseif ( $iAmountOnPage == 0 )\r
+ {\r
+ /*\r
+ * [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]\r
+ * try a count query\r
+ */\r
+ if ( $this->skintype == 'index' )\r
+ {\r
+ $sqlquery = $blog->getSqlBlog('', 'count');\r
+ $url = $path;\r
}\r
- else $url = '';\r
- break;\r
- default:\r
- break;\r
- } // switch($direction)\r
-\r
- if ($url != '')\r
- echo $this->_link($url, $linktext);\r
+ else if ( $this->skintype == 'search' )\r
+ {\r
+ $unused_highlight = '';\r
+ $sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');\r
+ $url = $CONF['SearchURL'];\r
+ }\r
+ if ( $sqlquery )\r
+ {\r
+ $iAmountOnPage = intval(quickQuery($sqlquery)) - intval($startpos);\r
+ }\r
+ }\r
+ \r
+ $url = '';\r
+ if ( intval($iAmountOnPage) >= intval($maxresults) )\r
+ {\r
+ $startpos = intval($startpos) + intval($maxresults);\r
+ $url .= '?' . alterQueryStr($parsed, 'startpos', $startpos);\r
+ }\r
+ }\r
+ \r
+ if ( $url != '' )\r
+ {\r
+ echo $this->link($url, $linktext);\r
+ }\r
+ return;\r
}\r
-\r
+ \r
/**\r
- * Actions::_itemlink()\r
+ * Actions::itemlink()\r
* Creates an item link and if no id is given a todaylink \r
* \r
- * @param Integer $id id for link\r
- * @param String $linktext text for link\r
- * @return Void\r
+ * @param integer $id id for link\r
+ * @param string $linktext text for link\r
+ * @return void\r
*/\r
- function _itemlink($id, $linktext = '')\r
+ private function itemlink($id, $linktext = '')\r
{\r
global $CONF;\r
- if ( $id )\r
+ if ( $id != 0 )\r
{\r
- echo $this->_link(Link::create_item_link($id, $this->linkparams), $linktext);\r
+ echo $this->link(Link::create_item_link($id, $this->linkparams), $linktext);\r
}\r
else\r
{\r
}\r
\r
/**\r
- * Actions::_archivelink)\r
+ * Actions::archivelink)\r
* Creates an archive link and if no id is given a todaylink \r
* \r
- * @param Integer $id id for link\r
- * @param String $linktext text for link\r
- * @return Void\r
+ * @param integer $id id for link\r
+ * @param string $linktext text for link\r
+ * @return void\r
*/\r
- function _archivelink($id, $linktext = '')\r
+ private function archivelink($id, $linktext = '')\r
{\r
global $CONF, $blog;\r
- if ( $id )\r
+ if ( $id != 0 )\r
{\r
- echo $this->_link(Link::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);\r
+ echo $this->link(Link::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);\r
}\r
else\r
{\r
}\r
\r
/**\r
- * Helper function that sets the category that a blog will need to use\r
- *\r
- * @param $blog\r
- * An object of the blog class, passed by reference (we want to make changes to it)\r
- * @param $catname\r
- * The name of the category to use\r
- */\r
- function _setBlogCategory(&$blog, $catname) {\r
+ * Actions:setBlogCategory()\r
+ * Helper function that sets the category that a blog will need to use\r
+ *\r
+ * @param string $blog An object of the blog class, passed by reference (we want to make changes to it)\r
+ * @param string $catname The name of the category to use\r
+ * @return void\r
+ */\r
+ private function setBlogCategory(&$blog, $catname)\r
+ {\r
global $catid;\r
- if ($catname != '')\r
+ if ( $catname != '' )\r
+ {\r
$blog->setSelectedCategoryByName($catname);\r
+ }\r
else\r
+ {\r
$blog->setSelectedCategory($catid);\r
+ }\r
+ return;\r
}\r
-\r
+ \r
/**\r
- * Notifies the Manager that a PreBlogContent event occurs\r
+ * Actions::preBlogContent()\r
+ * Notifies the Manager that a PreBlogContent event occurs\r
+ * \r
+ * @param string $type type of skin\r
+ * @param object $blog an instance of Blog class\r
+ * @return void\r
*/\r
- function _preBlogContent($type, &$blog) {\r
+ private function preBlogContent($type, &$blog)\r
+ {\r
global $manager;\r
$manager->notify('PreBlogContent',array('blog' => &$blog, 'type' => $type));\r
+ return;\r
}\r
\r
/**\r
- * Notifies the Manager that a PostBlogContent event occurs\r
+ * Actions::postBlogContent()\r
+ * Notifies the Manager that a PostBlogContent event occurs\r
+ * \r
+ * @param string $type type of skin\r
+ * @param objecct $blog an instance of Blog class\r
+ * @return void\r
*/\r
- function _postBlogContent($type, &$blog) {\r
+ private function postBlogContent($type, &$blog)\r
+ {\r
global $manager;\r
- $manager->notify('PostBlogContent',array('blog' => &$blog, 'type' => $type));\r
+ $manager->notify('PostBlogContent', array('blog' => &$blog, 'type' => $type));\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_additemform()\r
* Parse skinvar additemform\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_additemform() {\r
+ public function parse_additemform()\r
+ {\r
global $blog, $CONF;\r
$this->formdata = array(\r
- 'adminurl' => Entity::hsc($CONF['AdminURL']),\r
- 'catid' => $blog->getDefaultCategory()\r
+ 'adminurl' => Entity::hsc($CONF['AdminURL']),\r
+ 'catid' => $blog->getDefaultCategory()\r
);\r
$blog->InsertJavaScriptInfo();\r
$this->doForm('additemform');\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_addlink()\r
* Parse skinvar addlink\r
* A Link that allows to open a bookmarklet to add an item\r
*/\r
- function parse_addlink() {\r
+ public function parse_addlink()\r
+ {\r
global $CONF, $member, $blog;\r
- if ($member->isLoggedIn() && $member->isTeamMember($blog->blogid) ) {\r
+ if ( $member->isLoggedIn() && $member->isTeamMember($blog->blogid) )\r
+ {\r
echo $CONF['AdminURL'].'bookmarklet.php?blogid='.$blog->blogid;\r
}\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_addpopupcode()\r
* Parse skinvar addpopupcode\r
* Code that opens a bookmarklet in an popup window\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_addpopupcode() {\r
+ public function parse_addpopupcode()\r
+ {\r
echo "if (event && event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";\r
+ return;\r
}\r
\r
/**\r
* Parse skinvar adminurl\r
- * (shortcut for admin url) \r
+ * (shortcut for admin url)\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_adminurl() {\r
+ public function parse_adminurl()\r
+ {\r
$this->parse_sitevar('adminurl');\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_archive()\r
* Parse skinvar archive\r
+ * \r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @return \r
*/\r
- function parse_archive($template, $category = '') {\r
+ public function parse_archive($template, $category = '')\r
+ {\r
global $blog, $archive;\r
// can be used with either yyyy-mm or yyyy-mm-dd\r
- sscanf($archive,'%d-%d-%d',$y,$m,$d);\r
- $this->_setBlogCategory($blog, $category);\r
- $this->_preBlogContent('achive',$blog);\r
+ sscanf($archive,'%d-%d-%d', $y, $m, $d);\r
+ $this->setBlogCategory($blog, $category);\r
+ $this->preBlogContent('achive',$blog);\r
$blog->showArchive($template, $y, $m, $d);\r
- $this->_postBlogContent('achive',$blog);\r
-\r
+ $this->postBlogContent('achive',$blog);\r
+ return;\r
}\r
-\r
+ \r
/**\r
* Actions::parse_archivedate()\r
* %archivedate(locale,date format)%\r
* \r
- * @paramstring $locale\r
+ * @param string $locale\r
* @return void\r
- * \r
- */\r
- function parse_archivedate($locale = '-def-')\r
+ */\r
+ public function parse_archivedate($locale = '-def-')\r
{\r
global $archive;\r
\r
/* \r
- * these lines are no meaning because there is no $template.\r
- */\r
+ * TODO: these lines are no meaning because there is no $template.\r
if ( $locale == '-def-' )\r
{\r
- setlocale(LC_TIME,$template['LOCALE']);\r
+ setlocale(LC_TIME, $template['LOCALE']);\r
}\r
else\r
{\r
- setlocale(LC_TIME,$locale);\r
+ setlocale(LC_TIME, $locale);\r
}\r
+ */\r
\r
// get archive date\r
sscanf($archive,'%d-%d-%d',$y,$m,$d);\r
{\r
$format = '%d %B %Y';\r
}\r
- echo i18n::formatted_timedate($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));\r
+ echo i18n::formatted_datetime($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));\r
return;\r
}\r
-\r
+ \r
/**\r
- * Parse skinvar archivedaylist\r
- */ \r
- function parse_archivedaylist($template, $category = 'all', $limit = 0) {\r
+ * Actions::parse_archivedaylist()\r
+ * Parse skinvar archivedaylist\r
+ * \r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @param integer $limit the number of items in a display\r
+ * @return void\r
+ */\r
+ public function parse_archivedaylist($template, $category = 'all', $limit = 0)\r
+ {\r
global $blog;\r
- if ($category == 'all') $category = '';\r
- $this->_preBlogContent('archivelist',$blog);\r
- $this->_setBlogCategory($blog, $category);\r
+ if ( $category == 'all' )\r
+ {\r
+ $category = '';\r
+ }\r
+ $this->preBlogContent('archivelist',$blog);\r
+ $this->setBlogCategory($blog, $category);\r
$blog->showArchiveList($template, 'day', $limit);\r
- $this->_postBlogContent('archivelist',$blog);\r
+ $this->postBlogContent('archivelist',$blog);\r
+ return;\r
}\r
\r
/**\r
* Actions::parse_archivelink()\r
- * A link to the archives for the current blog (or for default blog)\r
- *\r
- * @param String $linktext text for link\r
- * @return Void\r
+ * A link to the archives for the current blog (or for default blog)\r
+ * \r
+ * @param string $linktext text for link\r
+ * @return void\r
*/\r
- function parse_archivelink($linktext = '')\r
+ public function parse_archivelink($linktext = '')\r
{\r
global $blog, $CONF;\r
if ( $blog )\r
{\r
- echo $this->_link(Link::create_archivelist_link($blog->getID(),$this->linkparams), $linktext);\r
+ echo $this->link(Link::create_archivelist_link($blog->getID(), $this->linkparams), $linktext);\r
}\r
else\r
{\r
- echo $this->_link(Link::create_archivelist_link(), $linktext);\r
+ echo $this->link(Link::create_archivelist_link(), $linktext);\r
}\r
return;\r
}\r
\r
- function parse_archivelist($template, $category = 'all', $limit = 0) {\r
+ /**\r
+ * Actions::parse_archivelist()\r
+ * \r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @param integer $limit the number of items in a display\r
+ * @return void\r
+ */\r
+ public function parse_archivelist($template, $category = 'all', $limit = 0)\r
+ {\r
global $blog;\r
- if ($category == 'all') $category = '';\r
- $this->_preBlogContent('archivelist',$blog);\r
- $this->_setBlogCategory($blog, $category);\r
+ if ( $category == 'all' )\r
+ {\r
+ $category = '';\r
+ }\r
+ $this->preBlogContent('archivelist',$blog);\r
+ $this->setBlogCategory($blog, $category);\r
$blog->showArchiveList($template, 'month', $limit);\r
- $this->_postBlogContent('archivelist',$blog);\r
+ $this->postBlogContent('archivelist',$blog);\r
+ return;\r
}\r
- \r
- function parse_archiveyearlist($template, $category = 'all', $limit = 0) {\r
+ \r
+ /**\r
+ * Actions::parse_archiveyearlist()\r
+ * \r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @param integer $limit the number of items in a display\r
+ */\r
+ public function parse_archiveyearlist($template, $category = 'all', $limit = 0)\r
+ {\r
global $blog;\r
- if ($category == 'all') $category = '';\r
- $this->_preBlogContent('archivelist',$blog);\r
- $this->_setBlogCategory($blog, $category);\r
+ if ( $category == 'all' )\r
+ {\r
+ $category = '';\r
+ }\r
+ $this->preBlogContent('archivelist',$blog);\r
+ $this->setBlogCategory($blog, $category);\r
$blog->showArchiveList($template, 'year', $limit);\r
- $this->_postBlogContent('archivelist',$blog);\r
+ $this->postBlogContent('archivelist',$blog);\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_archivetype()\r
* Parse skinvar archivetype\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_archivetype() {\r
+ public function parse_archivetype()\r
+ {\r
global $archivetype;\r
echo $archivetype;\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_blog()\r
* Parse skinvar blog\r
+ * \r
+ * @param string $template name of template\r
+ * @param mixed $amount the number of items in a display, in case it includes the beginning\r
+ * @param string $category name of category\r
+ * @return void\r
*/\r
- function parse_blog($template, $amount = 10, $category = '') {\r
+ public function parse_blog($template, $amount = 10, $category = '')\r
+ {\r
global $blog, $startpos;\r
-\r
+ \r
list($limit, $offset) = sscanf($amount, '%d(%d)');\r
- $this->_setBlogCategory($blog, $category);\r
- $this->_preBlogContent('blog',$blog);\r
+ $this->setBlogCategory($blog, $category);\r
+ $this->preBlogContent('blog',$blog);\r
$this->amountfound = $blog->readLog($template, $limit, $offset, $startpos);\r
- $this->_postBlogContent('blog',$blog);\r
+ $this->postBlogContent('blog',$blog);\r
+ return;\r
}\r
\r
- /*\r
- * Parse skinvar bloglist\r
- * Shows a list of all blogs\r
- * bnametype: whether 'name' or 'shortname' is used for the link text \r
- * orderby: order criteria\r
- * direction: order ascending or descending \r
- */\r
- function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc') {\r
+ /**\r
+ * Actions::parse_bloglist()\r
+ * Parse skinvar bloglist\r
+ * Shows a list of all blogs\r
+ * \r
+ * @param string $template name of template\r
+ * @param string $bnametype whether 'name' or 'shortname' is used for the link text\r
+ * @param string $orderby order criteria\r
+ * @param string $direction order ascending or descending \r
+ * @return void\r
+ */\r
+ public function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc')\r
+ {\r
Blog::showBlogList($template, $bnametype, $orderby, $direction);\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_blogsetting()\r
* Parse skinvar blogsetting\r
+ * \r
+ * @param string $which key of weblog settings\r
+ * @return void\r
*/\r
- function parse_blogsetting($which) {\r
+ public function parse_blogsetting($which)\r
+ {\r
global $blog;\r
- switch($which) {\r
+ switch( $which )\r
+ {\r
case 'id':\r
echo Entity::hsc($blog->getID());\r
break;\r
echo Entity::hsc($blog->getShortName());\r
break;\r
}\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_callback()\r
* Parse callback\r
+ * \r
+ * @param string $eventName name of event\r
+ * @param string $type type of skin\r
+ * @return void\r
*/\r
- function parse_callback($eventName, $type)\r
+ public function parse_callback($eventName, $type)\r
{\r
global $manager;\r
$manager->notify($eventName, array('type' => $type));\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_category()\r
* Parse skinvar category\r
+ * \r
+ * @param string $type key of category settings\r
+ * @return void\r
*/\r
- function parse_category($type = 'name') {\r
+ public function parse_category($type = 'name')\r
+ {\r
global $catid, $blog;\r
- if (!$blog->isValidCategory($catid))\r
+ if ( !$blog->isValidCategory($catid) )\r
+ {\r
return;\r
-\r
- switch($type) {\r
+ }\r
+ \r
+ switch ( $type )\r
+ {\r
case 'name':\r
echo $blog->getCategoryName($catid);\r
break;\r
echo $catid;\r
break;\r
}\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_categorylist()\r
* Parse categorylist\r
+ * \r
+ * @param string $template name of template\r
+ * @param string $blogname name of weblog\r
+ * @return void\r
*/\r
- function parse_categorylist($template, $blogname = '') {\r
+ public function parse_categorylist($template, $blogname = '')\r
+ {\r
global $blog, $manager;\r
-\r
+ \r
// when no blog found\r
- if (($blogname == '') && (!is_object($blog)))\r
+ if ( ($blogname == '') && (!is_object($blog)) )\r
+ {\r
return 0;\r
+ }\r
\r
- if ($blogname == '') {\r
- $this->_preBlogContent('categorylist',$blog);\r
+ if ( $blogname == '' )\r
+ {\r
+ $this->preBlogContent('categorylist',$blog);\r
$blog->showCategoryList($template);\r
- $this->_postBlogContent('categorylist',$blog);\r
- } else {\r
+ $this->postBlogContent('categorylist',$blog);\r
+ }\r
+ else\r
+ {\r
$b =& $manager->getBlog(getBlogIDFromName($blogname));\r
- $this->_preBlogContent('categorylist',$b);\r
+ $this->preBlogContent('categorylist',$b);\r
$b->showCategoryList($template);\r
- $this->_postBlogContent('categorylist',$b);\r
+ $this->postBlogContent('categorylist',$b);\r
}\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_charset()\r
* Parse skinvar charset\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_charset() {\r
+ public function parse_charset()\r
+ {\r
echo i18n::get_current_charset();\r
+ return;\r
}\r
\r
/**\r
* Actions::parse_commentform()\r
* Parse skinvar commentform\r
* \r
- * @param String $destinationurl URI for redirection\r
- * @return Void\r
+ * @param string $destinationurl URI for redirection\r
+ * @return void\r
*/\r
- function parse_commentform($destinationurl = '')\r
+ public function parse_commentform($destinationurl = '')\r
{\r
global $blog, $itemid, $member, $CONF, $manager, $DIR_LIBS, $errormessage;\r
\r
}\r
\r
/**\r
+ * Actions::parse_comments()\r
* Parse skinvar comments\r
- * include comments for one item \r
+ * include comments for one item\r
+ * \r
+ * @param string $template name of template\r
+ * @return void\r
*/\r
- function parse_comments($template) {\r
+ public function parse_comments($template)\r
+ {\r
global $itemid, $manager, $blog, $highlight;\r
$template =& $manager->getTemplate($template);\r
-\r
+ \r
// create parser object & action handler\r
$actions = new ItemActions($blog);\r
$parser = new Parser($actions->getDefinedActions(),$actions);\r
$actions->setParser($parser);\r
$item = Item::getitem($itemid, 0, 0);\r
$actions->setCurrentItem($item);\r
-\r
+ \r
$comments = new Comments($itemid);\r
$comments->setItemActions($actions);\r
- $comments->showComments($template, -1, 1, $highlight); // shows ALL comments\r
+ // shows ALL comments\r
+ $comments->showComments($template, -1, 1, $highlight);\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_errordiv()\r
* Parse errordiv\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_errordiv() {\r
+ public function parse_errordiv()\r
+ {\r
global $errormessage;\r
- if ($errormessage)\r
- echo '<div class="error">', Entity::hsc($errormessage),'</div>';\r
+ if ( $errormessage )\r
+ {\r
+ echo '<div class="error">' . Entity::hsc($errormessage) . "</div>\n";\r
+ }\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_errormessage()\r
* Parse skinvar errormessage\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_errormessage() {\r
+ public function parse_errormessage()\r
+ {\r
global $errormessage;\r
echo $errormessage;\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_formdata()\r
* Parse formdata\r
+ * \r
+ * @param string $what key of format data\r
+ * @return void\r
*/\r
- function parse_formdata($what) {\r
+ public function parse_formdata($what)\r
+ {\r
echo $this->formdata[$what];\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_ifcat()\r
* Parse ifcat\r
+ * \r
+ * @param string $text\r
+ * @return void\r
*/\r
- function parse_ifcat($text = '') {\r
- if ($text == '') {\r
+ public function parse_ifcat($text = '')\r
+ {\r
+ if ( $text == '' )\r
+ {\r
// new behaviour\r
$this->parse_if('category');\r
- } else {\r
+ }\r
+ else\r
+ {\r
// old behaviour\r
global $catid, $blog;\r
- if ($blog->isValidCategory($catid))\r
+ if ( $blog->isValidCategory($catid) )\r
+ {\r
echo $text;\r
+ }\r
}\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_image()\r
* Parse skinvar image\r
+ * \r
+ * @param string $what name of tag\r
+ * @return void\r
*/\r
- function parse_image($what = 'imgtag') {\r
+ public function parse_image($what = 'imgtag')\r
+ {\r
global $CONF;\r
-\r
+ \r
$imagetext = Entity::hsc(requestVar('imagetext'));\r
$imagepopup = requestVar('imagepopup');\r
$width = intRequestVar('width');\r
$height = intRequestVar('height');\r
$fullurl = Entity::hsc($CONF['MediaURL'] . $imagepopup);\r
-\r
- switch($what)\r
+ \r
+ switch ( $what )\r
{\r
case 'url':\r
echo $fullurl;\r
echo "<img src=\"$fullurl\" width=\"$width\" height=\"$height\" alt=\"$imagetext\" title=\"$imagetext\" />";\r
break;\r
}\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_imagetext()\r
* Parse skinvar imagetext\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_imagetext() {\r
- echo Entity::hsc(requestVar('imagetext'));\r
+ public function parse_imagetext()\r
+ {\r
+ $this->parse_image('imagetext');\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_item()\r
* Parse skinvar item\r
- * include one item (no comments) \r
+ * include one item (no comments)\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_item($template) {\r
+ public function parse_item($template)\r
+ {\r
global $blog, $itemid, $highlight;\r
- $this->_setBlogCategory($blog, ''); // need this to select default category\r
- $this->_preBlogContent('item',$blog);\r
+ \r
+ // need this to select default category\r
+ $this->setBlogCategory($blog, '');\r
+ $this->preBlogContent('item',$blog);\r
$r = $blog->showOneitem($itemid, $template, $highlight);\r
- if ($r == 0)\r
+ if ( $r == 0 )\r
+ {\r
echo _ERROR_NOSUCHITEM;\r
- $this->_postBlogContent('item',$blog);\r
+ }\r
+ $this->postBlogContent('item',$blog);\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_itemid()\r
* Parse skinvar itemid\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_itemid() {\r
+ public function parse_itemid()\r
+ {\r
global $itemid;\r
echo $itemid;\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parseitemlink()\r
* Parse skinvar itemlink\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_itemlink($linktext = '') {\r
+ public function parse_itemlink($linktext = '')\r
+ {\r
global $itemid;\r
- $this->_itemlink($itemid, $linktext);\r
+ $this->itemlink($itemid, $linktext);\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_itemtitle()\r
* Parse itemtitle\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_itemtitle($format = '') {\r
+ public function parse_itemtitle($format = '')\r
+ {\r
global $manager, $itemid;\r
$item =& $manager->getItem($itemid,0,0);\r
-\r
- switch ($format) {\r
+ \r
+ switch ( $format )\r
+ {\r
case 'xml':\r
echo Entity::hen($item['title']);\r
break;\r
echo Entity::hsc(strip_tags($item['title']));\r
break;\r
}\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_loginform()\r
* Parse skinvar loginform\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_loginform() {\r
+ public function parse_loginform()\r
+ {\r
global $member, $CONF;\r
- if (!$member->isLoggedIn()) {\r
+ if ( !$member->isLoggedIn() )\r
+ {\r
$filename = 'loginform-notloggedin';\r
$this->formdata = array();\r
- } else {\r
+ }\r
+ else\r
+ {\r
$filename = 'loginform-loggedin';\r
$this->formdata = array(\r
'membername' => $member->getDisplayName(),\r
);\r
}\r
$this->doForm($filename);\r
+ return;\r
}\r
-\r
+ \r
/**\r
* Actions::parse_member()\r
* Parse skinvar member\r
* (includes a member info thingie)\r
* \r
- * @param String $what which memberdata is needed\r
- * @return Void\r
+ * @param string $what which memberdata is needed\r
+ * @return void\r
*/\r
- function parse_member($what)\r
+ public function parse_member($what)\r
{\r
global $memberinfo, $member, $CONF;\r
\r
// 1. only allow the member-details-page specific variables on member pages\r
- if ($this->skintype == 'member')\r
+ if ( $this->skintype == 'member' )\r
{\r
switch( $what )\r
{\r
}\r
return;\r
}\r
-\r
+ \r
/**\r
* Link::parse_membermailform()\r
* Parse skinvar membermailform\r
* \r
- * @param Integer $rows the height for textarea\r
- * @param Integer $cols the width for textarea\r
- * @param String $desturl URI to redirect\r
- * @return Void\r
+ * @param integer $rows the height for textarea\r
+ * @param integer $cols the width for textarea\r
+ * @param string $desturl URI to redirect\r
+ * @return void\r
*/\r
- function parse_membermailform($rows = 10, $cols = 40, $desturl = '')\r
+ public function parse_membermailform($rows = 10, $cols = 40, $desturl = '')\r
{\r
global $member, $CONF, $memberid;\r
\r
}\r
\r
/**\r
+ * Actions::parse_nextarchive()\r
* Parse skinvar nextarchive\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_nextarchive() {\r
+ public function parse_nextarchive()\r
+ {\r
global $archivenext;\r
echo $archivenext;\r
+ return;\r
}\r
-\r
+ \r
/**\r
* Parse skinvar nextitem\r
* (include itemid of next item)\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_nextitem() {\r
+ public function parse_nextitem()\r
+ {\r
global $itemidnext;\r
- if (isset($itemidnext)) echo (int)$itemidnext;\r
+ if ( isset($itemidnext) )\r
+ {\r
+ echo (int)$itemidnext;\r
+ }\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_nextitemtitle()\r
* Parse skinvar nextitemtitle\r
* (include itemtitle of next item)\r
+ * \r
+ * @param string $format format of text\r
+ * @return void\r
*/\r
- function parse_nextitemtitle($format = '') {\r
+ public function parse_nextitemtitle($format = '')\r
+ {\r
global $itemtitlenext;\r
-\r
+ \r
switch ( $format )\r
{\r
case 'xml':\r
echo Entity::hsc($itemtitlenext);\r
break;\r
}\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_nextlink()\r
* Parse skinvar nextlink\r
+ * \r
+ * @param string $linktext text for content of anchor element\r
+ * @param integer $amount the amount of items in a display\r
+ * @param integer $recount increment from this value\r
+ * @return void\r
*/\r
- function parse_nextlink($linktext = '', $amount = 10, $recount = '') {\r
+ public function parse_nextlink($linktext = '', $amount = 10, $recount = '')\r
+ {\r
global $itemidnext, $archivenext, $startpos;\r
- if ($this->skintype == 'item')\r
- $this->_itemlink($itemidnext, $linktext);\r
- else if ($this->skintype == 'search' || $this->skintype == 'index')\r
- $this->_searchlink($amount, $startpos, 'next', $linktext, $recount);\r
+ if ( $this->skintype == 'item' )\r
+ {\r
+ $this->itemlink($itemidnext, $linktext);\r
+ }\r
+ else if ( $this->skintype == 'search' || $this->skintype == 'index' )\r
+ {\r
+ $this->searchlink($amount, $startpos, 'next', $linktext, $recount);\r
+ }\r
else\r
- $this->_archivelink($archivenext, $linktext);\r
+ {\r
+ $this->archivelink($archivenext, $linktext);\r
+ }\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_nucleusbutton()\r
* Parse skinvar nucleusbutton\r
+ * \r
+ * @param string $imgurl URL for image\r
+ * @param integer $imgwidth width of image\r
+ * @param integer $imgheidht height of image\r
*/\r
- function parse_nucleusbutton($imgurl = '',\r
- $imgwidth = '85',\r
- $imgheight = '31') {\r
+ public function parse_nucleusbutton($imgurl = '', $imgwidth = '85', $imgheight = '31')\r
+ {\r
global $CONF;\r
- if ($imgurl == '') {\r
+ if ( $imgurl == '' )\r
+ {\r
$imgurl = $CONF['AdminURL'] . 'nucleus.gif';\r
- } else if (Parser::getProperty('IncludeMode') == 'skindir'){\r
+ }\r
+ else if ( Parser::getProperty('IncludeMode') == 'skindir' )\r
+ {\r
// when skindit IncludeMode is used: start from skindir\r
$imgurl = $CONF['SkinsURL'] . Parser::getProperty('IncludePrefix') . $imgurl;\r
}\r
-\r
+ \r
$this->formdata = array(\r
'imgurl' => $imgurl,\r
'imgwidth' => $imgwidth,\r
'imgheight' => $imgheight,\r
);\r
$this->doForm('nucleusbutton');\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_otherarchive()\r
* Parse skinvar otherarchive\r
+ * \r
+ * @param string $blogname name of weblog\r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @return void\r
*/ \r
- function parse_otherarchive($blogname, $template, $category = '') {\r
+ public function parse_otherarchive($blogname, $template, $category = '')\r
+ {\r
global $archive, $manager;\r
sscanf($archive,'%d-%d-%d',$y,$m,$d);\r
$b =& $manager->getBlog(getBlogIDFromName($blogname));\r
- $this->_setBlogCategory($b, $category);\r
- $this->_preBlogContent('otherachive',$b);\r
+ $this->setBlogCategory($b, $category);\r
+ $this->preBlogContent('otherachive',$b);\r
$b->showArchive($template, $y, $m, $d);\r
- $this->_postBlogContent('otherachive',$b);\r
+ $this->postBlogContent('otherachive',$b);\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_otherarchivedaylist()\r
* Parse skinvar otherarchivedaylist\r
+ * \r
+ * @param string $blogname name of weblog\r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @param integer $limit the amount of items in a display\r
+ * @return void\r
*/\r
- function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0) {\r
+ public function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0)\r
+ {\r
global $manager;\r
- if ($category == 'all') $category = '';\r
+ if ( $category == 'all')\r
+ {\r
+ $category = '';\r
+ }\r
$b =& $manager->getBlog(getBlogIDFromName($blogname));\r
- $this->_setBlogCategory($b, $category);\r
- $this->_preBlogContent('otherarchivelist',$b);\r
+ $this->setBlogCategory($b, $category);\r
+ $this->preBlogContent('otherarchivelist',$b);\r
$b->showArchiveList($template, 'day', $limit);\r
- $this->_postBlogContent('otherarchivelist',$b);\r
+ $this->postBlogContent('otherarchivelist',$b);\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_otherarchivelist()\r
* Parse skinvar otherarchivelist\r
+ * \r
+ * @param string $blogname name of weblog\r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @param integer $limit the amount of items in a display\r
+ * @return void\r
*/\r
- function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0) {\r
+ public function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0)\r
+ {\r
global $manager;\r
- if ($category == 'all') $category = '';\r
+ if ( $category == 'all' )\r
+ {\r
+ $category = '';\r
+ }\r
$b =& $manager->getBlog(getBlogIDFromName($blogname));\r
- $this->_setBlogCategory($b, $category);\r
- $this->_preBlogContent('otherarchivelist',$b);\r
+ $this->setBlogCategory($b, $category);\r
+ $this->preBlogContent('otherarchivelist',$b);\r
$b->showArchiveList($template, 'month', $limit);\r
- $this->_postBlogContent('otherarchivelist',$b);\r
+ $this->postBlogContent('otherarchivelist',$b);\r
+ return;\r
}\r
- \r
+ \r
/**\r
+ * Actions::parse_otherarchiveyearlist()\r
* Parse skinvar otherarchiveyearlist\r
+ * \r
+ * @param string $blogname name of weblog\r
+ * @param string $template name of template\r
+ * @param string $category name of category\r
+ * @limit integer $limit the amount of items in a display\r
*/\r
- function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0) {\r
+ public function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0)\r
+ {\r
global $manager;\r
- if ($category == 'all') $category = '';\r
+ if ( $category == 'all' )\r
+ {\r
+ $category = '';\r
+ }\r
$b =& $manager->getBlog(getBlogIDFromName($blogname));\r
- $this->_setBlogCategory($b, $category);\r
- $this->_preBlogContent('otherarchivelist',$b);\r
+ $this->setBlogCategory($b, $category);\r
+ $this->preBlogContent('otherarchivelist',$b);\r
$b->showArchiveList($template, 'year', $limit);\r
- $this->_postBlogContent('otherarchivelist',$b);\r
- } \r
+ $this->postBlogContent('otherarchivelist',$b);\r
+ return;\r
+ }\r
\r
/**\r
+ * Actions::parse_otherblog()\r
* Parse skinvar otherblog\r
+ * \r
+ * @param string $blogname name of weblog\r
+ * @param string $template name of template\r
+ * @param mixed $amount the amount of items, in case it includes the beginning\r
+ * @param string $category name of category\r
+ * @return void\r
*/\r
- function parse_otherblog($blogname, $template, $amount = 10, $category = '') {\r
+ public function parse_otherblog($blogname, $template, $amount = 10, $category = '')\r
+ {\r
global $manager;\r
-\r
+ \r
list($limit, $offset) = sscanf($amount, '%d(%d)');\r
-\r
+ \r
$b =& $manager->getBlog(getBlogIDFromName($blogname));\r
- $this->_setBlogCategory($b, $category);\r
- $this->_preBlogContent('otherblog',$b);\r
+ $this->setBlogCategory($b, $category);\r
+ $this->preBlogContent('otherblog',$b);\r
$this->amountfound = $b->readLog($template, $limit, $offset);\r
- $this->_postBlogContent('otherblog',$b);\r
+ $this->postBlogContent('otherblog',$b);\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_othersearchresults()\r
* Parse skinvar othersearchresults\r
+ * \r
+ * @param string $blogname name of weblog\r
+ * @param string $template name of template\r
+ * @param integer $maxresults the amount of results\r
+ * @return void\r
*/\r
- function parse_othersearchresults($blogname, $template, $maxresults = 50) {\r
+ public function parse_othersearchresults($blogname, $template, $maxresults = 50)\r
+ {\r
global $query, $amount, $manager, $startpos;\r
$b =& $manager->getBlog(getBlogIDFromName($blogname));\r
- $this->_setBlogCategory($b, ''); // need this to select default category\r
- $this->_preBlogContent('othersearchresults',$b);\r
+ // need this to select default category\r
+ $this->setBlogCategory($b, '');\r
+ $this->preBlogContent('othersearchresults',$b);\r
$b->search($query, $template, $amount, $maxresults, $startpos);\r
- $this->_postBlogContent('othersearchresults',$b);\r
+ $this->postBlogContent('othersearchresults',$b);\r
+ return;\r
}\r
-\r
+ \r
/**\r
- * Executes a plugin skinvar\r
- *\r
- * @param pluginName name of plugin (without the NP_)\r
- *\r
- * extra parameters can be added\r
- */\r
- function parse_plugin($pluginName) {\r
+ * Actions::parse_plugin()\r
+ * Executes a plugin skinvar\r
+ * extra parameters can be added\r
+ * \r
+ * @param string $pluginName name of plugin (without the NP_)\r
+ * @return void\r
+ */\r
+ public function parse_plugin($pluginName)\r
+ {\r
global $manager;\r
-\r
- // should be already tested from the parser (PARSER.php)\r
- // only continue when the plugin is really installed\r
- /*if (!$manager->pluginInstalled('NP_' . $pluginName))\r
- return;*/\r
-\r
+ \r
$plugin =& $manager->getPlugin('NP_' . $pluginName);\r
- if (!$plugin) return;\r
-\r
+ if ( !$plugin )\r
+ {\r
+ return;\r
+ }\r
+ \r
// get arguments\r
$params = func_get_args();\r
-\r
+ \r
// remove plugin name\r
array_shift($params);\r
-\r
+ \r
// add skin type on front\r
array_unshift($params, $this->skintype);\r
-\r
+ \r
call_user_func_array(array(&$plugin,'doSkinVar'), $params);\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_prevarchive()\r
* Parse skinvar prevarchive\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_prevarchive() {\r
+ public function parse_prevarchive()\r
+ {\r
global $archiveprev;\r
echo $archiveprev;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_preview()\r
* Parse skinvar preview\r
+ * \r
+ * @param string $template name of tempalte\r
+ * @return void\r
*/\r
- function parse_preview($template) {\r
+ public function parse_preview($template)\r
+ {\r
global $blog, $CONF, $manager;\r
-\r
+ \r
$template =& $manager->getTemplate($template);\r
+ \r
$row['body'] = '<span id="prevbody"></span>';\r
$row['title'] = '<span id="prevtitle"></span>';\r
$row['more'] = '<span id="prevmore"></span>';\r
$row['itemlink'] = '';\r
$row['itemid'] = 0; $row['blogid'] = $blog->getID();\r
+ \r
echo Template::fill($template['ITEM_HEADER'],$row);\r
echo Template::fill($template['ITEM'],$row);\r
echo Template::fill($template['ITEM_FOOTER'],$row);\r
+ return;\r
}\r
-\r
- /*\r
+ \r
+ /**\r
+ * Actions::parse_previtem()\r
* Parse skinvar previtem\r
- * (include itemid of prev item) \r
+ * (include itemid of prev item)\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_previtem() {\r
+ public function parse_previtem()\r
+ {\r
global $itemidprev;\r
- if (isset($itemidprev)) echo (int)$itemidprev;\r
+ if ( isset($itemidprev) )\r
+ {\r
+ echo (integer) $itemidprev;\r
+ }\r
+ return;\r
}\r
\r
/**\r
* @param String $format string format\r
* @return String formatted string\r
*/\r
- function parse_previtemtitle($format = '')\r
+ public function parse_previtemtitle($format = '')\r
{\r
global $itemtitleprev;\r
\r
}\r
\r
/**\r
+ * Actions::parse_prevlink()\r
* Parse skinvar prevlink\r
+ * \r
+ * @param string $linktext text as a content of anchor element\r
+ * @param integer the amount of links\r
+ * @return void\r
*/\r
- function parse_prevlink($linktext = '', $amount = 10) {\r
+ public function parse_prevlink($linktext = '', $amount = 10)\r
+ {\r
global $itemidprev, $archiveprev, $startpos;\r
-\r
- if ($this->skintype == 'item')\r
- $this->_itemlink($itemidprev, $linktext);\r
- else if ($this->skintype == 'search' || $this->skintype == 'index')\r
- $this->_searchlink($amount, $startpos, 'prev', $linktext);\r
+ \r
+ if ( $this->skintype == 'item' )\r
+ {\r
+ $this->itemlink($itemidprev, $linktext);\r
+ }\r
+ else if ( $this->skintype == 'search' || $this->skintype == 'index' )\r
+ {\r
+ $this->searchlink($amount, $startpos, 'prev', $linktext);\r
+ }\r
else\r
- $this->_archivelink($archiveprev, $linktext);\r
+ {\r
+ $this->archivelink($archiveprev, $linktext);\r
+ }\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_query()\r
* Parse skinvar query\r
* (includes the search query) \r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_query() {\r
+ public function parse_query()\r
+ {\r
global $query;\r
echo Entity::hsc($query);\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_referer()\r
* Parse skinvar referer\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_referer() {\r
+ public function parse_referer()\r
+ {\r
echo Entity::hsc(serverVar('HTTP_REFERER'));\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_searchform()\r
* Parse skinvar searchform\r
+ * \r
+ * @param string $blogname name of weblog\r
+ * @return void\r
*/\r
- function parse_searchform($blogname = '') {\r
+ public function parse_searchform($blogname = '')\r
+ {\r
global $CONF, $manager, $maxresults;\r
- if ($blogname) {\r
+ if ( $blogname )\r
+ {\r
$blog =& $manager->getBlog(getBlogIDFromName($blogname));\r
- } else {\r
+ }\r
+ else\r
+ {\r
global $blog;\r
}\r
// use default blog when no blog is selected\r
$this->formdata = array(\r
- 'id' => $blog?$blog->getID():$CONF['DefaultBlog'],\r
- 'query' => Entity::hsc(getVar('query')),\r
+ 'id' => $blog?$blog->getID():$CONF['DefaultBlog'],\r
+ 'query' => Entity::hsc(getVar('query')),\r
);\r
$this->doForm('searchform');\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_searchresults()\r
* Parse skinvar searchresults\r
+ * \r
+ * @param string $template name of tempalte\r
+ * @param integer $maxresults searched items in a display\r
+ * @return void;\r
*/\r
- function parse_searchresults($template, $maxresults = 50 ) {\r
+ public function parse_searchresults($template, $maxresults = 50 )\r
+ {\r
global $blog, $query, $amount, $startpos;\r
-\r
- $this->_setBlogCategory($blog, ''); // need this to select default category\r
- $this->_preBlogContent('searchresults',$blog);\r
+ \r
+ $this->setBlogCategory($blog, ''); // need this to select default category\r
+ $this->preBlogContent('searchresults',$blog);\r
$this->amountfound = $blog->search($query, $template, $amount, $maxresults, $startpos);\r
- $this->_postBlogContent('searchresults',$blog);\r
+ $this->postBlogContent('searchresults',$blog);\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_self()\r
* Parse skinvar self\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_self() {\r
+ public function parse_self()\r
+ {\r
global $CONF;\r
echo $CONF['Self'];\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_sitevar()\r
* Parse skinvar sitevar\r
- * (include a sitevar) \r
+ * (include a sitevar)\r
+ * \r
+ * @param string $which\r
+ * @return void\r
*/\r
- function parse_sitevar($which) {\r
+ public function parse_sitevar($which)\r
+ {\r
global $CONF;\r
- switch($which) {\r
+ switch ( $which )\r
+ {\r
case 'url':\r
echo $CONF['IndexURL'];\r
break;\r
case 'adminurl':\r
echo $CONF['AdminURL'];\r
}\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_skinname()\r
* Parse skinname\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_skinname() {\r
+ public function parse_skinname()\r
+ {\r
echo $this->skin->getName();\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_skintype()\r
* Parse skintype (experimental)\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_skintype() {\r
+ public function parse_skintype()\r
+ {\r
echo $this->skintype;\r
+ return;\r
}\r
-\r
+ \r
/**\r
+ * Actions::parse_text()\r
* Parse text\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_text($which) {\r
+ public function parse_text($which)\r
+ {\r
// constant($which) only available from 4.0.4 :(\r
- if (defined($which)) {\r
+ if ( defined($which) )\r
+ {\r
eval("echo $which;");\r
}\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_ticket()\r
* Parse ticket\r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_ticket() {\r
+ public function parse_ticket()\r
+ {\r
global $manager;\r
$manager->addTicketHidden();\r
+ return;\r
}\r
\r
/**\r
* Parse skinvar todaylink\r
* A link to the today page (depending on selected blog, etc...)\r
*\r
- * @param String $linktext text for link\r
- * @return Void\r
+ * @param string $linktext text for link\r
+ * @return void\r
*/\r
- function parse_todaylink($linktext = '')\r
+ public function parse_todaylink($linktext = '')\r
{\r
global $blog, $CONF;\r
if ( $blog )\r
{\r
- echo $this->_link(Link::create_blogid_link($blog->getID(),$this->linkparams), $linktext);\r
+ echo $this->link(Link::create_blogid_link($blog->getID(),$this->linkparams), $linktext);\r
}\r
else\r
{\r
- echo $this->_link($CONF['SiteUrl'], $linktext);\r
+ echo $this->link($CONF['SiteUrl'], $linktext);\r
}\r
return;\r
}\r
/**\r
* Parse vars\r
* When commentform is not used, to include a hidden field with itemid \r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_vars() {\r
+ public function parse_vars()\r
+ {\r
global $itemid;\r
- echo '<input type="hidden" name="itemid" value="'.$itemid.'" />';\r
+ echo '<input type="hidden" name="itemid" value="'.$itemid.'" />' . "\n";\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_version()\r
* Parse skinvar version\r
* (include nucleus versionnumber) \r
+ * \r
+ * @param void\r
+ * @return void\r
*/\r
- function parse_version() {\r
+ public function parse_version()\r
+ {\r
global $nucleus;\r
echo 'Nucleus CMS ' . $nucleus['version'];\r
+ return;\r
}\r
\r
/**\r
+ * Actions::parse_sticky()\r
* Parse skinvar sticky\r
+ * \r
+ * @param integer $itemnumber id of item\r
+ * @param string $template name of template\r
+ * @return void\r
*/\r
- function parse_sticky($itemnumber = 0, $template = '') {\r
+ public function parse_sticky($itemnumber = 0, $template = '')\r
+ {\r
global $manager;\r
\r
$itemnumber = intval($itemnumber);\r
$itemarray = array($itemnumber);\r
-\r
+ \r
$b =& $manager->getBlog(getBlogIDFromItemID($itemnumber));\r
- $this->_preBlogContent('sticky',$b);\r
+ $this->preBlogContent('sticky',$b);\r
$this->amountfound = $b->readLogFromList($itemarray, $template);\r
- $this->_postBlogContent('sticky',$b);\r
+ $this->postBlogContent('sticky',$b);\r
+ return;\r
}\r
-\r
-\r
}\r