<?php\r
/*\r
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2012 The Nucleus Group\r
+ * Copyright (C) 2002-2009 The Nucleus Group\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
* This class is used when parsing comment templates\r
*\r
* @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2012 The Nucleus Group\r
+ * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
* @version $Id: CommentActions.php 1626 2012-01-09 15:46:54Z sakamocchi $\r
*/\r
\r
class CommentActions extends BaseActions\r
{\r
- // ref to COMMENTS object which is using this object to handle\r
- // its templatevars\r
+ /**\r
+ * CommentsActions::$commentsObj\r
+ * ref to COMMENTS object which is using this object to handle its templatevars\r
+ */\r
private $commentsObj;\r
\r
- // template to use to parse the comments\r
+ /**\r
+ * CommentsActions::$template\r
+ * template to use to parse the comments\r
+ */\r
private $template;\r
\r
- // comment currenlty being handled (mysql result assoc array; see Comments::showComments())\r
+ /**\r
+ * CommentsActions::$currentComment\r
+ * comment currenlty being handled (mysql result assoc array; see Comments::showComments())\r
+ */\r
private $currentComment;\r
\r
+ /**\r
+ * CommentsActions::$defined_actions\r
+ * defined actions in this class\r
+ */\r
static private $defined_actions = array(\r
+ 'authtext',
+ 'blogid',
'blogurl',\r
+ 'body',
'commentcount',\r
+ 'commentid',
'commentword',\r
+ 'date',
'email',\r
+ 'excerpt',
+ 'host',
+ 'ip',
+ 'itemid',
'itemlink',\r
- 'itemid',\r
'itemtitle',\r
- 'date',\r
+ 'memberid',
+ 'plugin',
+ 'short',
'time',\r
- 'commentid',\r
- 'body',\r
- 'memberid',\r
'timestamp',\r
- 'host',\r
- 'ip',\r
- 'blogid',\r
- 'authtext',\r
'user',\r
+ 'useremail',
'userid',\r
+ 'userlink',
'userlinkraw',\r
- 'userlink',\r
- 'useremail',\r
'userwebsite',\r
- 'userwebsitelink',\r
- 'excerpt',\r
- 'short',\r
- 'skinfile',\r
- 'set',\r
- 'plugin',\r
- 'include',\r
- 'phpinclude',\r
- 'parsedinclude',\r
- 'if',\r
- 'else',\r
- 'endif',\r
- 'elseif',\r
- 'ifnot',\r
- 'elseifnot'\r
+ 'userwebsitelink'
);\r
\r
/**\r
public function __construct(&$comments)\r
{\r
// call constructor of superclass first\r
- $this->BaseActions();\r
+ parent::__construct();
\r
// reference to the comments object\r
$this->setCommentsObj($comments);\r
/**\r
* CommentActions::getDefinedActions()\r
* \r
+ * @static
* @param void\r
* @return array actions array\r
*/\r
- public function getDefinedActions()\r
+ static public function getDefinedActions()
{\r
- return self::$defined_actions;\r
+ return array_merge(self::$defined_actions, parent::getDefinedActions());
}\r
\r
/**\r
*/\r
public function parse_time($format = '')\r
{\r
- if ( $format === '' )\r
+ if ( $format !== '' )
{\r
/* do nothing */\r
;\r
}\r
\r
/**\r
- * CommentActions::checkCondition()\r
+ * ItemActions::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\r
*/\r
- private function checkCondition($field, $name='', $value = '') {\r
+ protected function checkCondition($field, $name='', $value = '') {\r
global $catid, $blog, $member, $itemidnext, $itemidprev, $manager, $archiveprevexists, $archivenextexists;\r
$condition = 0;\r
switch ( $field )\r
* CommentActions::ifCategory()\r
* Different checks for a category\r
* \r
- * @param void\r
- * @return void\r
+ * @param string $key key of category\r
+ * @param string $value value for key of category\r
+ * @return boolean\r
*/\r
- private function ifCategory($name = '', $value = '')\r
+ private function ifCategory($key = '', $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
+ if ( ($key != 'catname' && $key != 'catid') || ($value == '') )\r
{\r
return $blog->isValidCategory($catid);\r
}\r
\r
// check category name\r
- if ( $name == 'catname' )\r
+ if ( $key == 'catname' )\r
{\r
$value = $blog->getCategoryIdFromName($value);\r
if ($value == $catid)\r
}\r
\r
// check category id\r
- if ( ($name == 'catid') && ($value == $catid) )\r
+ if ( ($key == 'catid') && ($value == $catid) )\r
{\r
return $blog->isValidCategory($catid);\r
}\r
* CommentActions::ifOnTeam()\r
* Checks if a member is on the team of a blog and return his rights\r
* \r
- * @param void\r
- * @return void\r
+ * @param string $blogName name of weblog\r
+ * @return boolean correct or not\r
*/\r
private function ifOnTeam($blogName = '')\r
{\r
* CommentActions::ifAdmin()\r
* Checks if a member is admin of a blog\r
* \r
- * @param void\r
- * @return void\r
+ * @param string $blogName name of weblog\r
+ * @return boolean correct or not\r
*/\r
private function ifAdmin($blogName = '')\r
{\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 name (and value) of plugin option\r
- * @return boolean\r
+ * @param string $value key (and value) of plugin option\r
+ * @return boolean correct or not\r
*/\r
private function ifHasPlugin($name, $value)\r
{\r
* Checks if a plugin exists and call its doIf function\r
* \r
* @param string $name name of plugin\r
- * @param string $key key for confition\r
- * @param string $value value for contdition\r
+ * @param string $key key of plugin option\r
+ * @param string $value value of plugin option\r
+ * @return boolean callback output from plugin\r
*/\r
private function ifPlugin($name, $key = '', $value = '')\r
{\r
return call_user_func_array(array(&$plugin, 'doIf'), $params);\r
}\r
}\r
-\r