Browse Source

Removed unnecessary markup from error views

tags/2.0.0-beta
Alexander Makarov 13 years ago
parent
commit
6caad53ade
  1. 14
      framework/views/error.php
  2. 34
      framework/views/exception.php

14
framework/views/error.php

@ -8,11 +8,10 @@ $owner = $this->owner;
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta charset="utf-8" />
<title><?php echo get_class($exception); ?></title> <title><?php echo get_class($exception)?></title>
<style type="text/css"> <style>
/*<![CDATA[*/
body { body {
font: normal 9pt "Verdana"; font: normal 9pt "Verdana";
color: #000; color: #000;
@ -47,12 +46,11 @@ $owner = $this->owner;
padding-top: 1em; padding-top: 1em;
margin-bottom: 1em; margin-bottom: 1em;
} }
/*]]>*/
</style> </style>
</head> </head>
<body> <body>
<h1><?php echo get_class($exception); ?></h1> <h1><?php echo get_class($exception)?></h1>
<h2><?php echo nl2br($owner->htmlEncode($exception->getMessage()))?> </h2> <h2><?php echo nl2br($owner->htmlEncode($exception->getMessage()))?> </h2>
<p> <p>
The above error occurred while the Web server was processing your request. The above error occurred while the Web server was processing your request.
@ -61,8 +59,8 @@ $owner = $this->owner;
Please contact us if you think this is a server error. Thank you. Please contact us if you think this is a server error. Thank you.
</p> </p>
<div class="version"> <div class="version">
<?php echo date('Y-m-d H:i:s', time()); ?> <?php echo date('Y-m-d H:i:s', time())?>
<?php echo YII_DEBUG ? $owner->versionInfo : ''; ?> <?php echo YII_DEBUG ? $owner->versionInfo : ''?>
</div> </div>
</body> </body>
</html> </html>

34
framework/views/exception.php

@ -8,10 +8,9 @@ $owner = $this->owner;
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta charset="utf-8" />
<title><?php echo get_class($exception); ?></title> <title><?php echo get_class($exception)?></title>
<style type="text/css"> <style>
/*<![CDATA[*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;} html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
body{line-height:1;} body{line-height:1;}
ol,ul{list-style:none;} ol,ul{list-style:none;}
@ -156,13 +155,12 @@ $owner = $this->owner;
.trace-file:hover { .trace-file:hover {
background: #f0ffff; background: #f0ffff;
} }
/*]]>*/
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<h1><?php echo get_class($exception); ?></h1> <h1><?php echo get_class($exception)?></h1>
<p class="message"> <p class="message">
<?php echo nl2br($owner->htmlEncode($exception->getMessage()))?> <?php echo nl2br($owner->htmlEncode($exception->getMessage()))?>
@ -170,26 +168,25 @@ $owner = $this->owner;
<div class="source"> <div class="source">
<p class="file"> <p class="file">
<?php echo $owner->htmlEncode($exception->getFile()) . '(' . $exception->getLine() . ')'; ?> <?php echo $owner->htmlEncode($exception->getFile()) . '(' . $exception->getLine() . ')'?>
</p> </p>
<?php if (YII_DEBUG) $owner->renderSourceCode($exception->getFile(), $exception->getLine(), $owner->maxSourceLines); ?> <?php if (YII_DEBUG) $owner->renderSourceCode($exception->getFile(), $exception->getLine(), $owner->maxSourceLines)?>
</div> </div>
<?php if (YII_DEBUG): ?> <?php if (YII_DEBUG):?>
<div class="traces"> <div class="traces">
<h2>Stack Trace</h2> <h2>Stack Trace</h2>
<?php $owner->renderTrace($exception->getTrace()); ?> <?php $owner->renderTrace($exception->getTrace())?>
</div> </div>
<?php endif; ?> <?php endif?>
<div class="version"> <div class="version">
<?php echo date('Y-m-d H:i:s', time()); ?> <?php echo date('Y-m-d H:i:s', time())?>
<?php echo YII_DEBUG ? $owner->versionInfo : ''; ?> <?php echo YII_DEBUG ? $owner->versionInfo : ''?>
</div> </div>
</div> </div>
<script type="text/javascript"> <script>
/*<![CDATA[*/
var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)"); var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)");
var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)"); var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)");
@ -198,14 +195,15 @@ for(var j=0,len=e.length;j<len;j++){
if(traceReg.test(e[j].className)){ if(traceReg.test(e[j].className)){
e[j].onclick = function(){ e[j].onclick = function(){
var trace = this.parentNode.parentNode; var trace = this.parentNode.parentNode;
if(collapsedReg.test(trace.className)) if(collapsedReg.test(trace.className)){
trace.className = trace.className.replace("collapsed", "expanded"); trace.className = trace.className.replace("collapsed", "expanded");
else }
else{
trace.className = trace.className.replace("expanded", "collapsed"); trace.className = trace.className.replace("expanded", "collapsed");
}
} }
} }
} }
/*]]>*/
</script> </script>
</body> </body>

Loading…
Cancel
Save