Revision 2098
Added by darkviper over 10 years ago
details.php | ||
---|---|---|
20 | 20 |
function getInfoFromLanguageFile($sFile) |
21 | 21 |
{ |
22 | 22 |
$mRetval = array(); |
23 |
$mLang = Translate::getInstance(); |
|
23 |
$oLang = Translate::getInstance(); |
|
24 |
$oLang->enableAddon('admin\\languages'); |
|
24 | 25 |
$oReg = WbAdaptor::getInstance(); |
25 | 26 |
// check for valid language code |
26 | 27 |
if(preg_match('/^([A-Z]{2}.php)/', $sFile)) { |
... | ... | |
33 | 34 |
$mRetval['VERSION'] = $language_version; |
34 | 35 |
$mRetval['DESIGNED_FOR'] = $language_platform; |
35 | 36 |
}else { |
36 |
$mRetval = $mLang->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES;
|
|
37 |
$mRetval = $oLang->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES;
|
|
37 | 38 |
} |
38 | 39 |
}else { |
39 |
$mRetval = $mLang->MESSAGE_GENERIC_NOT_INSTALLED;
|
|
40 |
$mRetval = $oLang->MESSAGE_GENERIC_NOT_INSTALLED;
|
|
40 | 41 |
} |
41 | 42 |
}else { |
42 |
$mRetval= $mLang->MESSAGE_GENERIC_FORGOT_OPTIONS;
|
|
43 |
$mRetval= $oLang->MESSAGE_GENERIC_FORGOT_OPTIONS;
|
|
43 | 44 |
} |
44 | 45 |
return $mRetval; |
45 | 46 |
} |
... | ... | |
47 | 48 |
// Include the config code |
48 | 49 |
require('../../config.php'); |
49 | 50 |
// Print admin header |
50 |
$mLang = Translate::getInstance();
|
|
51 |
$mLang->enableAddon('admin\addons');
|
|
51 |
$oLang = Translate::getInstance();
|
|
52 |
$oLang->enableAddon('admin\\languages');
|
|
52 | 53 |
require_once(WB_PATH.'/framework/class.admin.php'); |
53 |
$admin = new admin('Addons', 'languages_view', false); |
|
54 | 54 |
if(!$admin->checkFTAN()) { |
55 | 55 |
$admin->print_header(); |
56 |
$admin->print_error($mLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
56 |
$admin->print_error($oLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
57 | 57 |
} |
58 | 58 |
// After check print the header |
59 | 59 |
$admin->print_header(); |
60 | 60 |
// Get language code |
61 |
$oLang->enableAddon('admin\\languages'); |
|
61 | 62 |
$sFile = (string)$admin->get_post('code').'.php'; |
62 | 63 |
// Setup template object, parse vars to it, then parse it |
63 | 64 |
// Create new template object |
... | ... | |
65 | 66 |
// $template->debug = true; |
66 | 67 |
$template->set_file('page', 'languages_details.htt'); |
67 | 68 |
$template->set_block('page', 'main_block', 'main'); |
69 |
$template->set_var($oLang->getLangArray()); |
|
68 | 70 |
//getinfo |
69 | 71 |
$aValues = getInfoFromLanguageFile($sFile); |
70 | 72 |
if(!is_array($aValues)) { |
... | ... | |
77 | 79 |
// Insert values |
78 | 80 |
$template->set_var($aValues); |
79 | 81 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
80 |
$template->set_var($mLang->getLangArray());
|
|
82 |
$template->set_var($oLang->getLangArray());
|
|
81 | 83 |
|
82 | 84 |
// Parse language object |
83 | 85 |
$template->parse('main', 'main_block', false); |
Also available in: Unified diff
! activate class Translate for all addons in admin/ (except pages/)
! class.admin >> add translation of the current theme to Translate