Project

General

Profile

« Previous | Next » 

Revision 2098

Added by darkviper almost 11 years ago

! activate class Translate for all addons in admin/ (except pages/)
! class.admin >> add translation of the current theme to Translate

View differences:

index.php
27 27
// $template->debug = true;
28 28
$template->set_file('page', 'languages.htt');
29 29
$template->set_block('page', 'main_block', 'main');
30
$oLang = Translate::getInstance();
31
$oLang->enableAddon('admin\\languages');
30 32

  
31 33
// Insert values into language list
32 34
$template->set_block('main_block', 'language_list_block', 'language_list');
35
/*-- insert all needed vars from language files ----------------------------------------*/
36
$template->set_var($oLang->getLangArray());
33 37
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by directory");
34 38
if($result->numRows() > 0) {
35 39
	while($addon = $result->fetchRow()) {
......
50 54
	$template->set_var('DISPLAY_LIST', 'hide');
51 55
}
52 56

  
53
//$mLang = ModLanguage::getInstance();
54
//$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE);
55
$mLang = Translate::getInstance();
56
$mLang->enableAddon('admin\addons');
57

  
58
/*-- insert all needed vars from language files ----------------------------------------*/
59
$template->set_var($mLang->getLangArray());
60 57
// insert urls
61 58
$template->set_var(array(
62 59
				'ADMIN_URL' => ADMIN_URL,
......
67 64
		);
68 65
// Insert language text and messages
69 66
$template->set_var(array(
70
	'URL_ADVANCED' => '<b>'.$mLang->TEXT_ADVANCED.'</b>' ,
67
	'URL_ADVANCED' => '<b>'.$oLang->TEXT_ADVANCED.'</b>' ,
71 68
	'URL_MODULES' => $admin->get_permission('modules') ?
72
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $mLang->MENU_MODULES . '</a>' : '<b>'.$mLang->MENU_MODULES.'</b>',
69
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $oLang->MENU_MODULES . '</a>' : '<b>'.$oLang->MENU_MODULES.'</b>',
73 70
	'URL_TEMPLATES' => $admin->get_permission('templates') ?
74
		'<a href="' . ADMIN_URL . '/templates/index.php">' . $mLang->MENU_TEMPLATES . '</a>' : '<b>'.$mLang->MENU_TEMPLATES.'</b>',
71
		'<a href="' . ADMIN_URL . '/templates/index.php">' . $oLang->MENU_TEMPLATES . '</a>' : '<b>'.$oLang->MENU_TEMPLATES.'</b>',
75 72
	'HEADING_CHANGE_TEMPLATE_NOTICE' => ''
76 73
	)
77 74
);
......
79 76
// Parse template object
80 77
$template->parse('main', 'main_block', false);
81 78
$template->pparse('output', 'page');
82
$mLang->disableAddon();
79
$oLang->disableAddon();
83 80
// Print admin footer
84 81
$admin->print_footer();

Also available in: Unified diff