/** * Overridding IcmsPersistable::toArray() method to add a few info * * @return array of tribetopic info */ public function toArray() { $ret = parent::toArray(); $ret['last_post_time'] = formatTimestamp($this->getVar('last_post_time', 'e'), 'm'); $ret['poster_uname'] = icms_member_user_Handler::getUserLink($this->getVar('poster_uid')); $ret['userCanEditAndDelete'] = $this->userCanEditAndDelete(); $ret['itemLink'] = str_replace($this->handler->_itemname . '.php?', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&', $ret['itemLink']); $ret['itemUrl'] = str_replace($this->handler->_itemname . '.php?', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&', $ret['itemUrl']); $ret['editItemLink'] = str_replace($this->handler->_itemname . '.php?op=mod', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&op=modtribetopic', $this->getEditItemLink(false, true, true)); $ret['deleteItemLink'] = str_replace($this->handler->_itemname . '.php?op=del', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&op=deltribetopic', $this->getDeleteItemLink(false, true, true)); // build last post link $module = icms::handler("icms_module")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE); $start = ''; if ($this->getVar('replies') + 1 > $module->config['tribepostsperpage']) { $start = '&start=' . ($this->getVar('replies') + 1 - ($this->getVar('replies') + 1) % $module->config['tribepostsperpage']); } $ret['lastItemLink'] = '<a href="' . $ret['itemUrl'] . $start . '#post' . $this->getVar('last_post_id') . '"><img src="' . $this->handler->_moduleUrl . 'images/comments.gif" title="' . _MD_PROFILE_TRIBETOPIC_SHOW_LAST_POST . '" style="vertical-align:middle;" /></a>'; // build toggle close item link if ($this->getVar('closed')) { // link to reopen the topic $ret['closedIcon'] = '<img src="' . $this->handler->_moduleUrl . 'images/lock.gif" title="' . _MD_PROFILE_TRIBETOPIC_CLOSE . '" style="vertical-align:middle;" />'; $ret['toggleCloseLink'] = '<a href="' . $ret['itemUrl'] . '&op=toggleclose"><img src="' . $this->handler->_moduleUrl . 'images/unlock.gif" title="' . _MD_PROFILE_TRIBETOPIC_REOPEN . '" style="vertical-align:middle;" /></a>'; } else { // link to close the topic $ret['toggleCloseLink'] = '<a href="' . $ret['itemUrl'] . '&op=toggleclose"><img src="' . $this->handler->_moduleUrl . 'images/lock.gif" title="' . _MD_PROFILE_TRIBETOPIC_CLOSE . '" style="vertical-align:middle;" /></a>'; } return $ret; }
/** * Overridding IcmsPersistable::toArray() method to add a few info * * @global array $icmsConfigUser user configuration * @return array of tribetopic info */ public function toArray() { global $icmsConfigUser; $ret = parent::toArray(); $ret['post_time'] = formatTimestamp($this->getVar('post_time', 'e'), 'm'); $ret['poster_uname'] = icms_member_user_Handler::getUserLink($this->getVar('poster_uid')); $ret['userCanEditAndDelete'] = $this->userCanEditAndDelete(); $thisUser = icms::handler('icms_member')->getUser($this->getVar('poster_uid')); if (is_object($thisUser)) { // get poster avatar $avatar = $thisUser->gravatar(); if ($icmsConfigUser['avatar_allow_gravatar'] || strpos($avatar, 'http://www.gravatar.com/avatar/') === false) { $ret['poster_avatar'] = '<img src="' . $thisUser->gravatar() . '" />'; } // get poster signature if (trim($thisUser->getVar('user_sig')) && $this->getVar('attachsig')) { $ret['poster_signature'] = icms_core_DataFilter::checkVar($thisUser->getVar('user_sig', 'N'), 'html', 'output'); } } // rewrite edit and delete item links to work with tribes.php $ret['editItemLink'] = str_replace($this->handler->_itemname . '.php?op=mod', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&topic_id=' . $this->getVar('topic_id') . '&op=edittribepost', $this->getEditItemLink(false, true, true)); $ret['deleteItemLink'] = str_replace($this->handler->_itemname . '.php?op=del', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&topic_id=' . $this->getVar('topic_id') . '&op=deltribepost', $this->getDeleteItemLink(false, true, true)); return $ret; }
/** * Overridding IcmsPersistable::toArray() method to add a few info * * @return array of tribe info */ public function toArray() { $ret = parent::toArray(); $ret['itemLink'] = str_replace($this->handler->_itemname . '.php?', $this->handler->_itemname . '.php?uid=' . $this->getVar('uid_owner') . '&', $ret['itemLink']); $ret['itemUrl'] = str_replace($this->handler->_itemname . '.php?', $this->handler->_itemname . '.php?uid=' . $this->getVar('uid_owner') . '&', $ret['itemUrl']); $ret['creation_time'] = formatTimestamp($this->getVar('creation_time', 'e')); $ret['creation_time_short'] = formatTimestamp($this->getVar('creation_time', 'e'), 's'); $ret['tribe_title'] = $this->getVar('title', 'e'); $ret['tribe_content'] = $this->getTribePicture(); $ret['picture_link'] = $this->getTribePictureLink($ret['itemUrl']); $ret['editItemLink'] = $this->getEditItemLink(false, true, true); $ret['deleteItemLink'] = $this->getDeleteItemLink(false, true, true); $ret['userCanEditAndDelete'] = $this->userCanEditAndDelete(); $ret['tribe_senderid'] = $this->getVar('uid_owner', 'e'); $ret['tribe_sender_link'] = $this->getTribeSender(); $ret['tribe_sender_avatar'] = $this->getProfileTribeSenderAvatar(); return $ret; }
/** * Create an array of the category's properties * * @return array An array of the category's properties */ public function toArray() { $this->setVar('doxcode', true); global $myts; $objectArray = parent::toArray(); if ($objectArray['image']) { $objectArray['image'] = $this->getImageDir() . $objectArray['image']; } return $objectArray; }
public function __construct(&$handler) { parent::__construct($handler); $this->_deprecated = icms_core_Debug::setDeprecated('icms_ipf_seo_Object', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); }
/** * Overridding IcmsPersistable::toArray() method to add a few info * * @return array of article info */ function toArray() { $ret = parent::toArray(); $ret['content_info'] = $this->getContentInfo(); $ret['content_lead'] = $this->getContentLead(); $ret['content_comment_info'] = $this->getCommentsInfo(); $ret['content_css'] = $this->getVar('content_css', 'e'); $ret['content_subs'] = $this->getContentSubs($this->getVar('content_id', 'e'), true); $ret['content_hassubs'] = count($ret['content_subs']) > 0 ? true : false; $ret['editItemLink'] = $this->getEditItemLink(false, true, true); $ret['deleteItemLink'] = $this->getDeleteItemLink(false, true, true); $ret['userCanEditAndDelete'] = $this->userCanEditAndDelete(); $ret['content_posterid'] = $this->getVar('content_uid', 'e'); $ret['itemLink'] = $this->getItemLink(); $ret['accessgranted'] = $this->accessGranted(); return $ret; }