Index: trunk/kernel/include/parseditem.php =================================================================== diff -u -N -r870 -r875 --- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 870) +++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 875) @@ -1669,7 +1669,7 @@ global ${$v}; if(!strlen($page)) - $page = GetIndexURL(); + $page = GetIndexURL(2); $PerPage = $objConfig->Get($this->PerPageVar); if($PerPage<1) Index: trunk/kernel/include/portaluser.php =================================================================== diff -u -N -r701 -r875 --- trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 701) +++ trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 875) @@ -476,7 +476,7 @@ case 'send_pm_link': $var_list_update['t'] = $element->GetAttributeByName('_Template'); - $ret = GetIndexURL()."?env=".BuildEnv()."&ToUser=".$this->Get('Login'); + $ret = GetIndexURL(2)."?env=".BuildEnv()."&ToUser=".$this->Get('Login'); break; case "profile_link": @@ -492,7 +492,7 @@ } else $var_list_update["t"] = $var_list["t"]; - $ret = GetIndexURL()."?env=" . BuildEnv()."&UserId=".$this->Get("PortalUserId"); + $ret = GetIndexURL(2)."?env=" . BuildEnv()."&UserId=".$this->Get("PortalUserId"); break; case "add_friend_link": /* @@ -511,7 +511,7 @@ else $var_list_update["t"] = $var_list["t"]; $action = "m_add_friend"; - $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=".$action."&UserId=".$this->Get("PortalUserId"); + $ret = GetIndexURL(2)."?env=" . BuildEnv()."&Action=".$action."&UserId=".$this->Get("PortalUserId"); } else $ret = ""; @@ -533,7 +533,7 @@ else $var_list_update["t"] = $var_list["t"]; $action = "m_del_friend"; - $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=".$action."&UserId=".$this->Get("PortalUserId"); + $ret = GetIndexURL(2)."?env=" . BuildEnv()."&Action=".$action."&UserId=".$this->Get("PortalUserId"); } else $ret = ""; @@ -685,7 +685,7 @@ case "user_profile_link": $var_list_update["t"] = "user_profile"; $m_var_list_update["action"] = $this->Get("UserId"); - $ret = GetIndexURL()."?env=" . BuildEnv(); + $ret = GetIndexURL(2)."?env=" . BuildEnv(); unset($m_var_list_update["action"], $var_list_update["t"]); return $ret; break; @@ -694,7 +694,7 @@ break; case "user_messages_link": $var_list_update["t"] = "inbulletin/bb_private_msg_list"; - return GetIndexURL()."?env=" . BuildEnv(); + return GetIndexURL(2)."?env=" . BuildEnv(); unset($var_list_update); break; default: @@ -727,7 +727,7 @@ global $objConfig, $m_var_list_update, $var_list_update, $var_list; if(!strlen($page)) - $page = GetIndexURL(); + $page = GetIndexURL(2); $NumPages = $this->GetNumPages($objConfig->Get("Perpage_Topics")); if(strlen($dest_template)>0) { Index: trunk/kernel/include/language.php =================================================================== diff -u -N -r721 -r875 --- trunk/kernel/include/language.php (.../language.php) (revision 721) +++ trunk/kernel/include/language.php (.../language.php) (revision 875) @@ -277,7 +277,7 @@ else $var_list_update["t"] = $var_list["t"]; $m_var_list_update["lang"] = $this->Get("LanguageId"); - $ret = GetIndexURL()."?env=".BuildEnv(); + $ret = GetIndexURL(2)."?env=".BuildEnv(); unset($var_list_update["t"],$m_var_list_update["lang"]); break; case "primary": Index: trunk/kernel/parser.php =================================================================== diff -u -N -r858 -r875 --- trunk/kernel/parser.php (.../parser.php) (revision 858) +++ trunk/kernel/parser.php (.../parser.php) (revision 875) @@ -1317,7 +1317,7 @@ if($LangId) { $m_var_list_update["lang"] = $LangId; - $ret = GetIndexURL()."?env=".BuildEnv(); + $ret = GetIndexURL(2)."?env=".BuildEnv(); unset($m_var_list_update["lang"]); } else @@ -1429,7 +1429,7 @@ $Id = 0; } $m_var_list_update["theme"] = $Id; - $ret = GetIndexURL()."?env=".BuildEnv(); + $ret = GetIndexURL(2)."?env=".BuildEnv(); unset($m_var_list_update["theme"]); return $ret; } @@ -2245,7 +2245,9 @@ } } - if($attribs["_secure"]) + $ret = GetIndexURL(2)."?env=".BuildEnv().$query; + + /*if($attribs["_secure"]) { $ret = GetIndexURL(1)."?env=".BuildEnv().$query; } @@ -2254,7 +2256,9 @@ $ret = GetIndexURL(2)."?env=".BuildEnv().$query; } else + { $ret = GetIndexURL()."?env=".BuildEnv().$query; + }*/ if(strlen($attribs["_anchor"])) $ret .= "#".$attribs["_anchor"]; @@ -2347,7 +2351,7 @@ $var_list_update["t"] = $template; } - $ret = GetIndexURL()."?env=".BuildEnv(); + $ret = GetIndexURL(2)."?env=".BuildEnv(); unset($var_list_update["t"]); if(strlen($dest)) $ret .= "&dest=$dest"; Index: trunk/index.php =================================================================== diff -u -N -r842 -r875 --- trunk/index.php (.../index.php) (revision 842) +++ trunk/index.php (.../index.php) (revision 875) @@ -1,7 +1,7 @@ "; -if(!IsDebugMode()) header("Content-length: ".strlen($html)); +if( IsDebugMode() ) +{ + if($Action) $debugger->setHTMLByIndex(1,'Front Action: '.$Action.'','append'); + $html = 'Show Debugger
'.$html; +} +else +{ + header("Content-length: ".strlen($html)); +} header("Connection-Type: Keep-Alive"); echo $html; Index: trunk/kernel/include/itemreview.php =================================================================== diff -u -N -r852 -r875 --- trunk/kernel/include/itemreview.php (.../itemreview.php) (revision 852) +++ trunk/kernel/include/itemreview.php (.../itemreview.php) (revision 875) @@ -557,7 +557,7 @@ global $objConfig, $var_list_update, $var_list; if(!strlen($page)) - $page = GetIndexURL(); + $page = GetIndexURL(2); $PerPage = $objConfig->Get($this->PerPageVar); if($PerPage<1) $PerPage=20; Index: trunk/kernel/frontaction.php =================================================================== diff -u -N -r874 -r875 --- trunk/kernel/frontaction.php (.../frontaction.php) (revision 874) +++ trunk/kernel/frontaction.php (.../frontaction.php) (revision 875) @@ -1,13 +1,5 @@ setHTMLByIndex(1,'Front Action: '.$Action.'','append'); - echo 'Show Debugger
'; -} -// ====== Debugger related: end ====== - switch($Action) { case "m_login": Index: trunk/kernel/include/category.php =================================================================== diff -u -N -r865 -r875 --- trunk/kernel/include/category.php (.../category.php) (revision 865) +++ trunk/kernel/include/category.php (.../category.php) (revision 875) @@ -167,7 +167,7 @@ $m_var_list_update["p"] = "1"; $cat_name = $rs->fields['Name']; if (!is_null($anchor)) - $ret .= "$cat_name"; + $ret .= "$cat_name"; else $ret .= "$cat_name"; @@ -596,7 +596,7 @@ global $m_var_list_update; $m_var_list_update["cat"] = $this->Get("CategoryId"); - $ret = GetIndexURL()."?env=".BuildEnv(); + $ret = GetIndexURL(2)."?env=".BuildEnv(); unset($m_var_list_update["cat"]); return $ret; } @@ -606,7 +606,7 @@ global $m_var_list_update; $m_var_list_update["cat"] = $this->Get("ParentId"); - $ret = GetIndexURL()."?env=".BuildEnv(); + $ret = GetIndexURL(2)."?env=".BuildEnv(); unset($m_var_list_update["cat"]); return $ret; } @@ -942,7 +942,7 @@ else $var_list_update["t"] = $var_list["t"]; $m_var_list_update["cat"] = $this->Get("CategoryId"); - $ret = GetIndexURL()."?env=" . BuildEnv(); + $ret = GetIndexURL(2)."?env=" . BuildEnv(); unset($m_var_list_update["cat"], $var_list_update["t"]); break; case "adminlink": @@ -962,7 +962,7 @@ else $var_list_update["t"] = $var_list["t"]; $m_var_list_update["cat"] = $this->Get("CategoryId"); - $ret = GetIndexURL()."?env=" . BuildEnv(); + $ret = GetIndexURL(2)."?env=" . BuildEnv(); unset($m_var_list_update["cat"], $var_list_update["t"]); break; case "link_selector": @@ -1634,7 +1634,7 @@ global $objConfig, $m_var_list_update, $var_list_update, $var_list; if(!strlen($page)) - $page = GetIndexURL(); + $page = GetIndexURL(2); $PerPage = $this->GetPerPage(); $NumPages = ceil( $this->GetNumPages($PerPage) ); @@ -1803,7 +1803,7 @@ if ($LinkRoot) { $var_list_update["t"] = strlen($RootTemplate)? $RootTemplate : $target_template; - $nav = "$cat_name"; } + $nav = "$cat_name"; } else $nav = "$cat_name"; } @@ -1845,7 +1845,7 @@ { $var_list_update["t"] = $target_template; } - $nav[] = "".$cat_name.""; + $nav[] = "".$cat_name.""; } } } @@ -1872,7 +1872,7 @@ } else $var_list_update["t"] = $target_template; - $nav[] = "".$cat_name.""; + $nav[] = "".$cat_name.""; } } @@ -1911,7 +1911,7 @@ else { $var_list_update["t"] = $t; - $nav[] = "".$cat_name.""; + $nav[] = "".$cat_name.""; unset($var_list_update["t"]); } } Index: trunk/kernel/include/theme.php =================================================================== diff -u -N -r850 -r875 --- trunk/kernel/include/theme.php (.../theme.php) (revision 850) +++ trunk/kernel/include/theme.php (.../theme.php) (revision 875) @@ -544,7 +544,7 @@ break; case "select_url": $var_list_update["t"] = "index"; - $ret = GetIndexURL()."?env=".BuildEnv()."&Action=m_set_theme&ThemeId=".$this->Get("ThemeId"); + $ret = GetIndexURL(2)."?env=".BuildEnv()."&Action=m_set_theme&ThemeId=".$this->Get("ThemeId"); break; case "selected": $ret = ""; Index: trunk/kernel/include/debugger.php =================================================================== diff -u -N -r874 -r875 --- trunk/kernel/include/debugger.php (.../debugger.php) (revision 874) +++ trunk/kernel/include/debugger.php (.../debugger.php) (revision 875) @@ -1,7 +1,24 @@ 'c:\Program Files\UltraEdit\uedit32.exe', 'params' => '%F/%L'); + $dbg_editors[1] = Array('editor' => 'c:\Program Files\Zend\ZendStudio-4.0Beta\bin\ZDE.exe', 'params' => '%F'); + define('WINDOWS_EDITOR',$dbg_editors[$dbg_editor]['editor'].' '.$dbg_editors[$dbg_editor]['params']); + unset($dbg_editors,$dbg_editor); + } + class Debugger { /** @@ -13,12 +30,40 @@ var $ProfilerData = Array(); var $RecursionStack = Array(); // prevent recursion when processing debug_backtrace() function results + var $Options = 0; + var $OptionsMap = Array('shutdown_func' => 1, 'error_handler' => 2, + 'output_buffer' => 4, 'highlight_output' => 8); + function Debugger() { - $this->appendHTML('Hide Debugger'); $this->appendRequest(); } + function initOptions() + { + + + } + + function setOption($name,$value) + { + if( !isset($this->OptionsMap[$name]) ) die('undefined debugger option: ['.$name.']
'); + if($value) + { + $this->Options|=$this->OptionsMap[$name]; + } + else + { + $this->Options=$this->Options&~$this->OptionsMap[$name]; + } + } + + function getOption($name) + { + if( !isset($this->OptionsMap[$name]) ) die('undefined debugger option: ['.$name.']
'); + return ($this->Options & $this->OptionsMap[$name]) == $this->OptionsMap[$name]; + } + function dumpVars() { $dumpVars = func_get_args(); @@ -43,8 +88,7 @@ break; case 'var_dump': - $ret = highlight_string('', true); - $ret = preg_replace('/<\?php (.*)\?>/s','$1',$ret); + $ret = $this->highlightString( print_r($Data['value'], true) ); return addslashes($ret); break; @@ -202,6 +246,18 @@ return true; } + /** + * Move $debugLineCount lines of input from debug output + * end to beginning. + * + * @param int $debugLineCount + */ + function moveToBegin($debugLineCount) + { + $lines = array_splice($this->Data,count($this->Data)-$debugLineCount,$debugLineCount); + $this->Data = array_merge($lines,$this->Data); + } + function appendRequest() { $script = $_SERVER['PATH_TRANSLATED']; @@ -233,6 +289,16 @@ ob_end_clean(); } + function appendSession() + { + if( isset($_SESSION)&&$_SESSION ) + { + $this->appendHTML('PHP Session: ['.ini_get('session.name').']'); + $this->dumpVars($_SESSION); + $this->moveToBegin(2); + } + } + function profileStart($key, $description) { $timeStamp = $this->getMoment(); @@ -298,6 +364,13 @@ */ function printReport($returnResult = false) { + // show php session if any + $this->appendSession(); + + // ensure, that 1st line of debug output always is this one: + $this->appendHTML('Hide Debugger'); + $this->moveToBegin(1); + $i = 0; $lineCount = count($this->Data); ob_start(); ?> @@ -387,7 +460,7 @@ if(!$e) $e = window.event; var $KeyCode = getEventKeyCode($e); //alert(showProps($e)); - if($KeyCode == 123 || $KeyCode == 68 && $e.shiftKey) // F12 (for Maxthon) or Ctrl+F2 (for Other Browsers) + if($KeyCode == 123 || $KeyCode == 27) // F12 or ESC { toggleDebugLayer(); $e.cancelBubble = true; @@ -514,7 +587,7 @@ ob_clean(); return $ret; } - else + else { ob_end_flush(); } @@ -538,7 +611,18 @@ trigger_error('Unknown error type ['.$errno.']', E_USER_ERROR); return false; } + if( strpos($errfile,'eval()\'d code') !== false ) + { + $errstr = '[EVAL, line '.$errline.']: '.$errstr; + $tmpStr = $errfile; + $pos = strpos($tmpStr,'('); + $errfile = substr($tmpStr,0,$pos); + $pos++; + $errline = substr($tmpStr,$pos,strpos($tmpStr,')',$pos)-$pos); + } + $this->Data[] = Array('no' => $errno, 'str' => $errstr, 'file' => $errfile, 'line' => $errline, 'context' => $errcontext, 'debug_type' => 'error'); + if( substr($errorType,0,5) == 'Fatal') { echo '';