}\r
\r
/**\r
+ * BodyActions::getAvailableActions()\r
+ * Get the defined actions in an item\r
+ * \r
+ * @param void\r
+ * @return array self::$defined_actions\r
+ */\r
+ public function getAvailableActions()\r
+ {\r
+ return array_merge(self::$defined_actions, parent::getAvailableActions());\r
+ }\r
+ \r
+ /**\r
* BodyActions::setCurrentItem()\r
* Set the current item\r
* \r
{\r
global $currentitemid;\r
$this->currentItem =& $item;\r
- $currentitemid = $this->currentItem->itemid;\r
+ $currentitemid = $this->currentItem['itemid'];\r
return;\r
}\r
\r
}\r
\r
/**\r
- * BodyActions::getDefinedActions()\r
- * Get the defined actions in an item\r
- * \r
- * @static
- * @param void\r
- * @return Array self::$defined_actions\r
- */\r
- static public function getDefinedActions()
- {\r
- return array_merge(self::$defined_actions, parent::getDefinedActions());
- }\r
- \r
- /**\r
* BodyActions::parse_plugin()\r
* Parse a plugin var\r
* Called if <%plugin(...)%> in an item appears\r
array_shift($params);\r
\r
// add item reference (array_unshift didn't work)\r
- $params = array_merge(array(&$this->currentItem),$params);\r
+ $params = array_merge(array(&$this->currentItem), $params);\r
\r
- call_user_func_array(array(&$plugin,'doItemVar'), $params);\r
+ call_user_func_array(array(&$plugin, 'doItemVar'), $params);\r
return;\r
}\r
\r
{\r
// image/popup calls have arguments separated by |\r
$args = func_get_args();\r
- $args = preg_split('#\|#',implode($args,', '));\r
- echo call_user_func_array(array(&$this,'createImageCode'),$args);\r
+ $args = preg_split('#\|#', implode($args, ', '));\r
+ echo call_user_func_array(array(&$this, 'createImageCode'), $args);\r
}\r
\r
/**\r
global $CONF;\r
\r
// select private collection when no collection given\r
- if ( !strstr($filename,'/') )\r
+ if ( i18n::strpos($filename, '/') === FALSE )\r
{\r
- $filename = $this->currentItem->authorid . '/' . $filename;\r
+ $filename = $this->currentItem['authorid'] . '/' . $filename;\r
}\r
\r
$windowwidth = $width;\r
$windowheight = $height;\r
\r
- $vars['link'] = Entity::hsc($CONF['MediaURL']. $filename);\r
- $vars['text'] = Entity::hsc($text);\r
- $vars['image'] = '<img src="' . $vars['link'] . '" width="' . $width . '" height="' . $height . '" alt="' . $vars['text'] . '" title="' . $vars['text'] . '" />';\r
- $vars['width'] = $width;\r
- $vars['height'] = $height;\r
- $vars['media'] = '<a href="' . $vars['link'] . '">' . $vars['text'] . '</a>';\r
+ $vars['link'] = Entity::hsc($CONF['MediaURL']. $filename);\r
+ $vars['text'] = Entity::hsc($text);\r
+ $vars['image'] = '<img src="' . $vars['link'] . '" width="' . $width . '" height="' . $height . '" alt="' . $vars['text'] . '" title="' . $vars['text'] . '" />';\r
+ $vars['width'] = $width;\r
+ $vars['height'] = $height;\r
+ $vars['media'] = '<a href="' . $vars['link'] . '">' . $vars['text'] . '</a>';\r
\r
return Template::fill($this->template['IMAGE_CODE'], $vars);
}\r
{\r
// image/popup calls have arguments separated by |\r
$args = func_get_args();\r
- $args = preg_split('#\|#', implode($args,', '));\r
- echo call_user_func_array(array(&$this,'createMediaCode'), $args);\r
+ $args = preg_split('#\|#', implode($args, ', '));\r
+ echo call_user_func_array(array(&$this, 'createMediaCode'), $args);\r
}\r
\r
/**\r
global $CONF;\r
\r
// select private collection when no collection given\r
- if ( !strstr($filename,'/') )\r
+ if ( i18n::strpos($filename, '/') === FALSE )\r
{\r
- $filename = $this->currentItem->authorid . '/' . $filename;\r
+ $filename = $this->currentItem['authorid'] . '/' . $filename;\r
}\r
\r
$vars['link'] = Entity::hsc($CONF['MediaURL'] . $filename);\r
{\r
// image/popup calls have arguments separated by |\r
$args = func_get_args();\r
- $args = preg_split('#\|#', implode($args,', '));\r
- echo call_user_func_array(array(&$this,'createPopupCode'), $args);\r
+ $args = preg_split('#\|#', implode($args, ', '));\r
+ echo call_user_func_array(array(&$this, 'createPopupCode'), $args);\r
}\r
\r
/**\r
global $CONF;\r
\r
// select private collection when no collection given\r
- if ( !strstr($filename,'/') )\r
+ if ( i18n::strpos($filename, '/') === FALSE )\r
{\r
- $filename = $this->currentItem->authorid . '/' . $filename;\r
+ $filename = $this->currentItem['authorid'] . '/' . $filename;\r
}\r
\r
$windowwidth = $width;\r
$condition = ($blog && ($blog->getSetting($name) == $value));\r
break;\r
case 'itemblogsetting':\r
- $b =& $manager->getBlog(getBlogIDFromItemID($this->currentItem->itemid));\r
+ $b =& $manager->getBlog($this->currentItem['blogid']);\r
$condition = ($b && ($b->getSetting($name) == $value));\r
break;\r
case 'loggedin':\r
{\r
global $member, $manager;\r
\r
- $b =& $manager->getBlog(getBlogIDFromItemID($this->currentItem->itemid));\r
+ $b =& $manager->getBlog($this->currentItem['blogid']);\r
\r
// when no parameter is defined, just check if author is current visitor\r
if ( ($key != 'isadmin' && $key != 'name') || ($key == 'name' && $value == '') )\r
{\r
- return (intval($member->getID()) > 0 && intval($member->getID()) == intval($this->currentItem->authorid));\r
+ return (intval($member->getID()) > 0 && intval($member->getID()) == intval($this->currentItem['authorid']));\r
}\r
\r
// check author name\r
if ( $key == 'name' )\r
{\r
$value = strtolower($value);\r
- if ( $value == strtolower($this->currentItem->author) )\r
+ if ( $value == strtolower($this->currentItem['author']) )\r
{\r
return TRUE;\r
}\r
// check if author is admin\r
if ( ($key == 'isadmin') )\r
{\r
- $aid = intval($this->currentItem->authorid);\r
+ $aid = intval($this->currentItem['authorid']);\r
$blogid = intval($b->getID()); \r
$amember =& $manager->getMember($aid);\r
if ( $amember->isAdmin() )\r
{\r
global $catid, $manager;\r
\r
- $b =& $manager->getBlog(getBlogIDFromItemID($this->currentItem->itemid));\r
+ $b =& $manager->getBlog($this->currentItem['blogid']);\r
\r
// when no parameter is defined, just check if a category is selected\r
if ( ($key != 'catname' && $key != 'catid') || ($value == '') )\r
return $b->isValidCategory($catid);\r
}\r
\r
- $icatid = $this->currentItem->catid;\r
+ $icatid = $this->currentItem['catid'];\r
\r
// check category name\r
if ( $key == 'catname' )\r