Exemplo n.º 1
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;
 }
                    ?>
	<a class="cStream-Avatar cFloat-L" href="<?php 
                    echo CUrlHelper::userLink($user->id);
                    ?>
">
		<img class="cAvatar" data-author="<?php 
                    echo $user->id;
                    ?>
" src="<?php 
                    echo $user->getThumbAvatar();
                    ?>
">
	</a>
	<div class="cStream-Content">
		<div class="cStream-Attachment">
			<?php 
                    $html = CGroups::getActivityContentHTML($act);
                    echo $html;
                    ?>
		</div>

		<?php 
                    $this->load('activities.actions');
                    ?>
	</div>
<?php 
                }
            }
        }
    }
}
Exemplo n.º 3
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;
 }