示例#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);
     }
 }
示例#3
0
文件: Menu.php 项目: a4tunado/piwik
 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);
 }
示例#4
0
文件: Menu.php 项目: a4tunado/piwik
 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);
     }
 }
示例#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);
     }
 }
示例#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']);
 }
示例#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);
     }
 }
示例#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);
         }
     }
 }
示例#9
0
文件: Menu.php 项目: a4tunado/piwik
 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++;
         }
     }
 }
示例#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++;
         }
     }
 }
示例#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);
 }
示例#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);
     }
 }
示例#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);
         }
     }
 }
示例#14
0
文件: Menu.php 项目: mgou-net/piwik
 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');
 }
示例#15
0
文件: Menu.php 项目: cemo/piwik
 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);
     }
 }
示例#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']));
         }
     }
 }
示例#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);
     }
 }
示例#18
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->add('General_Visitors', 'DevicesDetection_submenu', array('module' => 'DevicesDetection', 'action' => 'index'));
 }
示例#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']);
 }
示例#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);
 }
示例#21
0
文件: Menu.php 项目: normimuc/piwik
 private function addDefaultDashboard(MenuReporting $menu)
 {
     $menu->addItem('Dashboard_Dashboard', 'Dashboard_Dashboard', $this->urlForAction('embeddedIndex', array('idDashboard' => 1)));
 }
示例#22
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addVisitorsItem('ClickHeat', array('module' => 'ClickHeat', 'action' => 'view'), 1);
 }
示例#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;
 }
示例#24
0
文件: Menu.php 项目: kreynen/elmsln
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->rename('General_Visitors', 'UserCountry_SubmenuLocations', 'General_Visitors', 'Provider_SubmenuLocationsProvider');
 }
示例#25
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addVisitorsItem('VisitFrequency_SubmenuFrequency', array('module' => 'VisitFrequency', 'action' => 'index'), $order = 55);
 }
示例#26
0
文件: Menu.php 项目: kreynen/elmsln
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->add('General_Visitors', 'CustomVariables_CustomVariables', array('module' => 'CustomVariables', 'action' => 'index'), $display = true, $order = 50);
 }
示例#27
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->rename('General_Visitors', 'VisitFrequency_SubmenuFrequency', 'General_Visitors', 'VisitorInterest_Engagement');
 }
示例#28
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->add('General_Visitors', 'General_Settings', array('module' => 'UserSettings', 'action' => 'index'));
 }
示例#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);
     }
 }
示例#30
0
文件: Menu.php 项目: a4tunado/piwik
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addVisitorsItem('DevicesDetection_submenu', $this->urlForAction('index'));
 }