cvs: smarty /libs Smarty.class.php

"Monte Ohrt" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmohrt1071861789@cvsserver>
mohrt		Fri Dec 19 14:23:09 2003 EDT

  Modified files:              
    /smarty/libs	Smarty.class.php 
  Log:
  add debug console persistance feature
  
  
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.466 smarty/libs/Smarty.class.php:1.467
--- smarty/libs/Smarty.class.php:1.466	Tue Dec 16 04:05:04 2003
+++ smarty/libs/Smarty.class.php	Fri Dec 19 14:23:09 2003
@@ -43,7 +43,7 @@
  * @version 2.6.1-dev
  */
 
-/* $Id: Smarty.class.php,v 1.466 2003/12/16 09:05:04 messju Exp $ */
+/* $Id: Smarty.class.php,v 1.467 2003/12/19 19:23:09 mohrt Exp $ */
 
 /**
  * DIR_SEP isn't used anymore, but third party apps might
@@ -1141,11 +1141,26 @@
         $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->tpl_error_reporting) 
                ? $this->tpl_error_reporting : error_reporting() & ~E_NOTICE);
 
-        if (!$this->debugging && $this->debugging_ctrl == 'URL'
-               && @strstr(($this->request_use_auto_globals) ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'], $this->_smarty_debug_id)) {
-            // enable debugging from URL
-            $this->debugging = true;
-        }
+        if (!$this->debugging && $this->debugging_ctrl == 'URL') {
+			$_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'];
+            if (@strstr($_query_string, $this->_smarty_debug_id)) {
+				if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) {
+            		// enable debugging for this browser session
+					@setcookie('SMARTY_DEBUG', true);
+            		$this->debugging = true;					
+				} elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) {
+            		// disable debugging for this browser session
+					@setcookie('SMARTY_DEBUG', false);
+            		$this->debugging = false;
+				} else {
+            		// enable debugging for this page
+            		$this->debugging = true;
+				}
+        	} else {
+				$_cookie_var = $this->request_use_auto_globals ? $_COOKIE['SMARTY_DEBUG'] : $GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG'];
+            	$this->debugging = $_cookie_var ? true : false;				
+			}
+		}
 
         if ($this->debugging) {
             // capture time for debugging info


-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.