2015-05-05 03:00:01 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
2015-03-27 02:00:01 +01:00
|
|
|
|
|
|
|
class Alert {
|
|
|
|
|
2015-11-07 01:23:50 +01:00
|
|
|
// Status, 0 = OK, 1 = Fail
|
|
|
|
public static function set($value, $status=ALERT_STATUS_OK, $key='alert')
|
2015-03-27 02:00:01 +01:00
|
|
|
{
|
2015-05-15 00:07:45 +02:00
|
|
|
Session::set('defined', true);
|
2015-11-07 01:23:50 +01:00
|
|
|
Session::set('alertStatus', $status);
|
2015-03-27 02:00:01 +01:00
|
|
|
Session::set($key, $value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function get($key='alert')
|
|
|
|
{
|
2015-05-15 00:07:45 +02:00
|
|
|
Session::set('defined', false);
|
2015-03-27 02:00:01 +01:00
|
|
|
return Session::get($key);
|
|
|
|
}
|
|
|
|
|
2015-11-07 01:23:50 +01:00
|
|
|
public static function status()
|
|
|
|
{
|
|
|
|
return Session::get('alertStatus');
|
|
|
|
}
|
|
|
|
|
2015-10-22 05:14:22 +02:00
|
|
|
public static function p($key='alert')
|
|
|
|
{
|
|
|
|
echo self::get($key);
|
|
|
|
}
|
|
|
|
|
2015-05-15 00:07:45 +02:00
|
|
|
public static function defined()
|
2015-05-05 03:00:01 +02:00
|
|
|
{
|
2015-05-15 00:07:45 +02:00
|
|
|
return Session::get('defined');
|
2015-05-05 03:00:01 +02:00
|
|
|
}
|
2015-03-27 02:00:01 +01:00
|
|
|
|
2015-10-22 05:14:22 +02:00
|
|
|
}
|