Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

443
 
637
 
637
 
shipping.php
_> 11 <?php
  22 /*
<> 3 -  $Id: shipping.php 443 2006-02-19 23:01:01Z hpdl $
   3+  $Id: shipping.php 637 2006-07-18 16:30:55Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
1414     var $_modules = array(),
  1515         $_selected_module,
  1616         $_quotes = array(),
<> 17 -        $_keys,
1817         $_group = 'shipping';
  1918 
  2019 // class constructor
     
 !
7877       return $this->_description;
  7978     }
  8079 
<> 81 -    function getStatus() {
   80+    function isEnabled() {
8281       return $this->_status;
  8382     }
  8483 
     
 !
156155         $has_active = false;
  157156 
  158157         foreach ($this->_modules as $module) {
<> 159 -          if ($GLOBALS['osC_Shipping_' . $module]->getStatus() === true) {
   158+          if ($GLOBALS['osC_Shipping_' . $module]->isEnabled()) {
160159             $has_active = true;
  161160             break;
  162161           }
     
 !
166165       return $has_active;
  167166     }
  168167 
<> 169 -    function hasKeys() {
  170 -      static $has_keys;
  171 -
  172 -      if (isset($has_keys) === false) {
  173 -        $has_keys = (sizeof($this->getKeys()) > 0) ? true : false;
  174 -      }
  175 -
  176 -      return $has_keys;
  177 -    }
  178 -
  179 -    function install() {
  180 -      global $osC_Database, $osC_Language;
  181 -
  182 -      $Qinstall = $osC_Database->query('insert into :table_templates_boxes (title, code, author_name, author_www, modules_group) values (:title, :code, :author_name, :author_www, :modules_group)');
  183 -      $Qinstall->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  184 -      $Qinstall->bindValue(':title', $this->_title);
  185 -      $Qinstall->bindValue(':code', $this->_code);
  186 -      $Qinstall->bindValue(':author_name', $this->_author_name);
  187 -      $Qinstall->bindValue(':author_www', $this->_author_www);
  188 -      $Qinstall->bindValue(':modules_group', $this->_group);
  189 -      $Qinstall->execute();
  190 -
  191 -      foreach ($osC_Language->getAll() as $key => $value) {
  192 -        if (file_exists(dirname(__FILE__) . '/../languages/' . $key . '/modules/' . $this->_group . '/' . $this->_code . '.xml')) {
  193 -          foreach ($osC_Language->extractDefinitions($key . '/modules/' . $this->_group . '/' . $this->_code . '.xml') as $def) {
  194 -            $Qcheck = $osC_Database->query('select id from :table_languages_definitions where definition_key = :definition_key and content_group = :content_group and languages_id = :languages_id limit 1');
  195 -            $Qcheck->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
  196 -            $Qcheck->bindValue(':definition_key', $def['key']);
  197 -            $Qcheck->bindValue(':content_group', $def['group']);
  198 -            $Qcheck->bindInt(':languages_id', $value['id']);
  199 -            $Qcheck->execute();
  200 -
  201 -            if ($Qcheck->numberOfRows() === 1) {
  202 -              $Qdef = $osC_Database->query('update :table_languages_definitions set definition_value = :definition_value where definition_key = :definition_key and content_group = :content_group and languages_id = :languages_id');
  203 -            } else {
  204 -              $Qdef = $osC_Database->query('insert into :table_languages_definitions (languages_id, content_group, definition_key, definition_value) values (:languages_id, :content_group, :definition_key, :definition_value)');
  205 -            }
  206 -            $Qdef->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
  207 -            $Qdef->bindInt(':languages_id', $value['id']);
  208 -            $Qdef->bindValue(':content_group', $def['group']);
  209 -            $Qdef->bindValue(':definition_key', $def['key']);
  210 -            $Qdef->bindValue(':definition_value', $def['value']);
  211 -            $Qdef->execute();
  212 -          }
  213 -        }
  214 -      }
  215 -
  216 -      osC_Cache::clear('languages');
  217 -    }
  218 -
  219 -    function remove() {
  220 -      global $osC_Database, $osC_Language;
  221 -
  222 -      $Qdel = $osC_Database->query('delete from :table_templates_boxes where code = :code and modules_group = :modules_group');
  223 -      $Qdel->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  224 -      $Qdel->bindValue(':code', $this->_code);
  225 -      $Qdel->bindValue(':modules_group', $this->_group);
  226 -      $Qdel->execute();
  227 -
  228 -      if ($this->hasKeys()) {
  229 -        $Qdel = $osC_Database->query('delete from :table_configuration where configuration_key in (":configuration_key")');
  230 -        $Qdel->bindTable(':table_configuration', TABLE_CONFIGURATION);
  231 -        $Qdel->bindRaw(':configuration_key', implode('", "', $this->getKeys()));
  232 -        $Qdel->execute();
  233 -      }
  234 -
  235 -      if (file_exists(dirname(__FILE__) . '/../languages/' . $osC_Language->getCode() . '/modules/' . $this->_group . '/' . $this->_code . '.xml')) {
  236 -        foreach ($osC_Language->extractDefinitions($osC_Language->getCode() . '/modules/' . $this->_group . '/' . $this->_code . '.xml') as $def) {
  237 -          $Qdel = $osC_Database->query('delete from :table_languages_definitions where definition_key = :definition_key and content_group = :content_group');
  238 -          $Qdel->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
  239 -          $Qdel->bindValue(':definition_key', $def['key']);
  240 -          $Qdel->bindValue(':content_group', $def['group']);
  241 -          $Qdel->execute();
  242 -        }
  243 -
  244 -        osC_Cache::clear('languages');
  245 -      }
  246 -    }
  247 -
248168     function _calculate() {
  249169       global $osC_ShoppingCart;
  250170 
     
 !
256176         if (is_array($this->_modules)) {
  257177           $include_quotes = array();
  258178 
<> 259 -          if (defined('MODULE_SHIPPING_FREE_STATUS') && (MODULE_SHIPPING_FREE_STATUS == 'True') && ($GLOBALS['osC_Shipping_free']->getStatus() === true)) {
   179+          if (defined('MODULE_SHIPPING_FREE_STATUS') && (MODULE_SHIPPING_FREE_STATUS == 'True') && $GLOBALS['osC_Shipping_free']->isEnabled()) {
260180             $include_quotes[] = 'osC_Shipping_free';
  261181           } else {
  262182             foreach ($this->_modules as $module) {
<> 263 -              if ($GLOBALS['osC_Shipping_' . $module]->getStatus() === true) {
   183+              if ($GLOBALS['osC_Shipping_' . $module]->isEnabled()) {
<_ 264184                 $include_quotes[] = 'osC_Shipping_' . $module;
  265185               }
  266186             }