  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: language.php 1498 2007-03-29 14:04:50Z hpdl $ |
| |
| 3 | + | $Id: language.php 1512 2007-03-29 23:46:41Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
7 | 7 | | |
  |
8 | | - | Copyright (c) 2006 osCommerce |
| |
| 8 | + | Copyright (c) 2007 osCommerce |
|
9 | 9 | | |
| |
10 | 10 | | This program is free software; you can redistribute it and/or modify |
| |
11 | 11 | | it under the terms of the GNU General Public License v2 (1991) |
| |
|
|
 |
… |
|
41 | 41 | | 'text_direction' => $Qlanguages->value('text_direction'), |
| |
42 | 42 | | 'currencies_id' => $Qlanguages->valueInt('currencies_id'), |
| |
43 | 43 | | 'numeric_separator_decimal' => $Qlanguages->value('numeric_separator_decimal'), |
  |
44 | | - | 'numeric_separator_thousands' => $Qlanguages->value('numeric_separator_thousands')); |
| |
| 44 | + | 'numeric_separator_thousands' => $Qlanguages->value('numeric_separator_thousands'), |
| |
| 45 | + | 'parent_id' => $Qlanguages->valueInt('parent_id')); |
|
45 | 46 | | } |
| |
46 | 47 | | |
| |
47 | 48 | | $Qlanguages->freeResult(); |
| |
|
|
 |
… |
|
51 | 52 | | |
| |
52 | 53 | | /* Public methods */ |
| |
53 | 54 | | |
  |
54 | | - | function load($key) { |
| |
| 55 | + | function load($key, $language_code = null) { |
|
55 | 56 | | global $osC_Database; |
| |
56 | 57 | | |
  |
| 58 | + | if ( is_null($language_code) ) { |
| |
| 59 | + | $language_code = $this->_code; |
| |
| 60 | + | } |
| |
| 61 | + | |
| |
| 62 | + | if ( $this->_languages[$language_code]['parent_id'] > 0 ) { |
| |
| 63 | + | $this->load($key, $this->getCodeFromID($this->_languages[$language_code]['parent_id'])); |
| |
| 64 | + | } |
| |
| 65 | + | |
|
57 | 66 | | $Qdef = $osC_Database->query('select * from :table_languages_definitions where languages_id = :languages_id and content_group = :content_group'); |
| |
58 | 67 | | $Qdef->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS); |
  |
59 | | - | $Qdef->bindInt(':languages_id', $this->getID()); |
| |
| 68 | + | $Qdef->bindInt(':languages_id', $this->getData('id', $language_code)); |
|
60 | 69 | | $Qdef->bindValue(':content_group', $key); |
  |
61 | | - | $Qdef->setCache('languages-' . $this->_code . '-' . $key); |
| |
| 70 | + | $Qdef->setCache('languages-' . $language_code . '-' . $key); |
  |
62 | 71 | | $Qdef->execute(); |
| |
63 | 72 | | |
| |
64 | 73 | | while ($Qdef->next()) { |