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:
authorbenakamoorthi <benaka.moorthi@gmail.com>2012-12-05 10:18:00 +0400
committerbenakamoorthi <benaka.moorthi@gmail.com>2012-12-05 10:18:00 +0400
commit2b3ecb8cc9cc075f2c5cd7647280087ebd832370 (patch)
tree75d8e232c2c420ebe211d081a4df1bebae66bc81 /plugins/UserCountry
parent384715bbd43501bdb14a5848a460d018727de67f (diff)
Refs #3456, various UX improvements to GeoIP updater/auto-downloader.
git-svn-id: http://dev.piwik.org/svn/trunk@7577 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/UserCountry')
-rw-r--r--plugins/UserCountry/Controller.php9
-rwxr-xr-xplugins/UserCountry/templates/admin.js1
-rwxr-xr-xplugins/UserCountry/templates/adminIndex.tpl12
-rwxr-xr-xplugins/UserCountry/templates/styles.css5
-rwxr-xr-xplugins/UserCountry/templates/updaterSetup.tpl12
5 files changed, 27 insertions, 12 deletions
diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php
index 8d62f7e473..bf08563637 100644
--- a/plugins/UserCountry/Controller.php
+++ b/plugins/UserCountry/Controller.php
@@ -35,7 +35,7 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin
{
Piwik::checkUserIsSuperUser();
$view = Piwik_View::factory('adminIndex');
-
+
$allProviderInfo = Piwik_UserCountry_LocationProvider::getAllProviderInfo(
$newline = '<br/>', $includeExtra = true);
$view->locationProviders = $allProviderInfo;
@@ -160,6 +160,8 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin
$view->geoIPIspUrl = $urls['isp'];
$view->geoIPOrgUrl = $urls['org'];
$view->geoIPUpdatePeriod = Piwik_UserCountry_GeoIPAutoUpdater::getSchedulePeriod();
+
+ $view->geoLiteUrl = Piwik_UserCountry_LocationProvider_GeoIp::GEO_LITE_URL;
}
/**
@@ -466,10 +468,13 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin
{
$missingDbKey = $missingDbs[0];
$missingDbName = Piwik_UserCountry_LocationProvider_GeoIp::$dbNames[$missingDbKey][0];
+ $url = Piwik_UserCountry_GeoIPAutoUpdater::getConfiguredUrl($missingDbKey);
+
+ $link = '<a href="'.$url.'">'.$missingDbName.'</a>';
return array(
'to_download' => $missingDbKey,
- 'to_download_label' => Piwik_Translate('UserCountry_DownloadingDb', $missingDbName).'...',
+ 'to_download_label' => Piwik_Translate('UserCountry_DownloadingDb', $link).'...',
);
}
return false;
diff --git a/plugins/UserCountry/templates/admin.js b/plugins/UserCountry/templates/admin.js
index fc5e71c762..5c874753d5 100755
--- a/plugins/UserCountry/templates/admin.js
+++ b/plugins/UserCountry/templates/admin.js
@@ -140,6 +140,7 @@ $(document).ready(function() {
$('body').on('click', '#start-automatic-update-geoip', function() {
$('#geoipdb-screen1').hide("slide", {direction: "left"}, 800, function () {
+ $('#geoip-db-mangement').text(_pk_translate('UserCountry_SetupAutomaticUpdatesOfGeoIP_js'));
$('#geoipdb-update-info').fadeIn(1000);
});
});
diff --git a/plugins/UserCountry/templates/adminIndex.tpl b/plugins/UserCountry/templates/adminIndex.tpl
index 7c5fe69131..490205f2f3 100755
--- a/plugins/UserCountry/templates/adminIndex.tpl
+++ b/plugins/UserCountry/templates/adminIndex.tpl
@@ -94,10 +94,14 @@
</div>
-<h2>{'UserCountry_GeoIPDatabases'|translate}</h2>
+{if !$geoIPDatabasesInstalled}
+<h2 id="geoip-db-mangement">{'UserCountry_GeoIPDatabases'|translate}</h2>
+{else}
+<h2 id="geoip-db-mangement">{'UserCountry_SetupAutomaticUpdatesOfGeoIP_js'|translate}</h2>
+{/if}
{if $showGeoIPUpdateSection}
-<div id="manage-geoip-dbs" style="width:900px">
+<div id="manage-geoip-dbs" style="width:900px" class="adminTable">
{if !$geoIPDatabasesInstalled}
<div id="geoipdb-screen1">
@@ -107,12 +111,12 @@
<input type="button" class="submit" value="{'General_GetStarted'|translate}..." id="start-download-free-geoip"/>
</div>
<div class="geoipdb-column-2">
- <p>{'UserCountry_IPurchasedGeoIPDBs'|translate}</p>
+ <p>{'UserCountry_IPurchasedGeoIPDBs'|translate:'<a href="http://www.maxmind.com/en/geolocation_landing?rId=piwik">':'</a>'}</p>
<input type="button" class="submit" value="{'General_GetStarted'|translate}..." id="start-automatic-update-geoip"/>
</div>
</div>
<div id="geoipdb-screen2-download" style="display:none">
- <p class='loadingPiwik'><img src='./themes/default/images/loading-blue.gif' />{'UserCountry_DownloadingDb'|translate:'GeoLiteCity.dat'}...</p>
+ <p class='loadingPiwik'><img src='./themes/default/images/loading-blue.gif' />{'UserCountry_DownloadingDb'|translate:"<a href=\"$geoLiteUrl\">GeoLiteCity.dat</a>"}...</p>
<div id="geoip-download-progress"></div>
</div>
{/if}
diff --git a/plugins/UserCountry/templates/styles.css b/plugins/UserCountry/templates/styles.css
index 4ded571aa5..57cf159777 100755
--- a/plugins/UserCountry/templates/styles.css
+++ b/plugins/UserCountry/templates/styles.css
@@ -19,10 +19,13 @@ span.is-broken {
}
#manage-geoip-dbs {
- width:900px;
height: 20em;
}
+#geoipdb-screen1, #geoipdb-screen2-download,#geoipdb-update-info {
+ width:900px;
+}
+
#geoipdb-update-info tr input[type="text"],#geoipdb-screen2-update tr input[type="text"] {
width: 90%;
}
diff --git a/plugins/UserCountry/templates/updaterSetup.tpl b/plugins/UserCountry/templates/updaterSetup.tpl
index 96d55b5f1a..4cb2342af4 100755
--- a/plugins/UserCountry/templates/updaterSetup.tpl
+++ b/plugins/UserCountry/templates/updaterSetup.tpl
@@ -1,8 +1,10 @@
<div id="geoipdb-update-info" {if !$geoIPDatabasesInstalled}style="display:none"{/if}>
- <p>{'UserCountry_GeoIPUpdaterInstructions'|translate:'<a href="http://www.maxmind.com/en/download_files?rId=piwik" _target="blank">':'</a>':'<a href="http://www.maxmind.com/?rId=piwik">':'</a>'}</p>
+ <p>{'UserCountry_GeoIPUpdaterInstructions'|translate:'<a href="http://www.maxmind.com/en/download_files?rId=piwik" _target="blank">':'</a>':'<a href="http://www.maxmind.com/?rId=piwik">':'</a>'}<br/><br/>
+ {'UserCountry_GeoLiteCityLink'|translate:"<a href=\"$geoLiteUrl\">":$geoLiteUrl:'</a>'}
{if $geoIPDatabasesInstalled}
- <p>{'UserCountry_GeoIPUpdaterIntro'|translate}:</p>
+ <br/><br/>{'UserCountry_GeoIPUpdaterIntro'|translate}:
{/if}
+ </p>
<table class="adminTable" style="width:900px">
<tr>
<th>{'Live_GoalType'|translate}</th>
@@ -28,13 +30,13 @@
<td><input type="text" id="geoip-org-db" value="{$geoIPOrgUrl}"/></td>
</tr>
<tr>
- <td width="140">{'General_Period'|translate}</td>
+ <td width="140">{'UserCountry_DownloadNewDatabasesEvery'|translate}</td>
<td id="geoip-update-period-cell">
<input type="radio" name="geoip-update-period" value="month" id="geoip-update-period-month" {if $geoIPUpdatePeriod eq 'month'}checked="checked"{/if}/>
- <label for="geoip-update-period-month">{'General_Monthly'|translate}</label>
+ <label for="geoip-update-period-month">{'CoreHome_PeriodMonth'|translate}</label>
<input type="radio" name="geoip-update-period" value="week" id="geoip-update-period-week" {if $geoIPUpdatePeriod eq 'week'}checked="checked"{/if}/>
- <label for="geoip-update-period-week">{'General_Weekly'|translate}</label>
+ <label for="geoip-update-period-week">{'CoreHome_PeriodWeek'|translate}</label>
</td>
<td width="164">&nbsp;</td>
</tr>