(merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60259 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-08-10 22:52:52 +00:00
parent a1f37b93eb
commit 7b26120582
3 changed files with 29 additions and 0 deletions

View File

@ -170,6 +170,29 @@ class Debug {
}
}
/**
* Log to a standard text file output.
*
* @param $message string to output
*/
static function log($message) {
$file = dirname(__FILE__).'/../../debug.log';
$now = date('r');
$oldcontent = file_get_contents($file);
$content = $oldcontent . "\n\n== $now ==\n$message\n";
file_put_contents($file, $content);
}
private static $warning_pos = 220;
static function warning($notice) {
echo '<div style="background-color:#ccc;border:3px solid #999;position:absolute;right:0;bottom:'.self::$warning_pos.'px;">';
echo '<h6>Warning:</h6>';
echo '<p>'.$notice.'</p>';
echo '</div>';
self::$warning_pos = self::$warning_pos-50;
}
/**
* Load error handlers into environment
*/

View File

@ -1,4 +1,9 @@
<?php
/**
* @package sapphire
* @subpackage dev
*/
/**
* A basic HTML wrapper for stylish rendering of a developement info view.
* Used to output error messages, and test results.

View File

@ -88,6 +88,7 @@ class ConfirmedPasswordField extends FormField {
function Field() {
Requirements::javascript('jsparty/prototype.js');
Requirements::javascript('jsparty/behaviour.js');
Requirements::javascript('jsparty/prototype_improvements.js');
Requirements::javascript('sapphire/javascript/ConfirmedPasswordField.js');
$content = '';