1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | require_once( PHPWG_THEMES_PATH . 'greydragon/include/greydragon.class.php'); |
---|
6 | require_once( PHPWG_THEMES_PATH . 'greydragon/admin/upgrade.inc.php'); |
---|
7 | |
---|
8 | load_language('theme.lang', PHPWG_THEMES_PATH.'greydragon/'); |
---|
9 | |
---|
10 | $themeCore = greyDragonCore::Instance(GDTHEME_VERSION); |
---|
11 | $themeroot = './themes/' . basename(dirname(dirname(__FILE__))) . '/'; |
---|
12 | |
---|
13 | // Store settings on Save |
---|
14 | if ($themeCore->hasSettingFromPost('submit_greydragon')): |
---|
15 | |
---|
16 | if ($themeCore->getSettingFromPost('p_main_menu') == "static"): |
---|
17 | $_POST['p_expand_main_menu'] = "off"; |
---|
18 | endif; |
---|
19 | |
---|
20 | $themeCore->saveSettingsFromPost(); |
---|
21 | |
---|
22 | if ($themeCore->getOption('p_rootpage') == 'on'): |
---|
23 | global $prefixeTable, $conf; |
---|
24 | $ap_conf = @unserialize($conf['additional_pages']); |
---|
25 | if ($ap_conf['homepage']): |
---|
26 | $config_temp = $themeCore->getConfig(); |
---|
27 | if ($themeCore->prepareHomePage($prefixeTable, $ap_conf['homepage'])): |
---|
28 | array_push($page['infos'], l10n('Home Page Content for "Additional Pages" plugin has been updated')); |
---|
29 | endif; |
---|
30 | else: |
---|
31 | array_push($page['infos'], l10n('Please Create Home Page in "Additional Pages" Plugin')); |
---|
32 | endif; |
---|
33 | endif; |
---|
34 | |
---|
35 | $config_min = $themeCore->getConfig(FALSE); |
---|
36 | $conf['greydragon'] = serialize($config_min); |
---|
37 | conf_update_param('greydragon', pwg_db_real_escape_string($conf['greydragon'])); |
---|
38 | |
---|
39 | $themeCore->prepareCustomCSS(); |
---|
40 | |
---|
41 | pwg_set_session_var( 'purge_template', 1 ); |
---|
42 | |
---|
43 | array_push($page['infos'], l10n('Theme Settings are saved')); |
---|
44 | endif; |
---|
45 | |
---|
46 | $template->set_filenames(array('theme_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
47 | |
---|
48 | foreach ($template->smarty->tpl_vars['plugin_menu_items']->value as $key => $value): |
---|
49 | if ($value["NAME"] == "Additional Pages"): |
---|
50 | $themeCore->setSetting("hasAP", "yes"); |
---|
51 | endif; |
---|
52 | if ($value["NAME"] == "Extended Description"): |
---|
53 | $themeCore->setSetting("hasED", "yes"); |
---|
54 | endif; |
---|
55 | if ($value["NAME"] == "gdThumb"): |
---|
56 | $themeCore->setSetting("hasGT", "yes"); |
---|
57 | endif; |
---|
58 | if ($value["NAME"] == "Admin Tools"): |
---|
59 | $themeCore->setSetting("hasAT", "yes"); |
---|
60 | endif; |
---|
61 | endforeach; |
---|
62 | |
---|
63 | $themeCore->setSetting("pwgVer", PHPWG_VERSION); |
---|
64 | if (PHPWG_VERSION >= '2.7.0'): |
---|
65 | $themeCore->setSetting("hasMinVer", "yes"); |
---|
66 | endif; |
---|
67 | |
---|
68 | $packlist = $themeCore->getColorPackList(); |
---|
69 | |
---|
70 | // Ensure default values are set |
---|
71 | $template->assign('options', $themeCore->getConfig()); |
---|
72 | $template->assign('colorpackArr', $packlist); |
---|
73 | $template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content'); |
---|
74 | |
---|
75 | ?> |
---|