From b202ff1f5483fd8fb523e82965444b8e87b7871d Mon Sep 17 00:00:00 2001
From: mattab
Date: Mon, 4 Feb 2013 12:27:19 +1300
Subject: [PATCH] Refs #3619 * Updating icons * Tooltip more readable *
putting language in General and deprecating redundant translation
---
core/Controller.php | 32 ++++++++++++++----
lang/en.php | 5 ++-
plugins/MultiSites/Controller.php | 2 +-
plugins/MultiSites/images/arrow_desc.gif | Bin 122 -> 130 bytes
plugins/MultiSites/images/arrow_down.png | Bin 155 -> 234 bytes
.../MultiSites/images/arrow_down_green.png | Bin 1532 -> 221 bytes
plugins/MultiSites/images/arrow_up.png | Bin 158 -> 222 bytes
plugins/MultiSites/images/arrow_up_red.png | Bin 1528 -> 248 bytes
plugins/MultiSites/images/stop.png | Bin 577 -> 307 bytes
plugins/MultiSites/templates/index.tpl | 6 ++--
plugins/Referers/Controller.php | 19 ++++++-----
plugins/Referers/templates/index.tpl | 18 +++++-----
plugins/SEO/templates/index.tpl | 4 +--
themes/default/common.css | 7 ++++
14 files changed, 60 insertions(+), 33 deletions(-)
diff --git a/core/Controller.php b/core/Controller.php
index 5c7872149e8..4c120b31fa6 100644
--- a/core/Controller.php
+++ b/core/Controller.php
@@ -844,6 +844,21 @@ public static function getCalendarPrettyDate($period)
}
}
+
+
+ /**
+ * Returns the pretty date representation
+ *
+ * @param $date string
+ * @param $period string
+ * @return string Pretty date
+ */
+ public static function getPrettyDate($date, $period)
+ {
+ return self::getCalendarPrettyDate( Piwik_Period::factory($period, Piwik_Date::factory($date)) );
+ }
+
+
/**
* Calculates the evolution from one value to another and returns HTML displaying
* the evolution percent. The HTML includes an up/down arrow and is colored red, black or
@@ -855,10 +870,9 @@ public static function getCalendarPrettyDate($period)
* @param int $currentValue The value to calculate evolution to.
* @param string $pastDate The date of past value.
* @param int $pastValue The value in the past to calculate evolution from.
- * @param bool $isVisits If the value is for visits or some other unit.
* @return string|false The HTML or false if the evolution is 0 and the current value is 0.
*/
- protected function getEvolutionHtml( $date, $currentValue, $pastDate, $pastValue, $isVisits = true )
+ protected function getEvolutionHtml( $date, $currentValue, $pastDate, $pastValue)
{
$evolutionPercent = Piwik_DataTable_Filter_CalculateEvolutionFilter::calculate(
$currentValue, $pastValue, $precision = 2);
@@ -873,7 +887,7 @@ protected function getEvolutionHtml( $date, $currentValue, $pastDate, $pastValue
$titleEvolutionPercent = $evolutionPercent;
if ($evolutionPercent < 0)
{
- $color = "red";
+ $color = "#e02a3b"; //red
$img = "arrow_down.png";
}
else if ($evolutionPercent == 0)
@@ -887,11 +901,15 @@ protected function getEvolutionHtml( $date, $currentValue, $pastDate, $pastValue
$titleEvolutionPercent = '+'.$titleEvolutionPercent;
}
- $token = $isVisits ? 'MultiSites_TotalsEvolutionSummary' : 'Referers_EvolutionSummaryGeneric';
- $title = Piwik_Translate($token,
- array($currentValue, $date, $pastValue, $titleEvolutionPercent, $pastDate));
+ $title = Piwik_Translate('General_EvolutionSummaryGeneric', array(
+ Piwik_Translate('General_NVisits', $currentValue),
+ $date,
+ Piwik_Translate('General_NVisits', $pastValue),
+ $pastDate,
+ $titleEvolutionPercent
+ ));
- $result = ' 'Metadata',
'General_OneVisit' => '1 visit',
'General_NVisits' => '%s visits',
+ 'General_EvolutionSummaryGeneric' => '%1$s in %2$s compared to %3$s in %4$s. Evolution: %5$s',
'General_OneDay' => '1 day',
'General_NDays' => '%s days',
'General_MainMetrics' => 'Main metrics',
@@ -360,7 +361,7 @@
'General_Show_js' => 'show',
'General_Hide_js' => 'hide',
'General_Donate' => 'Donate',
- 'General_MoreSparklines' => 'More Sparklines',
+ 'General_MoreDetails' => 'More Details',
'Actions_PluginDescription' => 'Reports about the page views, the outlinks and downloads. Outlinks and Downloads tracking is automatic! You can also track your internal website\'s Search Engine.',
'Actions_Actions' => 'Actions',
'Actions_SubmenuPages' => 'Pages',
@@ -1148,7 +1149,6 @@
'MultiSites_PluginDescription' => 'Displays multi-site executive summary/statistics. Currently maintained as a core Piwik plugin.',
'MultiSites_Evolution' => 'Evolution',
'MultiSites_TopLinkTooltip' => 'Compare Web Analytics stats for all of your Websites.',
- 'MultiSites_TotalsEvolutionSummary' => '%s visits in %s compared to %s visits (%s) in %s',
'Provider_PluginDescription' => 'Reports the Provider of the visitors.',
'Provider_WidgetProviders' => 'Providers',
'Provider_ColumnProvider' => 'Provider',
@@ -1207,7 +1207,6 @@
'Referers_WidgetSearchEngines' => 'Search Engines',
'Referers_WidgetOverview' => 'Overview',
'Referers_SocialFooterMessage' => 'This is a subset of the Websites report to the left. It filters out other websites so you can compare your social network referrers directly.',
- 'Referers_EvolutionSummaryGeneric' => '%s in %s compared to %s (%s) in %s',
'Referers_WidgetGetAll' => 'All Referrers',
'SecurityInfo_PluginDescription' => 'Based on PhpSecInfo from the PHP Security Consortium, this plugin provides security information about your PHP environment and offers suggestions for improvement. It is a tool in a multilayered security approach. It does not replace secure development practices nor audit the code/application.',
'SecurityInfo_Security' => 'Security',
diff --git a/plugins/MultiSites/Controller.php b/plugins/MultiSites/Controller.php
index 05c5481b767..f1ae285990f 100644
--- a/plugins/MultiSites/Controller.php
+++ b/plugins/MultiSites/Controller.php
@@ -174,7 +174,7 @@ public function getSitesInfo($isWidgetized)
echo $view->render();
}
-
+
/**
* The Multisites reports displays the first calendar date as the earliest day available for all websites.
* Also, today is the later "today" available across all timezones.
diff --git a/plugins/MultiSites/images/arrow_desc.gif b/plugins/MultiSites/images/arrow_desc.gif
index abe79f0769407b0f9db8c5b1b8ffb6a2221bd445..e8234178efaea626368f6bb5fffaa716e862b596 100644
GIT binary patch
delta 101
zcmbUWE2`K(#VPs(7X3znNfs`=og&yT)o%gb?nqf
t-IG-2t1)rRoZDKkVw#1}L5|>g84OF>JDKBNrtgj|vYb$~vy*|r8URu&8@T`g
delta 93
zcmZo-tm1L^bhEHbWif!pOkD&!EEq1Ry00Eb1Rldam9pps>K%kc5XwR0{)}XI*!f6GUg3^i*r=AmT)}OcyJM90T+R*e`-O2Wh-t_u8JT~*|
z3=NEpjei&x9KL(7B!?QaaUmci52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i5n_`cN*4k%;aVG{$8kR
TN46Y4D2_Z`{an^LB{Ts5ydInz
diff --git a/plugins/MultiSites/images/arrow_up.png b/plugins/MultiSites/images/arrow_up.png
index 54d48a6cb0e08cc755f6477bd2763c1c553f5139..eaf8672cc7453116b04a43176e3c65dad3a43e8d 100644
GIT binary patch
delta 207
zcmbQoc#m;{cs)A{GXn#|@p8djAjMc53VtQ&&YGO)d
z;mK4Rpdz*apAgs5{Wbsp|M&H1_5+GAl?3?(|7Uo*-M|aTQ}A?g45_%4l#r5=lE5IS
rAax{(;WCc_mlns=Lnj$H3>a9v7-VPc7O@AaW#I61^>bP0l+XkKAjT}`
diff --git a/plugins/MultiSites/images/arrow_up_red.png b/plugins/MultiSites/images/arrow_up_red.png
index 8135545c32cae0c571e754e42de1bc3622d5da5d..c03dad9a2252f105aee54f856cda5b8de93fc0c6 100644
GIT binary patch
delta 215
zcmeyt{ey9WxF$OX8v_G_X(Ue^kYX$ja(7}_cTVOdki(Yb?e4>S|f?5q$_l%JNFlghxL
zF|jxFZvO2M5&O>km?dKN3pV!giFU6K4UXO^Ew%O-o9E=EFP)@zp1q;9VEBTyyC%o=Ipm#|1T~LTe+NBWu8+`xNWW6$ION)E3Mb@E8KJY`9br(Z
z(0BMWb5`||LqAWNi@gqhuW+w(N7j$ll>z%Q&Q4L=ky})G&TduPoa|lZUAE2Qg7;Tl
zcAEHH*esy+FYGsXr|a`9s!r_nV%2x<1@|u>JKa$&Q2*lAE0*(-5zErz
zp8jjq?u+Lu7PzLnIpm35r_0_2#~j{WUw&+duH}Qribc^zvBrHOPX8t)vu*C!Iq`Fz
z^V*g<(z9ltF1CMSw^eK5`77&IO-tP?>rx}pr)shw;V{oTtB4JZMk^+?^X!u?2n=Rs
z_L&lJC1{F7=ki3p)VGyS8x9v9nZdi}`b<-|%<~Tg-?hlhE)i~hbNso2<|OBo89fa?
z_f+yH9#-kTBv@2%d7Di4`J}ryzkIecxuE@6w)xD?d2aC{@7Gjcy0E_f%XhKt-xKF#
zYR|7=KX90D%M9j^zt-#h-Jtzxqm$mA>dmiT3HjKp+`sbn%CA?r-mPA_wPWHh+pTT;
zLp_r7(k5KAv2&ZyE`C}e?r>^N&4q&h%#~$5+f|d!T3r{;j8K2UzO-G{;BS&JmsbDvEJk8iTPJ_c|DUa$z6GK&t`kYo(f&IIS2M$z4~pV#rmcw
zWX@!
z_Olh7{39O8P*`z9z9|8>y;bpKhp8
z8yV>WRp=I1=9MH?=;jqGLkxkLnOgw2
zD6bgmE1>`MD-sLz4fPE4;U)t$+5r7%B1+#)b?h#wpqi4Cj(%=_gu7ofY0MY478&=d{F<63uZ{c_O43H=i0vc3r>Afpn
zvUW}~&de<5%yAr;8LGY27RmnNiG!1><3Ry*D~N6r}$K~;YT05ikK7&*@qfRxgI^q#7!sOy@)
zaU5yemJkBYIZ7#n5Qs6-bsf&k?0sM6c_yWVssb=g698XM^m>E;jS(yW0000K0!iBL{Q4GJ0x0000DNk~Le0000G0000G2nGNE03Y-JVUZy{f7t;D
z5IGbHNgS^L00F^CL_t(I%cYY`tKvWqg}=mEm?&bz2Z|_ebmvMp{{OWL5!d2dFq%g3
zm9Fkt42j?0wZw6Z@B1{HO^U@L
zuIr}t&bxvrir8+qc%FyjI2dEFf7W8HMMT)|_jEcPn$6~?f&}dQK1wMrmrDv15q#gL
zQmL@p?Z{@cl*{Fpf+&huuh%K~d_DtUj6p;-Oz(m&*|Z0Z|mu?RKeFtGED*#e!@$
z%jtANDTOhHIF5)Vz1ZZbUINkm&xbz-0ydu&*zs-+-^4t
zg#z_@ox|b4a5#J^sMTtSW(c#{j7p`#
-{'General_AllWebsitesDashboard'|translate}
-
+{'General_AllWebsitesDashboard'|translate}
+ {capture assign=nVisits}{'General_NVisits'|translate:$totalVisits}{/capture}
+ {capture assign=nVisitsLast}{'General_NVisits'|translate:$pastTotalVisits}{/capture}
+
{'General_TotalVisitsPageviewsRevenue'|translate:"$totalVisits":"$totalPageviews":"$totalRevenue"}
diff --git a/plugins/Referers/Controller.php b/plugins/Referers/Controller.php
index 3337630f70d..742da7c8689 100644
--- a/plugins/Referers/Controller.php
+++ b/plugins/Referers/Controller.php
@@ -54,15 +54,18 @@ function index()
if ($lastPeriodDate !== false)
{
$date = Piwik_Common::getRequestVar('date');
-
+ $period = Piwik_Common::getRequestVar('period');
+
+ $prettyDate = self::getPrettyDate($date, $period);
+ $prettyLastPeriodDate = self::getPrettyDate($lastPeriodDate, $period);
+
// visit metrics
$previousValues = $this->getReferersVisitorsByType($lastPeriodDate);
- $this->addEvolutionPropertiesToView($view, $date, $nameValues, $lastPeriodDate, $previousValues);
+ $this->addEvolutionPropertiesToView($view, $prettyDate, $nameValues, $prettyLastPeriodDate, $previousValues);
// distinct metrics
$previousValues = $this->getDistinctReferrersMetrics($lastPeriodDate);
- $this->addEvolutionPropertiesToView(
- $view, $date, $distinctMetrics, $lastPeriodDate, $previousValues, $isVisits = false);
+ $this->addEvolutionPropertiesToView($view, $prettyDate, $distinctMetrics, $prettyLastPeriodDate, $previousValues);
}
// sparkline for the historical data of the above values
@@ -685,16 +688,14 @@ private function getDistinctReferrersMetrics( $date = false )
* in this array should be the same as keys in $currentValues.
* @param bool $isVisits Whether the values are counting visits or something else.
*/
- private function addEvolutionPropertiesToView( $view, $date, $currentValues, $lastPeriodDate,
- $previousValues, $isVisits = false )
+ private function addEvolutionPropertiesToView( $view, $date, $currentValues, $lastPeriodDate, $previousValues)
{
foreach ($previousValues as $name => $pastValue)
{
$currentValue = $currentValues[$name];
$evolutionName = $name.'Evolution';
-
- $view->$evolutionName = $this->getEvolutionHtml(
- $date, $currentValue, $lastPeriodDate, $pastValue, $isVisits);
+
+ $view->$evolutionName = $this->getEvolutionHtml($date, $currentValue, $lastPeriodDate, $pastValue);
}
}
}
diff --git a/plugins/Referers/templates/index.tpl b/plugins/Referers/templates/index.tpl
index 04496e37e2a..005f3fab118 100644
--- a/plugins/Referers/templates/index.tpl
+++ b/plugins/Referers/templates/index.tpl
@@ -7,18 +7,18 @@
{'Referers_Type'|translate}
{sparkline src=$urlSparklineDirectEntry}
- {'Referers_TypeDirectEntries'|translate:"$visitorsFromDirectEntry"}{if !empty($visitorsFromDirectEntryPercent)}, {$visitorsFromDirectEntryPercent}% of visits{/if}{if !empty($visitorsFromDirectEntryEvolution)}, {$visitorsFromDirectEntryEvolution}{/if}
+ {'Referers_TypeDirectEntries'|translate:"$visitorsFromDirectEntry"}{if !empty($visitorsFromDirectEntryPercent)}, {$visitorsFromDirectEntryPercent}% of visits{/if}{if !empty($visitorsFromDirectEntryEvolution)} {$visitorsFromDirectEntryEvolution}{/if}
{sparkline src=$urlSparklineSearchEngines}
- {'Referers_TypeSearchEngines'|translate:"$visitorsFromSearchEngines"}{if !empty($visitorsFromSearchEnginesPercent)}, {$visitorsFromSearchEnginesPercent}% of visits{/if}{if !empty($visitorsFromSearchEnginesEvolution)}, {$visitorsFromSearchEnginesEvolution}{/if}
+ {'Referers_TypeSearchEngines'|translate:"$visitorsFromSearchEngines"}{if !empty($visitorsFromSearchEnginesPercent)}, {$visitorsFromSearchEnginesPercent}% of visits{/if}{if !empty($visitorsFromSearchEnginesEvolution)} {$visitorsFromSearchEnginesEvolution}{/if}
{sparkline src=$urlSparklineWebsites}
- {'Referers_TypeWebsites'|translate:"$visitorsFromWebsites"}{if !empty($visitorsFromWebsitesPercent)}, {$visitorsFromWebsitesPercent}% of visits{/if}{if !empty($visitorsFromWebsitesEvolution)}, {$visitorsFromWebsitesEvolution}{/if}
+ {'Referers_TypeWebsites'|translate:"$visitorsFromWebsites"}{if !empty($visitorsFromWebsitesPercent)}, {$visitorsFromWebsitesPercent}% of visits{/if}{if !empty($visitorsFromWebsitesEvolution)} {$visitorsFromWebsitesEvolution}{/if}
{sparkline src=$urlSparklineCampaigns}
- {'Referers_TypeCampaigns'|translate:"$visitorsFromCampaigns"}{if !empty($visitorsFromCampaignsPercent)}, {$visitorsFromCampaignsPercent}% of visits{/if}{if !empty($visitorsFromCampaignsEvolution)}, {$visitorsFromCampaignsEvolution}{/if}
+ {'Referers_TypeCampaigns'|translate:"$visitorsFromCampaigns"}{if !empty($visitorsFromCampaignsPercent)}, {$visitorsFromCampaignsPercent}% of visits{/if}{if !empty($visitorsFromCampaignsEvolution)} {$visitorsFromCampaignsEvolution}{/if}
@@ -26,25 +26,25 @@
- {'General_MoreSparklines'|translate} ({'General_Show_js'|translate})
+
{sparkline src=$urlSparklineDistinctSearchEngines}
- {$numberDistinctSearchEngines} {'Referers_DistinctSearchEngines'|translate}{if !empty($numberDistinctSearchEnginesEvolution)}, {$numberDistinctSearchEnginesEvolution}{/if}
+ {$numberDistinctSearchEngines} {'Referers_DistinctSearchEngines'|translate}{if !empty($numberDistinctSearchEnginesEvolution)} {$numberDistinctSearchEnginesEvolution}{/if}
{sparkline src=$urlSparklineDistinctKeywords}
- {$numberDistinctKeywords} {'Referers_DistinctKeywords'|translate}{if !empty($numberDistinctKeywordsEvolution)}, {$numberDistinctKeywordsEvolution}{/if}
+ {$numberDistinctKeywords} {'Referers_DistinctKeywords'|translate}{if !empty($numberDistinctKeywordsEvolution)} {$numberDistinctKeywordsEvolution}{/if}
|
{sparkline src=$urlSparklineDistinctWebsites}
- {$numberDistinctWebsites} {'Referers_DistinctWebsites'|translate} {'Referers_UsingNDistinctUrls'|translate:"$numberDistinctWebsitesUrls"}{if !empty($numberDistinctWebsitesEvolution)}, {$numberDistinctWebsitesEvolution}{/if}
+ {$numberDistinctWebsites} {'Referers_DistinctWebsites'|translate} {'Referers_UsingNDistinctUrls'|translate:"$numberDistinctWebsitesUrls"}{if !empty($numberDistinctWebsitesEvolution)} {$numberDistinctWebsitesEvolution}{/if}
{sparkline src=$urlSparklineDistinctCampaigns}
- {$numberDistinctCampaigns} {'Referers_DistinctCampaigns'|translate}{if !empty($numberDistinctCampaignsEvolution)}, {$numberDistinctCampaignsEvolution}{/if}
+ {$numberDistinctCampaigns} {'Referers_DistinctCampaigns'|translate}{if !empty($numberDistinctCampaignsEvolution)} {$numberDistinctCampaignsEvolution}{/if}
|
diff --git a/plugins/SEO/templates/index.tpl b/plugins/SEO/templates/index.tpl
index 22e91295eab..6abe3cce97a 100644
--- a/plugins/SEO/templates/index.tpl
+++ b/plugins/SEO/templates/index.tpl
@@ -4,7 +4,7 @@
-
\ No newline at end of file
+
diff --git a/themes/default/common.css b/themes/default/common.css
index 4cb8042eb13..8c966df8b58 100644
--- a/themes/default/common.css
+++ b/themes/default/common.css
@@ -772,3 +772,10 @@ table.entityTable tr td a {
.section-toggler-link:hover {
text-decoration:underline;
}
+
+.metricEvolution {
+ display:inline-block;
+ font-size:9pt;
+ opacity:0.75;
+}
+