/** * print a message to the debug window * * @access public * @param $mesg string message to display * @return null * @global */ function debug_msg($mesg) { debug_open_window(); print "<script language='JavaScript'>\n"; print "debugWindow.document.writeln('" . trim(nl2br($mesg)) . "<br>');\n"; print "self.focus();\n"; print "</script>\n"; }
function debug_var($name, $data) { debug_open_window(); $captured = explode("\n", debug_capture_print_r($data)); echo "<script language='JavaScript'>\n"; echo "debugWindow.document.writeln('<b>{$name}</b>');\n"; echo "debugWindow.document.writeln('<pre>');\n"; foreach ($captured as $line) { echo "debugWindow.document.writeln('" . debug_colorize_string($line) . "');\n"; } echo "debugWindow.document.writeln('</pre>');\n"; echo "self.focus();\n"; echo "</script>\n"; }
<form action="index.php" method="post" name="GeneralForm"> <input type="hidden" name="act" id="act" value="<?php echo $action; ?> "> </form> <p class="message" align="right"></p> <h1>Content Management System</h1> <div id="menu"> <?php if ($action != 'LOGIN' && $action != 'LOGOUT') { // Debugging - Fenster öffnen if ($_SESSION['debugging'] === true) { debug_open_window(); debug_var('Seite: ', $_SERVER['PHP_SELF']); debug_var('Action: ', $_REQUEST); debug_msg('Debugging ist aktiv'); debug_finish(); $message = 'Debugging: aktiv!'; } ?> <h2>Menu</h2> <ul> <li class="<?php set_class($action, 'NAVIGA'); ?> "><a href="#" onclick="javascript:start_form('naviga');"><?php echo $GLOBALS['CMS']['MENU01']; ?>
function menu($action) { global $menu_arr; // Debugging - Fenster �ffnen if ($_SESSION['debugging'] === true) { debug_open_window(); debug_var('Seite: ', $_SERVER['PHP_SELF']); debug_var('Action: ', $_REQUEST); debug_msg('Debugging ist aktiv'); debug_finish(); $message = 'Debugging: aktiv!'; } $html = ''; $html .= '<h2>Menu</h2>' . "\n"; $html .= '<ul>' . "\n"; if (in_array($GLOBALS['CMS']['MENU01'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'NAVIGA') . '"><a href="#" onclick="javascript:start_form(\'naviga\');">' . $GLOBALS['CMS']['MENU01'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU02'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'SEITEN') . '"><a href="#" onclick="javascript:start_form(\'seiten\');">' . $GLOBALS['CMS']['MENU02'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU11'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'FRGMNT') . '"><a href="#" onclick="javascript:start_form(\'frgmnt\');">' . $GLOBALS['CMS']['MENU11'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU12'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'ADDONS') . '"><a href="#" onclick="javascript:start_form(\'addons\');">' . $GLOBALS['CMS']['MENU12'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU03'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'MEDIEN') . '"><a href="#" onclick="javascript:start_form(\'medien\');">' . $GLOBALS['CMS']['MENU03'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU10'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'CONFIG') . '"><a href="#" onclick="javascript:start_form(\'config\');">' . $GLOBALS['CMS']['MENU10'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU06'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'XLINKS') . '"><a href="#" onclick="javascript:start_form(\'xlinks\');">' . $GLOBALS['CMS']['MENU06'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU07'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'BACKUP') . '"><a href="#" onclick="javascript:start_form(\'backup\');">' . $GLOBALS['CMS']['MENU07'] . '</a></li>' . "\n"; } if (in_array($GLOBALS['CMS']['MENU08'], $menu_arr)) { $html .= '<li class="' . set_class($action, 'DOKU') . '"><a href="#" onclick="javascript:start_form(\'docu\');">' . $GLOBALS['CMS']['MENU08'] . '</a></li>' . "\n"; } $html .= '<li class="even">' . "\n"; $html .= '<p><font color="#00CC00">' . $GLOBALS['TEXTE']['ANGEMELDET'] . ' ' . $_SESSION['username'] . '</font><br />' . "\n"; if ($message != '') { $html .= $message; } $html .= '</p>' . "\n"; $html .= '</li>' . "\n"; $html .= '<li class="even"><a href="#" onclick="javascript:start_form(\'logout\');">' . $GLOBALS['CMS']['MENU09'] . '</a></li>' . "\n"; $html .= '</ul>' . "\n"; return $html; }
/** * print a message to the debug window * * @access public * @param $mesg string message to display * @return null * @global */ function debug_msg($mesg) { $debug = $_SESSION['debug']; if (!$debug) {return;} $tmp1 = str_replace("'","\\'",$mesg); $tmp2 = str_replace("\n", '<br />', $tmp1); $tmp3 = trim($tmp2); // Write debug info to debug browser window debug_open_window(); print "<script type=text/javascript>\n"; print "debugWindow.document.writeln('".$tmp3."<br />');\n"; print "debugWindow.scrollTo(0,99999);\n"; print "self.focus();\n"; print "</script>\n"; // Write debug to log log_entry ("DEBUG: $mesg"); }