'."\n";
# Safe mode
if ($safe_mode)
{
echo
'
'.__('Safe mode').'
'.
'
'.__('You are in safe mode. All plugins have been temporarily disabled. Remind to log out then log in again normally to get back all functionalities').'
'.
'
';
}
// Display breadcrumb (if given) before any error message
echo $breadcrumb;
if ($core->error->flag()) {
echo
'
'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'
'.
$core->error->toHTML().
'
';
}
// Display notices
echo self::notices();
}
public static function notices()
{
// return notices if any
$res = '';
if (isset($_SESSION['notifications'])) {
$types = array("success" => "success", "warning" => "warning-msg", "error" => "error");
$notifications = $_SESSION['notifications'];
foreach ($types as $type => $class) {
if (isset($notifications[$type])) {
foreach ($notifications[$type] as $n) {
$res .= self::getNotification($n,$class);
}
}
}
unset($_SESSION['notifications']);
}
return $res;
}
public static function addNotice($type,$message)
{
$notification = isset($_SESSION['notifications']) ? $_SESSION['notifications'] : array();
$notification[$type][] = array('ts' => time(), 'text' => $message);
$_SESSION['notifications'] = $notification;
}
public static function addSuccessNotice($message)
{
self::addNotice("success",$message);
}
public static function addWarningNotice($message)
{
self::addNotice("warning",$message);
}
public static function addErrorNotice($message)
{
self::addNotice("error",$message);
}
protected static function getNotification($msg,$class)
{
global $core;
$res = '
'.dt::str(__('[%H:%M:%S]'),$msg['ts'],$core->auth->getInfo('user_tz')).' '.$msg['text'].'
';
return $res;
}
public static function close()
{
global $core;
if (!$GLOBALS['__resources']['ctxhelp']) {
echo
'
'.__('Global help').'
';
}
$menu =& $GLOBALS['_menu'];
echo
"