diff options
author | Greg Aker <greg.aker@ellislab.com> | 2010-11-19 01:43:03 +0100 |
---|---|---|
committer | Greg Aker <greg.aker@ellislab.com> | 2010-11-19 01:43:03 +0100 |
commit | 3a563987be22b542a26c05b21a5691c9dd4ec7be (patch) | |
tree | 5e93d057f8bbef94c6a8a0be5c4d7f21bcb460cf /system | |
parent | 3080ee782b2f1c394bc6a1ba91be223f7260fda2 (diff) |
Updating Output Profiler to validate xHTML Strict, and HTML5.
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Profiler.php | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 4441a9fbe..e7d88b665 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -117,16 +117,16 @@ class CI_Profiler { // be modified. We also might want to make this data available to be logged $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_benchmarks" style="border:1px solid #900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#900;"> '.$this->CI->lang->line('profiler_benchmarks').' </legend>'; $output .= "\n"; - $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; + $output .= "\n\n<table style='width:100%'>\n"; foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "<tr><td style='width:50%;color:#000;font-weight:bold;background-color:#ddd;'>".$key." </td><td style='width:50%;color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; + $output .= "<tr><td style='padding:5px;width:50%;color:#000;font-weight:bold;background-color:#ddd;'>".$key." </td><td style='padding:5px;width:50%;color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; } $output .= "</table>\n"; @@ -158,12 +158,12 @@ class CI_Profiler { if (count($dbs) == 0) { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_queries" style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#0000FF;"> '.$this->CI->lang->line('profiler_queries').' </legend>'; $output .= "\n"; - $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' style='width:100%'>\n"; - $output .="<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n"; + $output .= "\n\n<table style='border:none; width:100%'>\n"; + $output .="<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n"; $output .= "</table>\n"; $output .= "</fieldset>"; @@ -184,11 +184,11 @@ class CI_Profiler { $output .= "\n"; $output .= '<legend style="color:#0000FF;"> '.$this->CI->lang->line('profiler_database').': '.$db->database.' '.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).' </legend>'; $output .= "\n"; - $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' style='width:100%;'>\n"; + $output .= "\n\n<table style='width:100%;'>\n"; if (count($db->queries) == 0) { - $output .= "<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_queries')."</td></tr>\n"; + $output .= "<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px;'>".$this->CI->lang->line('profiler_no_queries')."</td></tr>\n"; } else { @@ -203,7 +203,7 @@ class CI_Profiler { $val = str_replace($bold, '<strong>'.$bold.'</strong>', $val); } - $output .= "<tr><td valign='top' style='width:1%;color:#900;font-weight:normal;background-color:#ddd;'>".$time." </td><td style='color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; + $output .= "<tr><td style='padding:5px; vertical-align: top;width:1%;color:#900;font-weight:normal;background-color:#ddd;'>".$time." </td><td style='padding:5px; color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n"; } } @@ -226,7 +226,7 @@ class CI_Profiler { protected function _compile_get() { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #cd6e00;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_get" style="border:1px solid #cd6e00;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#cd6e00;"> '.$this->CI->lang->line('profiler_get_data').' </legend>'; $output .= "\n"; @@ -237,7 +237,7 @@ class CI_Profiler { } else { - $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; + $output .= "\n\n<table style='width:100%; border:none'>\n"; foreach ($_GET as $key => $val) { @@ -246,7 +246,7 @@ class CI_Profiler { $key = "'".$key."'"; } - $output .= "<tr><td width='50%' style='color:#000;background-color:#ddd;'>$_GET[".$key."] </td><td width='50%' style='color:#cd6e00;font-weight:normal;background-color:#ddd;'>"; + $output .= "<tr><td style='width:50%;color:#000;background-color:#ddd;padding:5px'>$_GET[".$key."] </td><td style='width:50%;padding:5px;color:#cd6e00;font-weight:normal;background-color:#ddd;'>"; if (is_array($val)) { $output .= "<pre>" . htmlspecialchars(stripslashes(print_r($val, true))) . "</pre>"; @@ -275,7 +275,7 @@ class CI_Profiler { protected function _compile_post() { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #009900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_post" style="border:1px solid #009900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#009900;"> '.$this->CI->lang->line('profiler_post_data').' </legend>'; $output .= "\n"; @@ -286,7 +286,7 @@ class CI_Profiler { } else { - $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; + $output .= "\n\n<table style='width:100%'>\n"; foreach ($_POST as $key => $val) { @@ -295,7 +295,7 @@ class CI_Profiler { $key = "'".$key."'"; } - $output .= "<tr><td width='50%' style='color:#000;background-color:#ddd;'>$_POST[".$key."] </td><td width='50%' style='color:#009900;font-weight:normal;background-color:#ddd;'>"; + $output .= "<tr><td style='width:50%;padding:5px;color:#000;background-color:#ddd;'>$_POST[".$key."] </td><td style='width:50%;padding:5px;color:#009900;font-weight:normal;background-color:#ddd;'>"; if (is_array($val)) { $output .= "<pre>" . htmlspecialchars(stripslashes(print_r($val, TRUE))) . "</pre>"; @@ -324,7 +324,7 @@ class CI_Profiler { protected function _compile_uri_string() { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_uri_string" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#000;"> '.$this->CI->lang->line('profiler_uri_string').' </legend>'; $output .= "\n"; @@ -353,14 +353,13 @@ class CI_Profiler { protected function _compile_controller_info() { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #995300;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_controller_info" style="border:1px solid #995300;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#995300;"> '.$this->CI->lang->line('profiler_controller_info').' </legend>'; $output .= "\n"; $output .= "<div style='color:#995300;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."</div>"; - $output .= "</fieldset>"; return $output; @@ -378,7 +377,7 @@ class CI_Profiler { protected function _compile_memory_usage() { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #5a0099;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_memory_usage" style="border:1px solid #5a0099;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#5a0099;"> '.$this->CI->lang->line('profiler_memory_usage').' </legend>'; $output .= "\n"; @@ -409,17 +408,17 @@ class CI_Profiler { protected function _compile_http_headers() { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_http_headers" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#000;"> '.$this->CI->lang->line('profiler_headers').' </legend>'; $output .= "\n"; - $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; + $output .= "\n\n<table style='width:100%'>\n"; foreach(array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) { $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; - $output .= "<tr><td valign='top' style='color:#900;background-color:#ddd;'>".$header." </td><td style='color:#000;background-color:#ddd;'>".$val."</td></tr>\n"; + $output .= "<tr><td style='vertical-align: top;width:50%;padding:5px;color:#900;background-color:#ddd;'>".$header." </td><td style='width:50%;padding:5px;color:#000;background-color:#ddd;'>".$val."</td></tr>\n"; } $output .= "</table>\n"; @@ -440,12 +439,12 @@ class CI_Profiler { protected function _compile_config() { $output = "\n\n"; - $output .= '<fieldset style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; + $output .= '<fieldset id="ci_profiler_config" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; $output .= "\n"; $output .= '<legend style="color:#000;"> '.$this->CI->lang->line('profiler_config').' </legend>'; $output .= "\n"; - $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; + $output .= "\n\n<table style='width:100%'>\n"; foreach($this->CI->config->config as $config=>$val) { @@ -454,7 +453,7 @@ class CI_Profiler { $val = print_r($val, TRUE); } - $output .= "<tr><td valign='top' style='color:#900;background-color:#ddd;'>".$config." </td><td style='color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n"; + $output .= "<tr><td style='padding:5px; vertical-align: top;color:#900;background-color:#ddd;'>".$config." </td><td style='padding:5px; color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n"; } $output .= "</table>\n"; |