Esempio n. 1
0
 /**
  * Add new activity into stream
  * @param array|object $data
  * @return CActivity|boolean
  */
 public static function add($data)
 {
     $activity = new CActivity($data);
     /**
      * @todo We'll move all event trigger into this class not in table class or anywhere
      * @todo Anything else we want to include when posting please put here
      */
     /* Event trigger */
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $params = array();
     $params[] =& $activity;
     /* We do raise event here that will allow user change $activity properties before save it */
     $appsLib->triggerEvent('onBeforeActivitySave', $params);
     if ($activity->get('cmd')) {
         /* Userpoints */
         $userPointModel = CFactory::getModel('Userpoints');
         $point = $userPointModel->getPointData($activity->get('cmd'));
         if ($point) {
             /**
              * @todo Need clearly about this !
              * for every unpublished user points the stream will be disabled for that item
              * but not sure if this for 3rd party API, this feature should be available or not?
              */
             if (!$point->published) {
                 //return;
             }
         }
     }
     if ($activity->save()) {
         $params = array();
         $params[] =& $activity;
         $appsLib->triggerEvent('onAfterActivitySave', $params);
         return $activity;
     }
     return false;
 }
Esempio n. 2
0
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)) {
    if (!is_object($act->params)) {
        $act->params = new JRegistry($act->params);
    }
    $mood = $act->params->get('mood', null);
} else {
    $mood = null;
}
$title = $activity->get('title');
?>

<div class="joms-stream__header">
    <div class= "joms-avatar--stream">
        <?php 
if ($user->id > 0) {
    ?>
            <a href="<?php 
    echo CUrlHelper::userLink($user->id);
    ?>
">
                <img data-author="<?php 
    echo $user->id;
    ?>
" src="<?php 
    <article>
      <a href="<?php 
echo $this->event->getLink();
?>
"> <i class="joms-icon-calendar-empty portrait-phone-only"></i> <?php 
echo JHTML::_('string.truncate', $this->event->title, $truncateVal, true, false);
?>
</a>
      <div class="separator"></div>
      <p><?php 
echo JHTML::_('string.truncate', $this->event->description, $truncateVal, true, false);
?>
</p>
      <ul class="list-unstyled content-details">
          <li><i class="joms-icon-calendar"></i><?php 
echo CTimeHelper::getFormattedTime($this->event->startdate, $format);
?>
</li>
          <li><i class="joms-icon-map-marker"></i><?php 
echo CActivities::format($activity->get('location'));
?>
</li>
      </ul>
    </article>
</div>

    <?php 
$this->load('activities.actions');
?>
</div>
if ($headMetas) {
    $headMetaParams = new JRegistry($headMetas);
}
if ($act->app == 'profile.avatar.upload') {
    $this->load('activities.profile.avatar.upload');
    return;
}
if (!empty($act->params)) {
    if (!is_object($act->params)) {
        $act->params = new JRegistry($act->params);
    }
    $mood = $act->params->get('mood', null);
} else {
    $mood = null;
}
$title = $activity->get('title');
?>
<!-- Avatar -->
<div class="joms-stream-avatar">
    <a href="<?php 
echo CUrlHelper::userLink($user->id);
?>
">
        <img class="img-responsive joms-radius-rounded" data-author="<?php 
echo $user->id;
?>
" src="<?php 
echo $user->getThumbAvatar();
?>
">
    </a>