Quick Search:

View

Revision:

Diff

Diff from 383 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/trunk/oscommerce/includes/classes/order_total.php

Annotated File View

hpdl
1
1 <?php
2 /*
mattice
151
3   $Id: order_total.php 383 2006-01-09 16:35:46Z hpdl $
hpdl
1
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
8   Copyright (c) 2003 osCommerce
9
10   Released under the GNU General Public License
11 */
12
13   class order_total {
14     var $modules;
15
16 // class constructor
17     function order_total() {
hpdl
383
18       global $osC_Language;
19
hpdl
1
20       if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
21         $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
22
23         reset($this->modules);
24         while (list(, $value) = each($this->modules)) {
hpdl
383
25           include('includes/languages/' . $osC_Language->getDirectory() . '/modules/order_total/' . $value);
hpdl
368
26           include('includes/modules/order_total/' . $value);
hpdl
1
27
28           $class = substr($value, 0, strrpos($value, '.'));
29           $GLOBALS[$class] = new $class;
30         }
31       }
32     }
33
34     function process() {
35       $order_total_array = array();
36       if (is_array($this->modules)) {
37         reset($this->modules);
38         while (list(, $value) = each($this->modules)) {
39           $class = substr($value, 0, strrpos($value, '.'));
40           if ($GLOBALS[$class]->enabled) {
41             $GLOBALS[$class]->process();
42
43             for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
44               if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
45                 $order_total_array[] = array('code' => $GLOBALS[$class]->code,
46                                              'title' => $GLOBALS[$class]->output[$i]['title'],
47                                              'text' => $GLOBALS[$class]->output[$i]['text'],
48                                              'value' => $GLOBALS[$class]->output[$i]['value'],
49                                              'sort_order' => $GLOBALS[$class]->sort_order);
50               }
51             }
52           }
53         }
54       }
55
56       return $order_total_array;
57     }
58
59     function output() {
60       $output_string = '';
61       if (is_array($this->modules)) {
62         reset($this->modules);
63         while (list(, $value) = each($this->modules)) {
64           $class = substr($value, 0, strrpos($value, '.'));
65           if ($GLOBALS[$class]->enabled) {
66             $size = sizeof($GLOBALS[$class]->output);
67             for ($i=0; $i<$size; $i++) {
68               $output_string .= '              <tr>' . "\n" .
69                                 '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" .
70                                 '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" .
71                                 '              </tr>';
72             }
73           }
74         }
75       }
76
77       return $output_string;
78     }
79   }
80 ?>
    \ No newline at end of file