Exemplo n.º 1
0
                ▶ <a href="<?php 
    echo CUrlHelper::eventLink($event->id);
    ?>
"><?php 
    echo $event->title;
    ?>
</a>
            </span>
        <?php 
} else {
    if ($activity->get('groupid')) {
        $group = $this->group;
        ?>
            <span class="joms-stream__reference">
                ▶ <a href="<?php 
        echo CUrlHelper::groupLink($group->id);
        ?>
"><?php 
        echo $group->name;
        ?>
</a>
            </span>
            <!-- Target is user profile -->
        <?php 
    } else {
        if ($activity->get('app') == 'profile' && $activity->get('target') != 0 && $activity->get('target') != $user->id) {
            ?>
            <span class="joms-stream__reference">
                ▶ <a href="<?php 
            echo CUrlHelper::userLink($activity->target);
            ?>
').remove(); jax.call('community','notification,ajaxGroupRejectRequest', '<?php 
    echo $row->id;
    ?>
' , '<?php 
    echo $row->groupId;
    ?>
');">

							    <?php 
    echo JText::_('COM_COMMUNITY_FRIENDS_PENDING_ACTION_REJECT');
    ?>

						    </a>
							
							<a class="jsIcon1 icon-go" style="text-indent: 0;" href="<?php 
    echo CUrlHelper::groupLink($row->groupId);
    ?>
" >

							    <?php 
    echo JText::_('COM_COMMUNITY_EVENTS_GO');
    ?>

						    </a>
						</span>
					    </span>

						<span id="error-request-<?php 
    echo $row->id;
    ?>
">
Exemplo n.º 3
0
		<!--NEWS FEED CONTENT-->
	    <div class="newsfeed-content">
			<div class="newsfeed-content-top">
			<?php 
                // Put user header link if necessary
                if ($act->eventid) {
                    echo '<div class="newsfeed-content-actor">';
                    echo '<strong><a class="actor-link" href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a></strong> <span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span> <a href="' . CUrlHelper::eventLink($act->eventid) . '">' . $act->appTitle . '</a>';
                    if ($act->event_access == 1) {
                        echo ' <span title="' . JText::_('COM_COMMUNITY_GROUPS_PRIVATE') . '" class="com_icons com_icons12 com_icons-inline com_icons-private jomNameTips">' . JText::_('COM_COMMUNITY_GROUPS_PRIVATE') . '</span>';
                    }
                    echo '</div>';
                } else {
                    if ($act->groupid) {
                        echo '<div class="newsfeed-content-actor">';
                        echo '<strong><a class="actor-link" href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a></strong> <span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span> <a href="' . CUrlHelper::groupLink($act->groupid) . '">' . $act->appTitle . '</a>';
                        if ($act->group_access == 1) {
                            echo ' <span title="' . JText::_('COM_COMMUNITY_GROUPS_PRIVATE') . '" class="com_icons com_icons12 com_icons-inline com_icons-private jomNameTips">' . JText::_('COM_COMMUNITY_GROUPS_PRIVATE') . '</span>';
                        }
                        echo '</div>';
                    } else {
                        if (!empty($act->target) && $act->target != $act->actor && $act->app == 'profile' && $act->target != $actorId) {
                            // Actor doing something to target
                            echo '<div class="newsfeed-content-actor">';
                            echo '<strong><a class="actor-link" href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a></strong> ';
                            echo '<span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span> ';
                            echo '<a class="actor-link" href="' . CUrlHelper::userLink($act->target) . '">' . $target->getDisplayName() . '</a>';
                            echo '</div>';
                        } else {
                            // Everythings else should have the actor's title
                            $actorNeedle = '<a class="actor-link" href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a>';
Exemplo n.º 4
0
        }
        ?>

                <small>
                    <a href="<?php 
        echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $video->creator);
        ?>
"><?php 
        echo $video->getCreatorName();
        ?>
</a>
                    <?php 
        if ($video->groupid) {
            $group = JTable::getInstance('Group', 'CTable');
            $group->load($video->groupid);
            echo JText::sprintf('COM_COMMUNITY_VIDEOS_FROM_GROUP', '<a href="' . CUrlHelper::groupLink($group->id) . '">' . $group->name . '</a>');
        } elseif ($video->eventid) {
            $event = JTable::getInstance('Event', 'CTable');
            $event->load($video->eventid);
            echo JText::sprintf('COM_COMMUNITY_VIDEOS_FROM_EVENT', '<a href="' . CUrlHelper::eventLink($event->id) . '">' . $event->title . '</a>');
        } elseif ($params->get('activity_id')) {
            $targetUser = CFactory::getUser($params->get('target_id'));
            ?>
                        ▶ <?php 
            echo CLinkGeneratorHelper::getUserURL($targetUser->id, $targetUser->getDisplayName());
            ?>
 <a href="<?php 
            echo CUrlHelper::streamURI($params->get('activity_id'), $targetUser->id);
            ?>
"><?php 
            echo JText::_('COM_COMMUNITY_SINGULAR_STREAM');
Exemplo n.º 5
0
/**
 * Deprecated since 1.8
 * Use CUrlHelper::groupLink instead. 
 */
function cGroupLink($id, $route = true)
{
    return CUrlHelper::groupLink($id, $route);
}
Exemplo n.º 6
0
 public function ajaxGetNotification()
 {
     if (!COwnerHelper::isRegisteredUser()) {
         return $this->ajaxBlockUnregister();
     }
     $json = array();
     $my = CFactory::getUser();
     //$inboxModel       = CFactory::getModel( 'inbox' );
     $friendModel = CFactory::getModel('friends');
     $eventModel = CFactory::getModel('events');
     $groupModel = CFactory::getModel('groups');
     $notiTotal = 0;
     //getting pending event request
     $pendingEvent = $eventModel->getPending($my->id);
     $eventHtml = '';
     $event = JTable::getInstance('Event', 'CTable');
     if (!empty($pendingEvent)) {
         $notiTotal += count($pendingEvent);
         for ($i = 0; $i < count($pendingEvent); $i++) {
             $row = $pendingEvent[$i];
             $row->invitor = CFactory::getUser($row->invited_by);
             $event->load($row->eventid);
             // remove the notification if there is no longer seats available
             if (!CEventHelper::seatsAvailable($event)) {
                 unset($pendingEvent[$i]);
                 continue;
             }
             $row->eventAvatar = $event->getThumbAvatar();
             $row->url = CRoute::_('index.php?option=com_community&view=events&task=viewevent&eventid=' . $row->eventid . false);
             $row->isGroupEvent = $event->contentid ? true : false;
             if ($row->isGroupEvent) {
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($event->contentid);
                 $row->groupname = $group->name;
                 $row->grouplink = CUrlHelper::groupLink($group->id);
             }
         }
         $tmpl = new CTemplate();
         $tmpl->set('rows', $pendingEvent);
         $tmpl->setRef('my', $my);
         $eventHtml = $tmpl->fetch('notification.event.invitations');
     }
     //getting pending group request
     $pendingGroup = $groupModel->getGroupInvites($my->id);
     $groupHtml = '';
     $group = JTable::getInstance('Group', 'CTable');
     $groupNotiTotal = 0;
     if (!empty($pendingGroup)) {
         $groupNotiTotal += count($pendingGroup);
         for ($i = 0; $i < count($pendingGroup); $i++) {
             $gRow = $pendingGroup[$i];
             $gRow->invitor = CFactory::getUser($gRow->creator);
             $group->load($gRow->groupid);
             $gRow->name = $group->name;
             $gRow->groupAvatar = $group->getThumbAvatar();
             $gRow->url = CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $gRow->groupid . false);
         }
         $tmpl = new CTemplate();
         $tmpl->set('gRows', $pendingGroup);
         $tmpl->setRef('my', $my);
         $groupHtml = $tmpl->fetch('notification.group.invitations');
     }
     //geting pending private group join request
     //Find Users Groups Admin
     $allGroups = $groupModel->getAdminGroups($my->id, COMMUNITY_PRIVATE_GROUP);
     $groupMemberApproveHTML = '';
     //Get unApproved member
     if (!empty($allGroups)) {
         foreach ($allGroups as $groups) {
             $member = $groupModel->getMembers($groups->id, 0, false);
             if (!empty($member)) {
                 for ($i = 0; $i < count($member); $i++) {
                     $oRow = $member[$i];
                     $group->load($groups->id);
                     $oRow->groupId = $groups->id;
                     $oRow->groupName = $groups->name;
                     $oRow->groupAvatar = $group->getThumbAvatar();
                     $oRow->url = CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . false);
                     $members[] = $member[$i];
                 }
             }
         }
     }
     if (!empty($members)) {
         $tmpl = new CTemplate();
         $tmpl->set('oRows', $members);
         $tmpl->set('my', $my);
         $groupMemberApproveHTML = $tmpl->fetch('notification.group.request');
     }
     //non require action notification
     $itemHtml = '';
     $notifCount = 10;
     $notificationModel = CFactory::getModel('notification');
     $myParams = $my->getParams();
     $notifications = $notificationModel->getNotification($my->id, '0', $notifCount, $myParams->get('lastnotificationlist', ''));
     if (!empty($notifications)) {
         for ($i = 0; $i < count($notifications); $i++) {
             $iRow = $notifications[$i];
             $iRow->actorUser = CFactory::getUser($iRow->actor);
             $iRow->actorAvatar = $iRow->actorUser->getThumbAvatar();
             $iRow->actorName = $iRow->actorUser->getDisplayName();
             $iRow->timeDiff = CTimeHelper::timeLapse(CTimeHelper::getDate($iRow->created));
             $iRow->contentHtml = CContentHelper::injectTags($iRow->content, $iRow->params, true);
             $params = new CParameter($iRow->params);
             $iRow->url = $params->get('url', '');
         }
         $tmpl = new CTemplate();
         $tmpl->set('iRows', $notifications);
         $tmpl->setRef('my', $my);
         $itemHtml = $tmpl->fetch('notification.item');
     }
     $notiHtml = $eventHtml . $groupHtml . $groupMemberApproveHTML . $itemHtml;
     if (empty($notiHtml)) {
         $notiHtml .= '<li>';
         $notiHtml .= JText::_('COM_COMMUNITY_NO_NOTIFICATION');
         $notiHtml .= '</li>';
     }
     $date = JFactory::getDate();
     $myParams->set('lastnotificationlist', $date->toSql());
     $my->save('params');
     $url = CRoute::_('index.php?option=com_community&view=profile&task=notifications');
     $notiHtml .= '<div>';
     $notiHtml .= '<a href="' . $url . '" class="joms-button--neutral joms-button--full">' . JText::_('COM_COMMUNITY_VIEW_ALL') . '</a>';
     $notiHtml .= '</div>';
     $json['title'] = JText::_('COM_COMMUNITY_NOTIFICATIONS');
     $json['html'] = $notiHtml;
     die(json_encode($json));
 }