Example #1
0
 public function show($stream)
 {
     $my = JXFactory::getUser();
     if (!AccountAccessHelper::allowPublicStream($my->id)) {
         $app = JFactory::getApplication();
         $app->enqueueMessage(JText::_('COM_STREAM_ERROR_NO_ACCESS'), 'error');
         return;
     }
     $doc = JFactory::getDocument();
     $this->_attachScripts();
     // Pathway to group
     if ($stream->group_id) {
         $group = JTable::getInstance('Group', 'StreamTable');
         $group->load($stream->group_id);
         $this->addPathway(JText::_('NAVIGATOR_LABEL_GROUPS'), JRoute::_('index.php?option=com_stream&view=groups'));
         $this->addPathway($group->name, JRoute::_('index.php?option=com_stream&view=groups&task=show&group_id=' . $group->id));
     } else {
         // Pathway to public item
         // Breadcrumb for know 'type'
         switch ($stream->type) {
             case 'page':
                 $this->addPathway(JText::_('NAVIGATOR_LABEL_BLOG'), JRoute::_('index.php?option=com_stream&view=blog'));
                 break;
             case 'todo':
                 $this->addPathway(JText::_('NAVIGATOR_LABEL_TODO'), JRoute::_('index.php?option=com_stream&view=todo'));
                 break;
             case 'event':
                 $this->addPathway(JText::_('NAVIGATOR_LABEL_EVENTS'), JRoute::_('index.php?option=com_stream&view=events'));
                 break;
             default:
                 // Show profile link
                 $user = JXFactory::getUser($stream->user_id);
                 $this->addPathway($user->name, $user->getURL());
         }
     }
     $this->addPathway(JText::sprintf('COM_STREAM_BLOG_MESSAGE_ID', $stream->id), JRoute::_('index.php?option=com_stream&view=company'));
     // Add attendee if this is an event
     if ($stream->type == 'event') {
         JXModule::addBuffer('right', $this->modGetAttendeeHTML($stream));
     }
     // Add attachment script
     $doc->addScript(JURI::root() . 'media/uploader/fileuploader.js');
     $doc->addStyleSheet(JURI::root() . 'media/uploader/fileuploader.css');
     $html = '<div class="update"><ol id="stream" class="stream">';
     $html .= $stream->getHTML();
     $html .= '</ol></div>';
     return $html;
 }
Example #2
0
 function display($tpl = null)
 {
     $this->addPathway(JText::_('NAVIGATOR_LABEL_TODO'), JRoute::_('index.php?option=com_stream&view=todo'));
     $this->_attachScripts();
     $my = JXFactory::getUser();
     $html = '';
     $doc = JFactory::getDocument();
     $doc->setTitle(JText::_("COM_STREAM_LABEL_TODO_LIST"));
     $tmpl = new StreamTemplate();
     $html .= $tmpl->fetch('todo.header');
     // Add attachment script
     $doc->addScript(JURI::root() . 'media/uploader/fileuploader.js');
     $doc->addStyleSheet(JURI::root() . 'media/uploader/fileuploader.css');
     //JXModule::addBuffer('right', '<div><strong>I am working on...</strong></div>');
     JXModule::addBuffer('right', $this->modGetPendingTask(array('user_id' => $my->id)));
     $html .= $this->getStreamDataHTML();
     echo $html;
 }
Example #3
0
 function tagFilter($tpl = null)
 {
     $doc = JFactory::getDocument();
     $search = JRequest::getVar('search', '');
     // Hashtags
     $tag = JRequest::getVar('tag', '', 'GET', 'STRING');
     // Tags
     $options = array();
     $options['hide_filter'] = 1;
     // Hide filter tabs
     $filter = array();
     $html = '';
     if (!empty($search)) {
         $doc->setTitle(JText::sprintf("COM_STREAM_SEARCH_TEXT", $search));
     } else {
         if (!empty($tag)) {
             $filter['tag'] = $tag;
             if ($tagGroupId = JRequest::getVar('tagGroupId', '')) {
                 $group = JTable::getInstance('Group', 'StreamTable');
                 $group->load($tagGroupId);
                 $doc->setTitle(JText::sprintf("COM_STREAM_SEARCH_GROUP_TAG", $tag));
                 $this->addPathway(JText::_('NAVIGATOR_LABEL_GROUPS'), JRoute::_('index.php?option=com_stream&view=groups'));
                 $this->addPathway($group->name, JRoute::_('index.php?option=com_stream&view=groups&task=show&group_id=' . $group->id));
                 $filter['group_id'] = $tagGroupId;
             } else {
                 $doc->setTitle(JText::sprintf("COM_STREAM_SEARCH_TAG", $tag));
             }
             $this->addPathway('Tag Filter');
         } else {
             return $html;
         }
     }
     // Trending tags at the right sidebar
     JXModule::addBuffer('right', $this->modTagsTrendingHTML(isset($group) ? $group : null));
     $html .= '<hr />';
     $html .= $this->getStreamDataHTML($filter, $options);
     return $html;
 }
Example #4
0
    function display($tpl = null)
    {
        $doc = JFactory::getDocument();
        $doc->setTitle(JText::_("COM_STREAM_LABEL_ALL_EVENTS"));
        $html = '';
        $this->addPathway(JText::_('NAVIGATOR_LABEL_EVENTS'), JRoute::_('index.php?option=com_stream&view=groups'));
        $this->_attachScripts();
        $tmpl = new StreamTemplate();
        $html .= $tmpl->fetch('event.page');
        $my = JXFactory::getUser();
        if (!$my->getParam(ALERT_CALENDAR_INTRO)) {
            $html .= '
			<div class="alert alert-success" data-alert_id="' . ALERT_CALENDAR_INTRO . '">
	        <a data-dismiss="alert" class="close">×</a>
			' . JText::_('COM_STREAM_HELPER_EVENT') . '</div>';
        }
        JXModule::addBuffer('right', $this->getUpcomingHotEvent());
        // Show calendar
        $now = new JDate();
        StreamFactory::load('helpers' . DS . 'calendar');
        $html .= '<div id="stream-calendar">' . StreamCalendarHelper::generate_calendar($now->format('Y'), $now->format('m')) . '</div>';
        echo $html;
        //echo $this->getStreamDataHTML();
    }
Example #5
0
 public function getStreamDataHTML()
 {
     jimport('joomla.html.pagination');
     $jconfig = new JConfig();
     $filter = array();
     if ($mention = JRequest::getVar('mention', '')) {
         $filter['mention'] = '@' . $mention;
     }
     if ($user_id = JRequest::getVar('user_id', '')) {
         $filter['user_id'] = $user_id;
     }
     if ($search = JRequest::getVar('search', '')) {
         $filter['search'] = $search;
     }
     if ($group_id = JRequest::getVar('group_id', '')) {
         $filter['group_id'] = $group_id;
     }
     if ($limit_start = JRequest::getVar('limitstart', '')) {
         $filter['limitstart'] = $limit_start;
     }
     /* Month/year created */
     if ($month = JRequest::getVar('month', '')) {
         $filter['month'] = $month;
     }
     if ($year = JRequest::getVar('year', '')) {
         $filter['year'] = $year;
     }
     // to check if category is in valid type
     preg_match('/[0-9]+/', JRequest::getVar('category_id'), $match);
     if (isset($match[0])) {
         $filter['category_id'] = $match[0];
     }
     $filter['type'] = 'page';
     $tmpl = new StreamTemplate();
     $model = StreamFactory::getModel('stream');
     $data = $model->getStream($filter, $jconfig->list_limit, JRequest::getVar('limitstart', 0));
     $total = $model->countStream($filter);
     $pagination = new JPagination($total, JRequest::getVar('limitstart', 0), $jconfig->list_limit);
     JXModule::addBuffer('right', $this->modTagsTrendingHTML());
     JXModule::addBuffer('right', $this->getArchiveHTML());
     $html = '';
     //$tmpl	= new StreamTemplate();
     //$html = $tmpl->fetch('stream.filter');
     $tmpl = new StreamTemplate();
     $tmpl->set('rows', $data);
     $tmpl->set('total', $total);
     $tmpl->set('pagination', $pagination);
     $html .= $tmpl->fetch('stream.data');
     return $html;
 }
Example #6
0
<?php

/* include the architecture */
require_once JPATH_ROOT . DS . 'components' . DS . 'com_profile' . DS . 'views' . DS . 'view.php';
require_once JPATH_ROOT . DS . 'components' . DS . 'com_profile' . DS . 'factory.php';
// Require specific controller if requested
if ($controller = JRequest::getWord('view', 'display')) {
    $path = JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}
JXModule::addBuffer('right', ProfileView::showSideBar());
// Create the controller
$classname = 'ProfileController' . ucfirst($controller);
$controller = new $classname();
// Perform the Request task
$controller->execute(JRequest::getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
Example #7
0
 function display($tpl = null)
 {
     jimport('joomla.html.pagination');
     $my = JXFactory::getUser();
     $this->_attachScripts();
     $html = '';
     $jconfig = new JConfig();
     $doc = JFactory::getDocument();
     $customlist_id = JRequest::getVar('list_id', '', 'GET');
     $customList = JTable::getInstance('Customlist', 'StreamTable');
     $customList->load($customlist_id);
     $doc->setTitle($customList->title);
     $this->addPathway(JText::_('COM_TEMPLATE_CUSTOMLIST'));
     $buildConditionFilter = array();
     $filterArr = array();
     $preloadedSource = array();
     $group = JTable::getInstance('Group', 'StreamTable');
     if ($customList->filter) {
         $filterArr = json_decode($customList->filter, true);
         // Build the filter conditions
         foreach ($filterArr as $filterEntity => $arrvalue) {
             $buildConditionFilter[$filterEntity] = implode(',', $arrvalue);
             //TODO: Temporary preloaded source - this should be returned from a model
             foreach ($arrvalue as $value) {
                 if ($filterEntity == 'group_ids') {
                     $group->load($value);
                     $preloadedSource[$filterEntity][] = array('id' => $group->id, 'value' => $group->name, 'selected' => '1');
                 } elseif ($filterEntity == 'user_ids') {
                     $user = JXFactory::getUser($value);
                     $preloadedSource[$filterEntity][] = array('id' => $value, 'value' => $user->name, 'thumb' => $user->getThumbAvatarURL(), 'selected' => '1');
                 } elseif ($filterEntity == 'tags') {
                     $preloadedSource[$filterEntity][] = array('value' => $value, 'selected' => '1');
                 }
             }
         }
     }
     $tmpl = new StreamTemplate();
     $tmpl->set('my', $my);
     $tmpl->set('customList', $customList);
     // current list
     $tmpl->set('filterArr', $filterArr);
     // array of list filters
     $tmpl->set('preloadedSource', $preloadedSource);
     // array of preloaded list selections
     $html .= $tmpl->fetch('customlist.header');
     $html .= '<br />';
     $options = array();
     $options['hide_filter'] = 1;
     // Hide filter tabs
     // Side bar
     if (isset($filterArr['group_ids'])) {
         JXModule::addBuffer('right', $this->getFilteredGroupsHTML($filterArr['group_ids']));
     }
     if (isset($filterArr['user_ids'])) {
         JXModule::addBuffer('right', $this->getFilteredUsersHTML($filterArr['user_ids']));
     }
     if (isset($filterArr['tags'])) {
         JXModule::addBuffer('right', $this->getFilteredTagsHTML($filterArr['tags']));
     }
     if (!empty($buildConditionFilter)) {
         $companyView = StreamFactory::getView('company');
         $html .= $companyView->getStreamDataHTML($buildConditionFilter, $options);
     } else {
         $html .= '<div class="alert-message block-message info">' . JText::_('COM_STREAM_LABEL_NOFILTERSAPPLIED_LONG') . '</div>';
     }
     echo $html;
 }
Example #8
0
 /**
  * Show individual group
  */
 function show($group)
 {
     jimport('joomla.html.pagination');
     $my = JXFactory::getUser();
     $jconfig = new JConfig();
     $html = '';
     $this->_addPathway($group);
     $document = JFactory::getDocument();
     $this->_attachScripts();
     $document->setTitle($group->name);
     //$tmpl	= new StreamTemplate();
     //$html 	.= $tmpl->fetch('groups.tab');
     $tmpl = new StreamTemplate();
     $tmpl->set('group', $group)->set('show_back', false);
     $html .= $tmpl->fetch('group.header');
     $messageId = JRequest::getInt('message_id', 0);
     if (intval($messageId) > 0) {
         $message_id = JRequest::getVar('message_id');
         $stream = JTable::getInstance('Stream', 'StreamTable');
         $stream->load($message_id);
         $view = StreamFactory::getView('message');
         //JRequest::setVar('view', 'message');
         $html .= $view->show($stream);
     } else {
         $tmpl->set('group', $group);
         $html .= $tmpl->fetch('groups.show');
         $filter = array();
         $filter['group_id'] = $group->id;
         // Order by 'updated'
         $filter['order_by_desc'] = 'updated';
         $model = StreamFactory::getModel('stream');
         $data = $model->getStream($filter, $jconfig->list_limit, JRequest::getVar('limitstart', 0));
         $total = $model->countStream($filter);
         $html .= $tmpl->fetch('stream.filter');
         /*if ($total <= 0 && $my->getParam('first_grp_create', 0) == 0)
         		{
         			$my->setParam('first_grp_create', 1);
         			$my->save();
         			$html 	.= $tmpl->fetch('group.first.create');
         		}
         		else
         		{*/
         $pagination = new JPagination($total, JRequest::getVar('limitstart', 0), $jconfig->list_limit);
         $tmpl->set('rows', $data);
         $tmpl->set('total', $total);
         $tmpl->set('pagination', $pagination);
         $html .= $tmpl->fetch('stream.data');
         //}
     }
     $fileView = StreamFactory::getView('files');
     // Sidebar
     $todoView = StreamFactory::getView('todo');
     $eventView = StreamFactory::getView('events');
     //$analyticsHTML = '<div class="moduletable"><h3>'.JText::_('COM_STREAM_LABEL_GROUP_ACTIVITY').'</h3><img src="'. JURI::root().'components/com_stream/assets/images/analytics.png" width="240" height="38"/></div>';
     //JXModule::addBuffer('right', $analyticsHTML);
     // Add group header to the sidebar
     JXModule::addBuffer('right', $tmpl->fetch('group.module.info'));
     JXModule::addBuffer('right', $this->modTagsTrendingHTML($group));
     JXModule::addBuffer('right', $this->modGetMilestonesHTML($group));
     JXModule::addBuffer('right', $todoView->modGetPendingTask(array('group_id' => $group->id)));
     JXModule::addBuffer('right', $eventView->getUpcomingHTML(array('group_id' => $group->id)));
     JXModule::addBuffer('right', $this->modGetMembersHTML($group));
     //JXModule::addBuffer('right', $fileView->modGroupFilesHTML($group));
     return $html;
 }
Example #9
0
$docTitle = $document->getTitle();
if (!empty($docTitle) && $docTitle != $config->sitename) {
    echo '<h1>' . StreamTemplate::escape($docTitle) . '</h1>';
}
?>
					<jdoc:include type="component" />
				
					<jdoc:include type="modules" name="component_bottom" style="default"/>
				</div>
			
				<div id="sidebar-right" class="grid_3">
					<?php 
// Add guest invite right module
$accountView = AccountFactory::getView('invite');
JXModule::addBuffer('right', $accountView->modMemberInvite());
$buffer =& JXModule::getBuffer('right');
foreach ($buffer as $buff) {
    echo $buff;
}
?>
					<?php 
/* if($option == 'com_stream' && $view == 'company') { ?>
			<img src="<?php echo JURI::root().'components/com_stream/assets/images/hot_topics.png'; ?>" />
			<?php } */
?>

				</div>
			</div>
		</div><!-- #eContent -->

	</div>
Example #10
0
 public static function addBuffer($position, $html)
 {
     $buff =& JXModule::getBuffer($position);
     $buff[] = $html;
     return true;
 }
Example #11
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);
 }