SF.net SVN: postfixadmin:[1544] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2013-10-19 20:12:07
|
Revision: 1544 http://sourceforge.net/p/postfixadmin/code/1544 Author: christian_boltz Date: 2013-10-19 20:12:02 +0000 (Sat, 19 Oct 2013) Log Message: ----------- smarty.inc.php: - move header() calls from index.tpl to smarty.inc.php, which means we no longer need to use SmartyBC class - use Smarty instead of SmartyBC class - eval_size(): use Config::Lang instead of $PALANG templates/header.tpl: - move header() calls to smarty.inc.php, and drop {php} usage Modified Paths: -------------- trunk/smarty.inc.php trunk/templates/header.tpl Modified: trunk/smarty.inc.php =================================================================== --- trunk/smarty.inc.php 2013-10-19 19:19:56 UTC (rev 1543) +++ trunk/smarty.inc.php 2013-10-19 20:12:02 UTC (rev 1544) @@ -1,7 +1,5 @@ <?php -#require_once ("$incpath/smarty/libs/Smarty.class.php"); -# We have to use the SmartyBC ("Backwards Compatible") class because some templates use {php}. (TODO: do we really need {php}?) -require_once ("$incpath/smarty/libs/SmartyBC.class.php"); +require_once ("$incpath/smarty/libs/Smarty.class.php"); /** * Turn on sanitisation of all data by default so it's not possible for XSS flaws to occur in PFA @@ -9,7 +7,7 @@ class PFASmarty { protected $template = null; public function __construct() { - $this->template = new SmartyBC(); + $this->template = new Smarty(); //$this->template->debugging = true; $incpath = dirname(__FILE__); @@ -28,6 +26,13 @@ } public function display($template) { + header ("Expires: Sun, 16 Mar 2003 05:00:00 GMT"); + header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); + header ("Cache-Control: no-store, no-cache, must-revalidate"); + header ("Cache-Control: post-check=0, pre-check=0", false); + header ("Pragma: no-cache"); + header ("Content-Type: text/html; charset=UTF-8"); + $this->template->display($template); unset($_SESSION['flash']); # cleanup flash messages } @@ -80,8 +85,8 @@ return $ret_val; } function eval_size ($aSize) { - if ($aSize == 0) {$ret_val = $GLOBALS ['PALANG']['pOverview_unlimited']; } - elseif ($aSize < 0) {$ret_val = $GLOBALS ['PALANG']['pOverview_disabled']; } + if ($aSize == 0) {$ret_val = Config::Lang('pOverview_unlimited'); } + elseif ($aSize < 0) {$ret_val = Config::Lang('pOverview_disabled'); } else {$ret_val = $aSize; } return $ret_val; } Modified: trunk/templates/header.tpl =================================================================== --- trunk/templates/header.tpl 2013-10-19 19:19:56 UTC (rev 1543) +++ trunk/templates/header.tpl 2013-10-19 20:12:02 UTC (rev 1544) @@ -1,12 +1,4 @@ <!-- {$smarty.template} --> -{php} - @header ("Expires: Sun, 16 Mar 2003 05:00:00 GMT"); - @header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); - @header ("Cache-Control: no-store, no-cache, must-revalidate"); - @header ("Cache-Control: post-check=0, pre-check=0", false); - @header ("Pragma: no-cache"); - @header ("Content-Type: text/html; charset=UTF-8"); -{/php} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |