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); }
protected function getDefaultIndexView() { $view = Piwik_View::factory('index'); $this->setGeneralVariablesView($view); $view->menu = Piwik_GetMenu(); $view->content = ''; return $view; }
protected function getDefaultIndexView() { $view = new Piwik_View('CoreHome/templates/index.tpl'); $this->setGeneralVariablesView($view); $view->menu = Piwik_GetMenu(); $view->content = ''; return $view; }
protected function setGeneralVariablesView($view) { parent::setGeneralVariablesView($view); $view->menu = Piwik_GetMenu(); }