2016-09-02 11:17:10 +02:00
|
|
|
<?php
|
|
|
|
/*****************************************************************************
|
|
|
|
* Alert.php
|
|
|
|
* Defines the key template Alert.
|
|
|
|
*
|
|
|
|
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
class Alert extends SubTemplate
|
|
|
|
{
|
2022-12-25 13:50:33 +01:00
|
|
|
private $_type;
|
|
|
|
private $_message;
|
|
|
|
private $_title;
|
|
|
|
|
2016-09-02 11:17:10 +02:00
|
|
|
public function __construct($title = '', $message = '', $type = 'alert')
|
|
|
|
{
|
|
|
|
$this->_title = $title;
|
|
|
|
$this->_message = $message;
|
|
|
|
$this->_type = in_array($type, ['alert', 'error', 'success', 'info']) ? $type : 'alert';
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function html_content()
|
|
|
|
{
|
|
|
|
echo '
|
|
|
|
<div class="alert', $this->_type != 'alert' ? ' alert-' . $this->_type : '', '">', (!empty($this->_title) ? '
|
2018-07-08 10:19:37 +02:00
|
|
|
<strong>' . $this->_title . '</strong><br>' : ''), '<p>', $this->_message, '</p>';
|
|
|
|
|
|
|
|
$this->additional_alert_content();
|
|
|
|
|
|
|
|
echo '</div>';
|
2016-09-02 11:17:10 +02:00
|
|
|
}
|
2018-07-08 10:19:37 +02:00
|
|
|
|
|
|
|
protected function additional_alert_content()
|
|
|
|
{}
|
2016-09-02 11:17:10 +02:00
|
|
|
}
|