Beispiel #1
0
 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);
     }
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #6
0
 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']);
 }
Beispiel #7
0
 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);
     }
 }
Beispiel #8
0
 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);
         }
     }
 }
Beispiel #9
0
 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++;
         }
     }
 }
Beispiel #10
0
 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++;
         }
     }
 }
Beispiel #11
0
 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);
 }
Beispiel #12
0
 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);
     }
 }
Beispiel #13
0
 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);
         }
     }
 }
Beispiel #14
0
 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');
 }
Beispiel #15
0
 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);
     }
 }
Beispiel #16
0
 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']));
         }
     }
 }
Beispiel #17
0
 /**
  * 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);
     }
 }
Beispiel #18
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->add('General_Visitors', 'DevicesDetection_submenu', array('module' => 'DevicesDetection', 'action' => 'index'));
 }
Beispiel #19
0
 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']);
 }
Beispiel #20
0
 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);
 }
Beispiel #21
0
 private function addDefaultDashboard(MenuReporting $menu)
 {
     $menu->addItem('Dashboard_Dashboard', 'Dashboard_Dashboard', $this->urlForAction('embeddedIndex', array('idDashboard' => 1)));
 }
Beispiel #22
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addVisitorsItem('ClickHeat', array('module' => 'ClickHeat', 'action' => 'view'), 1);
 }
Beispiel #23
0
 protected function getDefaultIndexView()
 {
     $view = new View('@CoreHome/getDefaultIndexView');
     $this->setGeneralVariablesView($view);
     $view->menu = MenuReporting::getInstance()->getMenu();
     $view->dashboardSettingsControl = new DashboardManagerControl();
     $view->content = '';
     return $view;
 }
Beispiel #24
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->rename('General_Visitors', 'UserCountry_SubmenuLocations', 'General_Visitors', 'Provider_SubmenuLocationsProvider');
 }
Beispiel #25
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addVisitorsItem('VisitFrequency_SubmenuFrequency', array('module' => 'VisitFrequency', 'action' => 'index'), $order = 55);
 }
Beispiel #26
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->add('General_Visitors', 'CustomVariables_CustomVariables', array('module' => 'CustomVariables', 'action' => 'index'), $display = true, $order = 50);
 }
Beispiel #27
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->rename('General_Visitors', 'VisitFrequency_SubmenuFrequency', 'General_Visitors', 'VisitorInterest_Engagement');
 }
Beispiel #28
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->add('General_Visitors', 'General_Settings', array('module' => 'UserSettings', 'action' => 'index'));
 }
Beispiel #29
0
 /**
  * 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);
     }
 }
Beispiel #30
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addVisitorsItem('DevicesDetection_submenu', $this->urlForAction('index'));
 }