<div class="joms-stream__body">
    <?php 
//remove for now
if ($act->groupid && false) {
    $group = JTable::getInstance('Group', 'CTable');
    $group->load($act->groupid);
    $this->set('group', $group);
    ?>


        <a class="joms-stream-reference" href="<?php 
    echo CUrlHelper::groupLink($group->id);
    ?>
"><i class="joms-icon-users"></i><?php 
    echo $group->name;
    ?>
</a>

    <?php 
}
$html = CPhotos::getActivityContentHTML($act);
echo $html;
?>
</div>

<?php 
// No action for wall comment
if ($action != 'wall') {
    $this->load('activities.actions');
}
Exemple #2
0
 public static function formatSharePopup($act)
 {
     switch ($act->app) {
         case 'photos':
             $album = JTable::getInstance('Album', 'CTable');
             $album->load($act->cid);
             $act->album = $album;
             $act->params = new CParameter($act->params);
             $act->content = CPhotos::getActivityContentHTML($act);
             break;
         case 'videos':
             $video = JTable::getInstance('Video', 'CTable');
             $video->load($act->cid);
             $act->title = $video->title;
             $act->content = new stdClass();
             $act->content->title = $video->title;
             $act->content->duration = CVideosHelper::toNiceHMS(CVideosHelper::formatDuration($video->getDuration()));
             $act->content->thumb = $video->getThumbnail();
             $act->content->description = $video->description;
             break;
         case 'events.wall':
         case 'groups.wall':
         case 'profile':
             $param = new CParameter($act->params);
             $metas = $param->get('headMetas', NULL);
             $headers = new CParameter($metas);
             if (!is_null($headers->get('title'))) {
                 $act->content = new stdClass();
                 $act->content->title = $headers->get('title');
                 $act->content->description = $headers->get('description');
                 $act->content->thumb = $headers->get('image');
             }
             break;
         case 'groups':
             $group = JTable::getInstance('Group', 'CTable');
             $group->load($act->cid);
             $act->title = $group->name;
             $act->content = new stdClass();
             $act->content->title = $group->name;
             $act->content->description = $group->description;
             $act->content->thumb = $group->getThumbAvatar();
             break;
         case 'events':
             $event = JTable::getInstance('Event', 'CTable');
             $event->load($act->cid);
             $act->title = $event->title;
             $act->content = new stdClass();
             $act->content->title = $event->title;
             $act->content->description = $event->description;
             $act->content->thumb = $event->getThumbAvatar();
             break;
     }
     return self::generateShareHtml($act);
 }
Exemple #3
0
 /**
  * Return the HTML formatted activity content
  */
 static function getActivityContent($act)
 {
     $cache = CFactory::getFastCache();
     $cacheid = __FILE__ . __LINE__ . serialize(func_get_args());
     if ($data = $cache->get($cacheid)) {
         return $data;
     }
     // Return empty content or content with old, invalid data
     // In some old version, some content might have 'This is the body'
     if ($act->content == 'This is the body') {
         return '';
     }
     $html = $act->content;
     // For known core, apps, we can simply call the content command
     switch ($act->app) {
         case 'videos':
             CFactory::load('libraries', 'videos');
             $html = CVideos::getActivityContentHTML($act);
             break;
         case 'photos':
             CFactory::load('libraries', 'photos');
             $html = CPhotos::getActivityContentHTML($act);
             break;
         case 'events':
             CFactory::load('libraries', 'events');
             $html = CEvents::getActivityContentHTML($act);
             break;
         case 'groups.wall':
         case 'groups':
             CFactory::load('libraries', 'groups');
             $html = CGroups::getActivityContentHTML($act);
             break;
         case 'groups.discussion.reply':
         case 'groups.discussion':
             CFactory::load('libraries', 'groups');
             $html = CGroups::getActivityContentHTML($act);
             break;
         case 'groups.bulletin':
             CFactory::load('libraries', 'groups');
             $html = CGroups::getActivityContentHTML($act);
         case 'system':
             CFactory::load('libraries', 'adminstreams');
             $html = CAdminstreams::getActivityContentHTML($act);
             break;
         case 'walls':
             // If a wall does not have any content, do not
             // display the summary
             if ($act->app == 'walls' && $act->cid == 0) {
                 $html = '';
                 return $html;
             }
             if ($act->cid != 0) {
                 CFactory::load('libraries', 'wall');
                 $html = CWall::getActivityContentHTML($act);
             }
             break;
         default:
             // for other unknown apps, we include the plugin see if it is is callable
             // we call the onActivityContentDisplay();
             CFactory::load('libraries', 'apps');
             $apps =& CAppPlugins::getInstance();
             $plugin =& $apps->get($act->app);
             $method = 'onActivityContentDisplay';
             if (is_callable(array($plugin, $method))) {
                 $args = array();
                 $args[] = $act;
                 $html = call_user_func_array(array($plugin, $method), $args);
             } else {
                 $html = $act->content;
             }
     }
     $cache->store($html, $cacheid, array('activities'));
     return $html;
 }
Exemple #4
0
 /**
  * Return the HTML formatted activity contet
  */
 static function getActivityContent($act)
 {
     // Return empty content or content with old, invalid data
     // In some old version, some content might have 'This is the body'
     if ($act->content == 'This is the body') {
         return '';
     }
     $html = $act->content;
     // For know core, apps, we can simply call the content command
     switch ($act->app) {
         case 'videos':
             CFactory::load('libraries', 'videos');
             $html = CVideos::getActivityContentHTML($act);
             break;
         case 'photos':
             CFactory::load('libraries', 'photos');
             $html = CPhotos::getActivityContentHTML($act);
             break;
         case 'events':
             CFactory::load('libraries', 'events');
             $html = CEvents::getActivityContentHTML($act);
             break;
         case 'groups':
             CFactory::load('libraries', 'groups');
             $html = CGroups::getActivityContentHTML($act);
             break;
         case 'walls':
             // If a wall does not have any content, do not
             // display the summary
             if ($act->app == 'walls' && $act->cid == 0) {
                 $html = '';
                 return $html;
             }
         default:
             // for other unknown apps, we include the plugin see if it is is callable
             // we call the onActivityContentDisplay();
             CFactory::load('libraries', 'apps');
             $apps =& CAppPlugins::getInstance();
             $plugin =& $apps->get($act->app);
             $method = 'onActivityContentDisplay';
             if (is_callable(array($plugin, $method))) {
                 $args = array();
                 $args[] = $act;
                 $html = call_user_func_array(array($plugin, $method), $args);
             } else {
                 $html = $act->content;
             }
     }
     return $html;
 }