public function getItemHTML($format = null) { // If were not in 'article' view, just show short summary /* $view = JRequest::getVar('view'); $task = JRequest::getVar('task'); if( ($view != 'message' || $task != 'show') && $format != 'full'){ $date = new JDate($this->data->start_date); $html = '<li class="message-item compact-item"><span class="label-compact label-event">Event</span> <div class="message-content-compact"> <a href="'. $this->data->getUri().'"> '.StreamMessage::format($this->data->message).' </a> <span class="small hint">'.JXDate::formatLapse( $date ).'</span> </div> <div class="clear"></div> </li>'; return $html; } */ $tmpl = new StreamTemplate(); $tmpl->set('stream', $this->data)->set('comment', StreamComment::getCommentSummaryHTML($this->data)); return $tmpl->fetch('stream.item.event'); }
/** * Return HTML of all */ public function showall() { $stream_id = JRequest::getVar('message_id'); $html = StreamComment::getCommentsHTML($stream_id); header('Content-Type: text/html; charset=UTF-8'); echo $html; exit; }
public function getItemHTML($format = null) { $tmpl = new StreamTemplate(); // If were not in 'direct' view, just show short summary $view = JRequest::getVar('view'); $task = JRequest::getVar('task'); if ($view == 'direct' || $task == 'show') { $tmpl->set('stream', $this->data)->set('comment', StreamComment::getCommentSummaryHTML($this->data)); return $tmpl->fetch('stream.item.direct'); } else { $tmpl->set('stream', $this->data); return $tmpl->fetch('stream.compact.direct'); } }
<a class="meta-comment" href="#comment">Reply</a> <?php // TODO: disabled until edit callback output fixed if ($my->authorise('stream.message.edit', $stream) && false) { ?> • <a class="meta-edit" href="#edit">Edit</a> • <a class="meta-edit" href="#remove">Delete</a> <?php } ?> <div class="clear"></div> </div> <div class="message-content-bottom"> <?php echo StreamComment::getCommentSummaryHTML($stream); ?> </div> </li> </ul> </div> </li> <?php } ?> </ul> </div> <div class="pagination" style="display: none;"> <?php if ($pagination) {
public function getItemHTML($format = null) { $tmpl = new StreamTemplate(); $tmpl->set('stream', $this->data)->set('comment', StreamComment::getCommentSummaryHTML($this->data)); return $tmpl->fetch('stream.item.todo'); }
/** * Delete a message */ public function delete() { $my = JXFactory::getUser(); $message_id = JRequest::getVar('message_id'); $stream = JTable::getInstance('Stream', 'StreamTable'); $stream->load($message_id); if (!$my->authorise('stream.message.delete', $stream)) { // No reason this code would ever get here! exit; } // Remove trending tags data $tagsTrend = new StreamTag(); $rawData = json_decode($stream->raw); $rawData->tags = isset($rawData->tags) ? $rawData->tags : ''; $tagsArray = explode(',', trim($rawData->tags, ',')); foreach ($tagsArray as $tag) { // trim hashes $tag = trim($tag, '#'); // remove trending data $tagsTrend->updateTrending($tag, $stream->group_id, false); } $stream->delete(); // Delete related comments StreamComment::deleteComments($message_id); // Unattach all files $user = JXFactory::getUser($stream->user_id); $links = StreamMessage::getLinks($stream->message); if (!empty($links)) { $userLinks = $user->getParam('links'); foreach ($links as $row) { $link = JTable::getInstance('Link', 'StreamTable'); $link->load(array('link' => $row)); $link->removeUser($user->id); $link->store(); $userLinks = JXUtility::csvRemove($userLinks, $link->id); } $user->setParam('links', $userLinks); $user->save(); } // @todo: delete attachments // Upgrade group stats if necessary if (JRequest::getVar('group_id')) { $group = JTable::getInstance('Group', 'StreamTable'); $group->load(JRequest::getVar('group_id')); $group->setParam('message_count', $streamModel->countStream(array('group_id' => $group->id))); $group->setParam($stream->type . '_count', $streamModel->countStream(array('group_id' => $group->id, 'type' => $stream->type))); $group->store(); } $data = array(); $data['id'] = $message_id; header('Content-Type: text/json'); echo json_encode($data); exit; }
?> </a> • <a class="meta-edit" href="#remove"><?php echo JText::_('COM_STREAM_LABEL_DELETE'); ?> </a> <?php } ?> <div class="clear"></div> </div> <div class="message-content-bottom"> <?php echo StreamComment::getCommentSummaryHTML($event); ?> </div> </li> </ul> </div> <div class="clear"></div> </li> <?php } ?> </ul> <?php if (count($events) == 0) {
/** * Return object HTML */ public function getItemHTML($format = null) { // If were not in 'article' view, just show short summary $view = JRequest::getVar('view'); $task = JRequest::getVar('task'); $editType = JRequest::getVar('edit_type', ''); $messageId = JRequest::getVar('message_id', 0); //var_dump($messageId); if ($editType == 'list') { return $this->getMilestoneHTML($this->data); } if ($view == 'message' && ($task == 'show' || $task == 'save' || $task == 'fetch') || $view == 'milestones' || $task == 'showMessages' || $messageId == $this->data->id) { $tmpl = new StreamTemplate(); $tmpl->set('stream', $this->data)->set('comment', StreamComment::getCommentSummaryHTML($this->data)); return $tmpl->fetch('stream.item.milestone'); } else { $tmpl = new StreamTemplate(); $tmpl->set('stream', $this->data)->set('comment', StreamComment::getCommentSummaryHTML($this->data)); return $tmpl->fetch('stream.compact.milestone'); } /*if($task != 'show'){ $data = json_decode($this->data->raw); $date = new JDate( $this->data->created ); $user = JXFactory::getUser($this->data->user_id); $html = '<li style="border:none; background:#F2F2F2; padding:8px;list-style-type: none;margin: 0 0 15px;backgroun:#ddd"><span style="margin-right:6px;" class="label info">New Milestone</span> '. StreamMessage::format($this->data->message) .' <span class="small hint">- '.StreamTemplate::escape($user->name).' , '.JXDate::formatLapse( $date ).'</span> </li>'; return $html; } $tmpl = new StreamTemplate(); $tmpl->set( 'stream' , $this->data) ->set('comment', StreamComment::getCommentSummaryHTML($this->data)); return $tmpl->fetch('stream.item.milestone');*/ }