Skip to content

Commit

Permalink
* removing most mentions to "tpl"
Browse files Browse the repository at this point in the history
Refs #4019
  • Loading branch information
mattab committed Jun 28, 2013
1 parent e6009e4 commit 60e3b96
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 26 deletions.
5 changes: 3 additions & 2 deletions core/Piwik.php
Expand Up @@ -285,7 +285,7 @@ static public function copyRecursive($source, $target, $excludePhp = false)
*/
static public function copy($source, $dest, $excludePhp = false)
{
static $phpExtensions = array('php', 'tpl');
static $phpExtensions = array('php', 'tpl', 'twig');

if ($excludePhp) {
$path_parts = pathinfo($source);
Expand Down Expand Up @@ -547,7 +547,7 @@ static public function createHtAccessFiles()
// more selective allow/deny filters
$allowAny = "<Files \"*\">\n" . $allow . "Satisfy any\n</Files>\n";
$allowStaticAssets = "<Files ~ \"\\.(test\.php|gif|ico|jpg|png|svg|js|css|swf)$\">\n" . $allow . "Satisfy any\n</Files>\n";
$denyDirectPhp = "<Files ~ \"\\.(php|php4|php5|inc|tpl|in)$\">\n" . $deny . "</Files>\n";
$denyDirectPhp = "<Files ~ \"\\.(php|php4|php5|inc|tpl|in|twig)$\">\n" . $deny . "</Files>\n";

$directoriesToProtect = array(
'/js' => $allowAny,
Expand Down Expand Up @@ -582,6 +582,7 @@ static public function createWebConfigFiles()
</hiddenSegments>
<fileExtensions>
<add fileExtension=".tpl" allowed="false" />
<add fileExtension=".twig" allowed="false" />
<add fileExtension=".php4" allowed="false" />
<add fileExtension=".php5" allowed="false" />
<add fileExtension=".inc" allowed="false" />
Expand Down
2 changes: 1 addition & 1 deletion core/Version.php
Expand Up @@ -20,5 +20,5 @@ final class Piwik_Version
* Current Piwik version
* @var string
*/
const VERSION = '1.12';
const VERSION = '1.11';
}
1 change: 1 addition & 0 deletions core/View.php
Expand Up @@ -236,6 +236,7 @@ static public function factory($templateName = null)
}
$path = basename(dirname($bt[0]['file']));

// TODO fixmea
if (Piwik_Common::isPhpCliMode()) {
$templateFile = $path . '/templates/cli_' . $templateName . '.tpl';
if (file_exists(PIWIK_INCLUDE_PATH . '/plugins/' . $templateFile)) {
Expand Down
2 changes: 1 addition & 1 deletion core/ViewDataTable.php
Expand Up @@ -899,7 +899,7 @@ public function disableFooterIcons()
}

/**
* When this method is called, the output will not contain the template datatable_footer.tpl
* When this method is called, the output will not include the template datatable_footer
*/
public function disableFooter()
{
Expand Down
2 changes: 1 addition & 1 deletion core/ViewDataTable/Cloud.php
Expand Up @@ -11,7 +11,7 @@

/**
* Reads the requested DataTable from the API, and prepares the data to give
* to Piwik_Visualization_Cloud that will display the tag cloud (via the template cloud.tpl).
* to Piwik_Visualization_Cloud that will display the tag cloud (via the template _dataTable_cloud.twig).
*
* @package Piwik
* @subpackage Piwik_ViewDataTable
Expand Down
14 changes: 0 additions & 14 deletions plugins/CoreHome/javascripts/broadcast.js
Expand Up @@ -9,14 +9,6 @@
* broadcast object is to help maintain a hash for link clicks and ajax calls
* so we can have back button and refresh button working.
*
* Other file that currently depending on this are:
* calendar.js
* period_select.tpl
* sites_selections.tpl
* menu.js, ...etc
*
* !! Load this once and only once. !!
*
* @type {object}
*/
var broadcast = {
Expand Down Expand Up @@ -229,12 +221,6 @@ var broadcast = {
* Expecting:
* str = "param1=newVal1&param2=newVal2";
*
* Currently being use by:
*
* handlePeriodClick,
* calendar.js,
* sites_selection.tpl
*
* NOTE: This method will refresh the page with new values.
*
* @param {string} str url with parameters to be updated
Expand Down
2 changes: 1 addition & 1 deletion plugins/ExamplePlugin/Controller.php
Expand Up @@ -48,7 +48,7 @@ public function photostreamMatt()

/**
* this widgets shows how to make a remote API request to piwik.org
* you find the main JS code in templates/piwikDownloadCount.tpl
* you find the main JS code in templates/piwikDownloads.twig
*/
public function piwikDownloads()
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/MobileMessaging/ReportRenderer/Sms.php
Expand Up @@ -87,7 +87,7 @@ public function renderReport($processedReport)

// evolution metrics formatting :
// - remove monetary, percentage and white spaces to shorten SMS content
// (this is also needed to be able to test $value != 0 and see if there is an evolution at all in SMSReport.tpl)
// (this is also needed to be able to test $value != 0 and see if there is an evolution at all in SMSReport.twig)
// - adds a plus sign
$reportData->filter(
'ColumnCallbackReplace',
Expand Down
2 changes: 1 addition & 1 deletion plugins/Overlay/javascripts/Piwik_Overlay.js
Expand Up @@ -139,7 +139,7 @@ var Piwik_Overlay = (function () {

return {

/** This method is called when Overlay loads (from index.tpl) */
/** This method is called when Overlay loads */
init: function (iframeSrc, pIdSite, pPeriod, pDate) {
iframeSrcBase = iframeSrc;
idSite = pIdSite;
Expand Down
2 changes: 1 addition & 1 deletion plugins/SitesManager/javascripts/SitesManager.js
Expand Up @@ -5,7 +5,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/

// NOTE: if you cannot find the definition of a variable here, look in SitesManager.tpl
// NOTE: if you cannot find the definition of a variable here, look in index.twig
function SitesManager(_timezones, _currencies, _defaultTimezone, _defaultCurrency) {

var timezones = _timezones;
Expand Down
2 changes: 1 addition & 1 deletion plugins/UserCountry/Controller.php
Expand Up @@ -141,7 +141,7 @@ private function getGeoIpUpdaterManageScreen()
}

/**
* Sets some variables needed by the updaterSetup.tpl template.
* Sets some variables needed by the _updaterManage.twig template.
*
* @param Piwik_View $view
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/PHPUnit/Core/ReleaseCheckListTest.php
Expand Up @@ -52,8 +52,8 @@ private function _checkEqual($key, $valueExpected)
*/
public function testTemplatesDontContainDebug()
{
$patternFailIfFound = '{debug}';
$files = Piwik::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.tpl');
$patternFailIfFound = 'dump(';
$files = Piwik::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.twig');
foreach ($files as $file) {
$content = file_get_contents($file);
$this->assertFalse(strpos($content, $patternFailIfFound), 'found in ' . $file);
Expand Down

0 comments on commit 60e3b96

Please sign in to comment.