Changeset 4c6b662 in github


Ignore:
Timestamp:
Apr 30, 2008 10:07:29 AM (5 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
e090a1a
Parents:
3510d7b
Message:

Simply use reset() to clear the state vars of rcube_html_page; reverted r1346

Location:
program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_html_page.php

    r3510d7b r4c6b662  
    11<?php 
     2 
    23/* 
    34 +-----------------------------------------------------------------------+ 
     
    2324 * 
    2425 * @package HTML 
    25  * 
    26  * @author  Thomas Bruederli <roundcube@gmail.com> 
    27  * @license http://gnu.org GPL 
    28  * @todo    See about improving performance (__get, __set, sprintf) 
    2926 */ 
    3027class rcube_html_page 
    3128{ 
    32     protected $_store = array(); 
    33  
    34     /** 
    35      * Constructor 
    36      * 
    37      * @return rcube_html_page 
    38      * @uses self::reset() 
    39      */ 
    40     public function __construct() 
    41     { 
    42         $this->reset(); 
    43     } 
     29    protected $scripts_path = ''; 
     30    protected $script_files = array(); 
     31    protected $scripts = array(); 
     32    protected $charset = 'UTF-8'; 
     33 
     34    protected $script_tag_file = "<script type=\"text/javascript\" src=\"%s%s\"></script>\n"; 
     35    protected $script_tag      = "<script type=\"text/javascript\">\n<!--\n%s\n\n//-->\n</script>\n"; 
     36    protected $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>"; 
     37 
     38    protected $title = ''; 
     39    protected $header = ''; 
     40    protected $footer = ''; 
     41    protected $body = ''; 
     42 
     43 
     44    /** Constructor */ 
     45    public function __construct() {} 
    4446 
    4547    /** 
     
    121123    /** 
    122124     * Reset all saved properties 
    123      * 
    124      * @return void 
    125      * @see self::__construct 
    126      * @uses self::$_store 
    127125     */ 
    128126    public function reset() 
    129127    { 
    130         $this->scripts_path = ''; 
    131128        $this->script_files = array(); 
    132         $this->external_scripts = array(); 
    133129        $this->scripts = array(); 
    134         $this->charset = 'UTF-8'; 
    135  
    136         // templates 
    137         $this->script_tag_file = "<script type=\"text/javascript\" src=\"%s%s\"></script>\n"; 
    138         $this->script_tag = "<script type=\"text/javascript\">\n<!--\n%s\n\n//-->\n</script>\n"; 
    139         $this->default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>"; 
    140         $this->tag_format_external_script = "<script type=\"text/javascript\" src=\"%s\"></script>\n"; 
    141  
    142         // page stuff 
    143130        $this->title = ''; 
    144131        $this->header = ''; 
     
    265252        echo rcube_charset_convert($output, 'UTF-8', $this->charset); 
    266253    } 
    267  
    268     /** 
    269      * __get 
    270      * 
    271      * @param string $var A variable name. 
    272      * 
    273      * @return mixed 
    274      * @uses self::$_store 
    275      */ 
    276     public function __get($var) 
    277     { 
    278         return $this->_store[$var]; 
    279     } 
    280  
    281     /** 
    282      * __set 
    283      * 
    284      * @param string $var A variable name. 
    285      * @param mixed  $value The value of the variable. 
    286      * 
    287      * @return mixed 
    288      * @uses self::$_store 
    289      */ 
    290     public function __set($var, $value) 
    291     { 
    292         return $this->_store[$var] = $value; 
    293     } 
    294254} 
     255 
  • program/steps/error.inc

    r47124c22 r4c6b662  
    100100if (template_exists('error')) 
    101101  { 
    102   $OUTPUT->scripts = array(); 
    103   $OUTPUT->script_files = array(); 
     102  $OUTPUT->reset(); 
    104103  $OUTPUT->send('error'); 
    105104  } 
Note: See TracChangeset for help on using the changeset viewer.