source: extensions/greydragon/admin/admin.inc.php @ 30279

Last change on this file since 30279 was 30210, checked in by SergeD, 10 years ago

version 1.0.13
+ New colorpack - GreyDragon
+ ADMIN: Added support for horizontal menu - "Static Menu - Header Bottom". When used with Additional Pages Plugin, pages except Root Page would be embeded

into menu bar instead of drop down menu.

+ ADMIN: Added option "Display navigation arrows" for Root page
+ ADMIN: Added option "Display navigation controls" for Root page
+ Added support for thumb shadow space - custom CSS is required (please refer to help section in admin area). Latest gdThumb is recomended.
+ CSS: cleanup

  • Removed hardcoded height for root page slideshow to accomodate navigation controls
  • Fixed issues with Categories List overlapping when Static menu is enabled
  • In Phote page, hide overflow photo when huge size is used
  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5require_once( PHPWG_THEMES_PATH . 'greydragon/include/greydragon.class.php');
6require_once( PHPWG_THEMES_PATH . 'greydragon/admin/upgrade.inc.php');
7
8load_language('theme.lang', PHPWG_THEMES_PATH.'greydragon/');
9
10$themeCore = greyDragonCore::Instance('1.0.13');
11$themeroot = './themes/' . basename(dirname(dirname(__FILE__))) . '/';
12
13// Store settings on Save
14if ($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
37  $conf['greydragon'] = serialize($config_min);
38  conf_update_param('greydragon', pwg_db_real_escape_string($conf['greydragon']));
39
40  if ($themeCore->getOption('p_lowertext') == "on"):
41    $css  = "/* Theme dynamic settings. Do not modify */\n"
42          . "html, body, input, select, textarea, file { text-transform: lowercase; }\n\n";
43  else:
44    $css = "";
45  endif;
46  $temp = $themeCore->getOption('p_customcss');
47  if ($temp):
48    $css .= "/* Custom CSS. Do not modify */\n" . $temp;
49  endif;
50
51  $fileName = $themeroot . 'css/custom.css';
52  if ($css):
53    $handle = fopen($fileName, "w");
54    if ($handle):
55      fwrite($handle, $css);
56      fclose($handle);
57    endif;
58  else:
59    @unlink($fileName);
60  endif;
61
62  pwg_set_session_var( 'purge_template', 1 );
63
64  array_push($page['infos'], l10n('Theme Settings are saved'));
65endif;
66
67$template->set_filenames(array('theme_admin_content' => dirname(__FILE__) . '/admin.tpl'));
68
69foreach ($template->smarty->tpl_vars['plugin_menu_items']->value as $key => $value):
70  if ($value["NAME"] == "Additional Pages"):
71    $themeCore->setSetting("hasAP", "yes");
72  endif;
73  if ($value["NAME"] == "Extended Description"):
74    $themeCore->setSetting("hasED", "yes");
75  endif;
76  if ($value["NAME"] == "gdThumb"):
77    $themeCore->setSetting("hasGT", "yes");
78  endif;
79  if ($value["NAME"] == "Admin Tools"):
80    $themeCore->setSetting("hasAT", "yes");
81  endif;
82endforeach;
83
84if (PHPWG_VERSION >= '2.6.3'):
85  $themeCore->setSetting("hasMinVer", "yes");
86endif;
87
88$packlist = array();
89$packroot = $themeroot . 'css/colorpack/';
90foreach (scandir($packroot) as $pack_name):
91  if (file_exists($packroot . "$pack_name/styles.css")):
92    if ($pack_name[0] == "."):
93      continue;
94    endif;
95    $packlist[] = $pack_name;
96  endif;
97endforeach;
98
99// Ensure default values are set
100$template->assign('options', $themeCore->getConfig());
101$template->assign('colorpackArr', $packlist);
102$template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content');
103
104?>
Note: See TracBrowser for help on using the repository browser.