Beispiel #1
0
 public function getGettingStartedTask()
 {
     $decodedGetStartedTasks = $this->getParam('get_started_tasks');
     $getStartedTasks = json_decode($decodedGetStartedTasks, true);
     if ($decodedGetStartedTasks == null) {
         // If the user doesn't have a 'get_started_tasks' param, create one
         $newGetStartedTask = array();
         foreach ($this->_defaultGetStartedTasks as $task => $detail) {
             // TODO: TEMPORARY IMPORT; REMOVE ON PRODUCTION
             if ($task == self::GSTARTED_COMPLETE_PROFILE) {
                 // Get the old profile incomplete percentage and store it in the new one
                 $oldProfileCompletion = $this->getParam('profile_details_unfilled');
                 $newGetStartedTask[$task] = $oldProfileCompletion != null ? 100 - $oldProfileCompletion : 0;
             } else {
                 if ($task == self::GSTARTED_ADD_AVATAR) {
                     // If the avatar is already there, set the task as completed
                     $avatarExists = $this->getAvatarPath() ? true : false;
                     $newGetStartedTask[$task] = $avatarExists ? 100 : 0;
                 } else {
                     if ($task == self::GSTARTED_JOIN_GROUP) {
                         // If the user has already joined group[s], set the task as completed
                         $groupList = $this->getParam('groups_member');
                         $newGetStartedTask[$task] = JXUtility::csvCount($groupList) ? 100 : 0;
                     } else {
                         if ($task == self::GSTARTED_INVITE_FRIENDS) {
                             // If the user is admin, he will have additional task to invite users
                             if ($this->isAdmin()) {
                                 JModel::addIncludePath(JPATH_ROOT . DS . 'components' . DS . 'com_account' . DS . 'tables');
                                 $inviteModel = JModel::getInstance('UsersInvite', 'AccountModel');
                                 $total = $inviteModel->getTotal(array('from' => $this->email));
                                 $newGetStartedTask[$task] = $total >= 5 ? 100 : 0;
                             } else {
                                 continue;
                             }
                         } else {
                             $newGetStartedTask[$task] = 0;
                         }
                     }
                 }
             }
         }
         $this->setParam('get_started_tasks', json_encode($newGetStartedTask));
         $this->save();
         return $newGetStartedTask;
     } else {
         return $getStartedTasks;
     }
 }
Beispiel #2
0
		}*/
?>

		<?php 
foreach ($rows as $stream) {
    $my = JXFactory::getUser();
    $user = JXFactory::getUser($stream->user_id);
    $data = json_decode($stream->raw);
    $date = new JDate($stream->created);
    $members = array();
    if (!empty($stream->group_id)) {
        $group = $stream->getGroup();
        // Message sent to
        $memberIds = $group->members;
        $memberIds = explode(',', trim($memberIds, ','));
        $memberCount = JXUtility::csvCount($group->members);
        if ($memberCount > 1) {
            foreach ($memberIds as $id) {
                if (intval($id) > 0 && $id != $group->creator) {
                    $member = JXFactory::getUser($id);
                    $members[] = '<a href="' . $member->getURL() . '">' . $this->escape($member->name) . '</a>';
                }
            }
        } else {
            $members[] = 'Yourself';
        }
    }
    ?>
		<li class="direct-list-item">
			<div class="direct-avatar">
				<a href="<?php 
Beispiel #3
0
 /**
  * Show popup list of all followers
  */
 public function followers()
 {
     $group = JTable::getInstance('Group', 'StreamTable');
     $group->load(JRequest::getVar('group_id'));
     $followers = array();
     $html = '<p>No one is following the group</p>';
     $followers = JXUtility::csvDiff($group->followers, $group->members);
     if (JXUtility::csvCount($followers) > 0) {
         $html = '<ul>';
         foreach ($items = explode(',', $followers) as $id) {
             $user = JXFactory::getUser($id);
             $html .= '<li>' . $user->name . '</li>';
         }
         $html .= '</ul>';
     }
     $data = array();
     $data['html'] = $html;
     header('Content-Type: text/json');
     echo json_encode($data);
     exit;
 }
		<div class="group-module-members">
			<span class="count-members"><strong><?php 
echo JXUtility::csvCount($group->members);
?>
</strong>&nbsp;<?php 
echo JText::_('COM_STREAM_LABEL_MEMBERS');
?>
</span> 
			<span class="count-followers"><a data-group_id="<?php 
echo $group->id;
?>
" data-content="<?php 
echo StreamTemplate::escape($followersHtml);
?>
" href="#showFollowers"><strong><?php 
echo JXUtility::csvCount(JXUtility::csvDiff($group->followers, $group->members));
?>
</strong>&nbsp;<?php 
echo JText::_('COM_STREAM_LABEL_FOLLOWERS');
?>
</a></span>
		</div>
	</div>
	
	<?php 
/*?>
	<div class="group-module-actions">
		<form name="group-actions">
			
			<?php if(!$group->isMember($my->id)) { ?>
				<?php if(!$group->isFollower($my->id)) { ?>
Beispiel #5
0
 public function getTaskCount()
 {
     $todoIds = $this->data->getParam('todo');
     return JXUtility::csvCount($todoIds);
 }
Beispiel #6
0
 function display($tpl = null)
 {
     include_once JPATH_LIBRARIES . DS . 'joomla' . DS . 'html' . DS . 'html' . DS . 'string.php';
     $name = JRequest::getString('user');
     $userId = JUserHelper::getUserId($name);
     $user = JXFactory::getUser($userId);
     $my = JXFactory::getUser();
     $lastStatus = $user->getStatus();
     $task = JRequest::getVar('task', 'activities');
     $this->addPathway(JText::_('NAVIGATOR_LABEL_PEOPLE'), JRoute::_('index.php?option=com_people&view=members'));
     $this->addPathway($user->name);
     $doc = JFactory::getDocument();
     // Add attachment script
     $doc->addScript(JURI::root() . 'media/uploader/fileuploader.js');
     $doc->addStyleSheet(JURI::root() . 'media/uploader/fileuploader.css');
     $groupsView = StreamFactory::getView('groups');
     // $html = $groupsView->getUserGroupsHTML($userId);
     // JXModule::addBuffer('right', $html );
     // this section is to get the group_type to set the twitter button's toggle
     $validGroupType = JAnalytics::getGroupType();
     $analyticsGroupBy = JRequest::getVar('group_type', 'day');
     $analyticIndex = array_search($analyticsGroupBy, $validGroupType);
     $analyticIndex = $analyticIndex === false ? 1 : $analyticIndex;
     $this->assignRef('user', $user);
     $this->assignRef('my', $my);
     $this->assignRef('analyticIndex', $analyticIndex);
     $this->assignRef('analyticType', $validGroupType);
     $this->assign('lastStatus', $lastStatus[0]->message);
     $this->assign('analyticHtml', $this->generateAnalytics($user));
     switch ($task) {
         case 'activities':
             $companyView = StreamFactory::getView('company');
             $filter = array();
             $filter['user_id'] = $user->id;
             // Show only the user's stream
             $options = array();
             $options['filter'] = 'stream.filter.profile';
             $activities = $companyView->getStreamDataHTML($filter, $options);
             $this->assignRef('activities', $activities);
             break;
         case 'bio':
             // Bio
             JForm::addFieldPath(JPATH_COMPONENT . DS . 'models' . DS . 'fields');
             $form = JForm::getInstance('form', JPATH_ROOT . DS . 'components' . DS . 'com_profile' . DS . 'models' . DS . 'forms' . DS . 'details.xml');
             $detailModel = ProfileFactory::getModel('detail');
             $form->bind(array('params' => $detailModel->getDetails($user->id)));
             $this->assignRef('form', $form);
             $this->assignRef('user', $user);
             break;
         case 'content':
             $this->assignRef('user', $user);
             $streamModel = StreamFactory::getModel('stream');
             $blogs = $streamModel->getStream(array('type' => 'page', 'user_id' => $user->id), 10);
             $this->assign('blogs', $blogs);
             $this->assign('blogCount', $streamModel->countStream(array('type' => 'page', 'user_id' => $user->id)));
             $links = $user->getParam('links', '');
             $linkModel = StreamFactory::getModel('links');
             $links = $linkModel->getLinks(array('id' => $links, '!link' => ''), 10);
             $this->assignRef('links', $links);
             $this->assign('linkCount', JXUtility::csvCount($user->getParam('links')));
             $fileModel = StreamFactory::getModel('files');
             $files = $fileModel->getFiles(array('user_id' => $user->id), 10);
             $fileView = StreamFactory::getView('files');
             $this->assignRef('fileView', $fileView);
             $this->assignRef('files', $files);
             $this->assign('fileCount', $fileModel->countFiles(array('user_id' => $user->id)));
             break;
     }
     //$document = JFactory::getDocument();
     // $document->setTitle(JText::_('COM_PROFILE_LABEL_PROFILE_PAGE').': '.$user->name);
     $groupView = StreamFactory::getView('groups');
     JXModule::addBuffer('right', $groupView->getUserActiveGroupsHTML($user->id));
     // development
     $fileView = StreamFactory::getView('files');
     JXModule::addBuffer('right', $fileView->modUserFilesHTML($user));
     parent::display($tpl);
 }