From b814322485f8808c85bd98c0902d3bd8b34783de Mon Sep 17 00:00:00 2001 From: mattab Date: Wed, 26 Jun 2013 18:48:07 +1200 Subject: Removing Smarty strings from codebase, fixing install Adding twig to LEGALNOTICE Refs #4019 --- LEGALNOTICE | 6 +++--- config/global.ini.php | 15 --------------- core/FrontController.php | 4 +++- core/Piwik.php | 8 -------- core/Twig.php | 4 ++-- core/ViewDataTable.php | 2 +- core/ViewDataTable/HtmlTable/Goals.php | 1 - lang/en.php | 2 +- plugins/Installation/Controller.php | 1 - plugins/Installation/templates/displayJavascriptCode.twig | 2 +- plugins/SitesManager/templates/displayJavascriptCode.twig | 2 ++ 11 files changed, 13 insertions(+), 34 deletions(-) diff --git a/LEGALNOTICE b/LEGALNOTICE index 72af0a8bb9..651be5c447 100644 --- a/LEGALNOTICE +++ b/LEGALNOTICE @@ -178,9 +178,9 @@ THIRD-PARTY COMPONENTS AND LIBRARIES Link: http://www.getrank.org/free-pagerank-script License: GPL - Name: Smarty - Link: http://smarty.net/ - License: LGPL v2.1 or later + Name: Twig + Link: http://twig.sensiolabs.org/ + License: BSD Name: TCPDF Link: http://sourceforge.net/projects/tcpdf diff --git a/config/global.ini.php b/config/global.ini.php index 17b86d0df5..3903439a3e 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -494,21 +494,6 @@ logger_file_path = tmp/logs ; disabled by default as it can cause serious overhead and should only be used wisely ;logger_api_call[] = file -[smarty] -; the list of directories in which to look for templates -template_dir[] = plugins -template_dir[] = themes/default -template_dir[] = themes - -plugins_dir[] = core/SmartyPlugins -plugins_dir[] = libs/Smarty/plugins - -compile_dir = tmp/templates_c -cache_dir = tmp/cache - -; error reporting inside Smarty -error_reporting = E_ALL|E_NOTICE - [Plugins] Plugins[] = CorePluginsAdmin Plugins[] = CoreAdminHome diff --git a/core/FrontController.php b/core/FrontController.php index c09a6eeb20..f9b6e947c9 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -272,7 +272,9 @@ class Piwik_FrontController Piwik_PostEvent('FrontController.dispatchCoreAndPluginUpdatesScreen'); Piwik_PluginsManager::getInstance()->installLoadedPlugins(); - Piwik::install(); + + +// Piwik_Common::mkdir(PIWIK_USER_PATH . '/' . Piwik_Config::getInstance()->smarty['compile_dir']); // ensure the current Piwik URL is known for later use if (method_exists('Piwik', 'getPiwikUrl')) { diff --git a/core/Piwik.php b/core/Piwik.php index 95e953bd09..62a7bbcb29 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -105,14 +105,6 @@ class Piwik return $class; } - /** - * Installation helper - */ - static public function install() - { - Piwik_Common::mkdir(PIWIK_USER_PATH . '/' . Piwik_Config::getInstance()->smarty['compile_dir']); - } - /** * Uninstallation helper */ diff --git a/core/Twig.php b/core/Twig.php index c5c8cdc2cd..acd806a010 100644 --- a/core/Twig.php +++ b/core/Twig.php @@ -68,7 +68,7 @@ class Piwik_Twig { $includeAssetsFunction = new Twig_SimpleFunction('includeAssets', function ($params) { if (!isset($params['type'])) { - throw new Exception("The smarty function includeAssets needs a 'type' parameter."); + throw new Exception("The function includeAssets needs a 'type' parameter."); } $assetType = strtolower($params['type']); @@ -173,7 +173,7 @@ class Piwik_Twig { $moneyFilter = new Twig_SimpleFilter('money', function ($amount) { if (func_num_args() != 2) { - throw new Exception('the smarty modifier money expects one parameter: the idSite.'); + throw new Exception('the money modifier expects one parameter: the idSite.'); } $idSite = func_get_args(); $idSite = $idSite[1]; diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index 8ae368eb3c..7a1cd4c156 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -66,7 +66,7 @@ abstract class Piwik_ViewDataTable protected $variablesDefault = array(); /** - * Array of properties that are available in the view (from smarty) + * Array of properties that are available in the view * Used to store UI properties, eg. "show_footer", "show_search", etc. * * @var array diff --git a/core/ViewDataTable/HtmlTable/Goals.php b/core/ViewDataTable/HtmlTable/Goals.php index 882a044a8f..2ceb8e88c3 100644 --- a/core/ViewDataTable/HtmlTable/Goals.php +++ b/core/ViewDataTable/HtmlTable/Goals.php @@ -138,7 +138,6 @@ class Piwik_ViewDataTable_HtmlTable_Goals extends Piwik_ViewDataTable_HtmlTable foreach ($goals as $goal) { $idgoal = $goal['idgoal']; - // Columns names are escaped in smarty via | escape:'html' $goal['name'] = Piwik_Common::unsanitizeInputValue($goal['name']); if ($this->processOnlyIdGoal > Piwik_DataTable_Filter_AddColumnsProcessedMetricsGoal::GOALS_FULL_TABLE diff --git a/lang/en.php b/lang/en.php index 263596591b..5c675d3fe5 100644 --- a/lang/en.php +++ b/lang/en.php @@ -556,7 +556,7 @@ If you use the latest beta and you find a bug or have a suggestion, please %ssee 'CoreHome_DonateCall3' => 'If you feel that Piwik has added significant value to your business or endeavour, %1$splease consider donating!%2$s', 'CoreHome_HowMuchIsPiwikWorth' => 'How much is Piwik worth to you?', 'CoreHome_SupportPiwik' => 'Support Piwik!', - 'CoreHome_OnlyForAdmin' => 'This is only displayed to you, the superuser.', + 'CoreHome_OnlyForAdmin' => 'This widget is only displayed to you, the superuser.', 'CoreHome_DonateFormInstructions' => 'Click on the slider to select an amount, then click subscribe to donate.', 'CoreHome_SubscribeAndBecomePiwikSupporter' => 'Proceed to a secure credit card payment page (Paypal) to become a Piwik Supporter!', 'CoreHome_CheckPiwikOut' => 'Check Piwik out!', diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index 2367abf3de..a8827fd48a 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -426,7 +426,6 @@ class Piwik_Installation_Controller extends Piwik_Controller_Admin $viewTrackingHelp->idSite = $idSite; $viewTrackingHelp->piwikUrl = Piwik_Url::getCurrentUrlWithoutFileName(); - // Assign the html output to a smarty variable $view->trackingHelp = $viewTrackingHelp->render(); $view->displaySiteName = $siteName; diff --git a/plugins/Installation/templates/displayJavascriptCode.twig b/plugins/Installation/templates/displayJavascriptCode.twig index dede2e5a3e..1940641dd3 100644 --- a/plugins/Installation/templates/displayJavascriptCode.twig +++ b/plugins/Installation/templates/displayJavascriptCode.twig @@ -8,7 +8,7 @@ {% endif %} -{{ trackingHelp }} +{{ trackingHelp|raw }}

{{ 'Installation_LargePiwikInstances'|translate }}

{{ 'Installation_JsTagArchivingHelp1'|translate('','')|raw }} diff --git a/plugins/SitesManager/templates/displayJavascriptCode.twig b/plugins/SitesManager/templates/displayJavascriptCode.twig index 1d19de45f1..34ef90e10e 100644 --- a/plugins/SitesManager/templates/displayJavascriptCode.twig +++ b/plugins/SitesManager/templates/displayJavascriptCode.twig @@ -3,5 +3,7 @@ {% block content %} {{ loadJavascriptTranslations(['SitesManager']) }} +{% raw %} {% include "@SitesManager/_displayJavascriptCode.twig" %} +{% endraw %} {% endblock %} \ No newline at end of file -- cgit v1.2.3