includes/template.php
changeset 1363 f1ed3e9298ae
parent 1352 d97cf005f674
child 1364 68c17d935750
equal deleted inserted replaced
1362:c690f0b39bcb 1363:f1ed3e9298ae
    58  	* @var string
    58  	* @var string
    59  	*/
    59  	*/
    60 	
    60 	
    61 	var $fading_button = '';
    61 	var $fading_button = '';
    62 	
    62 	
       
    63 	/**
       
    64 	* Context stack. You can save and restore the var set.
       
    65 	* @var array
       
    66 	*/
       
    67 
       
    68 	var $context_stack = array('bool' => array(), 'str' => array(), 'history' => array());
       
    69 	
    63 	function __construct()
    70 	function __construct()
    64 	{
    71 	{
    65 		global $db, $session, $paths, $template, $plugins; // Common objects
    72 		global $db, $session, $paths, $template, $plugins; // Common objects
    66 		global $cache;
    73 		global $cache;
    67 		
    74 		
   114 		$this->named_theme_list[ $this->default_theme ]['css'] = $this->get_theme_css_files($this->default_theme);
   121 		$this->named_theme_list[ $this->default_theme ]['css'] = $this->get_theme_css_files($this->default_theme);
   115 		// Come up with the default style. If the CSS file specified in default_style exists, we're good, just
   122 		// Come up with the default style. If the CSS file specified in default_style exists, we're good, just
   116 		// use that. Otherwise, use the first stylesheet that comes to mind.
   123 		// use that. Otherwise, use the first stylesheet that comes to mind.
   117 		$df_data =& $this->named_theme_list[ $this->default_theme ];
   124 		$df_data =& $this->named_theme_list[ $this->default_theme ];
   118 		$this->default_style = ( in_array($df_data['default_style'], $df_data['css']) ) ? $df_data['default_style'] : $df_data['css'][0];
   125 		$this->default_style = ( in_array($df_data['default_style'], $df_data['css']) ) ? $df_data['default_style'] : $df_data['css'][0];
       
   126 	}
       
   127 	
       
   128 	/**
       
   129 	* Save the current context and start a blank one.
       
   130 	*/
       
   131 	
       
   132 	function context_push()
       
   133 	{
       
   134 		array_push($this->context_stack['str'], $this->tpl_strings);
       
   135 		array_push($this->context_stack['bool'], $this->tpl_bool);
       
   136 		array_push($this->context_stack['history'], $this->vars_assign_history);
       
   137 	}
       
   138 	
       
   139 	function context_pop()
       
   140 	{
       
   141 		$this->tpl_strings = array_pop($this->context_stack['str']);
       
   142 		$this->tpl_bool = array_pop($this->context_stack['bool']);
       
   143 		$this->vars_assign_history = array_pop($this->context_stack['history']);
   119 	}
   144 	}
   120 	
   145 	
   121 	/**
   146 	/**
   122  	* Gets the list of available CSS files (styles) for the specified theme.
   147  	* Gets the list of available CSS files (styles) for the specified theme.
   123  	* @param string Theme ID
   148  	* @param string Theme ID