示例#1
0
文件: home.php 项目: rmiddle/usermeet
 function showTabNotificationsAction()
 {
     $visit = UsermeetApplication::getVisit();
     $translate = DevblocksPlatform::getTranslationService();
     $active_worker = UsermeetApplication::getActiveWorker();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     // Select tab
     $visit->set(UsermeetVisit::KEY_HOME_SELECTED_TAB, 'notifications');
     // My Notifications
     $myNotificationsView = Um_AbstractViewLoader::getView(self::VIEW_MY_NOTIFICATIONS);
     $title = vsprintf($translate->_('home.my_notifications.view.title'), $active_worker->getName());
     if (null == $myNotificationsView) {
         $myNotificationsView = new Um_WorkerEventView();
         $myNotificationsView->id = self::VIEW_MY_NOTIFICATIONS;
         $myNotificationsView->name = $title;
         $myNotificationsView->renderLimit = 25;
         $myNotificationsView->renderPage = 0;
         $myNotificationsView->renderSortBy = SearchFields_WorkerEvent::CREATED_DATE;
         $myNotificationsView->renderSortAsc = 0;
     }
     // Overload criteria
     $myNotificationsView->name = $title;
     $myNotificationsView->params = array(SearchFields_WorkerEvent::WORKER_ID => new DevblocksSearchCriteria(SearchFields_WorkerEvent::WORKER_ID, '=', $active_worker->id), SearchFields_WorkerEvent::IS_READ => new DevblocksSearchCriteria(SearchFields_WorkerEvent::IS_READ, '=', 0));
     /*
      * [TODO] This doesn't need to save every display, but it was possible to 
      * lose the params in the saved version of the view in the DB w/o recovery.
      * This should be moved back into the if(null==...) check in a later build.
      */
     Um_AbstractViewLoader::setView($myNotificationsView->id, $myNotificationsView);
     $tpl->assign('view', $myNotificationsView);
     $tpl->display('file:' . $this->_TPL_PATH . 'home/tabs/my_notifications/index.tpl');
 }
示例#2
0
 function isVisible()
 {
     // check login
     $visit = UsermeetApplication::getVisit();
     if (empty($visit)) {
         return false;
     } else {
         return true;
     }
 }
示例#3
0
 private static function _save()
 {
     // persist
     $visit = UsermeetApplication::getVisit();
     $visit->set(self::VISIT_ABSTRACTVIEWS, self::$views);
 }