MINOR ErrorPage removal of ShowInMenus explicitly being set - this is done using static $defaults on the class itself.

MINOR ErrorPage phpDoc updates - removal of non-existant token @usedby, replaced with @see
MINOR Code formatting changes to be more consistent

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64502 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-10-18 22:31:04 +00:00
parent 9025c57e4b
commit ee5b0e2447

View File

@ -7,8 +7,9 @@
* This enables us to show errors even if PHP experiences a recoverable error.
* ErrorPages
*
* @see Debug::friendlyError()
*
* @package cms
* @usedby Debug::friendlyError()
*/
class ErrorPage extends Page {
@ -22,24 +23,24 @@ class ErrorPage extends Page {
);
/**
* Ensures that there is always a 404 page.
* Ensures that there is always a 404 page
* by checking if there's an instance of
* ErrorPage with a 404 error code. If there
* is not, one is created when the DB is built.
*/
function requireDefaultRecords() {
parent::requireDefaultRecords();
if(!DataObject::get_one("ErrorPage", "ErrorCode = '404'")) {
if(!DataObject::get_one('ErrorPage', "ErrorCode = '404'")) {
$errorpage = new ErrorPage();
$errorpage->ErrorCode = 404;
$errorpage->Title = _t('ErrorPage.DEFAULTERRORPAGETITLE', 'Page not found');
$errorpage->URLSegment = "page-not-found";
$errorpage->ShowInMenus = false;
$errorpage->URLSegment = 'page-not-found';
$errorpage->Content = _t('ErrorPage.DEFAULTERRORPAGECONTENT', '<p>Sorry, it seems you were trying to access a page that doesn\'t exist.</p><p>Please check the spelling of the URL you were trying to access and try again.</p>');
$errorpage->Status = "New page";
$errorpage->Status = 'New page';
$errorpage->write();
// Don't publish, as the manifest may not be built yet
// $errorpage->publish("Stage", "Live");
Database::alteration_message("404 page created","created");
Database::alteration_message('404 page created', 'created');
}
}