mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-18 16:18:47 +02:00
N°2847 Add message on alpha/development fatal error pages 🤫
This commit is contained in:
@@ -2430,4 +2430,11 @@ class utils
|
|||||||
$e = new CoreException($sMessage, null, '', $oException);
|
$e = new CoreException($sMessage, null, '', $oException);
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 3.0.0
|
||||||
|
*/
|
||||||
|
public static function IsEasterEggAllowed(){
|
||||||
|
return (stripos(ITOP_VERSION, 'alpha') !== false) || utils::IsDevelopmentEnvironment();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
css/errorpage.scss
Normal file
8
css/errorpage.scss
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
body{
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
#ibo-page-container{
|
||||||
|
flex-grow: 0;
|
||||||
|
height: auto;
|
||||||
|
border: 3px solid #CBD2D9;
|
||||||
|
}
|
||||||
23
dictionaries/ui/pages/en.dictionary.itop.errorpage.php
Normal file
23
dictionaries/ui/pages/en.dictionary.itop.errorpage.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2013-2020 Combodo SARL
|
||||||
|
*
|
||||||
|
* This file is part of iTop.
|
||||||
|
*
|
||||||
|
* iTop is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* iTop is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Navigation menu
|
||||||
|
Dict::Add('EN US', 'English', 'English', array(
|
||||||
|
'UI:ErrorPage:UnstableVersion' => 'You are using an alpha version that may be unstable or include bugs and unfinished features. If you think this error occurred because of this please send us your feedback!',
|
||||||
|
));
|
||||||
@@ -13,6 +13,7 @@ class ErrorPage extends NiceWebPage
|
|||||||
$this->add_linked_script("../js/jquery.blockUI.js");
|
$this->add_linked_script("../js/jquery.blockUI.js");
|
||||||
$this->add_linked_script("../setup/setup.js");
|
$this->add_linked_script("../setup/setup.js");
|
||||||
$this->add_saas("css/setup.scss");
|
$this->add_saas("css/setup.scss");
|
||||||
|
$this->add_saas("css/errorpage.scss");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info($sText)
|
public function info($sText)
|
||||||
@@ -36,6 +37,11 @@ class ErrorPage extends NiceWebPage
|
|||||||
public function error($sText)
|
public function error($sText)
|
||||||
{
|
{
|
||||||
$this->add("<div class=\"message message-error\">$sText</div>");
|
$this->add("<div class=\"message message-error\">$sText</div>");
|
||||||
|
if(utils::IsEasterEggAllowed())
|
||||||
|
{
|
||||||
|
$this->add('<img src="../images/alpha-fatal-error.gif">');
|
||||||
|
$this->add('<div class="message message-valid">'.Dict::S('UI:ErrorPage:UnstableVersion').'</div>');
|
||||||
|
}
|
||||||
$this->log_error($sText);
|
$this->log_error($sText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user