Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

431
 
432
 
432
 
payment.php
_> 11 <?php
  22 /*
<> 3 -  $Id: payment.php 431 2006-02-15 05:57:09Z hpdl $
   3+  $Id: payment.php 432 2006-02-15 07:41:34Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
1313   class osC_Payment {
  1414     var $modules, $selected_module;
  1515 
<>  16+    var $_group = 'payment';
   17+
1618 // class constructor
  1719     function osC_Payment($module = '') {
  1820       global $osC_Database, $osC_Language;
     
 !
5355     }
  5456 
  5557 // class methods
<>  58+    function getCode() {
   59+      return $this->_code;
   60+    }
   61+
   62+    function getTitle() {
   63+      return $this->_title;
   64+    }
   65+
   66+    function getDescription() {
   67+      return $this->_description;
   68+    }
   69+
   70+    function getStatus() {
   71+      return $this->_status;
   72+    }
   73+
   74+    function getSortOrder() {
   75+      return $this->_sort_order;
   76+    }
   77+
5678 /* The following method is needed in the checkout_confirmation.php page
  5779    due to a chicken and egg problem with the payment class and order class.
  5880    The payment modules needs the order destination data for the dynamic status
     
 !
94116               '  }' . "\n\n";
  95117 
  96118         foreach ($this->modules as $module) {
<> 97 -          if ($GLOBALS['osC_Payment_' . $module]->enabled) {
   119+          if ($GLOBALS['osC_Payment_' . $module]->getStatus() === true) {
98120             $js .= $GLOBALS['osC_Payment_' . $module]->javascript_validation();
  99121           }
  100122         }
     
 !
120142       $selection_array = array();
  121143 
  122144       foreach ($this->modules as $module) {
<> 123 -        if ($GLOBALS['osC_Payment_' . $module]->enabled) {
   145+        if ($GLOBALS['osC_Payment_' . $module]->getStatus() === true) {
124146           $selection = $GLOBALS['osC_Payment_' . $module]->selection();
  125147           if (is_array($selection)) $selection_array[] = $selection;
  126148         }
     
 !
131153 
  132154     function pre_confirmation_check() {
  133155       if (is_array($this->modules)) {
<> 134 -        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
   156+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->getStatus() === true) ) {
135157           $GLOBALS[$this->selected_module]->pre_confirmation_check();
  136158         }
  137159       }
  138160     }
  139161 
  140162     function confirmation() {
  141163       if (is_array($this->modules)) {
<> 142 -        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
   164+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->getStatus() === true) ) {
143165           return $GLOBALS[$this->selected_module]->confirmation();
  144166         }
  145167       }
  146168     }
  147169 
  148170     function process_button() {
  149171       if (is_array($this->modules)) {
<> 150 -        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
   172+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->getStatus() === true) ) {
151173           return $GLOBALS[$this->selected_module]->process_button();
  152174         }
  153175       }
  154176     }
  155177 
  156178     function before_process() {
  157179       if (is_array($this->modules)) {
<> 158 -        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
   180+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->getStatus() === true) ) {
159181           return $GLOBALS[$this->selected_module]->before_process();
  160182         }
  161183       }
  162184     }
  163185 
  164186     function after_process() {
  165187       if (is_array($this->modules)) {
<> 166 -        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
   188+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->getStatus() === true) ) {
167189           return $GLOBALS[$this->selected_module]->after_process();
  168190         }
  169191       }
  170192     }
  171193 
  172194     function get_error() {
  173195       if (is_array($this->modules)) {
<> 174 -        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
   196+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->getStatus() === true) ) {
175197           return $GLOBALS[$this->selected_module]->get_error();
  176198         }
  177199       }
     
 !
184206         $has_active = false;
  185207 
  186208         foreach ($this->modules as $module) {
<> 187 -          if ($GLOBALS['osC_Payment_' . $module]->enabled) {
   209+          if ($GLOBALS['osC_Payment_' . $module]->getStatus() === true) {
188210             $has_active = true;
  189211             break;
  190212           }
     
 !
201223         $active = 0;
  202224 
  203225         foreach ($this->modules as $module) {
<> 204 -          if ($GLOBALS['osC_Payment_' . $module]->enabled) {
   226+          if ($GLOBALS['osC_Payment_' . $module]->getStatus() === true) {
205227             $active++;
  206228           }
  207229         }
     
 !
290312     }
  291313 
  292314     function _usortModules($a, $b) {
<> 293 -      if ($GLOBALS['osC_Payment_' . $a]->sort_order == $GLOBALS['osC_Payment_' . $b]->sort_order) {
  294 -        return strnatcasecmp($GLOBALS['osC_Payment_' . $a]->title, $GLOBALS['osC_Payment_' . $a]->title);
   315+      if ($GLOBALS['osC_Payment_' . $a]->getSortOrder() == $GLOBALS['osC_Payment_' . $b]->getSortOrder()) {
   316+        return strnatcasecmp($GLOBALS['osC_Payment_' . $a]->getTitle(), $GLOBALS['osC_Payment_' . $a]->getTitle());
295317       }
  296318 
<> 297 -      return ($GLOBALS['osC_Payment_' . $a]->sort_order < $GLOBALS['osC_Payment_' . $b]->sort_order) ? -1 : 1;
   319+      return ($GLOBALS['osC_Payment_' . $a]->getSortOrder() < $GLOBALS['osC_Payment_' . $b]->getSortOrder()) ? -1 : 1;
<_ 298320     }
  299321   }
  300322 ?>