73609e8ba9b0f5910f7a2f09f6bf2df8fb979a64
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Messaging / ErrorpageMessage.php
1 <?php
2 namespace TYPO3\CMS\Core\Messaging;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
17
18 /**
19 * A class representing error messages shown on a page.
20 * Classic Example: "No pages are found on rootlevel"
21 */
22 class ErrorpageMessage extends AbstractStandaloneMessage
23 {
24 /**
25 * Constructor for an Error message
26 *
27 * @param string $message The error message
28 * @param string $title Title of the message, can be empty
29 * @param int $severity Optional severity, must be either of AbstractMessage::INFO or related constants
30 */
31 public function __construct($message = '', $title = '', $severity = AbstractMessage::ERROR)
32 {
33 $this->setHtmlTemplate(ExtensionManagementUtility::siteRelPath('core') . 'Resources/Private/Templates/Page/Error.html');
34 parent::__construct($message, $title, $severity);
35 }
36
37 /**
38 * Returns the default markers for the template, with some additional parameters for the error page.
39 *
40 * @return array
41 */
42 protected function getDefaultMarkers()
43 {
44 $defaultMarkers = parent::getDefaultMarkers();
45 $defaultMarkers['###EXTPATH_CORE###'] = ExtensionManagementUtility::siteRelPath('core');
46 $defaultMarkers['###EXTPATH_BACKEND###'] = ExtensionManagementUtility::siteRelPath('backend');
47 return $defaultMarkers;
48 }
49 }