Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-07-23 11:52:15 +0400
committermattab <matthieu.aubry@gmail.com>2013-07-23 11:52:15 +0400
commit5104d94f3b2250f766b9c520e2da8da9b4cab2e9 (patch)
tree5f30daf7bc14373fb1bbd0504ce11a771dafc02f /plugins/UserCountryMap
parentae4b1f4e38077b174e4df5b7d4513d63fe026a24 (diff)
Refs #4059 Work in progress: Conversion to use Namespaces of dozen more classes
Removed many Piwik_ functions, in Piwik 2 it is best practise to use the methods calls instead Todo: finish converting core/ classes + convert plugins/ classes to use \Piwik\Plugin namespace + fix build + Merge master
Diffstat (limited to 'plugins/UserCountryMap')
-rw-r--r--plugins/UserCountryMap/Controller.php18
-rw-r--r--plugins/UserCountryMap/UserCountryMap.php10
2 files changed, 17 insertions, 11 deletions
diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php
index f9f52e8233..a70e3a83d7 100644
--- a/plugins/UserCountryMap/Controller.php
+++ b/plugins/UserCountryMap/Controller.php
@@ -8,8 +8,12 @@
* @category Piwik_Plugins
* @package Piwik_UserCountryMap
*/
+use Piwik\API\Request;
use Piwik\Piwik;
use Piwik\Common;
+use Piwik\Controller;
+use Piwik\ViewDataTable;
+use Piwik\View;
use Piwik\Site;
use Piwik\Config;
@@ -17,7 +21,7 @@ use Piwik\Config;
*
* @package Piwik_UserCountryMap
*/
-class Piwik_UserCountryMap_Controller extends Piwik_Controller
+class Piwik_UserCountryMap_Controller extends Controller
{
// By default plot up to the last 30 days of visitors on the map, for low traffic sites
@@ -34,10 +38,10 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
$date = Common::getRequestVar('date');
$token_auth = Piwik::getCurrentUserTokenAuth();
- $view = new Piwik_View('@UserCountryMap/visitorMap');
+ $view = new View('@UserCountryMap/visitorMap');
// request visits summary
- $request = new Piwik_API_Request(
+ $request = new Request(
'method=VisitsSummary.get&format=PHP'
. '&idSite=' . $idSite
. '&period=' . $period
@@ -107,7 +111,7 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
Piwik::checkUserHasViewAccess($idSite);
$token_auth = Piwik::getCurrentUserTokenAuth();
- $view = new Piwik_View('@UserCountryMap/realtimeMap');
+ $view = new View('@UserCountryMap/realtimeMap');
$view->mapIsStandaloneNotWidget = $standalone;
@@ -153,7 +157,7 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
{
$params['format'] = 'json';
$params['showRawMetrics'] = 1;
- $segment = Piwik_ViewDataTable::getRawSegmentFromRequest();
+ $segment = ViewDataTable::getRawSegmentFromRequest();
if(!empty($segment)) {
$params['segment'] = $segment;
}
@@ -171,7 +175,7 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
private function getMetrics($idSite, $period, $date, $token_auth)
{
- $request = new Piwik_API_Request(
+ $request = new Request(
'method=API.getMetadata&format=PHP'
. '&apiModule=UserCountry&apiAction=getCountry'
. '&idSite=' . $idSite
@@ -203,7 +207,7 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
. "&period=" . $period
. "&date=" . $date
. "&token_auth=" . $token_auth
- . "&segment=" . Piwik_ViewDataTable::getRawSegmentFromRequest()
+ . "&segment=" . ViewDataTable::getRawSegmentFromRequest()
. "&enable_filter_excludelowpop=1"
. "&showRawMetrics=1";
diff --git a/plugins/UserCountryMap/UserCountryMap.php b/plugins/UserCountryMap/UserCountryMap.php
index 1659288d1c..ac9255a303 100644
--- a/plugins/UserCountryMap/UserCountryMap.php
+++ b/plugins/UserCountryMap/UserCountryMap.php
@@ -8,6 +8,8 @@
* @category Piwik_Plugins
* @package Piwik_UserCountryMap
*/
+use Piwik\FrontController;
+use Piwik\Version;
use Piwik\Plugin;
/**
@@ -26,14 +28,14 @@ class Piwik_UserCountryMap extends Plugin
'description' => 'This plugin provides the widgets Visitor Map and Real-time Map. Note: Requires the UserCountry plugin enabled.',
'author' => 'Piwik',
'author_homepage' => 'http://piwik.org/',
- 'version' => Piwik_Version::VERSION
+ 'version' => Version::VERSION
);
}
public function postLoad()
{
- Piwik_AddWidget('General_Visitors', Piwik_Translate('UserCountryMap_VisitorMap'), 'UserCountryMap', 'visitorMap');
- Piwik_AddWidget('Live!', Piwik_Translate('UserCountryMap_RealTimeMap'), 'UserCountryMap', 'realtimeMap');
+ WidgetsList::add('General_Visitors', Piwik_Translate('UserCountryMap_VisitorMap'), 'UserCountryMap', 'visitorMap');
+ WidgetsList::add('Live!', Piwik_Translate('UserCountryMap_RealTimeMap'), 'UserCountryMap', 'realtimeMap');
Piwik_AddAction('template_leftColumnUserCountry', array('Piwik_UserCountryMap', 'insertMapInLocationReport'));
}
@@ -41,7 +43,7 @@ class Piwik_UserCountryMap extends Plugin
static public function insertMapInLocationReport(&$out)
{
$out = '<h2>' . Piwik_Translate('UserCountryMap_VisitorMap') . '</h2>';
- $out .= Piwik_FrontController::getInstance()->fetchDispatch('UserCountryMap', 'visitorMap');
+ $out .= FrontController::getInstance()->fetchDispatch('UserCountryMap', 'visitorMap');
}
/**