includes/template.php
changeset 1363 f1ed3e9298ae
parent 1352 d97cf005f674
child 1364 68c17d935750
--- a/includes/template.php	Sat Sep 15 13:16:13 2012 -0400
+++ b/includes/template.php	Sat Sep 15 13:18:01 2012 -0400
@@ -60,6 +60,13 @@
 	
 	var $fading_button = '';
 	
+	/**
+	* Context stack. You can save and restore the var set.
+	* @var array
+	*/
+
+	var $context_stack = array('bool' => array(), 'str' => array(), 'history' => array());
+	
 	function __construct()
 	{
 		global $db, $session, $paths, $template, $plugins; // Common objects
@@ -119,6 +126,24 @@
 	}
 	
 	/**
+	* Save the current context and start a blank one.
+	*/
+	
+	function context_push()
+	{
+		array_push($this->context_stack['str'], $this->tpl_strings);
+		array_push($this->context_stack['bool'], $this->tpl_bool);
+		array_push($this->context_stack['history'], $this->vars_assign_history);
+	}
+	
+	function context_pop()
+	{
+		$this->tpl_strings = array_pop($this->context_stack['str']);
+		$this->tpl_bool = array_pop($this->context_stack['bool']);
+		$this->vars_assign_history = array_pop($this->context_stack['history']);
+	}
+	
+	/**
  	* Gets the list of available CSS files (styles) for the specified theme.
  	* @param string Theme ID
  	* @return array