Quick Search:

View

Revision:

Diff

Diff from 368 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 368 2005-12-22 16:27:23Z 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() {
18       if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
19         $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
20
21         reset($this->modules);
22         while (list(, $value) = each($this->modules)) {
hpdl
368
23           include('includes/languages/' . $_SESSION['language'] . '/modules/order_total/' . $value);
24           include('includes/modules/order_total/' . $value);
hpdl
1
25
26           $class = substr($value, 0, strrpos($value, '.'));
27           $GLOBALS[$class] = new $class;
28         }
29       }
30     }
31
32     function process() {
33       $order_total_array = array();
34       if (is_array($this->modules)) {
35         reset($this->modules);
36         while (list(, $value) = each($this->modules)) {
37           $class = substr($value, 0, strrpos($value, '.'));
38           if ($GLOBALS[$class]->enabled) {
39             $GLOBALS[$class]->process();
40
41             for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
42               if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
43                 $order_total_array[] = array('code' => $GLOBALS[$class]->code,
44                                              'title' => $GLOBALS[$class]->output[$i]['title'],
45                                              'text' => $GLOBALS[$class]->output[$i]['text'],
46                                              'value' => $GLOBALS[$class]->output[$i]['value'],
47                                              'sort_order' => $GLOBALS[$class]->sort_order);
48               }
49             }
50           }
51         }
52       }
53
54       return $order_total_array;
55     }
56
57     function output() {
58       $output_string = '';
59       if (is_array($this->modules)) {
60         reset($this->modules);
61         while (list(, $value) = each($this->modules)) {
62           $class = substr($value, 0, strrpos($value, '.'));
63           if ($GLOBALS[$class]->enabled) {
64             $size = sizeof($GLOBALS[$class]->output);
65             for ($i=0; $i<$size; $i++) {
66               $output_string .= '              <tr>' . "\n" .
67                                 '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" .
68                                 '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" .
69                                 '              </tr>';
70             }
71           }
72         }
73       }
74
75       return $output_string;
76     }
77   }
78 ?>
    \ No newline at end of file