Source for file Smarty_Template.class.php
Documentation is available at Smarty_Template.class.php
* Smarty_Template.class.php
* This file contains a Template subclass intended as a bridge between
* SquirrelMail and Smarty. All abstract methods from the Template class
* @copyright 2003-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: Smarty_Template.class.php 14845 2020-01-07 08:09:34Z pdontthink $
* The SquirrelMail Smarty Template class. Extends the base
* Template class for use with Smarty template pages.
* @author Paul Lesniewski <paul at squirrelmail.org>
* The Smarty template object
* Please do not call directly. Use Template::construct_template().
* @param string $template_id the template ID
//FIXME: find a way to test that this is ONLY ever called
// from parent's construct_template() method (I doubt it
// is worth the trouble to parse the current stack trace)
// trigger_error('Please do not use default Smarty_Template() constructor. Instead, use Template::construct_template().', E_USER_ERROR);
// instantiate and set up Smarty object
// note that we do not use Smarty's template_dir
// because SquirrelMail has its own method of
// determining template file paths
//$this->smarty_template->template_dir =
* Assigns values to template variables
* @param array|string$tpl_var the template variable name(s)
* @param mixed $value the value to assign
FIXME: Proposed idea to add a parameter here that turns variable
encoding on, so that we can make sure output is always
run through something like sm_encode_html_special_chars() (maybe even nl2br()?)
function assign($tpl_var, $value =
NULL) {
* Assigns values to template variables by reference
* @param string $tpl_var the template variable name
* @param mixed $value the referenced value to assign
FIXME: Proposed idea to add a parameter here that turns variable
encoding on, so that we can make sure output is always
run through something like sm_encode_html_special_chars() (maybe even nl2br()?)
* Clears the values of all assigned varaiables.
* Returns assigned variable value(s).
* @param string $varname If given, the value of that variable
* is returned, assuming it has been
* previously assigned. If not specified
* an array of all assigned variables is
* @return mixed Desired single variable value or list of all
* assigned variable values.
* Appends values to template variables
* @param array|string$tpl_var the template variable name(s)
* @param mixed $value the value to append
* @param boolean $merge when $value is given as an array,
* this indicates whether or not that
* array itself should be appended as
* a new template variable value or if
* that array's values should be merged
* into the existing array of template
FIXME: Proposed idea to add a parameter here that turns variable
encoding on, so that we can make sure output is always
run through something like sm_encode_html_special_chars() (maybe even nl2br()?)
function append($tpl_var, $value =
NULL, $merge =
FALSE) {
* Appends values to template variables by reference
* @param string $tpl_var the template variable name
* @param mixed $value the referenced value to append
* @param boolean $merge when $value is given as an array,
* this indicates whether or not that
* array itself should be appended as
* a new template variable value or if
* that array's values should be merged
* into the existing array of template
FIXME: Proposed idea to add a parameter here that turns variable
encoding on, so that we can make sure output is always
run through something like sm_encode_html_special_chars() (maybe even nl2br()?)
* Applys the template and generates final output destined
* @param string $filepath The full file path to the template to be applied
* @return string The output for the given template
// if being passed a raw .css or .js file, default
// Smarty delimiters will cause errors
// Smarty wants absolute paths
if (strpos($filepath, '/') ===
0)
Documentation generated on Mon, 13 Jan 2020 04:23:33 +0100 by phpDocumentor 1.4.3