array( 'title' => 'User Error', 'class' => 'error' ), E_CORE_ERROR => array( 'title' => 'Core Error', 'class' => 'error' ), E_NOTICE => array( 'title' => 'Notice', 'class' => 'notice' ), E_USER_NOTICE => array( 'title' => 'User Notice', 'class' => 'notice' ), E_CORE_ERROR => array( 'title' => 'Core Error', 'class' => 'error' ), E_WARNING => array( 'title' => 'Warning', 'class' => 'warning' ), E_CORE_WARNING => array( 'title' => 'Core Warning', 'class' => 'warning' ), E_USER_WARNING => array( 'title' => 'User Warning', 'class' => 'warning' ) ); /** * Generate breadcrumb links to the URL path being displayed * * @return string */ public function Breadcrumbs() { $basePath = str_replace(Director::protocolAndHost(), '', Director::absoluteBaseURL()); $relPath = parse_url(substr($_SERVER['REQUEST_URI'], strlen($basePath), strlen($_SERVER['REQUEST_URI'])), PHP_URL_PATH); $parts = explode('/', $relPath); $base = Director::absoluteBaseURL(); $pathPart = ""; $pathLinks = array(); foreach($parts as $part) { if ($part != '') { $pathPart .= "$part/"; $pathLinks[] = "$part"; } } return implode('→ ', $pathLinks); } /** * Render HTML header for development views */ public function writeHeader() { $url = htmlentities( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'], ENT_COMPAT, 'UTF-8' ); echo '' . $url . ''; echo ''; echo ''; } /** * Render the information header for the view * * @param string $title * @param string $title */ public function writeInfo($title, $subtitle, $description=false) { echo '
'; echo "

" . Convert::raw2xml($title) . "

"; if($subtitle) echo "

" . Convert::raw2xml($subtitle) . "

"; if ($description) { echo "

$description

"; } else { echo $this->Breadcrumbs(); } echo '
'; } /** * Render HTML footer for development views */ public function writeFooter() { echo ""; } /** * Write information about the error to the screen */ public function writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext) { $errorType = self::$error_types[$errno]; $httpRequestEnt = htmlentities($httpRequest); echo '
'; echo "

[" . $errorType['title'] . '] ' . strip_tags($errstr) . "

"; echo "

$httpRequestEnt

"; echo "

Line $errline in $errfile

"; echo '
'; } /** * Write a fragment of the a source file * @param $lines An array of file lines; the keys should be the original line numbers */ function writeSourceFragment($lines, $errline) { echo '

Source

'; echo '
';
		foreach($lines as $offset => $line) {
			$line = htmlentities($line, ENT_COMPAT, 'UTF-8');
			if ($offset == $errline) {
				echo "$offset $line";
			} else {
				echo "$offset $line";
			}
		}
		echo '
'; } /** * Write a backtrace */ function writeTrace($trace) { echo '

Trace

'; echo SS_Backtrace::get_rendered_backtrace($trace); echo '
'; } /** * @param string $text */ function writeParagraph($text) { echo '

' . $text . '

'; } } ?>