diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-20 10:10:27 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-20 10:10:27 +0400 |
commit | 307ec31f2cfebd9c8bf9caba575e2864d42c8597 (patch) | |
tree | 2d6120c412b272344d204e9947fb3859bb7b3aa7 /plugins/Goals/Goals.php | |
parent | 45ae10e999baf0dfa066e5daae00bca824a68191 (diff) |
refs #5192 added generator for menus, updated more plugins to use menu class, fixed some bugs, improved design, fixed tests, ...
Diffstat (limited to 'plugins/Goals/Goals.php')
-rw-r--r-- | plugins/Goals/Goals.php | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index eb037238f5..4631010d3e 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -11,8 +11,6 @@ namespace Piwik\Plugins\Goals; use Piwik\ArchiveProcessor; use Piwik\Common; use Piwik\Db; -use Piwik\Menu\MenuAbstract; -use Piwik\Menu\MenuMain; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Site; @@ -106,7 +104,6 @@ class Goals extends \Piwik\Plugin 'API.getReportMetadata.end' => 'getReportMetadata', 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata', 'WidgetsList.addWidgets' => 'addWidgets', - 'Menu.Reporting.addItems' => 'addMenus', 'SitesManager.deleteSite.end' => 'deleteSiteGoals', 'Goals.getReportsWithGoalMetrics' => 'getActualReportsWithGoalMetrics', 'ViewDataTable.configure' => 'configureViewDataTable', @@ -495,45 +492,6 @@ class Goals extends \Piwik\Plugin } } - function addMenus(MenuAbstract $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'])); - } - } - } - - protected function getGoalCategoryName($idSite) - { - $site = new Site($idSite); - return $site->isEcommerceEnabled() ? 'Goals_EcommerceAndGoalsMenu' : 'Goals_Goals'; - } - public function configureViewDataTable(ViewDataTable $view) { switch ($view->requestConfig->apiMethodToRequestDataTable) { |