* class with any custom functionality needed to interface a target
* templating engine with SquirrelMail.
*
- * @copyright © 2003-2007 The SquirrelMail Project Team
+ * @copyright 2003-2021 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @static
*
*/
- function construct_template($template_set_id) {
+ static function construct_template($template_set_id) {
$template = new Template($template_set_id);
$template->override_plugins();
* @static
*
*/
- function get_fallback_template_set($default='default') {
+ static function get_fallback_template_set($default='default') {
// FIXME: do we want to place any restrictions on the ID such as
// making sure no slashes included?
* @static
*
*/
- function get_default_template_set($default='default') {
+ static function get_default_template_set($default='default') {
// FIXME: do we want to place any restrictions on the ID such as
// making sure no slashes included?
* @static
*
*/
- function get_rpc_template_set($default='default_rpc') {
+ static function get_rpc_template_set($default='default_rpc') {
// FIXME: do we want to place any restrictions on the ID such as
// making sure no slashes included?
* @static
*
*/
- function calculate_template_file_directory($template_set_id) {
+ static function calculate_template_file_directory($template_set_id) {
return 'templates/' . $template_set_id . '/';
* @static
*
*/
- function calculate_template_images_directory($template_set_id) {
+ static function calculate_template_images_directory($template_set_id) {
return 'templates/' . $template_set_id . '/images/';
* @static
*
*/
- function get_template_config($template_set_id, $setting,
+ static function get_template_config($template_set_id, $setting,
$default=NULL, $live_config=FALSE) {
sqGetGlobalVar('template_configuration_settings',
* @static
*
*/
- function cache_template_file_hierarchy($template_set_id,
+ static function cache_template_file_hierarchy($template_set_id,
$regenerate_cache=FALSE,
$additional_files=array()) {
* @static
*
*/
- function catalog_template_files($template_set_id, $file_list=array(), $directory='') {
+ static function catalog_template_files($template_set_id, $file_list=array(), $directory='') {
$template_base_dir = SM_PATH
. Template::calculate_template_file_directory($template_set_id);
*
* @param mixed $headers A list of (or a single) header
* text to be sent.
+ * @param boolean $replace Whether or not to replace header(s)
+ * previously sent header(s) of the
+ * same type (this parameter may be
+ * ignored in some implementations
+ * of this class if the target interface
+ * does not support this functionality)
+ * (OPTIONAL; default = TRUE, always replace).
*
*/
- function header($headers)
+ function header($headers, $replace=TRUE)
{
if (!is_array($headers)) $headers = array($headers);
foreach ($headers as $header) {
$this->assign('header', $header);
- header($this->fetch('header.tpl'));
+ header($this->fetch('header.tpl'), $replace);
}
}
if (empty($template)) {
- trigger_error('The template "' . htmlspecialchars($file)
+ trigger_error('The template "' . sm_encode_html_special_chars($file)
. '" could not be fetched!', E_USER_ERROR);
} else {