Пример #1
0
 public static function getActivityContentHTML($act)
 {
     // Ok, the activity could be an upload OR a wall comment. In the future, the content should
     // indicate which is which
     $html = '';
     $param = new CParameter($act->params);
     $action = $param->get('action', false);
     if ($action == 'events.create') {
         return CEvents::getEventSummary($act->cid, $param);
     } else {
         if ($action == 'event.join' || $action == 'event.attendence.attend') {
             return CEvents::getEventSummary($act->cid, $param);
         } else {
             if ($action == 'event.wall.create' || $action == 'events.wall.create') {
                 $wallid = $param->get('wallid', 0);
                 $html = CWallLibrary::getWallContentSummary($wallid);
                 return $html;
             }
         }
     }
     return $html;
 }
Пример #2
0
 public static function getActivityContentHTML($act)
 {
     // Ok, the activity could be an upload OR a wall comment. In the future, the content should
     // indicate which is which
     $html = '';
     $param = new CParameter($act->params);
     $action = $param->get('action', false);
     $config = CFactory::getConfig();
     $groupModel = CFactory::getModel('groups');
     if ($action == CGroupsAction::DISCUSSION_CREATE) {
         // Old discussion might not have 'action', and we can't display their
         // discussion summary
         $topicId = $param->get('topic_id', false);
         if ($topicId) {
             $group = JTable::getInstance('Group', 'CTable');
             $discussion = JTable::getInstance('Discussion', 'CTable');
             $group->load($act->cid);
             $discussion->load($topicId);
             $discussion->message = strip_tags($discussion->message);
             $topic = CStringHelper::escape($discussion->message);
             $tmpl = new CTemplate();
             $tmpl->set('comment', JString::substr($topic, 0, $config->getInt('streamcontentlength')));
             $html = $tmpl->fetch('activity.groups.discussion.create');
         }
         return $html;
     } else {
         if ($action == CGroupsAction::WALLPOST_CREATE) {
             // a new wall post for group
             // @since 1.8
             $group = JTable::getInstance('Group', 'CTable');
             $group->load($act->cid);
             $wallModel = CFactory::getModel('Wall');
             $wall = JTable::getInstance('Wall', 'CTable');
             $my = CFactory::getUser();
             // make sure the group is a public group or current use is
             // a member of the group
             if ($group->approvals == 0 || $group->isMember($my->id)) {
                 //CFactory::load( 'libraries' , 'comment' );
                 $wall->load($param->get('wallid'));
                 $comment = strip_tags($wall->comment, '<comment>');
                 $comment = CComment::stripCommentData($comment);
                 $tmpl = new CTemplate();
                 $tmpl->set('comment', JString::substr($comment, 0, $config->getInt('streamcontentlength')));
                 $html = $tmpl->fetch('activity.groups.wall.create');
             }
             return $html;
         } else {
             if ($action == CGroupsAction::DISCUSSION_REPLY) {
                 // @since 1.8
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($act->cid);
                 $wallModel = CFactory::getModel('Wall');
                 $wall = JTable::getInstance('Wall', 'CTable');
                 $my = CFactory::getUser();
                 // make sure the group is a public group or current use is
                 // a member of the group
                 if ($group->approvals == 0 || $group->isMember($my->id)) {
                     $wallid = $param->get('wallid');
                     //CFactory::load( 'libraries' , 'wall' );
                     $html = CWallLibrary::getWallContentSummary($wallid);
                 }
                 return $html;
             } else {
                 if ($action == CGroupsAction::CREATE) {
                     $group = JTable::getInstance('Group', 'CTable');
                     $group->load($act->cid);
                     $tmpl = new CTemplate();
                     $tmpl->set('group', $group);
                     $html = $tmpl->fetch('activity.groups.create');
                 }
             }
         }
     }
     return $html;
 }
Пример #3
0
 /**
  * Return the content of acitivity stream
  */
 public static function getActivityContentHTML($act)
 {
     $html = '';
     $my = CFactory::getUser();
     $config = CFactory::getConfig();
     $param = new CParameter($act->params);
     // Legacy issue. We could have either wall or video upload notice here
     $action = $param->get('action', 'upload');
     //CFactory::load( 'libraries' , 'wall' );
     // wall activity have either empty content (old) or $param action = 'wall'
     if ($action == 'wall') {
         // Only if the param wallid is specified that we could retrive the wall content
         $wallid = $param->get('wallid', false);
         if ($wallid) {
             $html = CWallLibrary::getWallContentSummary($wallid);
         }
     } elseif ($action == 'upload') {
         $video = $act->video;
         $url = $video->getViewUri();
         $template = 'activity.videos.upload';
         $tmpl = new CTemplate();
         $html = $tmpl->set('url', $url)->set('video', $video)->set('duration', CVideosHelper::toNiceHMS(CVideosHelper::formatDuration($video->getDuration())))->fetch('videos.activity.upload');
     }
     return $html;
 }
Пример #4
0
 /**
  * Return the content of acitivity stream
  */
 public static function getActivityContentHTML($act)
 {
     $html = '';
     $my = CFactory::getUser();
     $config = CFactory::getConfig();
     $param = new CParameter($act->params);
     // Legacy issue. We could have either wall or video upload notice here
     $action = $param->get('action', 'upload');
     CFactory::load('libraries', 'wall');
     // wall activity have either empty content (old) or $param action = 'wall'
     if ($action == 'wall') {
         // Only if the param wallid is specified that we could retrive the wall content
         $wallid = $param->get('wallid', false);
         if ($wallid) {
             $html = CWallLibrary::getWallContentSummary($wallid);
         }
     } elseif ($action == 'upload') {
         CFactory::load('models', 'videos');
         $video = JTable::getInstance('Video', 'CTable');
         $video->load($act->cid);
         $url = $video->getViewUri();
         // Add tagging code
         /*
         $tagsHTML = '';
         if($config->get('tags_videos') && $config->get('tags_show_in_stream')){
         	CFactory::load('libraries', 'tags');
         	$tags = new CTags();
         	$tagsHTML = $tags->getHTML('videos', $video->id, false);
         }
         */
         $template = 'activity.videos.upload';
         $tmpl = new CTemplate();
         $html = $tmpl->set('url', $url)->set('video', $video)->set('duration', CVideosHelper::toNiceHMS(CVideosHelper::formatDuration($video->getDuration())))->fetch('videos.activity.upload');
     }
     return $html;
 }