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:
authormattpiwik <matthieu.aubry@gmail.com>2009-04-27 08:18:16 +0400
committermattpiwik <matthieu.aubry@gmail.com>2009-04-27 08:18:16 +0400
commit16aab5b2e15377a74c6b3345de82291b90bfa8b5 (patch)
tree6379b457ce107dc84454e26c2ce5938ff3befab2 /core/Translate.php
parent23ad6dfa4e9413ee0fdb571bf8c69efe75ec5265 (diff)
- API CHANGE: the API for the function Piwik_AddWidget has changed. The new API is Piwik_AddWidget( $widgetCategory, $widgetName, $controllerName, $controllerAction, $customParameters = array()). See examples of calls in all the core Piwik plugins. This change was necessary to make widgets more modular (they now accept custom parameters).
- API CHANGE: a small number of CSV outputs for some API calls would change following the simplification of DataTable_Simple implementation. Affected calls are VisitsSummary.get, Goals.get, VisitFrequency.get. This is due to a change in the implementation of DataTable_Simple (we simplified implementation). - FIXED #84 Added proper translations for all columns, in tables, and graphs. - FIXED #322 piwik is now using open flash chart 2 - FIXED #126 all dates should be correctly displayed in all graphs. For example, evolution graph for days would show, on the X axis "Mon 29", "Wed 31". For months it would show "Aug 2009", etc. - ADDED: when hovering any of the sparklines, the UI makes it clear that clicking will refresh the evolution graph. This feature was in Piwik for months, and even Google Analytics implemented this UI feature after Piwik. However in Piwik it wasn't clear to the user that the sparklines were clickable. - ADDED: now widgets can be created with custom parameters. This makes it possible to create a widget that calls a controller->action with other custom parameters, this is used in Piwik to draw an evolution graph (module=VisitsSummary & action=getEvolutionGraph) for a given metric (&columns[]=nb_visits). These custom parameters are automatically forwarded to the sparkline url, the flash graph when clicked on sparkline, etc. - The widget layout is now saved as a JSON string rather than a custom data structure. The dashboard code should be able to read & restore most of the layouts from the old format (except the evolution graphs widgets). Simplified the Dashboard.js, widgetMenu.js, cleaned up what was a messy code. - Added sentence in Widgetize to let users know they can easily export the Piwik dashboard in an iframe. - Changed the way translations used in Javascript are loaded: all translations strings finishing by _js will be loaded to be used in the templates when calling {loadJavascriptTranslations plugins='YOUR_PLUGIN_NAME'} - Moved all templates in plugins under plugins/$PLUGIN/templates/ - 'Khtml (Konqueror, Safari)' now displayed as 'KHTML (Safari, Chrome)' git-svn-id: http://dev.piwik.org/svn/trunk@1072 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Translate.php')
-rw-r--r--core/Translate.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/core/Translate.php b/core/Translate.php
index 48b53029c6..3917bca56f 100644
--- a/core/Translate.php
+++ b/core/Translate.php
@@ -113,24 +113,17 @@ class Piwik_Translate
foreach($GLOBALS['Piwik_translations'] as $key => $value)
{
- $matches = array();
-
- if( preg_match($moduleRegex,$key,$matches) ) {
- $varName = $matches[1].'_'.$matches[2];
- $varValue = $value;
-
- $js .= "".$varName.": '".str_replace("'","\\'",$varValue)."',";
+ if( preg_match($moduleRegex,$key) ) {
+ $js .= '"'.$key.'": "'.str_replace('"','\"',$value).'",';
}
-
- $matches = null;
}
$js = substr($js,0,-1);
$js .= '};';
$js .= 'if(typeof(piwik_translations) == \'undefined\') { var piwik_translations = new Object; }'.
'for(var i in translations) { piwik_translations[i] = translations[i];} ';
- $js .= 'function _pk_translate(tvar, str) { '.
- 'var s = str; if( typeof(piwik_translations[tvar]) != \'undefined\' ){ s = piwik_translations[tvar]; }'.
- 'return s;}';
+ $js .= 'function _pk_translate(translationStringId) { '.
+ 'if( typeof(piwik_translations[translationStringId]) != \'undefined\' ){ return piwik_translations[translationStringId]; }'.
+ 'return "The string "+translationStringId+" was not loaded in javascript. Make sure it is prefixed with _js";}';
return $js;
}
@@ -175,5 +168,3 @@ function Piwik_TranslateException($message, $args = array())
return $message;
}
}
-
-