diff options
-rw-r--r-- | core/View.php | 2 | ||||
-rw-r--r-- | core/View/ReportsByDimension.php | 2 | ||||
-rw-r--r-- | core/ViewDataTable.php | 4 | ||||
-rw-r--r-- | plugins/Actions/Controller.php | 6 | ||||
-rw-r--r-- | plugins/CoreHome/templates/datatable_actions.tpl | 53 | ||||
-rw-r--r-- | plugins/CoreHome/templates/datatable_actions.twig | 53 | ||||
-rw-r--r-- | plugins/CoreHome/templates/datatable_cell.twig | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/js_disabled_notice.twig | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/single_report.twig | 2 | ||||
-rw-r--r-- | plugins/Goals/Controller.php | 6 |
10 files changed, 66 insertions, 66 deletions
diff --git a/core/View.php b/core/View.php index fb8925c6a9..3e45fb6400 100644 --- a/core/View.php +++ b/core/View.php @@ -210,7 +210,7 @@ class Piwik_View implements Piwik_View_Interface */ static public function singleReport($title, $reportHtml, $fetch = false) { - $view = new Piwik_View('@CoreHome/single_report.tpl'); + $view = new Piwik_View('@CoreHome/single_report'); $view->title = $title; $view->report = $reportHtml; diff --git a/core/View/ReportsByDimension.php b/core/View/ReportsByDimension.php index e02d428af6..a13ee95bb7 100644 --- a/core/View/ReportsByDimension.php +++ b/core/View/ReportsByDimension.php @@ -23,7 +23,7 @@ class Piwik_View_ReportsByDimension extends Piwik_View */ public function __construct() { - parent::__construct(PIWIK_INCLUDE_PATH . '/plugins/CoreHome/templates/reports_by_dimension.tpl'); + parent::__construct('@CoreHome/reports_by_dimension'); $this->dimensionCategories = array(); } diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index 5c165121b0..0a63b9f505 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -327,10 +327,10 @@ abstract class Piwik_ViewDataTable /** * Forces the View to use a given template. * Usually the template to use is set in the specific ViewDataTable_* - * eg. 'CoreHome/templates/cloud.tpl' + * eg. 'CoreHome/templates/cloud' * But some users may want to force this template to some other value * - * @param string $tpl eg .'MyPlugin/templates/templateToUse.tpl' + * @param string $tpl eg .'@MyPlugin/templateToUse' */ public function setTemplate($tpl) { diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php index 07802c0d9d..3e01c54bb1 100644 --- a/plugins/Actions/Controller.php +++ b/plugins/Actions/Controller.php @@ -452,13 +452,13 @@ class Piwik_Actions_Controller extends Piwik_Controller */ protected function configureGenericViewActions($view) { - $view->setTemplate('CoreHome/templates/datatable_actions.tpl'); + $view->setTemplate('@CoreHome/datatable_actions'); if (Piwik_Common::getRequestVar('idSubtable', -1) != -1) { - $view->setTemplate('CoreHome/templates/datatable_actions_subdatable.tpl'); + $view->setTemplate('@CoreHome/datatable_actions_subdatable'); } $currentlySearching = $view->setSearchRecursive(); if ($currentlySearching) { - $view->setTemplate('CoreHome/templates/datatable_actions_recursive.tpl'); + $view->setTemplate('@CoreHome/datatable_actions_recursive'); } // disable Footer icons $view->disableShowAllViewsIcons(); diff --git a/plugins/CoreHome/templates/datatable_actions.tpl b/plugins/CoreHome/templates/datatable_actions.tpl deleted file mode 100644 index 0777c1160c..0000000000 --- a/plugins/CoreHome/templates/datatable_actions.tpl +++ /dev/null @@ -1,53 +0,0 @@ -<div class="dataTable" data-table-type="actionDataTable" data-report="{$properties.uniqueId}" data-params="{$javascriptVariablesToSet|@json_encode|escape:'html'}"> - <div class="reportDocumentation"> - {if !empty($reportDocumentation)}<p>{$reportDocumentation}</p>{/if} - {if isset($properties.metadata.archived_date)}<span class='helpDate'>{$properties.metadata.archived_date}</span>{/if} - </div> - <div class="dataTableActionsWrapper"> - {if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'} - {$arrayDataTable.message} - {else} - {if count($arrayDataTable) == 0} - <div class="pk-emptyDataTable">{'CoreHome_ThereIsNoDataForThisReport'|translate}</div> - {else} - <table cellspacing="0" class="dataTable dataTableActions"> - <thead> - <tr> - {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}"> - {if !empty($columnDocumentation[$column])} - <div class="columnDocumentation"> - <div class="columnDocumentationTitle"> - {$columnTranslations[$column]|escape:'html'|replace:"&nbsp;":" "} - </div> - {$columnDocumentation[$column]|escape:'html'} - </div> - {/if} - <div id="thDIV">{$columnTranslations[$column]|escape:'html'}</div> - </th> - {/foreach} - </tr> - </thead> - - <tbody> - {foreach from=$arrayDataTable item=row} - <tr {if $row.idsubdatatable}class="rowToProcess subActionsDataTable" id="{$row.idsubdatatable}" - {else}class="actionsDataTable rowToProcess"{/if}> - {foreach from=$dataTableColumns item=column} - <td> - {include file="CoreHome/templates/datatable_cell.tpl"} - </td> - {/foreach} - </tr> - {/foreach} - </tbody> - </table> - {/if} - - {if $properties.show_footer} - {include file="CoreHome/templates/datatable_footer.tpl"} - {/if} - {include file="CoreHome/templates/datatable_js.tpl"} - {/if} - </div> -</div> diff --git a/plugins/CoreHome/templates/datatable_actions.twig b/plugins/CoreHome/templates/datatable_actions.twig new file mode 100644 index 0000000000..64263d87f7 --- /dev/null +++ b/plugins/CoreHome/templates/datatable_actions.twig @@ -0,0 +1,53 @@ +<div class="dataTable" data-table-type="actionDataTable" data-report="{{ properties.uniqueId }}" data-params="{{ javascriptVariablesToSet|json_encode }}"> + <div class="reportDocumentation"> + {% if reportDocumentation is not empty %}<p>{{ reportDocumentation|raw }}</p>{% endif %} + {% if properties.metadata.archived_date is defined %}<span class='helpDate'>{{ properties.metadata.archived_date }}</span>{% endif %} + </div> + <div class="dataTableActionsWrapper"> + {% if arrayDataTable.result is defined and arrayDataTable.result == 'error' %} + {{ arrayDataTable.message }} + {% else %} + {% if arrayDataTable|length == 0 %} + <div class="pk-emptyDataTable">{{ 'CoreHome_ThereIsNoDataForThisReport'|translate }}</div> + {% else %} + <table cellspacing="0" class="dataTable dataTableActions"> + <thead> + <tr> + {% for column in dataTableColumns %} + <th class="sortable {% if loop.first %}first{% elseif loop.last %}last{% endif %}" id="{{ column }}"> + {% if columnDocumentation[column] is not empty %} + <div class="columnDocumentation"> + <div class="columnDocumentationTitle"> + {{ columnTranslations[column]|raw }} + </div> + {{ columnDocumentation[column] }} + </div> + {% endif %} + <div id="thDIV">{{ columnTranslations[column]|raw }}</div> + </th> + {% endfor %} + </tr> + </thead> + + <tbody> + {% for row in arrayDataTable %} + <tr {% if row.idsubdatatable %}class="rowToProcess subActionsDataTable" id="{{ row.idsubdatatable }}" + {% else %}class="actionsDataTable rowToProcess"{% endif %}> + {% for column in dataTableColumns %} + <td> + {% include "@CoreHome/datatable_cell.twig" with {'column': column, 'row': row} only %} + </td> + {% endfor %} + </tr> + {% endfor %} + </tbody> + </table> + {% endif %} + + {% if properties.show_footer %} + {% include "@CoreHome/datatable_footer.twig" %} + {% endif %} + {% include "@CoreHome/datatable_js.twig" %} + {% endif %} + </div> +</div> diff --git a/plugins/CoreHome/templates/datatable_cell.twig b/plugins/CoreHome/templates/datatable_cell.twig index 45c7191f87..7ec96403c0 100644 --- a/plugins/CoreHome/templates/datatable_cell.twig +++ b/plugins/CoreHome/templates/datatable_cell.twig @@ -15,7 +15,7 @@ {# make sure there are no whitespaces inside the span #} {% if row.metadata.html_label_suffix is not empty %}<span class='label-suffix'>{{ row.metadata.html_label_suffix }}</span>{% endif %} {% endif %} -{% if row.columns[column] is defined %}{{ row.columns[column] }}{% else %}{{ defaultWhenColumnValueNotDefined }}{% endif %} +{% if row.columns[column] is defined %}{{ row.columns[column]|raw }}{% else %}{{ defaultWhenColumnValueNotDefined }}{% endif %} {% if column=='label' %}</span>{% endif %} {% if not row.idsubdatatable and column=='label' and row.metadata.url is not empty %} </a> diff --git a/plugins/CoreHome/templates/js_disabled_notice.twig b/plugins/CoreHome/templates/js_disabled_notice.twig index 37a699be43..fb50e92d56 100644 --- a/plugins/CoreHome/templates/js_disabled_notice.twig +++ b/plugins/CoreHome/templates/js_disabled_notice.twig @@ -1,3 +1,3 @@ <noscript> - <div id="javascriptDisabled">{{ 'CoreHome_JavascriptDisabled'|translate('<a href="">','</a>') }}</div> + <div id="javascriptDisabled">{{ 'CoreHome_JavascriptDisabled'|translate('<a href="">','</a>')|raw }}</div> </noscript> diff --git a/plugins/CoreHome/templates/single_report.twig b/plugins/CoreHome/templates/single_report.twig index bd64e5cd4f..f6ad622f21 100644 --- a/plugins/CoreHome/templates/single_report.twig +++ b/plugins/CoreHome/templates/single_report.twig @@ -1,2 +1,2 @@ <h2>{{ title }}</h2> -{{ report }}
\ No newline at end of file +{{ report|raw }}
\ No newline at end of file diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php index 35d795a23f..dc595f22d4 100644 --- a/plugins/Goals/Controller.php +++ b/plugins/Goals/Controller.php @@ -156,7 +156,7 @@ class Piwik_Goals_Controller extends Piwik_Controller protected function getGoalReportView($idGoal = false) { - $view = Piwik_View::factory('single_goal'); + $view = new Piwik_View('@Goals/single_goal'); if ($idGoal == Piwik_Archive::LABEL_ECOMMERCE_ORDER) { $goalDefinition['name'] = Piwik_Translate('Goals_Ecommerce'); $goalDefinition['allow_multiple'] = true; @@ -217,7 +217,7 @@ class Piwik_Goals_Controller extends Piwik_Controller protected function getOverviewView() { - $view = Piwik_View::factory('overview'); + $view = new Piwik_View('@Goals/overview'); $this->setGeneralVariablesView($view); $view->graphEvolution = $this->getEvolutionGraph(true, array('nb_conversions')); @@ -271,7 +271,7 @@ class Piwik_Goals_Controller extends Piwik_Controller public function addNewGoal() { - $view = Piwik_View::factory('add_new_goal'); + $view = new Piwik_View('@Goals/add_new_goal'); $this->setGeneralVariablesView($view); $view->userCanEditGoals = Piwik::isUserHasAdminAccess($this->idSite); $view->onlyShowAddNewGoal = true; |