protected function getDefaultIndexView() { $view = new View('@CoreHome/getDefaultIndexView'); $this->setGeneralVariablesView($view); $view->menu = MenuMain::getInstance()->getMenu(); $view->content = ''; return $view; }
/** * Adds Web Analytics menus */ function addMenus() { MenuMain::getInstance()->add('Referrers_Referrers', '', array('module' => 'Referrers', 'action' => 'index'), true, 20); MenuMain::getInstance()->add('Referrers_Referrers', 'General_Overview', array('module' => 'Referrers', 'action' => 'index'), true, 1); MenuMain::getInstance()->add('Referrers_Referrers', 'Referrers_SubmenuSearchEngines', array('module' => 'Referrers', 'action' => 'getSearchEnginesAndKeywords'), true, 2); MenuMain::getInstance()->add('Referrers_Referrers', 'Referrers_SubmenuWebsites', array('module' => 'Referrers', 'action' => 'indexWebsites'), true, 3); MenuMain::getInstance()->add('Referrers_Referrers', 'Referrers_Campaigns', array('module' => 'Referrers', 'action' => 'indexCampaigns'), true, 4); }
protected function getDefaultIndexView() { $view = new View('@CoreHome/getDefaultIndexView'); $this->setGeneralVariablesView($view); $view->menu = MenuMain::getInstance()->getMenu(); $view->dashboardSettingsControl = new DashboardManagerControl(); $view->content = ''; return $view; }
/** * Returns if the URL was found in the menu. * * @param string $url * @return boolean */ public function isUrlFound($url) { $menu = MenuMain::getInstance()->getMenu(); foreach ($menu as $subMenus) { foreach ($subMenus as $subMenuName => $menuUrl) { if (strpos($subMenuName, '_') !== 0 && $menuUrl['_url'] == $url) { return true; } } } return false; }
public function getReportingMenuItems() { \Piwik\Menu\MenuMain::getInstance()->add($category = 'Chat', $title = '', $urlParams = array('module' => $this->getPluginName(), 'action' => 'index'), $showOnlyIf = Piwik::hasUserSuperUserAccess(), $order = 11); \Piwik\Menu\MenuMain::getInstance()->add($category = 'Chat', $title = 'Conversations', $urlParams = array('module' => $this->getPluginName(), 'action' => 'index'), $showOnlyIf = Piwik::hasUserSuperUserAccess(), $order = 12); \Piwik\Menu\MenuMain::getInstance()->add($category = 'Chat', $title = 'Automatic messages', $urlParams = array('module' => $this->getPluginName(), 'action' => 'automaticMessages'), $showOnlyIf = Piwik::hasUserSuperUserAccess(), $order = 13); \Piwik\Menu\MenuMain::getInstance()->add($category = 'Chat', $title = 'Report a bug', $urlParams = array('module' => $this->getPluginName(), 'action' => 'reportBug'), $showOnlyIf = Piwik::hasUserSuperUserAccess(), $order = 14); /*\Piwik\Menu\MenuMain::getInstance()->add( $category = 'Chat', $title = 'Reports', $urlParams = array('module' => $this->getPluginName(), 'action' => 'index'), $showOnlyIf = Piwik::hasUserSuperUserAccess(), $order = 13 );*/ }
function addMenu() { MenuMain::getInstance()->add('General_Visitors', 'VisitTime_SubmenuTimes', array('module' => 'VisitTime', 'action' => 'index')); }
public function addMenu() { MenuMain::getInstance()->add('General_Visitors', 'UserCountry_SubmenuLocations', array('module' => 'UserCountry', 'action' => 'index')); }
public function addMenu() { MenuMain::getInstance()->rename('General_Visitors', 'UserCountry_SubmenuLocations', 'General_Visitors', 'Provider_SubmenuLocationsProvider'); }
private function addSubMenu($subMenu, $action, $order) { MenuMain::getInstance()->add('UI Framework', $subMenu, array('module' => 'ExampleUI', 'action' => $action), true, $order); }
/** * We link the graph dots to the same report as currently being displayed (only the date would change). * * In some cases the widget is loaded within a report that doesn't exist as such. * For example, the dashboards loads the 'Last visits graph' widget which can't be directly linked to. * Instead, the graph must link back to the dashboard. * * In other cases, like Visitors>Overview or the Goals graphs, we can link the graph clicks to the same report. * * To detect whether or not we can link to a report, we simply check if the current URL from which it was loaded * belongs to the menu or not. If it doesn't belong to the menu, we do not append the hash to the URL, * which results in loading the dashboard. * * @return array Query string array to append to the URL hash or false if the dashboard should be displayed */ private function getQueryStringAsHash() { $queryString = Url::getArrayFromCurrentQueryString(); $piwikParameters = array('idSite', 'date', 'period', 'XDEBUG_SESSION_START', 'KEY'); foreach ($piwikParameters as $parameter) { unset($queryString[$parameter]); } if (MenuMain::getInstance()->isUrlFound($queryString)) { return $queryString; } return false; }
public function addMenu() { MenuMain::getInstance()->add('General_Visitors', 'Live_VisitorLog', array('module' => 'Live', 'action' => 'indexVisitorLog'), true, $order = 5); }
function addMenus() { $idSite = Common::getRequestVar('idSite', null, 'int'); $goals = API::getInstance()->getGoals($idSite); $mainGoalMenu = $this->getGoalCategoryName($idSite); $site = new Site($idSite); if (count($goals) == 0) { MenuMain::getInstance()->add($mainGoalMenu, '', array('module' => 'Goals', 'action' => $site->isEcommerceEnabled() ? 'ecommerceReport' : 'addNewGoal', 'idGoal' => $site->isEcommerceEnabled() ? Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER : null), true, 25); if ($site->isEcommerceEnabled()) { MenuMain::getInstance()->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); } MenuMain::getInstance()->add($mainGoalMenu, 'Goals_AddNewGoal', array('module' => 'Goals', 'action' => 'addNewGoal')); } else { MenuMain::getInstance()->add($mainGoalMenu, '', array('module' => 'Goals', 'action' => $site->isEcommerceEnabled() ? 'ecommerceReport' : 'index', 'idGoal' => $site->isEcommerceEnabled() ? Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER : null), true, 25); if ($site->isEcommerceEnabled()) { MenuMain::getInstance()->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); } MenuMain::getInstance()->add($mainGoalMenu, 'Goals_GoalsOverview', array('module' => 'Goals', 'action' => 'index'), true, 2); foreach ($goals as $goal) { MenuMain::getInstance()->add($mainGoalMenu, str_replace('%', '%%', Translate::clean($goal['name'])), array('module' => 'Goals', 'action' => 'goalReport', 'idGoal' => $goal['idgoal'])); } } }
/** * Adds the User Settings menu */ function addMenu() { MenuMain::getInstance()->add('General_Visitors', 'General_Settings', array('module' => 'UserSettings', 'action' => 'index')); }
public function addMenu() { MenuMain::getInstance()->add('General_Visitors', 'UserCountryMap_RealTimeMap', array('module' => 'UserCountryMap', 'action' => 'realtimeWorldMap'), true, $order = 70); }
public function addMenu() { MenuMain::getInstance()->rename('General_Visitors', 'VisitFrequency_SubmenuFrequency', 'General_Visitors', 'VisitorInterest_Engagement'); }
function addMenu() { MenuMain::getInstance()->add('General_Visitors', '', array('module' => 'VisitsSummary', 'action' => 'index'), true, 10); MenuMain::getInstance()->add('General_Visitors', 'General_Overview', array('module' => 'VisitsSummary', 'action' => 'index'), true, 1); }
public function addMenu() { MenuMain::getInstance()->add('General_Visitors', 'DevicesDetection_submenu', array('module' => 'DevicesDetection', 'action' => 'index')); }
public function addMenus() { MenuMain::getInstance()->add('Dashboard_Dashboard', '', array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => 1), true, 5); if (!Piwik::isUserIsAnonymous()) { $login = Piwik::getCurrentUserLogin(); $dashboards = $this->getAllDashboards($login); if (count($dashboards) > 1) { $pos = 0; foreach ($dashboards as $dashboard) { MenuMain::getInstance()->add('Dashboard_Dashboard', $dashboard['name'], array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => $dashboard['iddashboard']), true, $pos); $pos++; } } } }
function addMenu() { MenuMain::getInstance()->add('General_Visitors', 'VisitFrequency_SubmenuFrequency', array('module' => 'VisitFrequency', 'action' => 'index')); }
function addMenus() { MenuMain::getInstance()->add('General_Actions', '', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 15); MenuMain::getInstance()->add('General_Actions', 'General_Pages', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 1); MenuMain::getInstance()->add('General_Actions', 'Actions_SubmenuPagesEntry', array('module' => 'Actions', 'action' => 'indexEntryPageUrls'), true, 2); MenuMain::getInstance()->add('General_Actions', 'Actions_SubmenuPagesExit', array('module' => 'Actions', 'action' => 'indexExitPageUrls'), true, 3); MenuMain::getInstance()->add('General_Actions', 'Actions_SubmenuPageTitles', array('module' => 'Actions', 'action' => 'indexPageTitles'), true, 4); MenuMain::getInstance()->add('General_Actions', 'General_Outlinks', array('module' => 'Actions', 'action' => 'indexOutlinks'), true, 6); MenuMain::getInstance()->add('General_Actions', 'General_Downloads', array('module' => 'Actions', 'action' => 'indexDownloads'), true, 7); if ($this->isSiteSearchEnabled()) { MenuMain::getInstance()->add('General_Actions', 'Actions_SubmenuSitesearch', array('module' => 'Actions', 'action' => 'indexSiteSearch'), true, 5); } }
public function addMenus() { MenuMain::getInstance()->add('General_Visitors', 'CustomVariables_CustomVariables', array('module' => 'CustomVariables', 'action' => 'index'), $display = true, $order = 50); }