예제 #1
0
 protected function setGeneralVariablesView($view)
 {
     // date
     $view->date = $this->strDate;
     $oDate = new Piwik_Date($this->strDate);
     $view->prettyDate = $oDate->getLocalized(Piwik_Translate('Home_LocalizedDateFormat'));
     // period
     $currentPeriod = Piwik_Common::getRequestVar('period');
     $otherPeriodsAvailable = array('day', 'week', 'month', 'year');
     $otherPeriodsNames = array('day' => Piwik_Translate('Home_PeriodDay'), 'week' => Piwik_Translate('Home_PeriodWeek'), 'month' => Piwik_Translate('Home_PeriodMonth'), 'year' => Piwik_Translate('Home_PeriodYear'));
     $found = array_search($currentPeriod, $otherPeriodsAvailable);
     if ($found !== false) {
         unset($otherPeriodsAvailable[$found]);
     }
     $view->period = $currentPeriod;
     $view->otherPeriods = $otherPeriodsAvailable;
     $view->periodsNames = $otherPeriodsNames;
     // other
     $view->idSite = Piwik_Common::getRequestVar('idSite');
     $view->userLogin = Piwik::getCurrentUserLogin();
     $view->sites = Piwik_SitesManager_API::getSitesWithAtLeastViewAccess();
     $view->url = Piwik_Url::getCurrentUrl();
     $view->menu = Piwik_GetMenu();
     $view->menuJson = json_encode($view->menu);
     //var_dump($view->menuJson);
 }
예제 #2
0
 protected function getDefaultIndexView()
 {
     $view = Piwik_View::factory('index');
     $this->setGeneralVariablesView($view);
     $view->menu = Piwik_GetMenu();
     $view->content = '';
     return $view;
 }
예제 #3
0
 protected function getDefaultIndexView()
 {
     $view = new Piwik_View('CoreHome/templates/index.tpl');
     $this->setGeneralVariablesView($view);
     $view->menu = Piwik_GetMenu();
     $view->content = '';
     return $view;
 }
예제 #4
0
 protected function setGeneralVariablesView($view)
 {
     parent::setGeneralVariablesView($view);
     $view->menu = Piwik_GetMenu();
 }