hpdl
|
266
|
1
|
<?php
|
|
2
|
/*
|
|
3
|
$Id: language.php 199 2005-09-22 17:56:13 +0200 (Do, 22 Sep 2005) hpdl $
|
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
hpdl
|
1315
|
8
|
Copyright (c) 2007 osCommerce
|
hpdl
|
266
|
9
|
|
hpdl
|
1498
|
10
|
This program is free software; you can redistribute it and/or modify
|
|
11
|
it under the terms of the GNU General Public License v2 (1991)
|
|
12
|
as published by the Free Software Foundation.
|
hpdl
|
266
|
13
|
*/
|
|
14
|
|
hpdl
|
410
|
15
|
require('../admin/includes/classes/language.php');
|
hpdl
|
266
|
16
|
|
hpdl
|
410
|
17
|
class osC_LanguageInstall extends osC_Language_Admin {
|
hpdl
|
266
|
18
|
|
|
19
|
/* Private variables */
|
frank
|
1283
|
20
|
var $_languages = array();
|
|
21
|
|
hpdl
|
266
|
22
|
/* Class constructor */
|
|
23
|
|
hpdl
|
383
|
24
|
function osC_LanguageInstall() {
|
frank
|
1283
|
25
|
$osC_DirectoryListing = new osC_DirectoryListing('../includes/languages');
|
|
26
|
$osC_DirectoryListing->setIncludeDirectories(false);
|
hpdl
|
1315
|
27
|
$osC_DirectoryListing->setCheckExtension('xml');
|
frank
|
1283
|
28
|
|
|
29
|
foreach ($osC_DirectoryListing->getFiles() as $file) {
|
|
30
|
$osC_XML = new osC_XML(file_get_contents('../includes/languages/' . $file['name']));
|
|
31
|
$lang = $osC_XML->toArray();
|
|
32
|
|
|
33
|
$this->_languages[$lang['language']['data']['code']] = array('name' => $lang['language']['data']['title'],
|
|
34
|
'code' => $lang['language']['data']['code'],
|
|
35
|
'charset' => $lang['language']['data']['character_set']);
|
|
36
|
}
|
|
37
|
|
|
38
|
unset($lang);
|
|
39
|
|
hpdl
|
468
|
40
|
$language = (isset($_GET['language']) && !empty($_GET['language']) ? $_GET['language'] : '');
|
hpdl
|
266
|
41
|
|
hpdl
|
468
|
42
|
$this->set($language);
|
|
43
|
|
hpdl
|
1512
|
44
|
$this->loadIniFile();
|
|
45
|
$this->loadIniFile(basename($_SERVER['SCRIPT_FILENAME']));
|
hpdl
|
266
|
46
|
}
|
|
47
|
}
|
|
48
|
?>
|