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:
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r--plugins/CoreHome/Controller.php45
-rw-r--r--plugins/CoreHome/CoreHome.php7
-rw-r--r--plugins/CoreHome/templates/broadcast.js58
-rw-r--r--plugins/CoreHome/templates/calendar.js153
-rw-r--r--plugins/CoreHome/templates/cloud.tpl4
-rw-r--r--plugins/CoreHome/templates/datatable.css62
-rw-r--r--plugins/CoreHome/templates/datatable.js163
-rw-r--r--plugins/CoreHome/templates/datatable.tpl8
-rw-r--r--plugins/CoreHome/templates/datatable_actions.tpl7
-rw-r--r--plugins/CoreHome/templates/datatable_actions_recursive.tpl2
-rw-r--r--plugins/CoreHome/templates/datatable_actions_subdatable.tpl1
-rw-r--r--plugins/CoreHome/templates/datatable_footer.tpl38
-rw-r--r--plugins/CoreHome/templates/date.js10
-rw-r--r--plugins/CoreHome/templates/graph.tpl8
-rw-r--r--plugins/CoreHome/templates/header.tpl22
-rw-r--r--plugins/CoreHome/templates/header_message.tpl12
-rw-r--r--plugins/CoreHome/templates/index.tpl25
-rw-r--r--plugins/CoreHome/templates/js_css_includes.tpl8
-rw-r--r--plugins/CoreHome/templates/loading.tpl4
-rw-r--r--plugins/CoreHome/templates/menu.css11
-rw-r--r--plugins/CoreHome/templates/menu.js14
-rw-r--r--plugins/CoreHome/templates/period_select.tpl10
-rw-r--r--plugins/CoreHome/templates/piwik_tag.tpl4
-rw-r--r--plugins/CoreHome/templates/sites_selection.tpl4
-rw-r--r--plugins/CoreHome/templates/styles.css28
-rw-r--r--plugins/CoreHome/templates/top_bar.tpl4
-rw-r--r--plugins/CoreHome/templates/top_screen.tpl7
27 files changed, 410 insertions, 309 deletions
diff --git a/plugins/CoreHome/Controller.php b/plugins/CoreHome/Controller.php
index 043feb8f28..853e65d4e3 100644
--- a/plugins/CoreHome/Controller.php
+++ b/plugins/CoreHome/Controller.php
@@ -23,13 +23,22 @@ class Piwik_CoreHome_Controller extends Piwik_Controller
function redirectToCoreHomeIndex()
{
- // redirect to Login only for anonymous user
- if((bool)Zend_Registry::get('config')->General->default_module_login == true
- && Piwik::getCurrentUserLogin() == 'anonymous')
+ $defaultReport = Piwik_UsersManager_API::getInstance()->getUserPreference(Piwik::getCurrentUserLogin(), Piwik_UsersManager_API::PREFERENCE_DEFAULT_REPORT);
+ $module = 'CoreHome';
+ $action = 'index';
+
+ // User preference: default report to load is the All Websites dashboard
+ if($defaultReport == 'MultiSites'
+ && Piwik_PluginsManager::getInstance()->isPluginActivated('MultiSites'))
{
- return Piwik_FrontController::dispatch('Login', false);
+ $module = 'MultiSites';
}
- parent::redirectToIndex('CoreHome', 'index');
+ if($defaultReport == Piwik::getLoginPluginName())
+ {
+ $module = Piwik::getLoginPluginName();
+ }
+
+ parent::redirectToIndex($module, $action);
}
public function showInContext()
@@ -37,7 +46,6 @@ class Piwik_CoreHome_Controller extends Piwik_Controller
$controllerName = Piwik_Common::getRequestVar('moduleToLoad');
$actionName = Piwik_Common::getRequestVar('actionToLoad', 'index');
$view = $this->getDefaultIndexView();
- $view->basicHtmlView = true;
$view->content = Piwik_FrontController::getInstance()->fetchDispatch( $controllerName, $actionName );
echo $view->render();
}
@@ -51,8 +59,33 @@ class Piwik_CoreHome_Controller extends Piwik_Controller
return $view;
}
+ protected function setDateTodayIfWebsiteCreatedToday()
+ {
+ $date = Piwik_Common::getRequestVar('date', false);
+ if($date == 'today')
+ {
+ return;
+ }
+ $websiteId = Piwik_Common::getRequestVar('idSite', false);
+ if ($websiteId) {
+ $website = new Piwik_Site($websiteId);
+ $datetimeCreationDate = $this->site->getCreationDate()->getDatetime();
+ $creationDateLocalTimezone = Piwik_Date::factory($datetimeCreationDate, $website->getTimezone())->toString('Y-m-d');
+ $todayLocalTimezone = Piwik_Date::factory('now', $website->getTimezone())->toString('Y-m-d');
+ if( $creationDateLocalTimezone == $todayLocalTimezone )
+ {
+ Piwik::redirectToModule( 'CoreHome', 'index',
+ array( 'date' => 'today',
+ 'idSite' => $websiteId,
+ 'period' => Piwik_Common::getRequestVar('period'))
+ );
+ }
+ }
+ }
+
public function index()
{
+ $this->setDateTodayIfWebsiteCreatedToday();
$view = $this->getDefaultIndexView();
echo $view->render();
}
diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php
index 8fd24df88e..7fb831ce9d 100644
--- a/plugins/CoreHome/CoreHome.php
+++ b/plugins/CoreHome/CoreHome.php
@@ -19,11 +19,10 @@ class Piwik_CoreHome extends Piwik_Plugin
public function getInformation()
{
return array(
- 'name' => 'Homepage',
- 'description' => 'Web Analytics Reports Structure.',
+ 'description' => Piwik_Translate('CoreHome_PluginDescription'),
'author' => 'Piwik',
- 'homepage' => 'http://piwik.org/',
- 'version' => '0.1',
+ 'author_homepage' => 'http://piwik.org/',
+ 'version' => Piwik_Version::VERSION,
);
}
}
diff --git a/plugins/CoreHome/templates/broadcast.js b/plugins/CoreHome/templates/broadcast.js
index 1a2d67383c..74d1149ee3 100644
--- a/plugins/CoreHome/templates/broadcast.js
+++ b/plugins/CoreHome/templates/broadcast.js
@@ -19,6 +19,8 @@ broadcast.init = function() {
// Initialize history plugin.
// The callback is called at once by present location.hash
$.historyInit(broadcast.pageload);
+
+ piwikHelper.showAjaxLoading();
}
/************************************************
@@ -61,16 +63,23 @@ broadcast.propagateAjax = function (ajaxUrl)
// available in global scope
var currentHashStr = window.location.hash;
- // Because $.history plugin doens't care about # or ? sign infront of the query string
- // We take it out if exist;
+ // Because $.history plugin doesn't care about # or ? sign in front of the query string
+ // We take it out if it exists
currentHashStr = currentHashStr.replace(/^\?|^#/,'');
ajaxUrl = ajaxUrl.replace(/^\?|&#/,'');
var params_vals = ajaxUrl.split("&");
- for( var i=0; i<params_vals.length; i++ ) {
- currentHashStr = broadcast.updateParamValue(params_vals[i],currentHashStr);
+ for( var i=0; i<params_vals.length; i++ )
+ {
+ currentHashStr = broadcast.updateParamValue(params_vals[i],currentHashStr);
}
+ // if the module is not 'Goals', we specifically unset the 'idGoal' parameter
+ // this is to ensure that the URLs are clean (and that clicks on graphs work as expected - they are broken with the extra parameter)
+ if(broadcast.getParamValue('action', currentHashStr) != 'goalReport')
+ {
+ currentHashStr = broadcast.updateParamValue('idGoal=', currentHashStr);
+ }
// Let history know about this new Hash and load it.
$.historyLoad(currentHashStr);
};
@@ -106,7 +115,10 @@ broadcast.propagateNewPage = function (str)
for( var i=0; i<params_vals.length; i++ ) {
// update both the current search query and hash string
currentSearchStr = broadcast.updateParamValue(params_vals[i],currentSearchStr);
- currentHashStr = broadcast.updateParamValue(params_vals[i],currentHashStr);
+
+ if(currentHashStr.length != 0 ) {
+ currentHashStr = broadcast.updateParamValue(params_vals[i],currentHashStr);
+ }
}
// Now load the new page.
@@ -135,12 +147,17 @@ broadcast.updateParamValue = function(newParamValue,urlStr)
var paramName = p_v[0];
var valFromUrl = broadcast.getParamValue(paramName,urlStr);
-
+ // if set 'idGoal=' then we remove the parameter from the URL automatically (rather than passing an empty value)
+ var paramValue = p_v[1];
+ if(paramValue == '')
+ {
+ newParamValue = '';
+ }
if( valFromUrl != '') {
// replacing current param=value to newParamValue;
var regToBeReplace = new RegExp(paramName + '=' + valFromUrl, 'ig');
urlStr = urlStr.replace( regToBeReplace, newParamValue );
- } else {
+ } else if(newParamValue != '') {
urlStr += (urlStr == '') ? newParamValue : '&' + newParamValue;
}
@@ -154,8 +171,7 @@ broadcast.loadAjaxContent = function(urlAjax)
{
urlAjax = urlAjax.match(/^\?/) ? urlAjax : "?" + urlAjax;
- // showing loading...
- $('#loadingPiwik').show();
+ piwikHelper.showAjaxLoading();
$('#content').hide();
$("object").remove();
@@ -164,21 +180,21 @@ broadcast.loadAjaxContent = function(urlAjax)
function sectionLoaded(content)
{
- if(content.substring(0, 14) == '<!DOCTYPE html') {
- window.location.reload();
- return;
- }
+ if(content.substring(0, 14) == '<!DOCTYPE html') {
+ window.location.reload();
+ return;
+ }
if(urlAjax == broadcast.lastUrlRequested) {
- $('#content').html( content ).show();
- $('#loadingPiwik').hide();
- broadcast.lastUrlRequested = null;
- }
+ $('#content').html( content ).show();
+ piwikHelper.hideAjaxLoading();
+ broadcast.lastUrlRequested = null;
+ }
}
- piwikMenu.activateMenu(
- broadcast.getParamValue('module', urlAjax),
- broadcast.getParamValue('action', urlAjax),
- broadcast.getParamValue('idGoal', urlAjax)
+ piwikMenu.activateMenu(
+ broadcast.getParamValue('module', urlAjax),
+ broadcast.getParamValue('action', urlAjax),
+ broadcast.getParamValue('idGoal', urlAjax)
);
ajaxRequest = {
type: 'GET',
diff --git a/plugins/CoreHome/templates/calendar.js b/plugins/CoreHome/templates/calendar.js
index 43f35f0110..506f994e00 100644
--- a/plugins/CoreHome/templates/calendar.js
+++ b/plugins/CoreHome/templates/calendar.js
@@ -1,22 +1,20 @@
-
Date.prototype.getWeek = function() {
-var onejan = new Date(this.getFullYear(),0,1);
-return Math.ceil((((this - onejan) / 86400000) + onejan.getDay())/7);
+ var onejan = new Date(this.getFullYear(),0,1);
+ return Math.ceil((((this - onejan) / 86400000) + onejan.getDay())/7);
}
var splitDate = piwik.currentDateString.split("-");
-
var currentYear = splitDate[0];
var currentMonth = splitDate[1] - 1;
var currentDay = splitDate[2];
-
var currentDate = new Date(currentYear, currentMonth, currentDay);
+
var todayDate = new Date;
var todayMonth = todayDate.getMonth();
var todayYear = todayDate.getFullYear();
var todayDay = todayDate.getDate();
-function isDateSelected( date )
+function highlightCurrentPeriod( date )
{
var valid = false;
@@ -25,21 +23,16 @@ function isDateSelected( date )
var dateDay = date.getDate();
var style = '';
- if( date.toLocaleDateString() == todayDate.toLocaleDateString())
- {
- style = style + 'dateToday ';
- }
-
- // we dont color dates in the future
+ // we don't color dates in the future
if( dateMonth == todayMonth
&& dateYear == todayYear
&& dateDay >= todayDay
)
{
- return [true, style];
+ return [true, ''];
}
- // we dont color dates before the minimum date
+ // we don't color dates before the minimum date
if( dateYear < piwik.minDateYear
|| ( dateYear == piwik.minDateYear
&&
@@ -51,7 +44,7 @@ function isDateSelected( date )
)
)
{
- return [true, style];
+ return [true, ''];
}
// we color all day of the month for the same year for the month period
@@ -87,67 +80,85 @@ function isDateSelected( date )
if(valid)
{
- return [true, style+'dateUsedStats'];
+ return [true, 'ui-datepicker-current-period'];
}
- return [true, style];
-}
-
-function updateDate()
-{
- var date = formatDate(popUpCal.getDateFor($('#calendar')[0]));
- // Let broadcast do it job:
- // It will replace date value to both search query and hash and load the new page.
- broadcast.propagateNewPage('date='+date);
+ return [true, ''];
}
-function formatDate(date)
+function updateDate(dateText, inst)
{
- var day = date.getDate();
- var month = date.getMonth() + 1;
- return date.getFullYear() + '-'
- + (month < 10 ? '0' : '') + month + '-'
- + (day < 10 ? '0' : '') + day ;
+ var date = dateText;
+ // Let broadcast do its job:
+ // It will replace date value to both search query and hash and load the new page.
+ broadcast.propagateNewPage('date=' + date);
}
$(document).ready(function(){
-
- $("#calendar").calendar({
- onSelect: updateDate,
- showOtherMonths: true,
- dateFormat: 'DMY-',
- firstDay: 1,
- minDate: new Date(piwik.minDateYear, piwik.minDateMonth - 1, piwik.minDateDay),
- maxDate: new Date(piwik.maxDateYear, piwik.maxDateMonth - 1, piwik.maxDateDay),
- changeFirstDay: false,
- prevText: "",
- nextText: "",
- currentText: "",
- customDate: isDateSelected,
- dayNames: [
- _pk_translate('CoreHome_DaySu_js'),
- _pk_translate('CoreHome_DayMo_js'),
- _pk_translate('CoreHome_DayTu_js'),
- _pk_translate('CoreHome_DayWe_js'),
- _pk_translate('CoreHome_DayTh_js'),
- _pk_translate('CoreHome_DayFr_js'),
- _pk_translate('CoreHome_DaySa_js')],
- monthNames: [
- _pk_translate('CoreHome_MonthJanuary_js'),
- _pk_translate('CoreHome_MonthFebruary_js'),
- _pk_translate('CoreHome_MonthMarch_js'),
- _pk_translate('CoreHome_MonthApril_js'),
- _pk_translate('CoreHome_MonthMay_js'),
- _pk_translate('CoreHome_MonthJune_js'),
- _pk_translate('CoreHome_MonthJuly_js'),
- _pk_translate('CoreHome_MonthAugust_js'),
- _pk_translate('CoreHome_MonthSeptember_js'),
- _pk_translate('CoreHome_MonthOctober_js'),
- _pk_translate('CoreHome_MonthNovember_js'),
- _pk_translate('CoreHome_MonthDecember_js')]
- },
- currentDate);
-
- $("#calendar").hide();
- }
-);
+ $('#datepicker').datepicker({
+ onSelect: updateDate,
+ showOtherMonths: false,
+ dateFormat: 'yy-mm-dd',
+ firstDay: 1,
+ minDate: new Date(piwik.minDateYear, piwik.minDateMonth - 1, piwik.minDateDay),
+ maxDate: new Date(piwik.maxDateYear, piwik.maxDateMonth - 1, piwik.maxDateDay),
+ prevText: "",
+ nextText: "",
+ currentText: "",
+ beforeShowDay: highlightCurrentPeriod,
+ defaultDate: currentDate,
+ changeMonth: true,
+ changeYear: true,
+ // jquery-ui-i18n 1.7.2 lacks some translations, so we use our own
+ dayNamesMin: [
+ _pk_translate('CoreHome_DaySu_js'),
+ _pk_translate('CoreHome_DayMo_js'),
+ _pk_translate('CoreHome_DayTu_js'),
+ _pk_translate('CoreHome_DayWe_js'),
+ _pk_translate('CoreHome_DayTh_js'),
+ _pk_translate('CoreHome_DayFr_js'),
+ _pk_translate('CoreHome_DaySa_js')],
+ dayNamesShort: [
+ _pk_translate('CoreHome_ShortDay_1_js'),
+ _pk_translate('CoreHome_ShortDay_2_js'),
+ _pk_translate('CoreHome_ShortDay_3_js'),
+ _pk_translate('CoreHome_ShortDay_4_js'),
+ _pk_translate('CoreHome_ShortDay_5_js'),
+ _pk_translate('CoreHome_ShortDay_6_js'),
+ _pk_translate('CoreHome_ShortDay_7_js')],
+ dayNames: [
+ _pk_translate('CoreHome_LongDay_1_js'),
+ _pk_translate('CoreHome_LongDay_2_js'),
+ _pk_translate('CoreHome_LongDay_3_js'),
+ _pk_translate('CoreHome_LongDay_4_js'),
+ _pk_translate('CoreHome_LongDay_5_js'),
+ _pk_translate('CoreHome_LongDay_6_js'),
+ _pk_translate('CoreHome_LongDay_7_js')],
+ monthNamesShort: [
+ _pk_translate('CoreHome_ShortMonth_1_js'),
+ _pk_translate('CoreHome_ShortMonth_2_js'),
+ _pk_translate('CoreHome_ShortMonth_3_js'),
+ _pk_translate('CoreHome_ShortMonth_4_js'),
+ _pk_translate('CoreHome_ShortMonth_5_js'),
+ _pk_translate('CoreHome_ShortMonth_6_js'),
+ _pk_translate('CoreHome_ShortMonth_7_js'),
+ _pk_translate('CoreHome_ShortMonth_8_js'),
+ _pk_translate('CoreHome_ShortMonth_9_js'),
+ _pk_translate('CoreHome_ShortMonth_10_js'),
+ _pk_translate('CoreHome_ShortMonth_11_js'),
+ _pk_translate('CoreHome_ShortMonth_12_js')],
+ monthNames: [
+ _pk_translate('CoreHome_MonthJanuary_js'),
+ _pk_translate('CoreHome_MonthFebruary_js'),
+ _pk_translate('CoreHome_MonthMarch_js'),
+ _pk_translate('CoreHome_MonthApril_js'),
+ _pk_translate('CoreHome_MonthMay_js'),
+ _pk_translate('CoreHome_MonthJune_js'),
+ _pk_translate('CoreHome_MonthJuly_js'),
+ _pk_translate('CoreHome_MonthAugust_js'),
+ _pk_translate('CoreHome_MonthSeptember_js'),
+ _pk_translate('CoreHome_MonthOctober_js'),
+ _pk_translate('CoreHome_MonthNovember_js'),
+ _pk_translate('CoreHome_MonthDecember_js')]
+ });
+});
diff --git a/plugins/CoreHome/templates/cloud.tpl b/plugins/CoreHome/templates/cloud.tpl
index 18d24c1e7e..b05a8db239 100644
--- a/plugins/CoreHome/templates/cloud.tpl
+++ b/plugins/CoreHome/templates/cloud.tpl
@@ -1,12 +1,12 @@
<div id="{$properties.uniqueId}">
<div class="tagCloud">
{if count($cloudValues) == 0}
- <div id="emptyDatatable">{'General_NoDataForTagCloud'|translate}</div>
+ <div class="pk-emptyDataTable">{'General_NoDataForTagCloud'|translate}</div>
{else}
{foreach from=$cloudValues key=word item=value}
<span title="{$value.word} ({$value.value} {$columnTranslation})" class="word size{$value.size} {* we strike tags with 0 hits *} {if $value.value == 0}valueIsZero{/if}">
{if false !== $labelMetadata[$value.word].url}<a href="{$labelMetadata[$value.word].url}" target="_blank">{/if}
- {if false !== $labelMetadata[$value.word].logo}<img src="{$labelMetadata[$value.word].logo}" width="{$value.logoWidth}">{else}
+ {if false !== $labelMetadata[$value.word].logo}<img src="{$labelMetadata[$value.word].logo}" width="{$value.logoWidth}" />{else}
{$value.wordTruncated}{/if}{if false !== $labelMetadata[$value.word].url}</a>{/if}</span>
{/foreach}
{/if}
diff --git a/plugins/CoreHome/templates/datatable.css b/plugins/CoreHome/templates/datatable.css
index 48fcf6824f..47f89df30e 100644
--- a/plugins/CoreHome/templates/datatable.css
+++ b/plugins/CoreHome/templates/datatable.css
@@ -1,3 +1,4 @@
+
/*Overriding some dataTable css for better dashboard display*/
.widget .dataTableWrapper,
.widget .dataTableAllColumnsWrapper,
@@ -52,6 +53,7 @@ table.dataTable td.label,
table.subDataTable td.label,
table.dataTableActions td.label {
width: 100%;
+ white-space:nowrap;
}
table.dataTable img,
@@ -81,6 +83,15 @@ table.dataTable th {
background: #D4E3ED url(images/bg_header.jpg) repeat-x;
}
+table.dataTable th.first {
+ -moz-border-radius:6px 0 0 0;
+ -webkit-border-radius:6px 0 0 0;
+}
+
+table.dataTable th.last {
+ -moz-border-radius:0 6px 0 0;
+ -webkit-border-radius:0 6px 0 0;
+}
table.dataTable th.columnSorted {
font-weight: bold;
padding-right: 20px;
@@ -208,85 +219,86 @@ table thead div {
position: absolute;
}
-#dataTablePages {
+.dataTablePages {
color: #BFBFBF;
font-weight: bold;
margin: 10px;
font-size: 0.9em;
}
-#dataTableSearchPattern {
+.dataTableSearchPattern {
display: inline;
white-space: nowrap;
}
-#dataTableSearchPattern input {
+.dataTableSearchPattern input {
font-size: 0.7em;
padding: 2px;
border: 1px solid #B3B3B3;
color: #0C183A;
}
-#dataTableSearchPattern input:hover {
+.dataTableSearchPattern input:hover {
background: #F7F7FF none repeat scroll 0%;
}
-#dataTableSearchPattern #keyword {
+.dataTableSearchPattern #keyword {
background: transparent url(images/search.png) no-repeat scroll 4px
center;
padding: 3px 3px 3px 20px;
}
-#dataTableExcludeLowPopulation,#dataTableNext,#dataTablePrevious {
+.dataTableExcludeLowPopulation,.dataTableNext,.dataTablePrevious {
font-size: 0.9em;
color: #184A83;
text-decoration: underline;
cursor: pointer;
}
-.subDataTable#dataTableFeatures {
+/* @todo are these supposed to be together? */
+.subDataTable.dataTableFeatures {
padding-top: 0px;
padding-bottom: 5px;
width: 100%;
}
-#dataTableFeatures {
+.dataTableFeatures {
padding-top: 10px;
padding-bottom: 10px;
width: 100%;
text-align: center;
}
-#dataTableExcludeLowPopulation {
+.dataTableExcludeLowPopulation {
float: right;
font-size: 0.8em;
color: #C3C6D8;
text-align: right;
}
-#dataTableNext,#dataTablePrevious,#dataTableSearchPattern,#loadingDataTable
+.dataTableNext,.dataTablePrevious,.dataTableSearchPattern,.pk-loadingDataTable
{
display: none;
}
-.subDataTable #dataTableFooterIcons {
+.subDataTable .dataTableFooterIcons {
height: 0px;
}
-#dataTableFooterIcons {
+.dataTableFooterIcons {
float: right;
height: 18px;
}
-#exportToFormat {
+.exportToFormatIcons {
float: right;
}
-#dataTableFooterIconsShow {
+.dataTableFooterIconsShow {
float: right;
}
-#dataTableFooterIcons,#dataTableFooterIcons a {
+.dataTableFooterIcons,.dataTableFooterIcons a {
text-decoration: none;
color: #8894B1;
font-size:0.9em;
@@ -296,7 +308,7 @@ table thead div {
clear: both;
}
-#loadingDataTable {
+.pk-loadingDataTable {
float: left;
font-size: 0.9em;
color: #193B6C;
@@ -308,6 +320,7 @@ table.dataTableActions tr td.labelodd {
background-image: none;
}
+
/* levels higher than 4 have a default padding left */
tr.subActionsDataTable td.label,tr.actionsDataTable td.label {
padding-left: 7em;
@@ -318,27 +331,32 @@ tr.level0 td.label {
}
tr.level1 td.label {
- padding-left: +3.5em;
+ padding-left: +2.5em;
}
tr.level2 td.label {
- padding-left: +5.5em;
+ padding-left: +3.5em;
}
tr.level3 td.label {
- padding-left: +6.5em;
+ padding-left: +4.5em;
}
tr.level4 td.label {
- padding-left: +7em;
+ padding-left: +5em;
}
+/* less right margins for the link image in the Pa*/
+table.dataTableActions img.link {
+ margin-right: 0.3em;
+ margin-left:-0.5em;
+}
tr td.label img.plusMinus {
- margin-left: -1em;
margin-right: 0em;
+ margin-left:-1em;
}
-#emptyDatatable {
+.pk-emptyDataTable {
padding-top: 20px;
padding-bottom: 10px;
text-align: center;
diff --git a/plugins/CoreHome/templates/datatable.js b/plugins/CoreHome/templates/datatable.js
index 3de4c8fb22..75c11a62ad 100644
--- a/plugins/CoreHome/templates/datatable.js
+++ b/plugins/CoreHome/templates/datatable.js
@@ -131,7 +131,7 @@ dataTable.prototype =
// Function called to trigger the AJAX request
// The ajax request contains the function callback to trigger if the request is successful or failed
- // displayLoading = false When we don't want to display the Loading... DIV #loadingDataTable
+ // displayLoading = false When we don't want to display the Loading... DIV .pk-loadingDataTable
// for example when the script add a Loading... it self and doesn't want to display the generic Loading
reloadAjaxDataTable: function(displayLoading, callbackSuccess)
{
@@ -148,7 +148,7 @@ dataTable.prototype =
if(displayLoading)
{
- $('#'+self.workingDivId+' #loadingDataTable').css('display','block');
+ $('#'+self.workingDivId+' .pk-loadingDataTable').last().css('display','block');
}
$.ajax(self.buildAjaxRequest(callbackSuccess));
@@ -170,14 +170,15 @@ dataTable.prototype =
{
// we add class to the table so that we can give a different style to the subtable
$(content).find('table.dataTable').addClass('subDataTable');
- $(content).find('#dataTableFeatures').addClass('subDataTable');
+ $(content).find('.dataTableFeatures').addClass('subDataTable');
//we force the initialisation of subdatatables
- dataTableSel.html( $(content).html() );
+ dataTableSel.html( $(content) );
}
else
{
- dataTableSel.html( $(content).html() );
+ dataTableSel.find('object').remove();
+ dataTableSel.html( $(content) );
piwikHelper.lazyScrollTo(dataTableSel[0], 400);
}
},
@@ -204,10 +205,52 @@ dataTable.prototype =
self.handleLowPopulationLink(domElem);
self.handleOffsetInformation(domElem);
self.handleExportBox(domElem);
+ self.handleLinkedRows(domElem);
self.applyCosmetics(domElem);
self.handleSubDataTable(domElem);
},
+ handleLinkedRows: function(domElem)
+ {
+ var self = this;
+
+ var urlLinkFoundDom = $("tr td:first-child:has('.urlLink')", domElem);
+ if(urlLinkFoundDom.length == 0)
+ {
+ self.truncate( $("table tr td:first-child", domElem) );
+ }
+ else
+ {
+ urlLinkFoundDom.each( function(){
+ // we add a link based on the <span id="urlLink"> present in the column label (the first column)
+ // if this span is there, we add the link around the HTML in the TD
+ // but we add this link only for the rows that are not clickable already (subDataTable)
+ var imgToPrepend = '';
+ if( $(this).find('img').length == 0 )
+ {
+ var imageLinkWidth = 10;
+ var imageLinkHeight = 9;
+ imgToPrepend = '<img class="link" width="'+imageLinkWidth+'" height="'+imageLinkHeight+'" src="themes/default/images/link.gif" /> ';
+ }
+ var urlLinkDom = $('.urlLink',this);
+ var urlToLink = $(urlLinkDom).html();
+ $(urlLinkDom).remove();
+
+ var truncationOffsetBecauseImageIsPrepend = -2; //website subtable needs -9.
+
+ self.truncate( $(this), truncationOffsetBecauseImageIsPrepend );
+ if( urlToLink.match("javascript:") )
+ {
+ $(this).prepend(imgToPrepend).wrapInner('<a href="#" onclick="' + urlToLink.replace("javascript:","") + '"></a>');
+ }
+ else
+ {
+ $(this).prepend(imgToPrepend).wrapInner('<a target="_blank" href="' + urlToLink + '"></a>');
+ }
+ });
+ }
+ },
+
// if sorting the columns is enabled, when clicking on a column,
// - if this column was already the one used for sorting, we revert the order desc<->asc
// - we send the ajax request with the new sorting information
@@ -239,7 +282,13 @@ dataTable.prototype =
$(".sortable#"+self.param.filter_sort_column+' #thDIV', domElem).parent()
.addClass('columnSorted')
.prepend('<div id="sortIconContainer"><img id="sortIcon" width="'+imageSortWidth+'" height="'+imageSortHeight+'" src="themes/default/images/sort'+prefixSortIcon+ self.param.filter_sort_order+'.png" /></div>');
- }
+
+
+ $("th.sortable", domElem)
+ .hover( function() { $(this).css({ cursor: "pointer"}); },
+ function() { $(this).css({ cursor: "auto"});
+ });
+ }
},
// Add behaviour to the low population link
@@ -248,7 +297,7 @@ dataTable.prototype =
var self = this;
// Set the string for the DIV, either "Exclude low pop" or "Include all"
- $('#dataTableExcludeLowPopulation', domElem)
+ $('.dataTableExcludeLowPopulation', domElem)
.each(
function()
{
@@ -301,7 +350,7 @@ dataTable.prototype =
currentPattern = '';
}
- $('#dataTableSearchPattern', domElem)
+ $('.dataTableSearchPattern', domElem)
.show()
.each(function(){
// when enter is pressed in the input field we submit the form
@@ -347,7 +396,7 @@ dataTable.prototype =
{
var target = this;
var clearImg = $('<span style="position: relative;">\
- <img src="plugins/CoreHome/templates/images/reset_search.png" style="position: absolute; top: 4px; left: -15px; cursor: pointer; display: inline;" title="Clear"/>\
+ <img src="plugins/CoreHome/templates/images/reset_search.png" style="position: absolute; top: 4px; left: -15px; cursor: pointer; display: inline;" title="Clear" />\
</span>')
.click( function() {
$('#keyword', target).val('');
@@ -365,7 +414,7 @@ dataTable.prototype =
{
var self = this;
- $('#dataTablePages', domElem).each(
+ $('.dataTablePages', domElem).each(
function(){
var offset = 1+Number(self.param.filter_offset);
var offsetEnd = Number(self.param.filter_offset) + Number(self.param.filter_limit);
@@ -384,7 +433,7 @@ dataTable.prototype =
);
// Display the next link if the total Rows is greater than the current end row
- $('#dataTableNext', domElem)
+ $('.dataTableNext', domElem)
.each(function(){
var offsetEnd = Number(self.param.filter_offset)
+ Number(self.param.filter_limit);
@@ -403,7 +452,7 @@ dataTable.prototype =
;
// Display the previous link if the current offset is not zero
- $('#dataTablePrevious', domElem)
+ $('.dataTablePrevious', domElem)
.each(function(){
var offset = 1+Number(self.param.filter_offset);
if(offset != 1)
@@ -436,18 +485,18 @@ dataTable.prototype =
}
// When the (+) image is hovered, the export buttons are displayed
- $('#dataTableFooterIconsShow', domElem)
+ $('.dataTableFooterIconsShow', domElem)
.show()
.hover( function() {
$(this).fadeOut('slow');
- $('#exportToFormat', $(this).parent()).show('slow');
+ $('.exportToFormatIcons', $(this).parent()).show('slow');
}, function(){}
);
//timeout object used to hide the datatable export buttons
var timeout = null;
- $('#dataTableFooterIcons', domElem)
+ $('.dataTableFooterIcons', domElem)
.hover( function() {
//display 'hand' cursor
$(this).css({ cursor: "pointer"});
@@ -466,8 +515,8 @@ dataTable.prototype =
//set a timeout that will hide export buttons after a few moments
var dom = this;
timeout = setTimeout(function(){
- $('#exportToFormat', dom).fadeOut('fast', function(){ //queue the two actions
- $('#dataTableFooterIconsShow', dom).show('fast');});
+ $('.exportToFormatIcons', dom).fadeOut('fast', function(){ //queue the two actions
+ $('.dataTableFooterIconsShow', dom).show('fast');});
}, 1000);
}
);
@@ -481,7 +530,7 @@ dataTable.prototype =
}
);
- $('#tableGoals', domElem)
+ $('.tableGoals', domElem)
.show()
.click(
function(){
@@ -494,7 +543,7 @@ dataTable.prototype =
}
);
- $('#tableAllColumnsSwitch', domElem)
+ $('.tableAllColumnsSwitch', domElem)
.show()
.click(
function(){
@@ -511,8 +560,8 @@ dataTable.prototype =
}
);
- $('#exportToFormat img', domElem).click(function(){
- $(this).siblings('#linksExportToFormat').toggle();
+ $('.exportToFormatIcons img', domElem).click(function(){
+ $(this).siblings('.linksExportToFormat').toggle();
});
$('.exportToFormat', domElem).attr( 'href', function(){
@@ -577,42 +626,6 @@ dataTable.prototype =
applyCosmetics: function(domElem)
{
var self = this;
-
- var urlLinkFoundDom = $("tr:not('.subDataTable') td:first-child:has('#urlLink')", domElem);
- if(urlLinkFoundDom.length == 0)
- {
- self.truncate( $("table tr td:first-child", domElem) );
- }
- else
- {
- var imageLinkWidth = 10;
- var imageLinkHeight = 9;
- urlLinkFoundDom.each( function(){
- // we add a link based on the <span id="urlLink"> present in the column label (the first column)
- // if this span is there, we add the link around the HTML in the TD
- // but we add this link only for the rows that are not clickable already (subDataTable)
- var imgToPrepend = '';
- if( $(this).find('img').length == 0 )
- {
- imgToPrepend = '<img width="'+imageLinkWidth+'" height="'+imageLinkHeight+'" src="themes/default/images/link.gif" /> ';
- }
- var urlLinkDom = $('#urlLink',this);
- var urlToLink = $(urlLinkDom).html();
- $(urlLinkDom).remove();
-
- var truncationOffsetBecauseImageIsPrepend = -2; //website subtable needs -9.
- self.truncate( $(this), truncationOffsetBecauseImageIsPrepend );
-
- if( urlToLink.match("javascript:") )
- {
- $(this).prepend(imgToPrepend).wrapInner('<a href="#" onclick="' + urlToLink.replace("javascript:","") + '"></a>');
- }
- else
- {
- $(this).prepend(imgToPrepend).wrapInner('<a target="_blank" href="' + urlToLink + '"></a>');
- }
- });
- }
// Add some styles on the cells even/odd
// label (first column of a data row) or not
@@ -622,14 +635,6 @@ dataTable.prototype =
$("tr:odd td", domElem).slice(1).addClass('columnodd');
$("tr:even td", domElem).slice(1).addClass('columneven');
- // Change cursor on mouse hover if sort is enabled
- if( self.param.enable_sort )
- {
- $("th.sortable", domElem)
- .hover( function() { $(this).css({ cursor: "pointer"}); },
- function() { $(this).css({ cursor: "auto"});
- });
- }
},
//behaviour for 'nested DataTable' (DataTable loaded on a click on a row)
@@ -656,7 +661,7 @@ dataTable.prototype =
'<tr>'+
'<td colspan="'+numberOfColumns+'" class="cellSubDataTable">'+
'<div id="'+divIdToReplaceWithSubTable+'">'+
- '<span id="loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" />'+ _pk_translate('CoreHome_Loading_js') +'</span>'+
+ '<span class="pk-loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" />'+ _pk_translate('CoreHome_Loading_js') +'</span>'+
'</div>'+
'</td>'+
'</tr>'
@@ -739,6 +744,9 @@ actionDataTable.prototype =
handleExportBox: dataTable.prototype.handleExportBox,
handleSort: dataTable.prototype.handleSort,
onClickSort: dataTable.prototype.onClickSort,
+ handleLinkedRows: dataTable.prototype.handleLinkedRows,
+ truncate: dataTable.prototype.truncate,
+ handleOffsetInformation: dataTable.prototype.handleOffsetInformation,
//initialisation of the actionDataTable
init: function(workingDivId, domElem)
@@ -778,10 +786,12 @@ actionDataTable.prototype =
self.handleExportBox(domElem);
self.handleSort(domElem);
+ self.handleLinkedRows(domElem);
+ self.handleOffsetInformation(domElem);
if( self.workingDivId != undefined)
{
- self.handleSearchBox(domElem, self.actionsDataTableLoaded );
- self.handleLowPopulationLink(domElem, self.actionsDataTableLoaded );
+ self.handleSearchBox(domElem, self.dataTableLoaded );
+ self.handleLowPopulationLink(domElem, self.dataTableLoaded );
}
},
@@ -840,8 +850,8 @@ actionDataTable.prototype =
$("td:first-child:odd", this).addClass('label labeleven');
$("td:first-child:even", this).addClass('label labelodd');
// we truncate the labels columns from the second row
- $("td:first-child", this).truncate(30);
- $('.truncated', this).tooltip();
+// $("td:first-child", this).truncate(30);
+// $('.truncated', this).tooltip();
})
.removeClass('rowToProcess');
},
@@ -875,7 +885,7 @@ actionDataTable.prototype =
$(domElem).after( '\
<tr id="'+divIdToReplaceWithSubTable+'" class="cellSubDataTable">\
<td colspan="'+numberOfColumns+'">\
- <span id="loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" /> Loading...</span>\
+ <span class="pk-loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" /> Loading...</span>\
</td>\
</tr>\
');
@@ -941,7 +951,7 @@ actionDataTable.prototype =
},
//called when the full table actions is loaded
- actionsDataTableLoaded: function(response)
+ dataTableLoaded: function(response)
{
var content = $(response);
var idToReplace = $(content).attr('id');
@@ -951,7 +961,7 @@ actionDataTable.prototype =
self.parentId = '';
var dataTableSel = $('#'+idToReplace);
- dataTableSel.html($(content).html());
+ dataTableSel.html( $(content) );
piwikHelper.lazyScrollTo(dataTableSel[0], 400);
},
@@ -976,7 +986,8 @@ actionDataTable.prototype =
}
// we execute the bindDataTableEvent function for the new DIV
- self.init(self.workingDivId, $('#'+idToReplace));
+ self.init(self.workingDivId, $('#'+self.workingDivId));
+// self.init(self.workingDivId, $('#'+idToReplace));
//bind back the click event (disabled to avoid double-click problem)
self.disabledRowDom.click(
@@ -990,7 +1001,7 @@ actionDataTable.prototype =
//helper function for actionDataTable
function getLevelFromClass( style)
{
- if (typeof style == "undefined") return 0;
+ if (!style || typeof style == "undefined") return 0;
var currentLevelIndex = style.indexOf('level');
var currentLevel = 0;
@@ -1004,7 +1015,7 @@ function getLevelFromClass( style)
//helper function for actionDataTable
function getNextLevelFromClass( style )
{
- if (typeof style == "undefined") return 0;
+ if (!style || typeof style == "undefined") return 0;
currentLevel = getLevelFromClass(style);
newLevel = currentLevel;
// if this is not a row to process so
diff --git a/plugins/CoreHome/templates/datatable.tpl b/plugins/CoreHome/templates/datatable.tpl
index 7cbdc6f2cc..56c508a151 100644
--- a/plugins/CoreHome/templates/datatable.tpl
+++ b/plugins/CoreHome/templates/datatable.tpl
@@ -4,14 +4,14 @@
{$arrayDataTable.message}
{else}
{if count($arrayDataTable) == 0}
- <div id="emptyDatatable">{'CoreHome_TableNoData'|translate}</div>
+ <div class="pk-emptyDataTable">{'CoreHome_TableNoData'|translate}</div>
{else}
<a name="{$properties.uniqueId}"></a>
<table cellspacing="0" class="dataTable">
<thead>
<tr>
- {foreach from=$dataTableColumns item=column}
- <th class="sortable" id="{$column}"><div id="thDIV">{$columnTranslations[$column]}</div></th>
+ {foreach from=$dataTableColumns item=column name=head}
+ <th class="sortable {if $smarty.foreach.head.first}first{elseif $smarty.foreach.head.last}last{/if}" id="{$column}"><div id="thDIV">{$columnTranslations[$column]}</div></th>
{/foreach}
</tr>
</thead>
@@ -21,7 +21,7 @@
<tr {if $row.idsubdatatable && $javascriptVariablesToSet.controllerActionCalledWhenRequestSubTable != null}class="subDataTable" id="{$row.idsubdatatable}"{/if}>
{foreach from=$dataTableColumns item=column}
<td>
-{if !$row.idsubdatatable && $column=='label' && isset($row.metadata.url)}<span id="urlLink">{$row.metadata.url}</span>{/if}
+{if !$row.idsubdatatable && $column=='label' && !empty($row.metadata.url)}<span class="urlLink">{$row.metadata.url}</span>{/if}
{if $column=='label'}{logoHtml metadata=$row.metadata alt=$row.columns.label}{/if}
{if isset($row.columns[$column])}{$row.columns[$column]}{else}{$defaultWhenColumnValueNotDefined}{/if}
</td>
diff --git a/plugins/CoreHome/templates/datatable_actions.tpl b/plugins/CoreHome/templates/datatable_actions.tpl
index 1ffa6b99c1..44c8a16911 100644
--- a/plugins/CoreHome/templates/datatable_actions.tpl
+++ b/plugins/CoreHome/templates/datatable_actions.tpl
@@ -4,13 +4,13 @@
{$arrayDataTable.message}
{else}
{if count($arrayDataTable) == 0}
- <div id="emptyDatatable">{'CoreHome_TableNoData'|translate}</div>
+ <div class="pk-emptyDataTable">{'CoreHome_TableNoData'|translate}</div>
{else}
<table cellspacing="0" class="dataTable dataTableActions">
<thead>
<tr>
- {foreach from=$dataTableColumns item=column}
- <th class="sortable" id="{$column}">{$columnTranslations[$column]}</td>
+ {foreach from=$dataTableColumns item=column name=head}
+ <th class="sortable {if $smarty.foreach.head.first}first{elseif $smarty.foreach.head.last}last{/if}" id="{$column}"><div id="thDIV">{if !empty($columnDescriptions[$column])}<label title='{$columnDescriptions[$column]|escape:'html'}'>{/if}{$columnTranslations[$column]|escape:'html'}{if !empty($columnDescriptions[$column])}</label>{/if}</div></td>
{/foreach}
</tr>
</thead>
@@ -20,6 +20,7 @@
<tr {if $row.idsubdatatable}class="rowToProcess subActionsDataTable" id="{$row.idsubdatatable}"{else} class="actionsDataTable rowToProcess"{/if}>
{foreach from=$dataTableColumns item=column}
<td>
+ {if !$row.idsubdatatable && $column=='label' && isset($row.metadata.url)}<span class="urlLink">{$row.metadata.url}</span>{/if}
{if isset($row.columns[$column])}{$row.columns[$column]}{else}{$defaultWhenColumnValueNotDefined}{/if}
</td>
{/foreach}
diff --git a/plugins/CoreHome/templates/datatable_actions_recursive.tpl b/plugins/CoreHome/templates/datatable_actions_recursive.tpl
index d405ea3fdc..48e98197d1 100644
--- a/plugins/CoreHome/templates/datatable_actions_recursive.tpl
+++ b/plugins/CoreHome/templates/datatable_actions_recursive.tpl
@@ -4,7 +4,7 @@
{$arrayDataTable.message}
{else}
{if count($arrayDataTable) == 0}
- <div id="emptyDatatable">{'CoreHome_TableNoData'|translate}</div>
+ <div class="pk-emptyDataTable">{'CoreHome_TableNoData'|translate}</div>
{else}
<table cellspacing="0" class="dataTable dataTableActions">
<thead>
diff --git a/plugins/CoreHome/templates/datatable_actions_subdatable.tpl b/plugins/CoreHome/templates/datatable_actions_subdatable.tpl
index 0a1ec0bb0d..dbd7b903c7 100644
--- a/plugins/CoreHome/templates/datatable_actions_subdatable.tpl
+++ b/plugins/CoreHome/templates/datatable_actions_subdatable.tpl
@@ -9,6 +9,7 @@
<tr {if $row.idsubdatatable}class="subActionsDataTable" id="{$row.idsubdatatable}"{else}class="actionsDataTable"{/if}>
{foreach from=$dataTableColumns item=column}
<td>
+ {if !$row.idsubdatatable && $column=='label' && isset($row.metadata.url)}<span class="urlLink">{$row.metadata.url}</span>{/if}
{if isset($row.columns[$column])}{$row.columns[$column]}{else}{$defaultWhenColumnValueNotDefined}{/if}
</td>
{/foreach}
diff --git a/plugins/CoreHome/templates/datatable_footer.tpl b/plugins/CoreHome/templates/datatable_footer.tpl
index 1398bed288..329a2002e9 100644
--- a/plugins/CoreHome/templates/datatable_footer.tpl
+++ b/plugins/CoreHome/templates/datatable_footer.tpl
@@ -1,36 +1,40 @@
-<div id="dataTableFeatures">
+<div class="dataTableFeatures">
{if $properties.show_exclude_low_population}
- <span id="dataTableExcludeLowPopulation"></span>
+ <span class="dataTableExcludeLowPopulation"></span>
+{/if}
+
+{if $properties.show_offset_information}
+<div>
+ <span class="dataTablePages"></span>
+ <span class="dataTablePrevious">&lsaquo; {'General_Previous'|translate}</span>
+ <span class="dataTableNext">{'General_Next'|translate} &rsaquo;</span>
+</div>
{/if}
{if $properties.show_search}
-<span id="dataTableSearchPattern">
+<span class="dataTableSearchPattern">
<input id="keyword" type="text" length="15" />
<input type="submit" value="{'General_Search'|translate}" />
</span>
{/if}
-{if $properties.show_offset_information}
- <span id="dataTablePages"></span>
- <span id="dataTablePrevious">&lsaquo; {'General_Previous'|translate}</span>
- <span id="dataTableNext">{'General_Next'|translate} &rsaquo;</span>
-{/if}
{if $properties.show_footer_icons}
<div>
- <span id="dataTableFooterIcons">
- <span id="exportToFormat" style="display:none;padding-left:4px;">
+ <span class="dataTableFooterIcons">
+ <span class="exportToFormatIcons" style="display:none;padding-left:4px;">
{if $properties.show_export_as_image_icon}
<span id="dataTableFooterExportAsImageIcon">
<a href="javascript:piwikHelper.OFC.jquery.popup('{$chartDivId}');"><img title="{'General_ExportAsImage_js'|translate}" src="themes/default/images/image.png" /></a>
</span>
{/if}
<img width="16" height="16" src="themes/default/images/export.png" title="{'General_Export'|translate}" />
- <span id="linksExportToFormat" style="display:none">
+ <span class="linksExportToFormat" style="display:none">
<a target="_blank" class="exportToFormat" methodToCall="{$properties.apiMethodToRequestDataTable}" format="CSV" filter_limit="100">CSV</a> |
+ <a target="_blank" class="exportToFormat" methodToCall="{$properties.apiMethodToRequestDataTable}" format="TSV" filter_limit="100">TSV (Excel)</a> |
<a target="_blank" class="exportToFormat" methodToCall="{$properties.apiMethodToRequestDataTable}" format="XML" filter_limit="100">XML</a> |
<a target="_blank" class="exportToFormat" methodToCall="{$properties.apiMethodToRequestDataTable}" format="JSON" filter_limit="100">Json</a> |
<a target="_blank" class="exportToFormat" methodToCall="{$properties.apiMethodToRequestDataTable}" format="PHP" filter_limit="100">Php</a> |
- <a target="_blank" class="exportToFormat" methodToCall="{$properties.apiMethodToRequestDataTable}" format="RSS" filter_limit="100" date="last10"><img border="0" src="themes/default/images/feed.png"></a>
+ <a target="_blank" class="exportToFormat" methodToCall="{$properties.apiMethodToRequestDataTable}" format="RSS" filter_limit="100" date="last10"><img border="0" src="themes/default/images/feed.png" /></a>
</span>
{if $properties.show_all_views_icons}
<a class="viewDataTable" format="cloud"><img width="16" height="16" src="themes/default/images/tagcloud.png" title="{'General_TagCloud'|translate}" /></a>
@@ -38,12 +42,12 @@
<a class="viewDataTable" format="graphPie"><img width="16" height="16" src="themes/default/images/chart_pie.png" title="{'General_Piechart'|translate}" /></a>
{/if}
</span>
- <span id="dataTableFooterIconsShow" style="display:none;padding-left:4px;">
+ <span class="dataTableFooterIconsShow" style="display:none;padding-left:4px;">
<img src="plugins/CoreHome/templates/images/more.png" />
</span>
{if $properties.show_table}
- <span id="tableAllColumnsSwitch" style="display:none;float:right;padding-right:4px;border-right:1px solid #82A1D2;">
+ <span class="tableAllColumnsSwitch" style="display:none;float:right;padding-right:4px;border-right:1px solid #82A1D2;">
{if $javascriptVariablesToSet.viewDataTable != 'table'}
<img title="{'General_DisplayNormalTable'|translate}" src="themes/default/images/table.png" />
{elseif $properties.show_table_all_columns}
@@ -53,9 +57,9 @@
{/if}
{if $properties.show_goals}
- <span id="tableGoals" style="display:none;float:right;padding-right:4px;">
+ <span class="tableGoals" style="display:none;float:right;padding-right:4px;">
{if $javascriptVariablesToSet.viewDataTable != 'tableGoals'}
- <img title="View Goals" src="themes/default/images/goal.png" />
+ <img title="{'General_DisplayGoals'|translate}" src="themes/default/images/goal.png" />
{/if}
</span>
{/if}
@@ -63,7 +67,7 @@
</div>
{/if}
-<span id="loadingDataTable"><img src="themes/default/images/loading-blue.gif" /> {'General_LoadingData'|translate}</span>
+<span class="pk-loadingDataTable"><img src="themes/default/images/loading-blue.gif" /> {'General_LoadingData'|translate}</span>
</div>
<div class="dataTableSpacer" />
diff --git a/plugins/CoreHome/templates/date.js b/plugins/CoreHome/templates/date.js
index 7ca90166a6..4b33793a55 100644
--- a/plugins/CoreHome/templates/date.js
+++ b/plugins/CoreHome/templates/date.js
@@ -1,7 +1,7 @@
$(document).ready(function(){
$("#periodString").hide();
$("#otherPeriods").hide();
- $("#calendar").hide();
+ $("#datepicker").hide();
$("#periodString").show();
// we get the content of the div before modifying it (append image, etc.)
@@ -54,7 +54,7 @@ $(document).ready(function(){
{
$("#currentPeriod:not(.hoverPeriod)")
.addClass("hoverPeriod")
- .append('&nbsp;<img src="plugins/CoreHome/templates/images/more_period.gif" style="vertical-align:middle">');
+ .append('&nbsp;<img src="plugins/CoreHome/templates/images/more_period.gif" style="vertical-align:middle" />');
}
}, function(){
restoreCurrentPeriod();
@@ -83,6 +83,10 @@ $(document).ready(function(){
})
.click(function(){
- $("#calendar").toggle();
+ $("#datepicker").toggle();
+ if($("#datepicker").is(":visible"))
+ {
+ $("#datepicker .ui-state-highlight").removeClass('ui-state-highlight');
+ }
});
} );
diff --git a/plugins/CoreHome/templates/graph.tpl b/plugins/CoreHome/templates/graph.tpl
index ff4f282a1b..eab4ef04f5 100644
--- a/plugins/CoreHome/templates/graph.tpl
+++ b/plugins/CoreHome/templates/graph.tpl
@@ -7,6 +7,9 @@
</div></div>
<script type="text/javascript">
<!--
+ {if $flashParameters.includeData}
+ piwikHelper.OFC.set("{$chartDivId}", '{$flashParameters.data}');
+ {/if}
swfobject.embedSWF(
"{$flashParameters.ofcLibraryPath}open-flash-chart.swf?{$tag}",
"{$chartDivId}",
@@ -14,10 +17,10 @@
"{$flashParameters.requiredFlashVersion}",
"{$flashParameters.swfLibraryPath}expressInstall.swf",
{literal}{{/literal}
+ "{if $flashParameters.includeData}x-{/if}data-file":"{$urlGraphData|escape:"url"}",
{if $flashParameters.includeData}
"id":"{$chartDivId}",
{/if}
- "{if $flashParameters.includeData}x-{/if}data-file":"{$urlGraphData|escape:"url"}",
"loading":"{'General_Loading'|translate|escape:"html"}"
{literal}},
{{/literal}
@@ -28,9 +31,6 @@
"bgcolor":"#FFFFFF"
{literal}}{/literal}
);
- {if $flashParameters.includeData}
- piwikHelper.OFC.set("{$chartDivId}", '{$flashParameters.data}');
- {/if}
//-->
</script>
{else}
diff --git a/plugins/CoreHome/templates/header.tpl b/plugins/CoreHome/templates/header.tpl
index d88d17ac95..9fbb3f6a95 100644
--- a/plugins/CoreHome/templates/header.tpl
+++ b/plugins/CoreHome/templates/header.tpl
@@ -1,7 +1,15 @@
-<div id="header">
-{include file="CoreHome/templates/header_message.tpl"}
-{include file="CoreHome/templates/logo.tpl"}
-{include file="CoreHome/templates/period_select.tpl"}
-{include file="CoreHome/templates/js_disabled_notice.tpl"}
-</div>
-<br />
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Piwik &rsaquo; {'CoreHome_WebAnalyticsReports'|translate}</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Piwik {$piwik_version}" />
+<link rel="shortcut icon" href="plugins/CoreHome/templates/images/favicon.ico" />
+{loadJavascriptTranslations plugins='CoreHome'}
+{include file="CoreHome/templates/js_global_variables.tpl"}
+{include file="CoreHome/templates/js_css_includes.tpl"}
+</head>
+<body>
+{include file="CoreHome/templates/top_bar.tpl"}
+{include file="CoreHome/templates/top_screen.tpl"}
diff --git a/plugins/CoreHome/templates/header_message.tpl b/plugins/CoreHome/templates/header_message.tpl
index 2a5f3a5ee6..2fca652693 100644
--- a/plugins/CoreHome/templates/header_message.tpl
+++ b/plugins/CoreHome/templates/header_message.tpl
@@ -1,10 +1,14 @@
<span id="header_message">
-{if $piwikUrl == 'http://piwik.org/demo/'}
+{if $piwikUrl == 'http://piwik.org/demo/'}
{'General_YouAreCurrentlyViewingDemoOfPiwik'|translate:"<a target='_blank' href='http://piwik.org'>Piwik</a>":"<a href='http://piwik.org/'>":"</a>":"<a href='http://piwik.org'>piwik.org</a>"}
{elseif $latest_version_available}
- <img src='themes/default/images/warning_small.png' alt='' style="vertical-align: middle;">
- {'General_PiwikXIsAvailablePleaseUpdateNow'|translate:$latest_version_available:"<br /><a href='index.php?module=CoreUpdater&action=newVersionAvailable'>":"</a>":"<a href='misc/redirectToUrl.php?url=http://piwik.org/changelog/' target='_blank'>":"</a>"}
+ <img src='themes/default/images/warning_small.png' alt='' style="vertical-align: middle;" />
+ {if $isSuperUser}
+ {'General_PiwikXIsAvailablePleaseUpdateNow'|translate:$latest_version_available:"<br /><a href='index.php?module=CoreUpdater&action=newVersionAvailable'>":"</a>":"<a href='misc/redirectToUrl.php?url=http://piwik.org/changelog/' target='_blank'>":"</a>"}
+ {else}
+ {'General_PiwikXIsAvailablePleaseNotifyPiwikAdmin'|translate:"<a href='misc/redirectToUrl.php?url=http://piwik.org/' target='_blank'>Piwik</a> <a href='misc/redirectToUrl.php?url=http://piwik.org/changelog/' target='_blank'>$latest_version_available</a>"}
+ {/if}
{else}
- {'General_PiwikIsACollaborativeProjectYouCanContribute'|translate:"<a href='misc/redirectToUrl.php?url=http://piwik.org'>":"$piwik_version</a>":"<br />":"<a target='_blank' href='misc/redirectToUrl.php?url=http://piwik.org/contribute/'>":"</a>"}
+ {'General_PiwikIsACollaborativeProjectYouCanContribute'|translate:"<a href='misc/redirectToUrl.php?url=http://piwik.org'>":"$piwik_version</a>":"<br />":"<a target='_blank' href='misc/redirectToUrl.php?url=http://piwik.org/contribute/'>":"</a>"}
{/if}
</span>
diff --git a/plugins/CoreHome/templates/index.tpl b/plugins/CoreHome/templates/index.tpl
index 6c34885895..cba7cbed4d 100644
--- a/plugins/CoreHome/templates/index.tpl
+++ b/plugins/CoreHome/templates/index.tpl
@@ -1,24 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>Piwik &rsaquo; Web Analytics Reports</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Piwik {$piwik_version}" />
-<link rel="shortcut icon" href="plugins/CoreHome/templates/images/favicon.ico" />
-{loadJavascriptTranslations plugins='CoreHome'}
-{include file="CoreHome/templates/js_global_variables.tpl"}
-{include file="CoreHome/templates/js_css_includes.tpl"}
-</head>
-<body>
{assign var=showSitesSelection value=true}
-{include file="CoreHome/templates/top_bar.tpl"}
+
{include file="CoreHome/templates/header.tpl"}
-{include file="CoreHome/templates/menu.tpl"}
-<div style='clear:both'></div>
-{include file="CoreHome/templates/loading.tpl"}
-<div id='content'>
+{if isset($menu) && $menu}{include file="CoreHome/templates/menu.tpl"}{/if}
+<div style="clear:both;"></div>
+{ajaxLoadingDiv}
+{ajaxRequestErrorDiv}
+
+<div id="content">
{if $content}{$content}{/if}
</div>
diff --git a/plugins/CoreHome/templates/js_css_includes.tpl b/plugins/CoreHome/templates/js_css_includes.tpl
index d4ac685907..06311092aa 100644
--- a/plugins/CoreHome/templates/js_css_includes.tpl
+++ b/plugins/CoreHome/templates/js_css_includes.tpl
@@ -1,16 +1,14 @@
<link rel="stylesheet" type="text/css" href="themes/default/common.css" />
-<link rel="stylesheet" type="text/css" href="libs/jquery/thickbox.css" />
-<link rel="stylesheet" type="text/css" href="libs/jquery/jquery-calendar.css" />
+<link rel="stylesheet" type="text/css" href="libs/jquery/themes/base/jquery-ui.css" class="ui-theme" />
<link rel="stylesheet" type="text/css" href="plugins/CoreHome/templates/styles.css" />
<link rel="stylesheet" type="text/css" href="plugins/CoreHome/templates/menu.css" />
<link rel="stylesheet" type="text/css" href="plugins/CoreHome/templates/datatable.css" />
<link rel="stylesheet" type="text/css" href="plugins/CoreHome/templates/cloud.css" />
-<link rel="stylesheet" type="text/css" href="plugins/Dashboard/templates/dashboard.css" />
{postEvent name="template_css_import"}
-<script type="text/javascript" src="themes/default/common.js"></script>
<script type="text/javascript" src="libs/jquery/jquery.js"></script>
<script type="text/javascript" src="libs/jquery/jquery-ui.js"></script>
+<script type="text/javascript" src="libs/jquery/jquery.bgiframe.js"></script>
<script type="text/javascript" src="libs/jquery/tooltip/jquery.tooltip.js"></script>
<script type="text/javascript" src="libs/jquery/truncate/jquery.truncate.js"></script>
<script type="text/javascript" src="libs/jquery/jquery.scrollTo.js"></script>
@@ -18,9 +16,9 @@
<script type="text/javascript" src="libs/jquery/fdd2div-modified.js"></script>
<script type="text/javascript" src="libs/jquery/superfish_modified.js"></script>
<script type="text/javascript" src="libs/jquery/jquery.history.js"></script>
-<script type="text/javascript" src="libs/jquery/thickbox.js"></script>
<script type="text/javascript" src="libs/swfobject/swfobject.js"></script>
<script type="text/javascript" src="libs/javascript/sprintf.js"></script>
+<script type="text/javascript" src="themes/default/common.js"></script>
<script type="text/javascript" src="plugins/CoreHome/templates/datatable.js"></script>
<script type="text/javascript" src="plugins/CoreHome/templates/broadcast.js"></script>
<script type="text/javascript" src="plugins/CoreHome/templates/menu.js"></script>
diff --git a/plugins/CoreHome/templates/loading.tpl b/plugins/CoreHome/templates/loading.tpl
deleted file mode 100644
index 5dc8755980..0000000000
--- a/plugins/CoreHome/templates/loading.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div id="loadingPiwik" {if isset($basicHtmlView) && $basicHtmlView}style="display:none"{/if}>
-<img src="themes/default/images/loading-blue.gif" alt="" /> {'General_LoadingData'|translate}
-</div>
-<div id="loadingError">{'General_ErrorRequest'|translate}</div>
diff --git a/plugins/CoreHome/templates/menu.css b/plugins/CoreHome/templates/menu.css
index b95539af8c..a4d9df5ed5 100644
--- a/plugins/CoreHome/templates/menu.css
+++ b/plugins/CoreHome/templates/menu.css
@@ -27,6 +27,7 @@
float: left;
list-style: none;
z-index: 49;
+ margin-right:1px;
}
.nav li.current ul {
@@ -59,10 +60,16 @@
position: absolute;
}
+.nav li, .nav li:hover,.nav li.sfHover,.nav li.current,.nav a:focus,.nav a:hover,.nav a:active{
+ -moz-border-radius:5px 5px 0 0;
+ -webkit-border-radius:5px 5px 0 0;
+}
+
/* LEVEL1 HOVER */
-.nav li:hover,.nav li.sfHover,.nav li.current,.nav a:focus,.nav a:hover,.nav a:active
- {
+.nav li:hover,.nav li.sfHover,.nav li.current,.nav a:focus,.nav a:hover,.nav a:active {
background: #C9D5FF;
+ -moz-border-radius:5px 5px 0 0;
+ -webkit-border-radius:5px 5px 0 0;
}
.nav li {
diff --git a/plugins/CoreHome/templates/menu.js b/plugins/CoreHome/templates/menu.js
index 51139ed6b7..eef1dd5ba4 100644
--- a/plugins/CoreHome/templates/menu.js
+++ b/plugins/CoreHome/templates/menu.js
@@ -10,7 +10,7 @@ menu.prototype =
if(urlLoaded == menu.prototype.lastUrlRequested)
{
$('#content').html( content ).show();
- $('#loadingPiwik').hide();
+ piwikHelper.hideAjaxLoading();
menu.prototype.lastUrlRequested = null;
}
},
@@ -47,7 +47,7 @@ menu.prototype =
.superfish({
pathClass : 'current',
animation : {opacity:'show'},
- delay : 1000
+ delay : 2000
});
this.param.superfish.find("li")
.click( self.onClickLI )
@@ -130,8 +130,10 @@ menu.prototype =
};
$(document).ready( function(){
- piwikMenu = new menu();
- piwikMenu.init();
- piwikMenu.loadFirstSection();
- broadcast.init();
+ if($('.nav').size()) {
+ piwikMenu = new menu();
+ piwikMenu.init();
+ piwikMenu.loadFirstSection();
+ broadcast.init();
+ }
});
diff --git a/plugins/CoreHome/templates/period_select.tpl b/plugins/CoreHome/templates/period_select.tpl
index 1db1f1092b..1c704ff5b5 100644
--- a/plugins/CoreHome/templates/period_select.tpl
+++ b/plugins/CoreHome/templates/period_select.tpl
@@ -1,5 +1,4 @@
{loadJavascriptTranslations plugins='CoreHome'}
-<script type="text/javascript" src="libs/jquery/jquery-calendar.js"></script>
<script type="text/javascript" src="plugins/CoreHome/templates/calendar.js"></script>
<script type="text/javascript" src="plugins/CoreHome/templates/date.js"></script>
@@ -11,11 +10,11 @@
{foreach from=$otherPeriods item=thisPeriod} | <a href='{url period=$thisPeriod}'>{$periodsNames.$thisPeriod.singular}</a>{/foreach}
</span>
</span>
- <br/>
- <span id="calendar"></span>
+ <br />
+ <span id="datepicker"></span>
</span>
-{literal}<script language="javascript">
+{literal}<script type="text/javascript">
$(document).ready(function() {
// this will trigger to change only the period value on search query and hash string.
$("#otherPeriods a").bind('click',function(e) {
@@ -27,5 +26,4 @@ $(document).ready(function() {
});</script>
{/literal}
-<div style="clear:both"></div>
-
+<div style="clear:both;"></div>
diff --git a/plugins/CoreHome/templates/piwik_tag.tpl b/plugins/CoreHome/templates/piwik_tag.tpl
index fb4c1886fc..994388e7cf 100644
--- a/plugins/CoreHome/templates/piwik_tag.tpl
+++ b/plugins/CoreHome/templates/piwik_tag.tpl
@@ -1,8 +1,8 @@
{if $piwikUrl == 'http://piwik.org/demo/' || $debugTrackVisitsInsidePiwikUI}
-<div style="clear:both"></div>
+<div style="clear:both;"></div>
{literal}
<!-- Piwik -->
-<script language="javascript" src="piwik.js" type="text/javascript"></script>
+<script src="piwik.js" type="text/javascript"></script>
<script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker("piwik.php", 1);
diff --git a/plugins/CoreHome/templates/sites_selection.tpl b/plugins/CoreHome/templates/sites_selection.tpl
index 21ed8f743b..be60868dda 100644
--- a/plugins/CoreHome/templates/sites_selection.tpl
+++ b/plugins/CoreHome/templates/sites_selection.tpl
@@ -8,11 +8,11 @@
{/foreach}
</select>
{hiddenurl idSite=null}
- <input type="submit" value="go"/>
+ <input type="submit" value="go" />
</form>
</span>
- {literal}<script language="javascript">
+ {literal}<script type="text/javascript">
$(document).ready(function() {
var extraPadding = 0;
// if there is only one website, we dont show the arrows image, so no need to add the extra padding
diff --git a/plugins/CoreHome/templates/styles.css b/plugins/CoreHome/templates/styles.css
index c3537c2cdb..850935ef0b 100644
--- a/plugins/CoreHome/templates/styles.css
+++ b/plugins/CoreHome/templates/styles.css
@@ -5,12 +5,16 @@ h1 {
}
h2 {
- font-size: 1.6em;
+ font-size: 1.3em;
color: #1D3256;
padding-bottom: 0.5em;
clear:both;
}
+h2 a {
+ text-decoration:none;
+}
+
h3 {
font-size: 1.3em;
margin-top: 2em;
@@ -20,6 +24,7 @@ h3 {
p {
padding-bottom: 1em;
margin-right: 1em;
+ margin-left:1em;
}
/* Content */
@@ -45,26 +50,14 @@ p {
padding-left:10px;
}
-#calendar {
- display: block;
-}
-
/* Calendar*/
-.calendar td.dateToday,.calendar td.dateToday a {
- font-weight: bold;
+div.ui-datepicker {
+ font-size: 62.5%;
}
-.calendar td.dateUsedStats,.calendar td.dateUsedStats a {
+.ui-datepicker-current-period a, .ui-datepicker-current-period a:link, .ui-datepicker-current-period a:visited {
+ border: 1px solid #2E85FF;
color: #2E85FF;
- border-color: #2E85FF;
-}
-
-.calendar td.calendar_unselectable {
- color: #F2F7FF;
-}
-
-.calendar {
- line-height: 1.33;
}
#otherPeriods a {
@@ -92,6 +85,7 @@ div .sparkline {
margin-top:10px;
border-bottom:1px solid white;
}
+
.sparkline img {
vertical-align: middle;
padding-right: 10px;
diff --git a/plugins/CoreHome/templates/top_bar.tpl b/plugins/CoreHome/templates/top_bar.tpl
index 7245055a2d..53957f4110 100644
--- a/plugins/CoreHome/templates/top_bar.tpl
+++ b/plugins/CoreHome/templates/top_bar.tpl
@@ -13,7 +13,7 @@
<nobr>
<small>
{'General_HelloUser'|translate:"<strong>$userLogin</strong>"}
-{if isset($userHasSomeAdminAccess) && $userHasSomeAdminAccess}| <a href='index.php?module=CoreAdminHome'>{'General_Settings'|translate}</a>{/if}
+{if $userLogin != 'anonymous'}| <a href='index.php?module=CoreAdminHome'>{'General_Settings'|translate}</a>{/if}
{if $showSitesSelection && $showWebsiteSelectorInUserInterface}| {include file=CoreHome/templates/sites_selection.tpl}{/if}
| {if $userLogin == 'anonymous'}<a href='index.php?module={$loginModule}'>{'Login_LogIn'|translate}</a>{else}<a href='index.php?module={$loginModule}&amp;action=logout'>{'Login_Logout'|translate}</a>{/if}
</small>
@@ -21,6 +21,6 @@
</nobr>
</div>
-<br clear="all" />
+<br class="clearAll" />
</div>
diff --git a/plugins/CoreHome/templates/top_screen.tpl b/plugins/CoreHome/templates/top_screen.tpl
new file mode 100644
index 0000000000..d88d17ac95
--- /dev/null
+++ b/plugins/CoreHome/templates/top_screen.tpl
@@ -0,0 +1,7 @@
+<div id="header">
+{include file="CoreHome/templates/header_message.tpl"}
+{include file="CoreHome/templates/logo.tpl"}
+{include file="CoreHome/templates/period_select.tpl"}
+{include file="CoreHome/templates/js_disabled_notice.tpl"}
+</div>
+<br />