diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-06-02 04:09:15 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-06-17 08:09:13 +0300 |
commit | 18501381cec766aa729fdc7bdcd282c90a7be45f (patch) | |
tree | cf7cfe213d72cbd57ec86e570a5e2a7c4dc55815 /plugins/SitesManager/Controller.php | |
parent | 1f707dd3c9422494b7cf844591079c11c651158c (diff) |
refs #7893 added possibility to measure mobile apps
Diffstat (limited to 'plugins/SitesManager/Controller.php')
-rw-r--r-- | plugins/SitesManager/Controller.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index 33b00235f6..bbf4bd52c4 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -12,6 +12,8 @@ use Exception; use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\Piwik; +use Piwik\Measurable\MeasurableSetting; +use Piwik\Measurable\MeasurableSettings; use Piwik\SettingsPiwik; use Piwik\Site; use Piwik\Tracker\TrackerCodeGenerator; @@ -33,8 +35,29 @@ class Controller extends \Piwik\Plugin\ControllerAdmin return $this->renderTemplate('index'); } - public function getGlobalSettings() { + public function getMeasurableTypeSettings() + { + $idSite = Common::getRequestVar('idSite', 0, 'int'); + $idType = Common::getRequestVar('idType', '', 'string'); + + if ($idSite >= 1) { + Piwik::checkUserHasAdminAccess($idSite); + } else if ($idSite === 0) { + Piwik::checkUserHasSomeAdminAccess(); + } else { + throw new Exception('Invalid idSite parameter. IdSite has to be zero or higher'); + } + + $view = new View('@SitesManager/measurable_type_settings'); + + $propSettings = new MeasurableSettings($idSite, $idType); + $view->settings = $propSettings->getSettingsForCurrentUser(); + return $view->render(); + } + + public function getGlobalSettings() + { Piwik::checkUserHasSomeViewAccess(); $response = new ResponseBuilder(Common::getRequestVar('format')); |