Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

This commit is contained in:
Jose Lorenzo Rodriguez 2011-09-03 07:05:48 -04:30
commit 2bca1435ab
18 changed files with 312 additions and 154 deletions

View file

@ -56,7 +56,7 @@ h2 {
font-size: 190%; font-size: 190%;
} }
h3 { h3 {
color: #993; color: #2c6877;
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif; font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
font-size: 165%; font-size: 165%;
} }
@ -67,6 +67,9 @@ h4 {
ul, li { ul, li {
margin: 0 12px; margin: 0 12px;
} }
p {
margin: 0 0 1em 0;
}
/** Layout **/ /** Layout **/
#container { #container {
@ -158,7 +161,7 @@ table tr td {
border-bottom:1px solid #ddd; border-bottom:1px solid #ddd;
} }
table tr:nth-child(even) { table tr:nth-child(even) {
background: #f5f5f5; background: #f9f9f9;
} }
td.actions { td.actions {
text-align: center; text-align: center;
@ -168,6 +171,8 @@ table td.actions a {
margin: 0px 6px; margin: 0px 6px;
padding:2px 5px; padding:2px 5px;
} }
/* SQL log */
.cake-sql-log { .cake-sql-log {
background: #fff; background: #fff;
} }
@ -181,21 +186,48 @@ table td.actions a {
} }
/** Paging **/ /** Paging **/
div.paging { .paging {
background:#fff; background:#fff;
color: #ccc; color: #ccc;
margin-top: 1em; margin-top: 1em;
clear:both; clear:both;
} }
div.paging span.disabled { .paging .current,
.paging .disabled,
.paging a {
text-decoration: none;
padding: 5px 8px;
display: inline-block
}
.paging > span {
display: inline-block;
border: 1px solid #ccc;
border-left: 0;
}
.paging > span:hover {
background: #efefef;
}
.paging .prev {
border-left: 1px solid #ccc;
-moz-border-radius: 4px 0 0 4px;
-webkit-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
.paging .next {
-moz-border-radius: 0 4px 4px 0;
-webkit-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
.paging .disabled {
color: #ddd; color: #ddd;
display: inline;
} }
div.paging span.current { .paging .disabled:hover {
background: transparent;
}
.paging .current {
background: #efefef;
color: #c73e14; color: #c73e14;
} }
div.paging span a {
}
/** Scaffold View **/ /** Scaffold View **/
dl { dl {
@ -228,20 +260,18 @@ form {
width: 95%; width: 95%;
} }
fieldset { fieldset {
border: 1px solid #ccc; border: none;
margin-bottom: 1em; margin-bottom: 1em;
padding: 16px 20px; padding: 16px 10px;
} }
fieldset legend { fieldset legend {
background:#fff;
color: #e32; color: #e32;
font-size: 160%; font-size: 160%;
font-weight: bold; font-weight: bold;
} }
fieldset fieldset { fieldset fieldset {
margin-top: 0px; margin-top: 0;
margin-bottom: 20px; padding: 10px 0 0;
padding: 16px 10px;
} }
fieldset fieldset legend { fieldset fieldset legend {
font-size: 120%; font-size: 120%;
@ -309,10 +339,13 @@ div.checkbox label {
input[type=radio] { input[type=radio] {
float:left; float:left;
width:auto; width:auto;
margin: 0 3px 7px 0; margin: 6px 0;
padding: 0;
line-height: 26px;
} }
div.radio label { .radio label {
margin: 0 0 6px 20px; margin: 0 0 6px 20px;
line-height: 26px;
} }
input[type=submit] { input[type=submit] {
display: inline; display: inline;
@ -321,109 +354,201 @@ input[type=submit] {
} }
form .submit input[type=submit] { form .submit input[type=submit] {
background:#62af56; background:#62af56;
background: -webkit-gradient(linear, left top, left bottom, from(#a8ea9c), to(#62af56)); background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
background-image: -moz-linear-gradient(top, #a8ea9c, #62af56); background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
border-color: #2d6324; border-color: #2d6324;
color: #000; color: #fff;
text-shadow: #8cee7c 0px 1px 0px; text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px;
padding: 8px 10px;
} }
form .submit input[type=submit]:hover { form .submit input[type=submit]:hover {
background:#4ca83d; background: #5BA150;
background: -webkit-gradient(linear, left top, left bottom, from(#85e573), to(#4ca83d)); }
background-image: -moz-linear-gradient(top, #85e573, #4ca83d); /* Form errors */
form .error {
background: #FFDACC;
-moz-order-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
font-weight: normal;
}
form .error-message {
-moz-border-radius: none;
-webkit-border-radius: none;
border-radius: none;
border: none;
background: none;
margin: 0;
padding-left: 4px;
padding-right: 0;
}
form .error,
form .error-message {
color: #9E2424;
-webkit-box-shadow: none;
-moz-box-shadow: none;
-ms-box-shadow: none;
-o-box-shadow: none;
box-shadow: none;
text-shadow: none;
} }
/** Notices and Errors **/ /** Notices and Errors **/
div.message { .message {
clear: both; clear: both;
color: #fff; color: #fff;
font-size: 140%; font-size: 140%;
font-weight: bold; font-weight: bold;
margin: 0 0 1em 0; margin: 0 0 1em 0;
background: #c73e14;
padding: 5px; padding: 5px;
} }
div.error-message {
.success,
.message,
.cake-error,
.cake-debug,
.notice,
p.error,
.error-message {
background: #ffcc00;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #ffcc00, #E6B800);
background-image: -ms-linear-gradient(top, #ffcc00, #E6B800);
background-image: -webkit-linear-gradient(top, #ffcc00, #E6B800);
background-image: -o-linear-gradient(top, #ffcc00, #E6B800);
background-image: linear-gradient(top, #ffcc00, #E6B800);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border: 1px solid rgba(0, 0, 0, 0.2);
margin-bottom: 18px;
padding: 7px 14px;
color: #404040;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.success,
.message,
.cake-error,
p.error,
.error-message {
clear: both; clear: both;
color: #fff; color: #fff;
font-weight: bold; background: #c43c35;
background: #c73e14; border: 1px solid rgba(0, 0, 0, 0.5);
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
background-image: linear-gradient(top, #ee5f5b, #c43c35);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.success {
clear: both;
color: #fff;
border: 1px solid rgba(0, 0, 0, 0.5);
background: #3B8230;
background-repeat: repeat-x;
background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
background-image: -ms-linear-gradient(top, #76BF6B, #3B8230);
background-image: -o-linear-gradient(top, #76BF6B, #3B8230);
background-image: linear-gradient(top, #76BF6B, #3B8230);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
} }
p.error { p.error {
background-color: #e32; font-family: Monaco, Consolas, Courier, monospace;
color: #fff;
font-family: Courier, monospace;
font-size: 120%; font-size: 120%;
line-height: 140%;
padding: 0.8em; padding: 0.8em;
margin: 1em 0; margin: 1em 0;
} }
p.error em { p.error em {
color: #000;
font-weight: normal; font-weight: normal;
line-height: 140%; line-height: 140%;
} }
.notice { .notice {
background: #ffcc00;
color: #000; color: #000;
display: block; display: block;
font-family: Courier, monospace;
font-size: 120%; font-size: 120%;
line-height: 140%;
padding: 0.8em; padding: 0.8em;
margin: 1em 0; margin: 1em 0;
} }
.success { .success {
background: green;
color: #fff; color: #fff;
} }
/** Actions **/ /** Actions **/
div.actions ul { .actions ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
div.actions li { .actions li {
margin:0 0 0.5em 0; margin:0 0 0.5em 0;
list-style-type: none; list-style-type: none;
white-space: nowrap; white-space: nowrap;
padding: 0; padding: 0;
} }
div.actions ul li a { .actions ul li a {
font-weight: normal; font-weight: normal;
display: block; display: block;
clear: both; clear: both;
} }
div.actions ul li a:hover {
text-decoration: underline;
}
/* Buttons and button links */
input[type=submit], input[type=submit],
div.actions ul li a, .actions ul li a,
td.actions a { .actions a {
font-weight:normal; font-weight:normal;
padding: 4px 8px; padding: 4px 8px;
background:#e6e49f; background: #dcdcdc;
background: -webkit-gradient(linear, left top, left bottom, from(#f1f1d4), to(#e6e49f)); background-image: -webkit-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -moz-linear-gradient(top, #f1f1d4, #e6e49f); background-image: -moz-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -ms-linear-gradient(top, #fefefe, #dcdcdc);
background-image: -o-linear-gradient(top, #fefefe, #dcdcdc);
background-image: linear-gradient(top, #fefefe, #dcdcdc);
color:#333; color:#333;
border:1px solid #aaac62; border:1px solid #bbb;
-webkit-border-radius:8px; -webkit-border-radius: 4px;
-moz-border-radius:8px; -moz-border-radius: 4px;
border-radius:8px; border-radius: 4px;
text-decoration:none; text-decoration: none;
text-shadow: #fff 0px 1px 0px; text-shadow: #fff 0px 1px 0px;
min-width: 0; min-width: 0;
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
-webkit-user-select: none;
user-select: none;
} }
input[type=submit]:hover, .actions ul li a:hover,
div.actions ul li a:hover, .actions a:hover {
td.actions a:hover { background: #ededed;
background: #f0f09a; border-color: #acacac;
background: -webkit-gradient(linear, left top, left bottom, from(#f7f7e1), to(#eeeca9)); text-decoration: none;
}
input[type=submit]:active,
.actions ul li a:active,
.actions a:active {
background: #eee;
background-image: -webkit-linear-gradient(top, #dfdfdf, #eee);
background-image: -moz-linear-gradient(top, #dfdfdf, #eee);
background-image: -ms-linear-gradient(top, #dfdfdf, #eee);
background-image: -o-linear-gradient(top, #dfdfdf, #eee);
background-image: linear-gradient(top, #dfdfdf, #eee);
text-shadow: #eee 0px 1px 0px;
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
border-color: #aaa;
text-decoration: none;
} }
/** Related **/ /** Related **/
div.related { .related {
clear: both; clear: both;
display: block; display: block;
} }
@ -432,38 +557,92 @@ div.related {
pre { pre {
color: #000; color: #000;
background: #f0f0f0; background: #f0f0f0;
padding: 1em; padding: 15px;
-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
} }
pre.cake-debug { .cake-debug-output {
background: #ffcc00; padding: 0;
font-size: 120%;
line-height: 140%;
margin-top: 1em;
overflow: auto;
position: relative; position: relative;
} }
div.cake-stack-trace { .cake-debug-output > span {
background: #fff; position: absolute;
top: 5px;
right: 5px;
background: rgba(255, 255, 255, 0.3);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
padding: 5px 6px;
color: #000;
display: block;
float: left;
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}
.cake-debug,
.cake-error {
font-size: 16px;
line-height: 20px;
clear: both;
}
.cake-error > a {
text-shadow: none;
}
.cake-error {
white-space: normal;
}
.cake-stack-trace {
background: rgba(255, 255, 255, 0.7);
color: #333; color: #333;
margin: 0px; margin: 10px 0 5px 0;
padding: 6px; padding: 10px 10px 0 10px;
font-size: 120%; font-size: 120%;
line-height: 140%; line-height: 140%;
overflow: auto; overflow: auto;
position: relative; position: relative;
-moz-border-radius: 4px;
-wekbkit-border-radius: 4px;
border-radius: 4px;
} }
div.cake-code-dump pre { .cake-stack-trace a {
text-shadow: none;
background: rgba(255, 255, 255, 0.7);
padding: 5px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin: 0px 4px 10px 2px;
font-family: sans-serif;
font-size: 14px;
line-height: 14px;
display: inline-block;
text-decoration: none;
-moz-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
}
.cake-code-dump pre {
position: relative; position: relative;
overflow: auto; overflow: auto;
} }
div.cake-stack-trace pre, div.cake-code-dump pre { .cake-context {
margin-bottom: 10px;
}
.cake-stack-trace pre {
color: #000; color: #000;
background-color: #F0F0F0; background-color: #F0F0F0;
margin: 0px; margin: 0px 0 10px 0;
padding: 1em; padding: 1em;
overflow: auto; overflow: auto;
text-shadow: none;
} }
div.cake-code-dump pre, div.cake-code-dump pre code { /* excerpt */
.cake-code-dump pre,
.cake-code-dump pre code {
clear: both; clear: both;
font-size: 12px; font-size: 12px;
line-height: 15px; line-height: 15px;
@ -471,25 +650,25 @@ div.cake-code-dump pre, div.cake-code-dump pre code {
padding: 4px; padding: 4px;
overflow: auto; overflow: auto;
} }
div.cake-code-dump span.code-highlight { .cake-code-dump .code-highlight {
background-color: #ff0; display: block;
padding: 4px; background-color: rgba(255, 255, 0, 0.5);
} }
div.code-coverage-results div.code-line { .code-coverage-results div.code-line {
padding-left:5px; padding-left:5px;
display:block; display:block;
margin-left:10px; margin-left:10px;
} }
div.code-coverage-results div.uncovered span.content { .code-coverage-results div.uncovered span.content {
background:#ecc; background:#ecc;
} }
div.code-coverage-results div.covered span.content { .code-coverage-results div.covered span.content {
background:#cec; background:#cec;
} }
div.code-coverage-results div.ignored span.content { .code-coverage-results div.ignored span.content {
color:#aaa; color:#aaa;
} }
div.code-coverage-results span.line-num { .code-coverage-results span.line-num {
color:#666; color:#666;
display:block; display:block;
float:left; float:left;
@ -497,37 +676,37 @@ div.code-coverage-results span.line-num {
text-align:right; text-align:right;
margin-right:5px; margin-right:5px;
} }
div.code-coverage-results span.line-num strong { .code-coverage-results span.line-num strong {
color:#666; color:#666;
} }
div.code-coverage-results div.start { .code-coverage-results div.start {
border:1px solid #aaa; border:1px solid #aaa;
border-width:1px 1px 0px 1px; border-width:1px 1px 0px 1px;
margin-top:30px; margin-top:30px;
padding-top:5px; padding-top:5px;
} }
div.code-coverage-results div.end { .code-coverage-results div.end {
border:1px solid #aaa; border:1px solid #aaa;
border-width:0px 1px 1px 1px; border-width:0px 1px 1px 1px;
margin-bottom:30px; margin-bottom:30px;
padding-bottom:5px; padding-bottom:5px;
} }
div.code-coverage-results div.realstart { .code-coverage-results div.realstart {
margin-top:0px; margin-top:0px;
} }
div.code-coverage-results p.note { .code-coverage-results p.note {
color:#bbb; color:#bbb;
padding:5px; padding:5px;
margin:5px 0 10px; margin:5px 0 10px;
font-size:10px; font-size:10px;
} }
div.code-coverage-results span.result-bad { .code-coverage-results span.result-bad {
color: #a00; color: #a00;
} }
div.code-coverage-results span.result-ok { .code-coverage-results span.result-ok {
color: #fa0; color: #fa0;
} }
div.code-coverage-results span.result-good { .code-coverage-results span.result-good {
color: #0a0; color: #0a0;
} }

View file

@ -65,9 +65,13 @@
</p> </p>
<div class="paging"> <div class="paging">
<?php echo "\t<?php echo \$this->Paginator->prev('<< ' . __('previous'), array(), null, array('class'=>'disabled'));?>\n";?> <?php
| <?php echo "\t<?php echo \$this->Paginator->numbers();?>\n"?> | echo "<?php\n";
<?php echo "\t<?php echo \$this->Paginator->next(__('next') . ' >>', array(), null, array('class' => 'disabled'));?>\n";?> echo "\t\techo \$this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));\n";
echo "\t\techo \$this->Paginator->numbers(array('separator' => ''));\n";
echo "\t\techo \$this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));\n";
echo "\t?>\n";
?>
</div> </div>
</div> </div>
<div class="actions"> <div class="actions">

View file

@ -677,15 +677,15 @@ class BasicsTest extends CakeTestCase {
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s';
$this->assertPattern($pattern, $result); $this->assertRegExp($pattern, $result);
ob_start(); ob_start();
debug('<div>this-is-a-test</div>', true); debug('<div>this-is-a-test</div>', true);
$result = ob_get_clean(); $result = ob_get_clean();
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s'; $pattern .= '.*line.*' . (__LINE__ -4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
$this->assertPattern($pattern, $result); $this->assertRegExp($pattern, $result);
ob_start(); ob_start();
debug('<div>this-is-a-test</div>', false); debug('<div>this-is-a-test</div>', false);
@ -693,7 +693,7 @@ class BasicsTest extends CakeTestCase {
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*\<div\>this-is-a-test\<\/div\>.*/s'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*\<div\>this-is-a-test\<\/div\>.*/s';
$this->assertPattern($pattern, $result); $this->assertRegExp($pattern, $result);
} }
/** /**

View file

@ -128,7 +128,7 @@ class DebuggerTest extends CakeTestCase {
Debugger::output('html'); Debugger::output('html');
$wrong .= ''; $wrong .= '';
$result = ob_get_clean(); $result = ob_get_clean();
$this->assertPattern('/<pre class="cake-debug">.+<\/pre>/', $result); $this->assertPattern('/<pre class="cake-error">.+<\/pre>/', $result);
$this->assertPattern('/<b>Notice<\/b>/', $result); $this->assertPattern('/<b>Notice<\/b>/', $result);
$this->assertPattern('/variable:\s+wrong/', $result); $this->assertPattern('/variable:\s+wrong/', $result);
@ -137,7 +137,7 @@ class DebuggerTest extends CakeTestCase {
$buzz .= ''; $buzz .= '';
$result = explode('</a>', ob_get_clean()); $result = explode('</a>', ob_get_clean());
$this->assertTags($result[0], array( $this->assertTags($result[0], array(
'pre' => array('class' => 'cake-debug'), 'pre' => array('class' => 'cake-error'),
'a' => array( 'a' => array(
'href' => "javascript:void(0);", 'href' => "javascript:void(0);",
'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = " . 'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = " .
@ -250,6 +250,11 @@ class DebuggerTest extends CakeTestCase {
$this->assertTags($result, $data, true); $this->assertTags($result, $data, true);
} }
/**
* Test adding a format that is handled by a callback.
*
* @return void
*/
public function testAddFormatCallback() { public function testAddFormatCallback() {
set_error_handler('Debugger::showError'); set_error_handler('Debugger::showError');
$this->_restoreError = true; $this->_restoreError = true;

View file

@ -43,13 +43,6 @@ class Debugger {
*/ */
public $errors = array(); public $errors = array();
/**
* Contains the base URL for error code documentation.
*
* @var string
*/
public $helpPath = null;
/** /**
* The current output format. * The current output format.
* *
@ -77,8 +70,8 @@ class Debugger {
'links' => array() 'links' => array()
), ),
'html' => array( 'html' => array(
'trace' => '<pre class="cake-debug trace"><b>Trace</b> <p>{:trace}</p></pre>', 'trace' => '<pre class="cake-error trace"><b>Trace</b> <p>{:trace}</p></pre>',
'context' => '<pre class="cake-debug context"><b>Context</b> <p>{:context}</p></pre>' 'context' => '<pre class="cake-error context"><b>Context</b> <p>{:context}</p></pre>'
), ),
'txt' => array( 'txt' => array(
'error' => "{:error}: {:code} :: {:description} on line {:line} of {:path}\n{:info}", 'error' => "{:error}: {:code} :: {:description} on line {:line} of {:path}\n{:info}",
@ -114,7 +107,7 @@ class Debugger {
define('E_RECOVERABLE_ERROR', 4096); define('E_RECOVERABLE_ERROR', 4096);
} }
$e = '<pre class="cake-debug">'; $e = '<pre class="cake-error">';
$e .= '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-trace\')'; $e .= '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-trace\')';
$e .= '.style.display = (document.getElementById(\'{:id}-trace\').style.display == '; $e .= '.style.display = (document.getElementById(\'{:id}-trace\').style.display == ';
$e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} '; $e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} ';
@ -140,20 +133,19 @@ class Debugger {
$link .= '\'none\' ? \'\' : \'none\')">Context</a>'; $link .= '\'none\' ? \'\' : \'none\')">Context</a>';
$links['context'] = $link; $links['context'] = $link;
$links['help'] = '<a href="{:helpPath}{:code}" target="_blank">Help</a>';
$this->_templates['js']['links'] = $links; $this->_templates['js']['links'] = $links;
$this->_templates['js']['context'] = '<pre id="{:id}-context" class="cake-context" '; $this->_templates['js']['context'] = '<pre id="{:id}-context" class="cake-context" ';
$this->_templates['js']['context'] .= 'style="display: none;">{:context}</pre>'; $this->_templates['js']['context'] .= 'style="display: none;">{:context}</pre>';
$this->_templates['js']['code'] = '<div id="{:id}-code" class="cake-code-dump" '; $this->_templates['js']['code'] = '<pre id="{:id}-code" class="cake-code-dump" ';
$this->_templates['js']['code'] .= 'style="display: none;"><pre>{:code}</pre></div>'; $this->_templates['js']['code'] .= 'style="display: none;">{:code}</pre>';
$e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} '; $e = '<pre class="cake-error"><b>{:error}</b> ({:code}) : {:description} ';
$e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>'; $e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>';
$this->_templates['html']['error'] = $e; $this->_templates['html']['error'] = $e;
$this->_templates['html']['context'] = '<pre class="cake-debug context"><b>Context</b> '; $this->_templates['html']['context'] = '<pre class="cake-context"><b>Context</b> ';
$this->_templates['html']['context'] .= '<p>{:context}</p></pre>'; $this->_templates['html']['context'] .= '<p>{:context}</p></pre>';
} }
@ -168,17 +160,10 @@ class Debugger {
if (!empty($class)) { if (!empty($class)) {
if (!$instance || strtolower($class) != strtolower(get_class($instance[0]))) { if (!$instance || strtolower($class) != strtolower(get_class($instance[0]))) {
$instance[0] = new $class(); $instance[0] = new $class();
if (Configure::read('debug') > 0) {
$instance[0]->helpPath = Configure::read('Cake.Debugger.HelpPath');
}
} }
} }
if (!$instance) { if (!$instance) {
$instance[0] = new Debugger(); $instance[0] = new Debugger();
if (Configure::read('debug') > 0) {
$instance[0]->helpPath = Configure::read('Cake.Debugger.HelpPath');
}
} }
return $instance[0]; return $instance[0];
} }
@ -219,6 +204,7 @@ class Debugger {
* @param integer $line Line that triggered the error * @param integer $line Line that triggered the error
* @param array $context Context * @param array $context Context
* @return boolean true if error was handled * @return boolean true if error was handled
* @deprecated This function is supersceeded by Debugger::outputError()
*/ */
public static function showError($code, $description, $file = null, $line = null, $context = null) { public static function showError($code, $description, $file = null, $line = null, $context = null) {
$_this = Debugger::getInstance(); $_this = Debugger::getInstance();
@ -264,15 +250,8 @@ class Debugger {
break; break;
} }
if (!empty($_this->helpPath) && preg_match('/.*\[([0-9]+)\]$/', $description, $codes)) {
if (isset($codes[1])) {
$helpID = $codes[1];
$description = trim(preg_replace('/\[[0-9]+\]$/', '', $description));
}
}
$data = compact( $data = compact(
'level', 'error', 'code', 'helpID', 'description', 'file', 'path', 'line', 'context' 'level', 'error', 'code', 'description', 'file', 'path', 'line', 'context'
); );
echo $_this->outputError($data); echo $_this->outputError($data);
@ -662,12 +641,11 @@ class Debugger {
'level' => 0, 'level' => 0,
'error' => 0, 'error' => 0,
'code' => 0, 'code' => 0,
'helpID' => null,
'description' => '', 'description' => '',
'file' => '', 'file' => '',
'line' => 0, 'line' => 0,
'context' => array(), 'context' => array(),
'start' => 2 'start' => 2,
); );
$data += $defaults; $data += $defaults;
@ -694,13 +672,13 @@ class Debugger {
$data['id'] = 'cakeErr' . uniqid(); $data['id'] = 'cakeErr' . uniqid();
$tpl = array_merge($this->_templates['base'], $this->_templates[$this->_outputFormat]); $tpl = array_merge($this->_templates['base'], $this->_templates[$this->_outputFormat]);
$insert = array('context' => join("\n", $context), 'helpPath' => $this->helpPath) + $data; $insert = array('context' => join("\n", $context)) + $data;
$detect = array('help' => 'helpID', 'context' => 'context'); $detect = array('context');
if (isset($tpl['links'])) { if (isset($tpl['links'])) {
foreach ($tpl['links'] as $key => $val) { foreach ($tpl['links'] as $key => $val) {
if (isset($detect[$key]) && empty($insert[$detect[$key]])) { if (in_array($key, $detect) && empty($insert[$key])) {
continue; continue;
} }
$links[$key] = String::insert($val, $insert, $insertOpts); $links[$key] = String::insert($val, $insert, $insertOpts);
@ -716,7 +694,7 @@ class Debugger {
} }
$info .= String::insert($tpl[$key], compact($key) + $insert, $insertOpts); $info .= String::insert($tpl[$key], compact($key) + $insert, $insertOpts);
} }
$links = join(' | ', $links); $links = join(' ', $links);
unset($data['context']); unset($data['context']);
if (isset($tpl['callback']) && is_callable($tpl['callback'])) { if (isset($tpl['callback']) && is_callable($tpl['callback'])) {
return call_user_func($tpl['callback'], $data, compact('links', 'info')); return call_user_func($tpl['callback'], $data, compact('links', 'info'));

View file

@ -34,7 +34,6 @@ class <?php echo $controller;?> extends AppController {
} }
</strong> </strong>
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -30,7 +30,6 @@
class <?php echo $class;?> extends ModelBehavior { class <?php echo $class;?> extends ModelBehavior {
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -30,7 +30,6 @@
class <?php echo $class;?> extends ModelBehavior { class <?php echo $class;?> extends ModelBehavior {
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -30,7 +30,6 @@
class <?php echo $class;?> extends Component {<br /> class <?php echo $class;?> extends Component {<br />
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -30,7 +30,6 @@
class <?php echo $class;?> extends Component {<br /> class <?php echo $class;?> extends Component {<br />
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -30,7 +30,6 @@
class <?php echo $controller;?> extends AppController { class <?php echo $controller;?> extends AppController {
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -30,7 +30,6 @@
class <?php echo $class;?> extends AppHelper { class <?php echo $class;?> extends AppHelper {
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -30,7 +30,6 @@
class <?php echo $class;?> extends AppHelper { class <?php echo $class;?> extends AppHelper {
} }
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>

View file

@ -28,7 +28,7 @@
<pre> <pre>
&lt;?php &lt;?php
CakePlugin::load('<?php echo $plugin?>'); CakePlugin::load('<?php echo $plugin?>');
?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __d('cake_dev', 'Loading all plugins'); ?>: </strong> <strong><?php echo __d('cake_dev', 'Loading all plugins'); ?>: </strong>

View file

@ -30,7 +30,7 @@
function _scaffoldError() {<br /> function _scaffoldError() {<br />
} }
?&gt;
</pre> </pre>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -170,8 +170,4 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li> <ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
<li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a> <li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li> <ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>
<li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php echo __d('cake_dev', 'Book Store'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Recommended Software Books'); ?></li></ul></li>
<li><a href="http://www.cafepress.com/cakefoundation"><?php echo __d('cake_dev', 'CakePHP gear'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
</ul> </ul>

View file

@ -67,9 +67,11 @@ endforeach;
)); ));
?></p> ?></p>
<div class="paging"> <div class="paging">
<?php echo $this->Paginator->prev('<< ' . __d('cake', 'previous'), array(), null, array('class' => 'disabled')); ?> <?php
| <?php echo $this->Paginator->numbers(); ?> echo $this->Paginator->prev('< ' . __d('cake', 'previous'), array(), null, array('class' => 'prev disabled'));
<?php echo $this->Paginator->next(__d('cake', 'next') .' >>', array(), null, array('class' => 'disabled')); ?> echo $this->Paginator->numbers(array('separator' => ''));
echo $this->Paginator->next(__d('cake', 'next') .' >', array(), null, array('class' => 'next disabled'));
?>
</div> </div>
</div> </div>
<div class="actions"> <div class="actions">

View file

@ -82,10 +82,12 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
$line = $calledFrom[0]['line']; $line = $calledFrom[0]['line'];
} }
$html = <<<HTML $html = <<<HTML
<strong>%s</strong> (line <strong>%s</strong>) <div class="cake-debug-output">
<span><strong>%s</strong> (line <strong>%s</strong>)</span>
<pre class="cake-debug"> <pre class="cake-debug">
%s %s
</pre> </pre>
</div>
HTML; HTML;
$text = <<<TEXT $text = <<<TEXT
@ -104,7 +106,7 @@ TEXT;
} }
$var = print_r($var, true); $var = print_r($var, true);
if ($showHtml) { if ($showHtml) {
$var = str_replace(array('<', '>'), array('&lt;', '&gt;'), $var); $var = htmlentities($var);
} }
printf($template, $file, $line, $var); printf($template, $file, $line, $var);
} }