Beispiel #1
0
/**
 * @since 3.2 we'll use CActivity for each activity object
 * @todo in sprint 3 we must move everything into CActivity while passing into template layout
 */
/* Temporary fix for sprint 2 */
if ($this->act instanceof CTableActivity) {
    /* If this's CTableActivity then we use getProperties() */
    $activity = new CActivity($this->act->getProperties());
} else {
    /* If it's standard object than we just passing it */
    $activity = new CActivity($this->act);
}
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$isSingleAct = $jinput->get->get('actid', 0) > 0 ? true : false;
$address = $activity->getLocation();
$user = $activity->getActor();
$target = $activity->getTarget();
$headMetas = $activity->getParams('headMetas');
/* We do convert into JRegistry to make it easier to use */
if ($headMetas) {
    $headMetaParams = new JRegistry($headMetas);
}
if ($act->app == 'profile.avatar.upload') {
    if ($my->id > 0) {
        $this->load('activities.stream.options');
    }
    $this->load('activities.profile.avatar.upload');
    return;
}
if (!empty($act->params)) {
$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() */
        $activity = new CActivity($this->act->getProperties());
    } else {
        /* If it's standard object than we just passing it */
        $activity = new CActivity($this->act);
    }
    $attachment->activity = $activity;
    $attachment->address = $activity->getLocation();
    $stream->attachments[] = $attachment;
}
$attachment = new stdClass();
$attachment->type = 'video';
$attachment->id = $act->cid;
$attachment->title = $video->title;
$attachment->thumbnail = $video->getThumbnail();
$attachment->description = $video->description;
$attachment->duration = CVideosHelper::toNiceHMS(CVideosHelper::formatDuration($video->getDuration()));
$attachment->access = $act->access;
$attachment->video_type = $video->type;
$attachment->link = $video->path;
$stream->attachments[] = $attachment;
$this->set('stream', $stream);
$this->load('stream/base-extended');