<?php
/* --------------------------------------------------------------
$Id: message_stack.php 950 2005-05-14 16:45:21Z mz $
XT-Commerce - community made shopping
http://www.xt-commerce.com
Copyright (c) 2003 XT-Commerce
--------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(message_stack.php,v 1.5 2002/11/22); www.oscommerce.com
(c) 2003 nextcommerce (message_stack.php,v 1.6 2003/08/18); www.nextcommerce.org
Released under the GNU General Public License
Example usage:
$messageStack = new messageStack();
$messageStack->add('Error: Error 1', 'error');
$messageStack->add('Error: Error 2', 'warning');
if ($messageStack->size > 0) echo $messageStack->output();
--------------------------------------------------------------*/
defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );
class messageStack extends tableBlock {
var $size = 0;
function messageStack() {
$this->errors = array();
if (isset($_SESSION['messageToStack'])) {
for ($i = 0, $n = sizeof($_SESSION['messageToStack']); $i < $n; $i++) {
$this->add($_SESSION['messageToStack'][$i]['text'], $_SESSION['messageToStack'][$i]['type']);
}
unset($_SESSION['messageToStack']);
}
}
function add($message, $type = 'error') {
if ($type == 'error') {
$this->errors[] = array('params' => 'class="messageStackError"', 'text' => xtc_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . ' ' . $message);
} elseif ($type == 'warning') {
$this->errors[] = array('params' => 'class="messageStackWarning"', 'text' => xtc_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $message);
} elseif ($type == 'success') {
$this->errors[] = array('params' => 'class="messageStackSuccess"', 'text' => xtc_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . ' ' . $message);
} else {
$this->errors[] = array('params' => 'class="messageStackError"', 'text' => $message);
}
$this->size++;
}
function add_session($message, $type = 'error') {
if (!isset($_SESSION['messageToStack'])) {
$_SESSION['messageToStack'] = array();
}
$_SESSION['messageToStack'][] = array('text' => $message, 'type' => $type);
}
function reset() {
$this->errors = array();
$this->size = 0;
}
function output() {
$this->table_data_parameters = 'class="messageBox"';
return $this->tableBlock($this->errors);
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| box.php | 2013-11-12 20:54 | 2.49 KB | 76129f60960:kunden | -xw-x----- | |
| campaigns.php | 2013-11-12 20:54 | 11.88 KB | 76129f60960:kunden | -xw-x----- | |
| categories.php | 2013-11-12 20:54 | 91.35 KB | 76129f60960:kunden | -xw-x----- | |
| class.paypal.php | 2013-11-12 20:54 | 17.41 KB | 76129f60960:kunden | -xw-x----- | |
| currencies.php | 2013-11-12 20:54 | 3.79 KB | 76129f60960:kunden | -xw-x----- | |
| image_manipulator_GD1.php | 2013-11-12 20:54 | 14.45 KB | 76129f60960:kunden | -xw-x----- | |
| image_manipulator_GD2.php | 2013-11-12 20:54 | 14.7 KB | 76129f60960:kunden | -xw-x----- | |
| import.php | 2013-11-12 20:54 | 50.53 KB | 76129f60960:kunden | -xw-x----- | |
| language.php | 2013-11-12 20:54 | 6.31 KB | 76129f60960:kunden | -xw-x----- | |
| logger.php | 2013-11-12 20:54 | 1.86 KB | 76129f60960:kunden | -xw-x----- | |
| message_stack.php | 2013-11-12 20:54 | 2.67 KB | 76129f60960:kunden | -xw-x----- | |
| object_info.php | 2013-11-12 20:54 | 1 KB | 76129f60960:kunden | -xw-x----- | |
| order.php | 2013-11-12 20:54 | 12.19 KB | 76129f60960:kunden | -xw-x----- | |
| payment_module_info.php | 2013-11-12 20:54 | 1.59 KB | 76129f60960:kunden | -xw-x----- | |
| pclzip.lib.php | 2013-11-12 20:54 | 266.23 KB | 76129f60960:kunden | -xw-x----- | |
| phplot.php | 2013-11-12 20:54 | 313.95 KB | 76129f60960:kunden | -xw-x----- | |
| phpmailer.lang-de.php | 2013-11-12 20:54 | 1.21 KB | 76129f60960:kunden | -xw-x----- | |
| phpmailer.lang-en.php | 2013-11-12 20:54 | 1.04 KB | 76129f60960:kunden | -xw-x----- | |
| sales_report.php | 2013-11-12 20:54 | 10.94 KB | 76129f60960:kunden | -xw-x----- | |
| sessions.php | 2013-11-12 20:54 | 13.33 KB | 76129f60960:kunden | -xw-x----- | |
| shopping_cart.php | 2013-11-12 20:54 | 14 KB | 76129f60960:kunden | -xw-x----- | |
| split_page_results.php | 2013-11-12 20:54 | 4.77 KB | 76129f60960:kunden | -xw-x----- | |
| table_block.php | 2013-11-12 20:54 | 3.72 KB | 76129f60960:kunden | -xw-x----- | |
| upload.php | 2013-11-12 20:54 | 5.56 KB | 76129f60960:kunden | -xw-x----- | |