diff options
-rw-r--r-- | LEGALNOTICE | 4 | ||||
-rw-r--r-- | core/Updates/1.11-b1.php | 33 | ||||
-rw-r--r-- | core/Version.php | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/menu.js | 2 | ||||
-rw-r--r-- | plugins/Live/Live.php | 2 | ||||
-rw-r--r-- | plugins/UserCountry/Controller.php | 5 | ||||
-rw-r--r-- | plugins/UserCountry/templates/index.tpl | 14 | ||||
-rw-r--r-- | plugins/UserCountryMap/Controller.php | 16 | ||||
-rw-r--r-- | plugins/UserCountryMap/UserCountryMap.php | 22 | ||||
-rw-r--r-- | plugins/UserCountryMap/js/realtime-map.js | 3 | ||||
-rw-r--r-- | plugins/UserCountryMap/templates/realtime-map.tpl | 15 |
11 files changed, 101 insertions, 17 deletions
diff --git a/LEGALNOTICE b/LEGALNOTICE index 22d6c6e0fa..6702ccb127 100644 --- a/LEGALNOTICE +++ b/LEGALNOTICE @@ -203,6 +203,10 @@ THIRD-PARTY COMPONENTS AND LIBRARIES Link: http://raphaeljs.com/ License: MIT + Name: kmeans.js + Link: http://polymaps.org/ex/cluster.html + License: BSD + THIRD-PARTY CONTENT Name: FamFamFam icons - Mark James diff --git a/core/Updates/1.11-b1.php b/core/Updates/1.11-b1.php new file mode 100644 index 0000000000..d38b123605 --- /dev/null +++ b/core/Updates/1.11-b1.php @@ -0,0 +1,33 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + * @category Piwik + * @package Updates + */ + +/** + * @package Updates + */ +class Piwik_Updates_1_11_b1 extends Piwik_Updates +{ + static function isMajorUpdate() + { + return false; + } + + static function update() + { + try + { + Piwik_PluginsManager::getInstance()->activatePlugin('UserCountryMap'); + } + catch(Exception $e) + { + // pass + } + } +}
\ No newline at end of file diff --git a/core/Version.php b/core/Version.php index 46e829821c..f31b146659 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,5 +20,5 @@ final class Piwik_Version * Current Piwik version * @var string */ - const VERSION = '1.10.2-b2'; + const VERSION = '1.11-b1'; } diff --git a/plugins/CoreHome/templates/menu.js b/plugins/CoreHome/templates/menu.js index 2902c4a4a5..d9067268c5 100644 --- a/plugins/CoreHome/templates/menu.js +++ b/plugins/CoreHome/templates/menu.js @@ -32,7 +32,7 @@ menu.prototype = onItemClick: function (item) { - $('ul.nav').trigger('piwikSwitchPage'); + $('ul.nav').trigger('piwikSwitchPage', item); broadcast.propagateAjax($(item).attr('name')); return false; }, diff --git a/plugins/Live/Live.php b/plugins/Live/Live.php index 2d02a100c0..a2362c3d08 100644 --- a/plugins/Live/Live.php +++ b/plugins/Live/Live.php @@ -57,7 +57,7 @@ class Piwik_Live extends Piwik_Plugin function addMenu() { - Piwik_AddMenu('General_Visitors', 'Live_VisitorLog', array('module' => 'Live', 'action' => 'getVisitorLog')); + Piwik_AddMenu('General_Visitors', 'Live_VisitorLog', array('module' => 'Live', 'action' => 'getVisitorLog'), true, $order = 5); } public function addWidget() diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php index f34aa33efb..037817d21d 100644 --- a/plugins/UserCountry/Controller.php +++ b/plugins/UserCountry/Controller.php @@ -26,7 +26,8 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin $view->dataTableContinent = $this->getContinent(true); $view->dataTableRegion = $this->getRegion(true); $view->dataTableCity = $this->getCity(true); - + $view->visitorMap = Piwik_FrontController::getInstance()->fetchDispatch('UserCountryMap', 'visitorMap'); + echo $view->render(); } @@ -344,7 +345,7 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin function getContinent( $fetch = false) { - $view = $this->getStandardDataTableUserCountry(__FUNCTION__, "UserCountry.getContinent", 'graphVerticalBar'); + $view = $this->getStandardDataTableUserCountry(__FUNCTION__, "UserCountry.getContinent", 'table'); $view->disableSearchBox(); $view->disableOffsetInformationAndPaginationControls(); $view->setColumnTranslation('label', Piwik_Translate('UserCountry_Continent')); diff --git a/plugins/UserCountry/templates/index.tpl b/plugins/UserCountry/templates/index.tpl index 8053722b12..f443dd19d7 100644 --- a/plugins/UserCountry/templates/index.tpl +++ b/plugins/UserCountry/templates/index.tpl @@ -1,22 +1,22 @@ -{postEvent name="template_headerUserCountry"} <div id="leftcolumn"> - -<h2>{'UserCountry_Country'|translate}</h2> -{$dataTableCountry} +{postEvent name="template_leftColumnUserCountry"} <h2>{'UserCountry_Continent'|translate}</h2> {$dataTableContinent} <div class="sparkline"> - {sparkline src=$urlSparklineCountries} - {'UserCountry_DistinctCountries'|translate:"<strong>$numberDistinctCountries</strong>"} -</div> +{sparkline src=$urlSparklineCountries} +{'UserCountry_DistinctCountries'|translate:"<strong>$numberDistinctCountries</strong>"} +</div> </div> <div id="rightcolumn"> +<h2>{'UserCountry_Country'|translate}</h2> +{$dataTableCountry} + <h2>{'UserCountry_Region'|translate}</h2> {$dataTableRegion} diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php index c35239c9e7..e5353460c2 100644 --- a/plugins/UserCountryMap/Controller.php +++ b/plugins/UserCountryMap/Controller.php @@ -81,10 +81,22 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller $config['svgBasePath'] = 'plugins/UserCountryMap/svg/'; $config['mapCssPath'] = 'plugins/UserCountryMap/css/map.css'; $view->config = json_encode($config); + echo $view->render(); } - public function realtimeMap() + /** + * Used to build the report Visitor > Real time map + */ + public function realtimeWorldMap() + { + return $this->realtimeMap($standalone = true); + } + + /** + * @param bool $standalone When set to true, the Top controls will be hidden to provide better full screen view + */ + public function realtimeMap($standalone = false) { if(Piwik::isUserIsAnonymous()) { return "<h2>" . Piwik_Translate("UserCountryMap_LoginToViewRealTime") . "</h2>"; @@ -97,6 +109,8 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller $token_auth = Piwik::getCurrentUserTokenAuth(); $view = Piwik_View::factory('realtime-map'); + $view->mapIsStandaloneNotWidget = $standalone; + $view->metrics = $this->getMetrics($idSite, 'range', self::REAL_TIME_WINDOW, $token_auth); $view->defaultMetric = 'nb_visits'; $view->liveRefreshAfterMs = (int)Piwik_Config::getInstance()->General['live_widget_refresh_after_seconds'] * 1000; diff --git a/plugins/UserCountryMap/UserCountryMap.php b/plugins/UserCountryMap/UserCountryMap.php index d7f6976e46..38c4e291cf 100644 --- a/plugins/UserCountryMap/UserCountryMap.php +++ b/plugins/UserCountryMap/UserCountryMap.php @@ -30,18 +30,33 @@ class Piwik_UserCountryMap extends Piwik_Plugin { Piwik_AddWidget('General_Visitors', Piwik_Translate('UserCountryMap_VisitorMap'), 'UserCountryMap', 'visitorMap'); Piwik_AddWidget('Live!', Piwik_Translate('UserCountryMap_RealTimeMap'), 'UserCountryMap', 'realtimeMap'); + + Piwik_AddAction('template_leftColumnUserCountry', array('Piwik_UserCountryMap', 'insertMapInLocationReport')); } - public function getListHooksRegistered() + static public function insertMapInLocationReport($notification) + { + $out =& $notification->getNotificationObject(); + $out = '<h2>'.Piwik_Translate('UserCountryMap_VisitorMap').'</h2>'; + $out .= Piwik_FrontController::getInstance()->fetchDispatch('UserCountryMap','visitorMap'); + } + + public function getListHooksRegistered() { $hooks = array( 'AssetManager.getJsFiles' => 'getJsFiles', - 'AssetManager.getCssFiles' => 'getCssFiles' + 'AssetManager.getCssFiles' => 'getCssFiles', + 'Menu.add' => 'addMenu', ); return $hooks; } - /** + function addMenu() + { + Piwik_AddMenu('General_Visitors', 'UserCountryMap_RealTimeMap', array('module' => 'UserCountryMap', 'action' => 'realtimeWorldMap'), true, $order = 70); + } + + /** * @param Piwik_Event_Notification $notification notification object */ public function getJsFiles($notification) @@ -61,4 +76,5 @@ class Piwik_UserCountryMap extends Piwik_Plugin $cssFiles[] = "plugins/UserCountryMap/css/qtip.css"; $cssFiles[] = "plugins/UserCountryMap/css/visitor-map.css"; } + } diff --git a/plugins/UserCountryMap/js/realtime-map.js b/plugins/UserCountryMap/js/realtime-map.js index 9c8099b0be..7995d2e191 100644 --- a/plugins/UserCountryMap/js/realtime-map.js +++ b/plugins/UserCountryMap/js/realtime-map.js @@ -485,6 +485,9 @@ // make sure the map adapts to the widget size $(window).resize(onResizeLazy); + function getTimeInSiteTimezone() { + + } // setup automatic tooltip updates setInterval(function() { $('.qtip .rel-time').each(function(i, el) { diff --git a/plugins/UserCountryMap/templates/realtime-map.tpl b/plugins/UserCountryMap/templates/realtime-map.tpl index 8ca5390871..d4c2827f47 100644 --- a/plugins/UserCountryMap/templates/realtime-map.tpl +++ b/plugins/UserCountryMap/templates/realtime-map.tpl @@ -127,7 +127,20 @@ <!-- configure some piwik vars --> <script type="text/javascript"> -{literal} +{* If the map is loaded from the menu, do a few tweaks to clean up the display *} +{if $mapIsStandaloneNotWidget} + $('.top_controls').hide(); + $('ul.nav').on('piwikSwitchPage', function(event, item) {ldelim} + var clickedMenuIsNotMap = ($(item).text() != "{'UserCountryMap_RealTimeMap'|translate|escape:'js'}"); + if(clickedMenuIsNotMap) {ldelim} + $('.top_controls').show(); + {rdelim} + {rdelim}); + $('.realTimeMap_overlay').css('top', '0px'); + $('.realTimeMap_datetime').css('top', '20px'); +{/if} + + {literal} var config = { metrics: {} }; {/literal} |