Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

386
 
387
 
387
 
language.php
_> 11 <?php
  22 /*
<> 3 -  $Id: language.php 386 2006-01-12 11:36:39Z hpdl $
   3+  $Id: language.php 387 2006-01-18 16:49:58Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
1414 
  1515 /* Private variables */
  1616     var $_code,
<> 17 -        $_languages = array();
   17+        $_languages = array(),
   18+        $_definitions = array();
1819 
  1920 /* Class constructor */
  2021 
     
 !
4950 
  5051 /* Public methods */
  5152 
<>  53+    function load($key) {
   54+      global $osC_Cache;
   55+
   56+      if ($osC_Cache->read('languages-english-' . $key)) {
   57+        $this->_definitions = array_merge($this->_definitions, $osC_Cache->getCache());
   58+      } else {
   59+        $osC_XML = new osC_XML('includes/languages/english.xml');
   60+        $osC_XML->parse();
   61+
   62+        $definitions = $osC_XML->getArray();
   63+
   64+        foreach ($definitions['language']['definitions']['definition'] as $def) {
   65+          if ($def['group']['VALUE'] == $key) {
   66+            $this->_definitions[$def['key']['VALUE']] = (string)$def['value']['VALUE'];
   67+          }
   68+        }
   69+
   70+        $osC_Cache->writeBuffer($this->_definitions);
   71+      }
   72+    }
   73+
   74+    function get($key) {
   75+      if (isset($this->_definitions[$key])) {
   76+        return $this->_definitions[$key];
   77+      }
   78+
   79+      return $key;
   80+    }
   81+
5282     function set($code = '') {
  5383       $this->_code = $code;
  5484 
     
 !
137167       return $this->_languages;
  138168     }
  139169 
<>  170+    function getData($key, $language = '') {
   171+      if (empty($language)) {
   172+        $language = $this->_code;
   173+      }
   174+
   175+      return $this->_languages[$language][$key];
   176+    }
   177+
140178     function getID() {
  141179       return $this->_languages[$this->_code]['id'];
  142180     }
     
 !
193231       return $this->_languages[$this->_code]['numeric_separator_thousands'];
  194232     }
  195233 
<> 196 -    function load($definition = false) {
   234+    function load_____old($definition = false) {
<_ 197235       if (is_string($definition)) {
  198236         include('includes/languages/' . $this->getDirectory() . '/' . $definition);
  199237       } else {