| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bsite.hellogtx.com/library/Catabatic/ |
Upload File : |
<?php
class Flexsin_MessageStack {
private $_storage;
private $messages;
public function __construct() {
$this->_storage = new Zend_Session_Namespace("message");
$this->messages = array();
}
public function add($message, $type = 'error', $class='') {
$message = trim($message);
if (strlen($message) > 0) {
if ($type == 'error') {
$this->messages[] = array('params' => 'style="height:20px;padding:3px;margin:5px 3px 5px 3px;" class="ui-state-error ui-corner-all"', 'class' => $class, 'text' => '<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> ' . $message);
} elseif ($type == 'warning') {
$this->messages[] = array('params' => 'style="height:20px;padding:3px;margin:5px 3px 5px 3px;" class="ui-state-highlight ui-corner-all"', 'class' => $class, 'text' => '<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> ' . $message);
} elseif ($type == 'success') {
$this->messages[] = array('params' => 'style="height:20px;padding:3px;margin:5px 3px 5px 3px;" class="ui-state-highlight ui-corner-all"', 'class' => $class, 'text' => '<span class="ui-icon ui-icon-check" style="float: left; margin-right: .3em;"></span> ' . $message);
} elseif ($type == 'caution') {
$this->messages[] = array('params' => 'style="height:20px;padding:3px;margin:5px 3px 5px 3px;" class="ui-state-highlight ui-corner-all"', 'class' => $class, 'text' => '<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> ' . $message);
} elseif ($type == 'home') {
$this->messages[] = array('params' => '', 'class' =>$class, 'text' => '' . $message);
} else {
$this->messages[] = array('params' => ' style="height:20px;padding:3px;margin:5px 3px 5px 3px;" class="ui-state-error ui-corner-all"', 'class' => $class, 'text' => $message);
}
}
$this->_storage->__set("message", $this->messages);
}
public static function output() {
$storage = new Zend_Session_Namespace("message");
if (isset($storage->message)) {
$messages = $storage->message;
} else {
$messages = array();
}
for ($i = 0, $n = count($messages); $i < $n; $i++) {
$output[] = $messages[$i];
echo '<div ' . $output[$i]['params'] . '>' . $output[$i]['text'] . '</div>';
}
unset($storage->message);
}
public static function outputerror() {
$storage = new Zend_Session_Namespace("message");
if (isset($storage->message)) {
$messages = $storage->message;
} else {
$messages = array();
}
for ($i = 0, $n = count($messages); $i < $n; $i++) {
$output[] = $messages[$i];
echo '<div align="center" class= "'.$output[$i]['class'].'" >' . $output[$i]['text'] . '</div>';
}
unset($storage->message);
}
}
?>