Example #1
0
 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     if ($stream->context != 'relationship') {
         return;
     }
     $params = $this->getParams();
     if (!$params->get('stream_approve', true)) {
         return;
     }
     // Get the actor
     $actor = $stream->actor;
     // check if the actor is ESAD profile or not, if yes, we skip the rendering.
     if (!$actor->hasCommunityAccess()) {
         $stream->title = '';
         return;
     }
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy && !$privacy->validate('core.view', $stream->contextId, 'relationship', $stream->actor->id)) {
         return;
     }
     $stream->color = '#DC554F';
     $stream->fonticon = 'ies-heart';
     $stream->label = FD::_('APP_USER_RELATIONSHIP_STREAM_TOOLTIP', true);
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $registry = FD::registry($stream->params);
     $this->set('type', $registry->get('type'));
     $this->set('actor', $stream->actor);
     $this->set('target', $stream->targets[0]);
     $stream->title = parent::display('streams/' . $stream->verb . '.title');
     if ($includePrivacy) {
         $stream->privacy = $privacy->form($stream->contextId, 'relationship', $stream->actor->id, 'core.view', false, $stream->uid);
     }
     return true;
 }
Example #2
0
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     // We only want to process related items
     if ($item->cluster_type !== SOCIAL_TYPE_EVENT || empty($item->cluster_id)) {
         return;
     }
     // Context are split into events and nodes
     // "events" context are stream items that are related to event item
     // "guests" context are stream items that are related to guests of the event
     // Only process "events" context here
     // "guests" context are processed in the app/event/guests app
     if ($item->context !== 'events') {
         return;
     }
     $event = FD::event($item->cluster_id);
     // Only show Social sharing in public group
     if (!$event->isOpen()) {
         $item->sharing = false;
     }
     if (!$event->canViewItem()) {
         return;
     }
     if (!$this->getParams()->get('stream_' . $item->verb, true)) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#f06050';
     $item->fonticon = 'ies-calendar';
     $item->label = FD::_('APP_EVENT_EVENTS_STREAM_TOOLTIP', true);
     $actor = $item->actor;
     $this->set('event', $event);
     $this->set('actor', $actor);
     // streams/create.title
     // streams/feature.title
     // streams/update.title
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = '';
     if ($event->isGroupEvent()) {
         $this->set('group', $event->getGroup());
         $item->content = parent::display('streams/content');
     }
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_UPDATE
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_CREATE
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_FEATURE
     $item->opengraph->addDescription(JText::sprintf('APP_EVENT_EVENTS_STREAM_OPENGRAPH_' . strtoupper($item->verb), $actor->getName(), $event->getName()));
 }
Example #3
0
 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'article') {
         return;
     }
     // Define standard stream looks
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#1616d3';
     $item->icon = '<i class="ies-copy" data-original-title="' . FD::_('APP_ARTICLE_STREAM_TOOLTIP', true) . '" data-es-provide="tooltip"></i>';
     if ($item->verb == 'create') {
         $this->prepareCreateArticleStream($item);
     }
     if ($item->verb == 'update') {
         $this->prepareUpdateArticleStream($item);
     }
     if ($item->verb == 'read') {
         $this->prepareReadArticleStream($item);
     }
 }
Example #4
0
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     // We only want to process related items
     if ($item->cluster_type !== SOCIAL_TYPE_EVENT || empty($item->cluster_id)) {
         return;
     }
     // Context are split into events and nodes
     // "events" context are stream items that are related to event item
     // "guests" context are stream items that are related to guests of the event
     // Only process "guests" context here
     // "events" context are processed in the app/event/events app
     if ($item->context !== 'guests') {
         return;
     }
     $event = FD::event($item->cluster_id);
     if (!$event->canViewItem()) {
         return;
     }
     if (!$this->getParams()->get('stream_' . $item->verb, true)) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#6bccb4';
     $item->fonticon = 'ies-user';
     $item->label = FD::_('APP_EVENT_GUESTS_STREAM_TOOLTIP', true);
     $actor = $item->actor;
     $this->set('event', $event);
     $this->set('actor', $actor);
     // streams/going.title
     // streams/makeadmin.title
     // streams/notgoing.title
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = '';
     // APP_EVENT_GUESTS_STREAM_OPENGRAPH_GOING
     // APP_EVENT_GUESTS_STREAM_OPENGRAPH_NOTGOING
     // APP_EVENT_GUESTS_STREAM_OPENGRAPH_MAKEADMIN
     $item->opengraph->addDescription(JText::sprintf('APP_EVENT_GUESTS_STREAM_OPENGRAPH_' . strtoupper($item->verb), $actor->getName(), $event->getName()));
 }
Example #5
0
    ?>
" data-es-provide="tooltip" data-placement="bottom">
                    <i class="ies-locked"></i>
                    <?php 
    echo JText::_('COM_EASYSOCIAL_EVENTS_PRIVATE_EVENT');
    ?>
                </span>
                <?php 
}
?>

                <?php 
if ($event->isInviteOnly()) {
    ?>
                <span class="label label-warning" data-original-title="<?php 
    echo FD::_('COM_EASYSOCIAL_EVENTS_INVITE_EVENT_TOOLTIP', true);
    ?>
" data-es-provide="tooltip" data-placement="bottom">
                    <i class="ies-locked muted"></i>
                    <?php 
    echo JText::_('COM_EASYSOCIAL_EVENTS_INVITE_EVENT');
    ?>
                </span>
                <?php 
}
?>
            </h4>

            <p class="mb-10 mt-10 blog-description">
                <?php 
echo $this->html('string.truncater', $event->getDescription(), 250);
Example #6
0
<?php

/**
* @package		EasySocial
* @copyright	Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-folder-3" 
    data-story-attachment-icon 
    data-es-provide="tooltip" 
    data-placement="top" 
    data-original-title="<?php 
echo FD::_('APP_USER_FILES_PANEL_TOOLTIP', true);
?>
"></i>
Example #7
0
 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context !== 'feeds') {
         return;
     }
     // Get app params
     $params = $this->getParams();
     if (!$params->get('stream_create', true)) {
         return;
     }
     // Get the feed table
     $rss = FD::table('Rss');
     $rss->load($item->contextId);
     if (!$rss->id || !$item->contextId) {
         return;
     }
     $group = FD::group($item->cluster_id);
     $actor = $item->actor;
     $app = $this->getApp();
     $this->set('app', $app);
     $this->set('rss', $rss);
     $this->set('actor', $actor);
     $this->set('group', $group);
     $item->color = '#e67e22';
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->fonticon = 'ies-feed';
     $item->label = FD::_('APP_USER_FEED_STREAM_TOOLTIP', true);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
 }
Example #8
0
<?php

/**
* @package		EasySocial
* @copyright	Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-checkbox-checked" data-story-attachment-icon data-es-provide="tooltip" data-original-title="<?php 
echo FD::_('APP_GROUP_TASKS_STORY_TOOLTIP', true);
?>
" data-placement="top"></i>
Example #9
0
<?php

/**
* @package      EasySocial
* @copyright    Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license      GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-calendar-2" data-story-attachment-icon data-es-provide="tooltip" data-placement="top" data-original-title="<?php 
echo FD::_('APP_USER_EVENTS_PANEL_TOOLTIP', true);
?>
" data-story-event-panel-button></i>
Example #10
0
 /**
  * Renders publish / unpublish icon.
  *
  * @since	1.0
  * @access	public
  * @param	object	The object to check against.
  * @param	string	The controller to be called.
  * @param	string	The key for the object.
  * @param	Array	An optional array of tasks
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public static function featured($obj, $controllerName = '', $key = '', $task = '', $allowed = true, $tooltip = array())
 {
     // If primary key is not provided, then we assume that we should use 'state' as the key property.
     $key = !empty($key) ? $key : 'default';
     $task = !empty($task) ? $task : 'toggleDefault';
     switch ($obj->{$key}) {
         case SOCIAL_STATE_PUBLISHED:
             $class = 'featured';
             $tooltip = '';
             if ($allowed) {
                 $tooltip = isset($tooltip[1]) ? $tooltip[1] : FD::_('COM_EASYSOCIAL_GRID_TOOLTIP_UNFEATURE_ITEM', true);
             }
             break;
         default:
             $class = 'default';
             $tooltip = isset($tooltip[0]) ? $tooltip[0] : FD::_('COM_EASYSOCIAL_GRID_TOOLTIP_FEATURE_ITEM', true);
             break;
     }
     $theme = FD::get('Themes');
     $theme->set('task', $task);
     $theme->set('class', $class);
     $theme->set('tooltip', $tooltip);
     $theme->set('allowed', $allowed);
     return $theme->output('admin/html/grid.published');
 }
Example #11
0
 /**
  * Responsible to generate the stream content for profiles apps.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'profiles') {
         return;
     }
     // Get the application params
     $params = $this->getParams();
     if ($item->verb == 'update' && !$params->get('stream_update', true)) {
         return;
     }
     if ($item->verb == 'register' && !$params->get('stream_register', true)) {
         return;
     }
     $my = FD::user();
     // Decorate the stream
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     if ($item->verb == 'register') {
         $item->color = '#FF7553';
         $item->fonticon = 'ies-user-add';
         $item->label = FD::_('APP_USER_PROFILES_REGISTER_STREAM_TOOLTIP', true);
     }
     // When user updates their profile.
     if ($item->verb == 'update') {
         $item->color = '#1FBCA7';
         $item->fonticon = 'ies-briefcase';
         $item->label = FD::_('APP_USER_PROFILES_UPDATE_PROFILE_STREAM_TOOLTIP', true);
     }
     $actor = $item->actor;
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     $genderValue = $actor->getFieldData('GENDER');
     $gender = 'THEIR';
     if ($genderValue == 1) {
         $gender = 'MALE';
     }
     if ($genderValue == 2) {
         $gender = 'FEMALE';
     }
     // Override the likes
     $item->likes = FD::likes($item->uid, 'userprofile', $item->verb, SOCIAL_APPS_GROUP_USER, $item->uid);
     // Override the comments
     $comments = FD::comments($item->uid, 'userprofile', $item->verb, SOCIAL_APPS_GROUP_USER, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item->uid))), $item->uid);
     $item->comments = $comments;
     $this->set('gender', $gender);
     $this->set('actor', $item->actor);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     return true;
 }
Example #12
0
 /**
  * Generates the stream title of group.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     if ($stream->context != 'links') {
         return;
     }
     // Group access
     $group = FD::group($stream->cluster_id);
     if (!$group) {
         return;
     }
     if (!$group->canViewItem()) {
         return;
     }
     //get links object, in this case, is the stream_item
     $uid = $stream->uid;
     $stream->color = '#5580BE';
     $stream->fonticon = 'ies-link';
     $stream->label = FD::_('APP_GROUP_LINKS_STREAM_TOOLTIP', true);
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($stream->uid, $stream->context, $stream->verb, SOCIAL_APPS_GROUP_GROUP, $stream->uid);
     $stream->likes = $likes;
     // Apply comments on the stream
     $comments = FD::comments($stream->uid, $stream->context, $stream->verb, SOCIAL_APPS_GROUP_GROUP, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $stream->uid))), $stream->uid);
     $stream->comments = $comments;
     // Apply repost on the stream
     $repost = FD::get('Repost', $stream->uid, SOCIAL_TYPE_STREAM, SOCIAL_APPS_GROUP_GROUP);
     $stream->repost = $repost;
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy && !$privacy->validate('story.view', $uid, SOCIAL_TYPE_LINKS, $stream->actor->id)) {
         return;
     }
     $actor = $stream->actor;
     $target = count($stream->targets) > 0 ? $stream->targets[0] : '';
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $assets = $stream->getAssets();
     if (empty($assets)) {
         return;
     }
     // Get the assets
     $assets = $assets[0];
     // Get app params
     $params = $this->getParams();
     // Retrieve the link that is stored.
     $hash = md5($assets->get('link'));
     // Load the link object
     $link = FD::table('Link');
     $link->load(array('hash' => $hash));
     // Get the link data
     $linkObj = json_decode($link->data);
     // Determine if there's any embedded object
     $oembed = isset($linkObj->oembed) ? $linkObj->oembed : '';
     $image = FD::links()->getImageLink($assets, $params);
     // Fix video issues with youtube when site is on https
     $oembed = FD::links()->fixOembedLinks($oembed);
     // Get the contents and truncate accordingly
     $content = $assets->get('content', '');
     if ($params->get('stream_link_truncate')) {
         $content = JString::substr(strip_tags($content), 0, $params->get('stream_link_truncate_length', 250)) . JText::_('COM_EASYSOCIAL_ELLIPSES');
     }
     $this->set('image', $image);
     $this->set('content', $content);
     $this->set('params', $params);
     $this->set('oembed', $oembed);
     $this->set('assets', $assets);
     $this->set('actor', $actor);
     $this->set('target', $target);
     $this->set('stream', $stream);
     $this->set('group', $group);
     $stream->title = parent::display('streams/title.' . $stream->verb);
     $stream->preview = parent::display('streams/preview.' . $stream->verb);
     return true;
 }
Example #13
0
 /**
  * Triggered when the prepare stream is rendered
  *
  * @since    1.2
  * @access    public
  * @param    string
  * @return
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'tasks') {
         return;
     }
     // Event access checking
     $event = FD::event($item->cluster_id);
     if (!$event) {
         return;
     }
     if (!$event->canViewItem()) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#658ea6';
     $item->fonticon = 'ies-checkbox-checked';
     $item->label = FD::_('APP_EVENT_TASKS_STREAM_TOOLTIP', true);
     // Get the verb
     $verb = $item->verb;
     // Do not allow reposting on milestone items
     $item->repost = false;
     if ($verb == 'createTask') {
         $this->prepareCreatedTaskStream($item, $includePrivacy);
     }
     if ($verb == 'createMilestone') {
         $this->prepareCreateMilestoneStream($item, $includePrivacy);
     }
 }
Example #14
0
 /**
  * Prepares the stream item.
  *
  * @since   1.3
  * @access  public
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     // We only want to process related items
     if ($item->cluster_type !== SOCIAL_TYPE_EVENT || empty($item->cluster_id)) {
         return;
     }
     // If the event is a invite-only event, then we do not want the stream to show on user's stream.
     // The stream still has to be generated because the same stream item is displayed on both user and event's stream.
     $event = FD::event($item->cluster_id);
     // Only show Social sharing in public event
     if ($event->type != SOCIAL_EVENT_TYPE_PUBLIC) {
         $item->sharing = false;
     }
     // If the event is pending and is a new item, this means this event is created from the story form, and we want to show a message stating that the event is in pending
     if ($event->isPending() && !empty($item->isNew)) {
         $item->title = JText::_('APP_USER_EVENTS_STREAM_EVENT_PENDING_APPROVAL');
         $item->display = SOCIAL_STREAM_DISPLAY_MINI;
         return;
     }
     // If event is not published, we do not want to render the stream.
     if (!$event->isPublished()) {
         return;
     }
     if ($event->isInviteOnly() && !$event->getGuest()->isGuest()) {
         return;
     }
     if (!in_array($item->context, array('events', 'guests', 'tasks', 'discussions'))) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#f06050';
     $item->fonticon = 'ies-calendar';
     $item->label = FD::_('APP_USER_EVENTS_STREAM_TOOLTIP', true);
     if ($event->isGroupEvent()) {
         $item->label = FD::_('APP_USER_EVENTS_GROUP_EVENT_STREAM_TOOLTIP', true);
     }
     if ($item->context === 'events' || $item->context === 'guests') {
         // Context are split into events and guests
         // "events" context are stream items that are related to event item
         // "guests" context are stream items that are related to guests of the event
         // From events
         // stream_feature
         // stream_create
         // stream_update
         // From guests
         // stream_makeadmin
         // stream_going
         // stream_notgoing
         if (!$this->getParams()->get('stream_' . $item->verb, true)) {
             return;
         }
         // Event stream items should just be mini
         // $item->display = SOCIAL_STREAM_DISPLAY_MINI;
         // This goes to user/events/streams in accordance to verb
         // $this->processStream($item);
         $this->set('event', $event);
         $this->set('actor', $item->actor);
         if ($event->isGroupEvent()) {
             $this->set('group', $event->getGroup());
         }
         // streams/create.title
         // streams/feature.title
         // streams/makeadmin.title
         // streams/going.title
         // streams/notgoing.title
         // streams/update.title
         $item->title = parent::display('streams/events/' . $item->verb . '.title');
         $item->content = parent::display('streams/events/content');
         // APP_USER_EVENTS_STREAM_OPENGRAPH_CREATE
         // APP_USER_EVENTS_STREAM_OPENGRAPH_FEATURE
         // APP_USER_EVENTS_STREAM_OPENGRAPH_MAKEADMIN
         // APP_USER_EVENTS_STREAM_OPENGRAPH_UPDATE
         // APP_USER_EVENTS_STREAM_OPENGRAPH_GOING
         // APP_USER_EVENTS_STREAM_OPENGRAPH_NOTGOING
         $item->opengraph->addDescription(JText::sprintf('APP_USER_EVENTS_STREAM_OPENGRAPH_' . strtoupper($item->verb), $item->actor->getName(), $event->getName()));
         return;
     }
     if ($item->context === 'discussions') {
         $this->processDiscussionStream($item, $includePrivacy);
         return;
     }
     if ($item->context === 'tasks') {
         $this->processTaskStream($item, $includePrivacy);
         return;
     }
 }
Example #15
0
 private function prepareGroupTask(SocialStreamItem &$item, $group, $includePrivacy)
 {
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#658ea6';
     $item->fonticon = 'ies-checkbox-checked';
     $item->label = FD::_('APP_GROUPS_TASKS_STREAM_TOOLTIP', true);
     // Get the verb
     $verb = $item->verb;
     if ($verb == 'createTask') {
         $this->prepareCreatedTaskStream($item, $includePrivacy);
     }
     if ($verb == 'createMilestone') {
         $this->prepareCreateMilestoneStream($item, $includePrivacy);
     }
 }
Example #16
0
 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'k2') {
         return;
     }
     // Decorate the stream item
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#415457';
     $item->fonticon = 'ies-list-2';
     $item->label = FD::_('APP_USER_K2_STREAM_TOOLTIP', true);
     // Get application params
     $params = $this->getParams();
     if ($item->verb == 'create' && $params->get('stream_create', true)) {
         $this->prepareCreateArticleStream($item);
     }
     if ($item->verb == 'update' && $params->get('stream_update', true)) {
         $this->prepareUpdateArticleStream($item);
     }
     if ($item->verb == 'read' && $params->get('stream_read', true)) {
         $this->prepareReadArticleStream($item);
     }
 }
Example #17
0
 /**
  * Triggered to prepare the stream item
  *
  * @since   1.0
  * @access  public
  * @param   string
  * @return
  */
 public function onPrepareStream(SocialStreamItem &$item)
 {
     // If this is not it's context, we don't want to do anything here.
     if ($item->context != 'story') {
         return;
     }
     // Get the event object
     $group = $item->getCluster();
     if (!$group) {
         return;
     }
     if (!$group->canViewItem()) {
         return;
     }
     // Allow editing of the stream item
     $item->editable = $this->my->isSiteAdmin() || $group->isAdmin() || $item->actor->id == $this->my->id;
     // Get the actor
     $actor = $item->getActor();
     // Decorate the stream
     $item->fonticon = 'ies-pencil-2';
     $item->color = '#6E9545';
     $item->label = FD::_('APP_GROUP_STORY_STREAM_TOOLTIP', true);
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $this->set('group', $group);
     $this->set('actor', $actor);
     $this->set('stream', $item);
     $item->title = parent::display('streams/title.' . $item->verb);
     $item->content = parent::display('streams/content.' . $item->verb);
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($item->uid, $item->context, $item->verb, SOCIAL_APPS_GROUP_GROUP, $item->uid);
     $item->likes = $likes;
     // If this update is posted in a group, the comments should be linked to the group item
     $comments = FD::comments($item->uid, $item->context, $item->verb, SOCIAL_APPS_GROUP_GROUP, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item->uid))), $item->uid);
     $item->comments = $comments;
     return true;
 }
Example #18
0
 /**
  * Responsible to generate the stream contents.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$item)
 {
     // Load up the config object
     $config = FD::config();
     if ($item->context != 'badges' || !$config->get('badges.enabled')) {
         return;
     }
     // Check if the app should be able to generate the stream.
     $params = $this->getParams();
     if (!$params->get('stream_achieved', true)) {
         return;
     }
     // Get the actor
     $actor = $item->actor;
     // check if the actor is ESAD profile or not, if yes, we skip the rendering.
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     // Test if stream item is allowed
     if (!$this->onStreamValidatePrivacy($item)) {
         return;
     }
     // Try to get the badge object from the params
     $raw = $item->params;
     $badge = FD::table('Badge');
     $badge->load($item->contextId);
     // lets load 3rd party component's language file if this is not a core badge
     if ($badge->extension && $badge->extension != 'com_easysocial') {
         Foundry::language()->load($badge->extension, JPATH_ROOT);
     }
     // Set the display mode to be full.
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#FEBC9D';
     $item->fonticon = 'ies-crown';
     $item->label = FD::_('APP_USER_BADGES_STREAM_TOOLTIP', true);
     // Format the likes for the stream
     $likes = FD::likes();
     $likes->get($item->contextId, $item->context, $item->verb . '.' . $item->actor->id, SOCIAL_APPS_GROUP_USER, $item->uid);
     $item->likes = $likes;
     // Apply comments on the stream
     $comments = FD::comments($item->contextId, $item->context, $item->verb . '.' . $item->actor->id, SOCIAL_APPS_GROUP_USER, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item->uid))), $item->uid);
     $item->comments = $comments;
     $this->set('badge', $badge);
     $this->set('actor', $actor);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
     return true;
 }
Example #19
0
 private function prepareLoginStream(SocialStreamItem &$item)
 {
     $params = $this->getParams();
     // Check if the settings is enabled.
     if (!$params->get('stream_login', false)) {
         $item->title = '';
         return;
     }
     // Decorate the stream
     $item->color = '#EF9033';
     $item->fonticon = 'ies-locked';
     $item->label = FD::_('APP_USER_USERS_LOGIN_STREAM_TOOLTIP', true);
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     // Set the actor
     $actor = $item->actor;
     // check if actor is an ESAD user, if yes, do not render the stream.
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     $this->set('actor', $actor);
     $item->title = parent::display('streams/login.title');
     if (isset($item->opengraph) && $item->opengraph instanceof SocialOpengraph) {
         $item->opengraph->addDescription($item->title);
     }
 }
Example #20
0
 /**
  * Trigger for onPrepareStream
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     // We do not want stream items to contain the repost link
     if ($item->cluster_id && $item->cluster_type) {
         $group = FD::group($item->cluster_id);
         if (!$group->isMember()) {
             $item->repost = false;
             $item->commentLink = false;
             $item->commentForm = false;
         }
         // Only show Social sharing in public group
         if (!$group->isOpen()) {
             $item->sharing = false;
         }
     }
     // We only want to process related items
     if ($item->context != 'groups') {
         return;
     }
     // Check for group access
     $params = FD::registry($item->params);
     $obj = $params->get('group');
     $group = FD::group($obj);
     // Check if the viewer can view items from this group
     if (!$group->canViewItem()) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     $item->color = '#303229';
     $item->fonticon = 'ies-users';
     $item->label = FD::_('APP_GROUP_GROUPS_STREAM_TOOLTIP', true);
     $appParams = $this->getParams();
     if ($item->verb == 'join' && $appParams->get('stream_join', true)) {
         $this->prepareJoinStream($item);
     }
     if ($item->verb == 'leave' && $appParams->get('stream_leave', true)) {
         $this->prepareLeaveStream($item);
     }
     if ($item->verb == 'makeadmin' && $appParams->get('stream_promoted', true)) {
         $this->prepareMakeAdminStream($item);
     }
     if ($item->verb == 'update' && $appParams->get('stream_update', true)) {
         $this->prepareUpdateStream($item);
     }
     if ($item->verb == 'create' && $appParams->get('stream_create', true)) {
         $this->prepareCreateStream($item);
     }
 }
Example #21
0
 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context !== 'feeds') {
         return;
     }
     // Get app params
     $params = $this->getParams();
     if (!$params->get('stream_create', true)) {
         return;
     }
     // Get the feed table
     $obj = FD::makeObject($item->params);
     $feed = $this->getTable('Feed');
     $feed->bind($obj);
     $actor = $item->actor;
     $app = $this->getApp();
     $this->set('app', $app);
     $this->set('feed', $feed);
     $this->set('actor', $actor);
     $item->color = '#e67e22';
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->fonticon = 'ies-feed';
     $item->label = FD::_('APP_USER_FEED_STREAM_TOOLTIP', true);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
 }
Example #22
0
 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'discussions') {
         return;
     }
     // group access checking
     $group = FD::group($item->cluster_id);
     if (!$group) {
         return;
     }
     if (!$group->canViewItem()) {
         return;
     }
     // Ensure that announcements are enabled for this group
     $registry = $group->getParams();
     if (!$registry->get('discussions', true)) {
         return;
     }
     // Define standard stream looks
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#69b598';
     $item->fonticon = 'ies-comments';
     $item->label = FD::_('COM_EASYSOCIAL_STREAM_CONTEXT_TITLE_DISCUSSIONS_TOOLTIP', true);
     $params = $this->getApp()->getParams();
     if ($params->get('stream_' . $item->verb, true) == false) {
         return;
     }
     // Do not allow user to repost discussions
     $item->repost = false;
     // Process likes and comments differently.
     $likes = FD::likes();
     $likes->get($item->contextId, $item->context, $item->verb, SOCIAL_APPS_GROUP_GROUP, $item->uid);
     $item->likes = $likes;
     // Apply comments on the stream
     $comments = FD::comments($item->contextId, $item->context, $item->verb, SOCIAL_APPS_GROUP_GROUP, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item->uid))), $item->uid);
     $item->comments = $comments;
     if ($item->verb == 'create') {
         $this->prepareCreateDiscussionStream($item);
     }
     if ($item->verb == 'reply') {
         $this->prepareReplyStream($item);
     }
     if ($item->verb == 'answered') {
         $this->prepareAnsweredStream($item);
     }
     if ($item->verb == 'lock') {
         $this->prepareLockedStream($item);
     }
 }
Example #23
0
 /**
  * Trigger for onPrepareStream
  *
  * @since   1.2
  * @access  public
  */
 public function onPrepareStream(SocialStreamItem &$item)
 {
     // We only want to process related items
     if ($item->context != 'photos') {
         return;
     }
     // Do not allow user to access photos if it's not enabled
     if (!$this->config->get('photos.enabled') && $item->verb != 'uploadAvatar' && $item->verb != 'updateCover') {
         return;
     }
     // Load up the event
     $event = FD::event($item->cluster_id);
     if (!$event) {
         return;
     }
     // Test if the viewer can really view the item
     if (!$event->canViewItem()) {
         return;
     }
     // Get the element and context out
     $element = $item->context;
     $uid = $item->contextId;
     // Get the photo object
     $photoId = $item->contextId;
     $photo = $this->getPhotoObject($item);
     // Process actions on the stream
     $this->processActions($item);
     // Decorate the stream
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->fonticon = 'ies-picture';
     $item->color = '#F8829C';
     $item->label = FD::_('APP_EVENT_PHOTOS_STREAM_TOOLTIP', true);
     // Get the app params.
     $params = $this->getParams();
     if ($item->verb == 'uploadAvatar' && $params->get('stream_avatar', true)) {
         $this->prepareUploadAvatarStream($item);
     }
     if ($item->verb == 'updateCover' && $params->get('stream_cover', true)) {
         $this->prepareUpdateCoverStream($item);
     }
     // Photo stream types. Uploaded via the story form
     if ($item->verb == 'share' && $params->get('stream_share', true)) {
         $this->prepareSharePhotoStream($item);
     }
     if (($item->verb == 'add' || $item->verb == 'create') && $params->get('stream_upload', true)) {
         $this->preparePhotoStream($item);
     }
     return true;
 }
Example #24
0
 /**
  * Generates the stream title of event.
  *
  * @since    1.0
  * @access    public
  * @param    object    $params        A standard object with key / value binding.
  *
  * @return    none
  */
 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     if ($stream->context != 'links') {
         return;
     }
     // event access checking
     $event = FD::event($stream->cluster_id);
     if (!$event || !$event->canViewItem()) {
         return;
     }
     //get links object, in this case, is the stream_item
     $uid = $stream->uid;
     $stream->color = '#5580BE';
     $stream->fonticon = 'ies-link';
     $stream->label = FD::_('APP_EVENT_LINKS_STREAM_TOOLTIP', true);
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($stream->uid, $stream->context, $stream->verb, SOCIAL_APPS_GROUP_EVENT, $stream->uid);
     $stream->likes = $likes;
     // Apply comments on the stream
     $comments = FD::comments($stream->uid, $stream->context, $stream->verb, SOCIAL_APPS_GROUP_EVENT, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $stream->uid))), $stream->uid);
     $stream->comments = $comments;
     // Apply repost on the stream
     $stream->repost = FD::get('Repost', $stream->uid, SOCIAL_TYPE_STREAM, SOCIAL_APPS_GROUP_EVENT);
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy && !$privacy->validate('story.view', $uid, SOCIAL_TYPE_LINKS, $stream->actor->id)) {
         return;
     }
     $actor = $stream->actor;
     $target = count($stream->targets) > 0 ? $stream->targets[0] : '';
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $assets = $stream->getAssets();
     if (empty($assets)) {
         return;
     }
     $assets = $assets[0];
     $videoHtml = '';
     // Retrieve the link that is stored.
     $hash = md5($assets->get('link'));
     $link = FD::table('Link');
     $link->load(array('hash' => $hash));
     $linkObj = FD::json()->decode($link->data);
     // Determine if there's any embedded object
     $oembed = isset($linkObj->oembed) ? $linkObj->oembed : '';
     // Get app params
     $params = $this->getParams();
     $this->set('event', $event);
     $this->set('params', $params);
     $this->set('oembed', $oembed);
     $this->set('assets', $assets);
     $this->set('actor', $actor);
     $this->set('target', $target);
     $this->set('stream', $stream);
     $stream->title = parent::display('streams/title.' . $stream->verb);
     $stream->preview = parent::display('streams/preview.' . $stream->verb);
     return true;
 }
Example #25
0
<?php

/**
* @package		EasySocial
* @copyright	Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-pictures-2" data-story-attachment-icon data-es-provide="tooltip" data-placement="top" data-original-title="<?php 
echo FD::_('APP_USER_PHOTOS_PANEL_TOOLTIP', true);
?>
"></i>
Example #26
0
 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context !== 'notes') {
         return;
     }
     // Determine if we should display the stream items
     $params = $this->getParams();
     if ($item->verb == 'create' && !$params->get('stream_create', true)) {
         return;
     }
     if ($item->verb == 'update' && !$params->get('stream_update', true)) {
         return;
     }
     // Decorate the stream
     $item->color = '#552E54';
     $item->fonticon = 'ies-notebook';
     $item->label = FD::_('APP_USER_NOTES_STREAM_TOOLTIP', true);
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     // Apply comments on the stream
     $app = $this->getApp();
     $permalink = $app->getPermalink('canvas', array('userId' => $item->actor->id, 'cid' => $item->contextId));
     $comments = FD::comments($item->contextId, $item->context, $item->verb, SOCIAL_APPS_GROUP_USER, array('url' => $permalink), $item->uid);
     $item->comments = $comments;
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($item->contextId, $item->context, $item->verb, SOCIAL_APPS_GROUP_USER, $item->uid);
     $item->likes = $likes;
     // Apply repost on the stream
     $repost = FD::get('Repost', $item->uid, SOCIAL_TYPE_STREAM);
     $item->repost = $repost;
     // Load the note
     $note = $this->getTable('Note');
     $note->load($item->contextId);
     // Get params
     $params = $this->getParams();
     $this->set('params', $params);
     $this->set('note', $note);
     $this->set('actor', $item->actor);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
     $item->opengraph->addDescription($note->getContent());
 }
Example #27
0
 /**
  * Responsible to generate the stream contents.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'friends') {
         return;
     }
     // Determines if the stream should be generated
     $params = $this->getParams();
     if (!$params->get('stream_friends', true)) {
         return;
     }
     // Get the actor
     $actor = $item->actor;
     // check if the actor is ESAD profile or not, if yes, we skip the rendering.
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy) {
         if (!$privacy->validate('core.view', $item->contextId, 'friends', $item->actor->id)) {
             return;
         }
     }
     // Get the context id.
     $id = $item->contextId;
     // no target. this could be data error. ignore this item.
     if (!$item->targets) {
         return;
     }
     // Receiving actor.
     $target = $item->targets[0];
     // Get the current id.
     $id = JRequest::getInt('id');
     // Decorate the stream
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     $item->color = '#7AD7EE';
     $item->fonticon = 'ies-user';
     $item->label = FD::_('APP_USER_FRIENDS_STREAM_TOOLTIP', true);
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($item->contextId, $item->context, $item->verb, SOCIAL_APPS_GROUP_USER, $item->uid);
     $item->likes = $likes;
     $this->set('actor', $actor);
     $this->set('target', $target);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     if ($includePrivacy) {
         $item->privacy = $privacy->form($item->contextId, 'friends', $item->actor->id, 'core.view', false, $item->uid);
     }
     return true;
 }
Example #28
0
            echo FD::_('COM_EASYSOCIAL_EVENTS_UPCOMING_EVENT_TOOLTIP', true);
            ?>
" data-es-provide="tooltip" data-placement="top">
                                        <i class="ies-alarm"></i> <?php 
            echo JText::_('COM_EASYSOCIAL_EVENTS_UPCOMING_EVENT');
            ?>
                                    </span>
                                    <?php 
        }
        ?>

                                    <?php 
        if ($event->isRecurringEvent()) {
            ?>
                                    <span class="label label-warning" data-original-title="<?php 
            echo FD::_('COM_EASYSOCIAL_EVENTS_RECURRING_EVENT_TOOLTIP', true);
            ?>
" data-es-provide="tooltip" data-placement="top">
                                        <i class="ies-refresh"></i> <?php 
            echo JText::_('COM_EASYSOCIAL_EVENTS_RECURRING_EVENT');
            ?>
                                    </span>
                                    <?php 
        }
        ?>
                                </div>
                            </div>
                        </div>
                    </td>

                    <?php 
Example #29
0
 /**
  * Triggered to prepare the stream item
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     // If this is not it's context, we don't want to do anything here.
     if ($stream->context != 'story') {
         return;
     }
     $uid = $stream->uid;
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($stream->cluster_id) {
         // Group access checking
         $cluster = FD::cluster($stream->cluster_type, $stream->cluster_id);
         if (!$cluster) {
             return;
         }
         if (!$cluster->canViewItem()) {
             return;
         }
         // Allow editing of the stream item
         $stream->editable = $my->isSiteAdmin() || $cluster->isAdmin() || $stream->actor->id == $my->id;
     } else {
         // Allow editing of the stream item
         $stream->editable = $my->isSiteAdmin() || $stream->actor->id == $my->id;
     }
     // we stil need to check for the privacy because the context might come from the 'repost'
     if ($includePrivacy && !$privacy->validate('story.view', $uid, SOCIAL_TYPE_STORY, $stream->actor->id)) {
         return;
     }
     // Actor of this stream
     $actor = $stream->actor;
     $target = count($stream->targets) > 0 ? $stream->targets[0] : '';
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $stream->color = '#16a085';
     $stream->fonticon = 'ies-pencil-2';
     $stream->label = FD::_('APP_USER_STORY_UPDATES_STREAM_TOOLTIP', true);
     if ($stream->cluster_id) {
         if ($stream->cluster_type == SOCIAL_TYPE_GROUP) {
             $stream->color = '#303229';
             $stream->fonticon = 'ies-users';
             $stream->label = FD::_('APP_USER_STORY_GROUPS_STREAM_TOOLTIP', true);
         }
         if ($stream->cluster_type == SOCIAL_TYPE_EVENT) {
             $stream->color = '#f06050';
             $stream->fonticon = 'ies-calendar';
             $stream->label = FD::_('APP_USER_STORY_EVENTS_STREAM_TOOLTIP', true);
         }
     }
     $appGroup = SOCIAL_APPS_GROUP_USER;
     if ($stream->cluster_id) {
         if ($stream->cluster_type == SOCIAL_TYPE_EVENT) {
             $appGroup = SOCIAL_APPS_GROUP_EVENT;
         } else {
             $appGroup = SOCIAL_APPS_GROUP_GROUP;
         }
     }
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($stream->uid, $stream->context, $stream->verb, $appGroup, $stream->uid);
     $stream->likes = $likes;
     // Apply comments on the stream
     $comments = FD::comments($stream->uid, $stream->context, $stream->verb, $appGroup, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $stream->uid))), $stream->uid);
     $stream->comments = $comments;
     // Apply repost on the stream
     $repost = FD::get('Repost', $stream->uid, SOCIAL_TYPE_STREAM, $appGroup);
     $stream->repost = $repost;
     // If this is a group type, and the viewer is not a member of the group, we need to hide these data
     if ($stream->cluster_id) {
         $cluster = FD::cluster($stream->cluster_type, $stream->cluster_id);
         if (!$cluster->isMember()) {
             $stream->commentLink = false;
             $stream->repost = false;
             $stream->commentForm = false;
         }
         // Sharing only show in public group
         if (!$cluster->isOpen()) {
             $stream->sharing = false;
         }
     }
     // Get application params
     $params = $this->getParams();
     $this->set('params', $params);
     $this->set('actor', $actor);
     $this->set('target', $target);
     $this->set('stream', $stream);
     if ($stream->cluster_id) {
         $clusterReg = FD::registry($stream->params);
         $object = $clusterReg->get($stream->cluster_type);
         $cluster = FD::cluster($stream->cluster_type);
         if ($object) {
             // If have the object only bind
             $cluster->bind($object);
         } else {
             $cluster = $stream->getCluster();
         }
         $this->set('cluster', $cluster);
     }
     $titleFileName = $stream->cluster_type ? $stream->cluster_type . '.' . $stream->verb : $stream->verb;
     $stream->title = parent::display('streams/title.' . $titleFileName);
     $stream->content = parent::display('streams/content.' . $stream->verb);
     $stream->opengraph->addDescription($stream->content);
     if ($includePrivacy) {
         $stream->privacy = $privacy->form($uid, SOCIAL_TYPE_STORY, $stream->actor->id, 'story.view', false, $stream->uid);
     }
     return true;
 }
Example #30
0
<?php

/**
* @package        EasySocial
* @copyright    Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license        GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-pictures-2" data-story-attachment-icon data-es-provide="tooltip" data-placement="top" data-original-title="<?php 
echo FD::_('APP_EVENT_PHOTOS_PANEL_TOOLTIP', true);
?>
"></i>