Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

5
 
121
 
121
 
language.php
_> 11 <?php
  22 /*
<> 3 -  $Id: language.php 5 2005-01-31 01:40:15Z hpdl $
   3+  $Id: language.php 121 2005-04-28 07:19:20Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
  77 
<> 8 -  Copyright (c) 2004 osCommerce
   8+  Copyright (c) 2005 osCommerce
99 
  1010   Released under the GNU General Public License
  1111 */
     
 !
4848 
  4949 /* Public methods */
  5050 
<> 51 -    function set($language = '') {
   51+    function set($lang = '') {
5252       if (PHP_VERSION < 4.1) {
  5353         global $_COOKIE;
  5454       }
  5555 
  5656       global $osC_Session;
  5757 
<> 58 -      if (empty($language) && $osC_Session->exists('language')) {
   58+      if (empty($lang) && $osC_Session->exists('language')) {
5959         foreach ($this->_languages as $l) {
  6060           if ($l['directory'] == $osC_Session->value('language')) {
<> 61 -            $language = $l['code'];
   61+            $lang = $l['code'];
6262             break;
  6363           }
  6464         }
  6565       }
  6666 
<> 67 -      if (empty($language) || ($this->exists($language) === false)) {
  68 -        $language = DEFAULT_LANGUAGE;
   67+      if (empty($lang) || ($this->exists($lang) === false)) {
   68+        $lang = DEFAULT_LANGUAGE;
6969       }
  7070 
<> 71 -      $this->language = $this->get($language);
   71+      $this->language = $this->get($lang);
7272 
  7373       if (!isset($_COOKIE['language']) || (isset($_COOKIE['language']) && ($_COOKIE['language'] != $this->language['code']))) {
  7474         tep_setcookie('language', $this->language['code'], time()+60*60*24*90);
     
 !
146146       $this->set(DEFAULT_LANGUAGE);
  147147     }
  148148 
<> 149 -    function get($language) {
  150 -      return $this->_languages[$language];
   149+    function get($lang) {
   150+      return $this->_languages[$lang];
151151     }
  152152 
  153153     function getAll() {
  154154       return $this->_languages;
  155155     }
  156156 
<> 157 -    function exists($language) {
  158 -      if (isset($this->_languages[$language])) {
  159 -        return true;
  160 -      }
   157+    function exists($lang) {
   158+      return array_key_exists($lang, $this->_languages);
   159+    }
161160 
<> 162 -      return false;
   161+    function getID() {
   162+      return $this->language['id'];
163163     }
<>  164+
   165+    function getName() {
   166+      return $this->language['name'];
   167+    }
   168+
   169+    function getCode() {
   170+      return $this->language['code'];
   171+    }
   172+
   173+    function getImage() {
   174+      return $this->language['image'];
   175+    }
   176+
   177+    function getDirectory() {
   178+      return $this->language['directory'];
   179+    }
   180+
   181+    function load($definition = false) {
   182+      if (is_string($definition)) {
   183+        include('includes/languages/' . $this->getDirectory() . '/' . $definition);
   184+      } else {
   185+        include('includes/languages/' . $this->getDirectory() . '.php');
   186+      }
   187+    }
<_ 164188   }
  165189 ?>