public function configureReportingMenu(MenuReporting $menu) { $menu->addReferrersItem('', array('module' => 'Referrers', 'action' => 'index'), 20); $menu->addReferrersItem('General_Overview', array('module' => 'Referrers', 'action' => 'index'), 1); $menu->addReferrersItem('Referrers_SubmenuSearchEngines', array('module' => 'Referrers', 'action' => 'getSearchEnginesAndKeywords'), 2); $menu->addReferrersItem('Referrers_SubmenuWebsites', array('module' => 'Referrers', 'action' => 'indexWebsites'), 3); }
public function configureReportingMenu(MenuReporting $menu) { if ($this->isEnabled()) { $url = array('module' => $this->module, 'action' => 'indexVisitorLog'); $menu->addVisitorsItem($this->widgetTitle, $url, $order = 5); } }
public function configureReportingMenu(MenuReporting $menu) { $menu->addReferrersItem('', $this->urlForAction('index'), 20); $menu->addReferrersItem('General_Overview', $this->urlForAction('index'), 1); $menu->addReferrersItem('Referrers_SubmenuSearchEngines', $this->urlForAction('getSearchEnginesAndKeywords'), 2); $menu->addReferrersItem('Referrers_SubmenuWebsites', $this->urlForAction('indexWebsites'), 3); }
public function configureReportingMenu(MenuReporting $menu) { $menu->addActionsItem('', $this->urlForAction('menuGetPageUrls'), 15); $actions = new Actions(); if ($actions->isSiteSearchEnabled()) { $menu->addActionsItem('Actions_SubmenuSitesearch', $this->urlForAction('indexSiteSearch'), 5); } }
public function configureReportingMenu(MenuReporting $menu) { $urlParams = array('module' => 'Actions', 'action' => 'menuGetPageUrls'); $menu->addActionsItem('', $urlParams, 15); $actions = new Actions(); if ($actions->isSiteSearchEnabled()) { $menu->addActionsItem('Actions_SubmenuSitesearch', array('module' => 'Actions', 'action' => 'indexSiteSearch'), 5); } }
public function test_getMenu_shouldAddMenuItemsOfReports() { $this->loadSomePlugins(); $items = $this->menu->getMenu(); $this->assertNotEmpty($items); $this->assertGreaterThan(20, $items); $this->assertEquals(array('General_Actions', 'General_Visitors'), array_keys($items)); $this->assertNotEmpty($items['General_Actions']['General_Pages']); $this->assertEquals('menuGetPageUrls', $items['General_Actions']['General_Pages']['_url']['action']); }
public function configureReportingMenu(MenuReporting $menu) { $menu->addActionsItem('', $this->urlForAction('menuGetPageUrls'), 15); $idSite = Common::getRequestVar('idSite', 0, 'int'); $idSites = Common::getRequestVar('idSites', '', 'string'); $actions = new Actions(); if ($actions->isSiteSearchEnabled($idSites, $idSite)) { $menu->addActionsItem('Actions_SubmenuSitesearch', $this->urlForAction('indexSiteSearch'), 5); } }
public function configureReportingMenu(MenuReporting $menu) { $idSite = Common::getRequestVar('idSite', null, 'int'); $goals = API::getInstance()->getGoals($idSite); $mainGoalMenu = $this->getGoalCategoryName($idSite); $site = new Site($idSite); if (count($goals) == 0) { $menu->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()) { $menu->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); } $menu->add($mainGoalMenu, 'Goals_AddNewGoal', array('module' => 'Goals', 'action' => 'addNewGoal')); } else { $menu->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()) { $menu->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); } $menu->add($mainGoalMenu, 'Goals_GoalsOverview', array('module' => 'Goals', 'action' => 'index'), true, 2); $group = new Group(); foreach ($goals as $goal) { $subMenuName = str_replace('%', '%%', Translate::clean($goal['name'])); $params = array('module' => 'Goals', 'action' => 'goalReport', 'idGoal' => $goal['idgoal']); $tooltip = sprintf('%s (id = %d)', $subMenuName, $goal['idgoal']); if (count($goals) <= 3) { $menu->add($mainGoalMenu, $subMenuName, $params, true, 50, $tooltip); } else { $group->add($subMenuName, $params, $tooltip); } } if (count($goals) > 3) { $menu->addGroup($mainGoalMenu, 'Goals_ChooseGoal', $group, $orderId = 50, $tooltip = false); } } }
public function configureReportingMenu(MenuReporting $menu) { $menu->addItem('Dashboard_Dashboard', '', $this->urlForAction('embeddedIndex', array('idDashboard' => 1)), 5); if (!Piwik::isUserIsAnonymous()) { $login = Piwik::getCurrentUserLogin(); $dashboard = new Dashboard(); $dashboards = $dashboard->getAllDashboards($login); $pos = 0; foreach ($dashboards as $dashboard) { $menu->addItem('Dashboard_Dashboard', $dashboard['name'], $this->urlForAction('embeddedIndex', array('idDashboard' => $dashboard['iddashboard'])), $pos); $pos++; } } }
public function configureReportingMenu(MenuReporting $menu) { $menu->add('Dashboard_Dashboard', '', array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => 1), true, 5); if (!Piwik::isUserIsAnonymous()) { $login = Piwik::getCurrentUserLogin(); $dashboard = new Dashboard(); $dashboards = $dashboard->getAllDashboards($login); $pos = 0; foreach ($dashboards as $dashboard) { $menu->add('Dashboard_Dashboard', $dashboard['name'], array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => $dashboard['iddashboard']), true, $pos); $pos++; } } }
public function configureReportingMenu(MenuReporting $menu) { $idSite = $this->getIdSite(); $goals = API::getInstance()->getGoals($idSite); $mainGoalMenu = 'Goals_Goals'; if (count($goals) == 0) { $linkToAddNewGoal = $this->urlForAction('addNewGoal', array('idGoal' => null)); $menu->addItem($mainGoalMenu, '', $linkToAddNewGoal, 25); $menu->addItem($mainGoalMenu, 'Goals_AddNewGoal', $linkToAddNewGoal, 1); return; } $order = 1; $url = $this->urlForAction('index', array('idGoal' => null)); $menu->addItem($mainGoalMenu, '', $url, 25); $menu->addItem($mainGoalMenu, 'General_Overview', $url, ++$order); $group = new Group(); foreach ($goals as $goal) { $subMenuName = str_replace('%', '%%', Translate::clean($goal['name'])); $params = $this->urlForAction('goalReport', array('idGoal' => $goal['idgoal'])); $tooltip = sprintf('%s (id = %d)', $subMenuName, $goal['idgoal']); if (count($goals) > 3) { $group->add($subMenuName, $params, $tooltip); } else { $menu->addItem($mainGoalMenu, $subMenuName, $params, ++$order, $tooltip); } } if (count($goals) > 3) { $menu->addGroup($mainGoalMenu, 'Goals_ChooseGoal', $group, ++$order, $tooltip = false); } $menu->addItem($mainGoalMenu, 'Goals_ManageGoals', $this->urlForAction('editGoals'), ++$order); }
public function configureReportingMenu(MenuReporting $menu) { $menu->add('General_Actions', '', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 15); $menu->add('General_Actions', 'General_Pages', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 1); $menu->add('General_Actions', 'Actions_SubmenuPagesEntry', array('module' => 'Actions', 'action' => 'indexEntryPageUrls'), true, 2); $menu->add('General_Actions', 'Actions_SubmenuPagesExit', array('module' => 'Actions', 'action' => 'indexExitPageUrls'), true, 3); $menu->add('General_Actions', 'Actions_SubmenuPageTitles', array('module' => 'Actions', 'action' => 'indexPageTitles'), true, 4); $menu->add('General_Actions', 'General_Outlinks', array('module' => 'Actions', 'action' => 'indexOutlinks'), true, 6); $menu->add('General_Actions', 'General_Downloads', array('module' => 'Actions', 'action' => 'indexDownloads'), true, 7); $actions = new Actions(); if ($actions->isSiteSearchEnabled()) { $menu->add('General_Actions', 'Actions_SubmenuSitesearch', array('module' => 'Actions', 'action' => 'indexSiteSearch'), true, 5); } }
private function addMenuItemsForCustomDimensions(MenuReporting $menu, $dimensions, $scope) { $numItems = 0; foreach ($dimensions as $dimension) { if ($scope === $dimension['scope']) { $numItems++; } } $group = new Group(); $mainMenuName = ''; if ($scope === CustomDimensions::SCOPE_VISIT) { $mainMenuName = 'General_Visitors'; } elseif ($scope === CustomDimensions::SCOPE_ACTION) { $mainMenuName = 'General_Actions'; } foreach ($dimensions as $dimension) { if ($dimension['scope'] !== $scope) { continue; } $name = $dimension['name']; $id = $dimension['idcustomdimension']; $url = $this->urlForAction('menuGetCustomDimension', array('idDimension' => $id)); $order = 100 + $id; $tooltip = Piwik::translate('CustomDimensions_CustomDimensionId', $id); if ($scope === CustomDimensions::SCOPE_VISIT) { if ($numItems > 3) { $group->add($name, $url, $tooltip); } else { $menu->addVisitorsItem($name, $url, $order, $tooltip); } } elseif ($scope === CustomDimensions::SCOPE_ACTION) { if ($numItems > 3) { $group->add($name, $url, $tooltip); } else { $menu->addActionsItem($name, $url, $order, $tooltip); } } if ($numItems > 3) { $title = Piwik::translate('CustomDimensions_CustomDimensions'); $menu->addGroup($mainMenuName, $title, $group, ++$order, $tooltip = false); } } }
public function configureReportingMenu(MenuReporting $menu) { $menu->registerMenuIcon('General_Visitors', 'icon-reporting-visitors'); $menu->registerMenuIcon('General_Actions', 'icon-reporting-actions'); $menu->registerMenuIcon('Referrers_Referrers', 'icon-reporting-referer'); $menu->registerMenuIcon('Goals_Goals', 'icon-reporting-goal'); $menu->registerMenuIcon('Goals_Ecommerce', 'icon-reporting-ecommerce'); $menu->registerMenuIcon('Dashboard_Dashboard', 'icon-reporting-dashboard'); }
public function configureReportingMenu(MenuReporting $menu) { $idSite = Common::getRequestVar('idSite', null, 'int'); $site = new Site($idSite); if ($site->isEcommerceEnabled()) { $ecommerceParams = array('idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER); $menu->addItem('Goals_Ecommerce', '', array(), 24); $menu->addItem('Goals_Ecommerce', 'General_Overview', $this->urlForAction('ecommerceReport', $ecommerceParams), 1); $menu->addItem('Goals_Ecommerce', 'Goals_EcommerceLog', $this->urlForAction('ecommerceLogReport'), 2); $menu->addItem('Goals_Ecommerce', 'Goals_Products', $this->urlForAction('products', $ecommerceParams), 3); $menu->addItem('Goals_Ecommerce', 'Ecommerce_Sales', $this->urlForAction('sales', $ecommerceParams), 4); } }
public function configureReportingMenu(MenuReporting $menu) { $idSite = Common::getRequestVar('idSite', null, 'int'); $goals = API::getInstance()->getGoals($idSite); $mainGoalMenu = $this->getGoalCategoryName($idSite); $site = new Site($idSite); if (count($goals) == 0) { $menu->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()) { $menu->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); } $menu->add($mainGoalMenu, 'Goals_AddNewGoal', array('module' => 'Goals', 'action' => 'addNewGoal')); } else { $menu->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()) { $menu->add($mainGoalMenu, 'Goals_Ecommerce', array('module' => 'Goals', 'action' => 'ecommerceReport', 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER), true, 1); } $menu->add($mainGoalMenu, 'Goals_GoalsOverview', array('module' => 'Goals', 'action' => 'index'), true, 2); foreach ($goals as $goal) { $menu->add($mainGoalMenu, str_replace('%', '%%', Translate::clean($goal['name'])), array('module' => 'Goals', 'action' => 'goalReport', 'idGoal' => $goal['idgoal'])); } } }
/** * By default a menu item will be added to the reporting menu if a {@link $menuTitle} is set. If you want to * customize the way the item is added or modify any other behavior you can overwrite this method. For instance * in case you need to add additional url properties beside module and action which are added by default. * @param \Piwik\Menu\MenuReporting $menu * @api */ public function configureReportingMenu(MenuReporting $menu) { if ($this->menuTitle) { $action = $this->getMenuControllerAction(); $menu->add($this->category, $this->menuTitle, array('module' => $this->module, 'action' => $action), $this->isEnabled(), $this->order); } }
public function configureReportingMenu(MenuReporting $menu) { $menu->add('General_Visitors', 'DevicesDetection_submenu', array('module' => 'DevicesDetection', 'action' => 'index')); }
public function test_configureReportingMenu_shouldAddAMenuIfATitleIsSet() { $menu = MenuReporting::getInstance(); $menuItems = $menu->getMenu(); $this->assertNull($menuItems); $this->advancedReport->configureReportingMenu($menu); $menuItems = $menu->getMenu(); $expected = array('_tooltip' => false, '_order' => 20, '_hasSubmenu' => true, 'Actions_SubmenuPageTitles' => array('_url' => array('module' => 'TestPlugin', 'action' => 'menuGetAdvancedReport'), '_order' => 20, '_name' => 'Actions_SubmenuPageTitles', '_tooltip' => false)); $this->assertCount(1, $menuItems); $this->assertEquals($expected, $menuItems['Goals_Goals']); }
public function configureReportingMenu(MenuReporting $menu) { $menu->registerMenuIcon('CampaignDetailed_Adwords', 'icon-chart-bar'); $menu->addItem('CampaignDetailed_Adwords', '', array(), 20); $menu->addItem('CampaignDetailed_Adwords', 'General_Overview', $this->urlForAction('index'), 1); }
private function addDefaultDashboard(MenuReporting $menu) { $menu->addItem('Dashboard_Dashboard', 'Dashboard_Dashboard', $this->urlForAction('embeddedIndex', array('idDashboard' => 1))); }
public function configureReportingMenu(MenuReporting $menu) { $menu->addVisitorsItem('ClickHeat', array('module' => 'ClickHeat', 'action' => 'view'), 1); }
protected function getDefaultIndexView() { $view = new View('@CoreHome/getDefaultIndexView'); $this->setGeneralVariablesView($view); $view->menu = MenuReporting::getInstance()->getMenu(); $view->dashboardSettingsControl = new DashboardManagerControl(); $view->content = ''; return $view; }
public function configureReportingMenu(MenuReporting $menu) { $menu->rename('General_Visitors', 'UserCountry_SubmenuLocations', 'General_Visitors', 'Provider_SubmenuLocationsProvider'); }
public function configureReportingMenu(MenuReporting $menu) { $menu->addVisitorsItem('VisitFrequency_SubmenuFrequency', array('module' => 'VisitFrequency', 'action' => 'index'), $order = 55); }
public function configureReportingMenu(MenuReporting $menu) { $menu->add('General_Visitors', 'CustomVariables_CustomVariables', array('module' => 'CustomVariables', 'action' => 'index'), $display = true, $order = 50); }
public function configureReportingMenu(MenuReporting $menu) { $menu->rename('General_Visitors', 'VisitFrequency_SubmenuFrequency', 'General_Visitors', 'VisitorInterest_Engagement'); }
public function configureReportingMenu(MenuReporting $menu) { $menu->add('General_Visitors', 'General_Settings', array('module' => 'UserSettings', 'action' => 'index')); }
/** * By default a menu item will be added to the reporting menu if a {@link $menuTitle} is set. If you want to * customize the way the item is added or modify any other behavior you can overwrite this method. For instance * in case you need to add additional url properties beside module and action which are added by default. * @param \Piwik\Menu\MenuReporting $menu * @api */ public function configureReportingMenu(MenuReporting $menu) { if ($this->menuTitle) { $action = 'menu' . ucfirst($this->action); $menu->add($this->category, $this->menuTitle, array('module' => $this->module, 'action' => $action), $this->isEnabled(), $this->order); } }
public function configureReportingMenu(MenuReporting $menu) { $menu->addVisitorsItem('DevicesDetection_submenu', $this->urlForAction('index')); }