Skip to content

Commit

Permalink
Removing Smarty strings from codebase, fixing install
Browse files Browse the repository at this point in the history
Adding twig to LEGALNOTICE
Refs #4019
  • Loading branch information
mattab committed Jun 26, 2013
1 parent 2577abf commit b814322
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 34 deletions.
6 changes: 3 additions & 3 deletions LEGALNOTICE
Expand Up @@ -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
Expand Down
15 changes: 0 additions & 15 deletions config/global.ini.php
Expand Up @@ -494,21 +494,6 @@
; 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
Expand Down
4 changes: 3 additions & 1 deletion core/FrontController.php
Expand Up @@ -272,7 +272,9 @@ public function init()
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')) {
Expand Down
8 changes: 0 additions & 8 deletions core/Piwik.php
Expand Up @@ -105,14 +105,6 @@ static public function unprefixClass($class)
return $class;
}

/**
* Installation helper
*/
static public function install()
{
Piwik_Common::mkdir(PIWIK_USER_PATH . '/' . Piwik_Config::getInstance()->smarty['compile_dir']);
}

/**
* Uninstallation helper
*/
Expand Down
4 changes: 2 additions & 2 deletions core/Twig.php
Expand Up @@ -68,7 +68,7 @@ protected function addFunction_includeAssets()
{
$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']);
Expand Down Expand Up @@ -173,7 +173,7 @@ protected function addFilter_money()
{
$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];
Expand Down
2 changes: 1 addition & 1 deletion core/ViewDataTable.php
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion core/ViewDataTable/HtmlTable/Goals.php
Expand Up @@ -138,7 +138,6 @@ public function setColumnsToDisplay($columnsNames)
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
Expand Down
2 changes: 1 addition & 1 deletion lang/en.php
Expand Up @@ -556,7 +556,7 @@
'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!',
Expand Down
1 change: 0 additions & 1 deletion plugins/Installation/Controller.php
Expand Up @@ -426,7 +426,6 @@ public function displayJavascriptCode()
$viewTrackingHelp->idSite = $idSite;
$viewTrackingHelp->piwikUrl = Piwik_Url::getCurrentUrlWithoutFileName();

// Assign the html output to a smarty variable
$view->trackingHelp = $viewTrackingHelp->render();
$view->displaySiteName = $siteName;

Expand Down
2 changes: 1 addition & 1 deletion plugins/Installation/templates/displayJavascriptCode.twig
Expand Up @@ -8,7 +8,7 @@
</span>
{% endif %}

{{ trackingHelp }}
{{ trackingHelp|raw }}
<br/><br/>
<h2>{{ 'Installation_LargePiwikInstances'|translate }}</h2>
{{ 'Installation_JsTagArchivingHelp1'|translate('<a target="_blank" href="http://piwik.org/docs/setup-auto-archiving/">','</a>')|raw }}
Expand Down
2 changes: 2 additions & 0 deletions plugins/SitesManager/templates/displayJavascriptCode.twig
Expand Up @@ -3,5 +3,7 @@
{% block content %}
{{ loadJavascriptTranslations(['SitesManager']) }}

{% raw %}
{% include "@SitesManager/_displayJavascriptCode.twig" %}
{% endraw %}
{% endblock %}

0 comments on commit b814322

Please sign in to comment.