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



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1544 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 11 years ago
parent d4a34b557d
commit ee90f4a74e

@ -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 @@ require_once ("$incpath/smarty/libs/SmartyBC.class.php");
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 @@ class PFASmarty {
}
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 @@ function select_options($aValues, $aSelected) {
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;
}

@ -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">

Loading…
Cancel
Save