if ($act->groupid) {
    $group = JTable::getInstance('Group', 'CTable');
    $group->load($act->groupid);
    $stream->group = $group;
    $act->appTitle = $group->name;
}
// get created date time
$date = JFactory::getDate($this->act->created);
if ($config->get('activitydateformat') == "lapse") {
    $createdTime = CTimeHelper::timeLapse($date);
} else {
    $createdTime = $date->format($config->get('profileDateFormat'));
}
$stream->actor = $user;
$stream->target = null;
$stream->headline = CVideos::getActivityTitleHTML($act);
$stream->message = "";
$stream->groupid = $act->groupid;
$stream->eventid = $act->eventid;
$stream->attachments = array();
$stream->access = $video->permissions;
$stream->createdtime = $createdTime;
$quoteContent = CActivities::format($act->title, $mood);
if (!empty($quoteContent) && $param->get('style') == COMMUNITY_STREAM_STYLE) {
    $attachment = new stdClass();
    $attachment->type = 'text';
    $attachment->message = $quoteContent;
    $attachment->hasMood = is_null($mood) ? false : true;
    /* Temporary fix for sprint 2 */
    if ($this->act instanceof CTableActivity) {
        /* If this's CTableActivity then we use getProperties() */
示例#2
0
 /**
  * Return HTML formatted activity title
  */
 public static function getActivityTitle($act)
 {
     $cache = CFactory::getFastCache();
     $cacheid = __FILE__ . __LINE__ . serialize(func_get_args());
     if ($data = $cache->get($cacheid)) {
         return $data;
     }
     $html = '';
     $user = CFactory::getUser($act->actor);
     // For known core, apps, we can simply call the content command
     switch ($act->app) {
         case 'videos':
             $html = CVideos::getActivityTitleHTML($act);
             break;
         case 'photos':
             $html = CPhotos::getActivityTitleHTML($act);
             break;
         default:
             // For everything else, use User > Group format
             $html = '<a href="' . CUrlHelper::userLink($act->actor) . '">' . CStringHelper::escape($user->getDisplayName()) . '</a>';
     }
     $cache->store($html, $cacheid, array('activities'));
     return $html;
 }