Revision 1712
Added by Dietmar about 12 years ago
index.php | ||
---|---|---|
4 | 4 |
* @category admin |
5 | 5 |
* @package templates |
6 | 6 |
* @author Ryan Djurovich, WebsiteBaker Project |
7 |
* @copyright 2009-2011, Website Baker Org. e.V.
|
|
7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
8 | 8 |
* @link http://www.websitebaker2.org/ |
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 10 |
* @platform WebsiteBaker 2.8.x |
... | ... | |
22 | 22 |
|
23 | 23 |
// Setup template object, parse vars to it, then parse it |
24 | 24 |
// Create new template object |
25 |
$template = new Template(dirname($admin->correct_theme_source('templates.htt'))); |
|
25 |
$template = new Template(dirname($admin->correct_theme_source('templates.htt')),'keep');
|
|
26 | 26 |
// $template->debug = true; |
27 | 27 |
$template->set_file('page', 'templates.htt'); |
28 | 28 |
$template->set_block('page', 'main_block', 'main'); |
... | ... | |
33 | 33 |
$sql = 'SELECT `directory`, `name`, `function` FROM `'.TABLE_PREFIX.'addons` ' |
34 | 34 |
. 'WHERE `type`=\'template\' ORDER BY `name`'; |
35 | 35 |
if(($result = $database->query($sql))) { |
36 |
while($addon = $result->fetchRow(MYSQL_ASSOC)) { |
|
36 |
while($addon = $result->fetchRow(MYSQL_ASSOC)) |
|
37 |
{ |
|
38 |
if ($admin->get_permission($addon['directory'],'template')==false) { continue;} |
|
37 | 39 |
$template->set_var('VALUE', $addon['directory']); |
38 | 40 |
$template->set_var('NAME', (($addon['function'] == 'theme' ? '[Theme] ' : '').$addon['name'])); |
39 | 41 |
$template->parse('template_list', 'template_list_block', true); |
... | ... | |
51 | 53 |
$template->set_var('DISPLAY_LIST', 'hide'); |
52 | 54 |
} |
53 | 55 |
|
54 |
// Insert language headings |
|
55 |
$template->set_var(array( |
|
56 |
'HEADING_INSTALL_TEMPLATE' => $HEADING['INSTALL_TEMPLATE'], |
|
57 |
'HEADING_UNINSTALL_TEMPLATE' => $HEADING['UNINSTALL_TEMPLATE'], |
|
58 |
'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS'] |
|
59 |
) |
|
60 |
); |
|
56 |
$mLang = ModLanguage::getInstance(); |
|
57 |
$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
58 |
|
|
59 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
|
60 |
$template->set_var($mLang->getLangArray()); |
|
61 |
|
|
61 | 62 |
// insert urls |
62 | 63 |
$template->set_var(array( |
63 | 64 |
'ADMIN_URL' => ADMIN_URL, |
... | ... | |
68 | 69 |
); |
69 | 70 |
// Insert language text and messages |
70 | 71 |
$template->set_var(array( |
71 |
'URL_MODULES' => $admin->get_permission('modules') ?
|
|
72 |
'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
|
|
72 |
'URL_MODULES' => $admin->get_permission('modules') ? |
|
73 |
'<a href="' . ADMIN_URL . '/modules/index.php">' . $mLang->MENU_MODULES . '</a>' : '<b>'.$mLang->MENU_MODULES.'</b>',
|
|
73 | 74 |
'URL_LANGUAGES' => $admin->get_permission('languages') ? |
74 |
'<a href="' . ADMIN_URL . '/languages/index.php">' . $MENU['LANGUAGES'] . '</a>' : '', |
|
75 |
'URL_ADVANCED' => '          ', |
|
76 |
'TEXT_INSTALL' => $TEXT['INSTALL'], |
|
77 |
'TEXT_UNINSTALL' => $TEXT['UNINSTALL'], |
|
78 |
'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'], |
|
79 |
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'], |
|
80 |
'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE'] |
|
75 |
'<a href="' . ADMIN_URL . '/languages/index.php">' . $mLang->MENU_LANGUAGES . '</a>' : '<b>'.$mLang->MENU_LANGUAGES.'</b>', |
|
76 |
'URL_ADVANCED' => $admin->get_permission('settings_advanced') |
|
77 |
? '<a href="' . ADMIN_URL . '/addons/index.php?advanced">' . $mLang->TEXT_ADVANCED . '</a>' : '<b>'.$mLang->TEXT_ADVANCED.'</b>' , |
|
81 | 78 |
) |
82 | 79 |
); |
83 | 80 |
|
Also available in: Unified diff
! update folder admin/addons admin/skel/htt