| 1 | <?php |
| 2 | require_once 'diogenes.common.inc.php'; |
| 3 | require_once 'diogenes.admin.inc.php'; |
| 4 | |
| 5 | $page = new DiogenesAdmin; |
| 6 | $bbarrel =& $page->barrel; |
| 7 | $page->assign('greeting',__("Site options")); |
| 8 | $page->assign('post',$page->script_self()); |
| 9 | |
| 10 | // handle update request |
| 11 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ""; |
| 12 | switch ($action) { |
| 13 | case "update": |
| 14 | $opt_names = array ('title', 'description', 'keywords', 'favicon', 'template', 'template_dir', 'menu_min_level', 'menu_style', 'menu_theme', 'menu_hide_diogenes', 'feed_enable'); |
| 15 | foreach ($opt_names as $opt_name) |
| 16 | { |
| 17 | if (isset($_REQUEST[$opt_name])) |
| 18 | $bbarrel->options->updateOption($opt_name, $_REQUEST[$opt_name]); |
| 19 | } |
| 20 | |
| 21 | // log this action |
| 22 | $page->log('barrel_options', $bbarrel->alias.":*"); |
| 23 | break; |
| 24 | } |
| 25 | |
| 26 | // fill out values |
| 27 | /* general options */ |
| 28 | $page->assign('title', $bbarrel->options->title); |
| 29 | $page->assign('description', $bbarrel->options->description); |
| 30 | $page->assign('keywords', $bbarrel->options->keywords); |
| 31 | $page->assign('favicon', $bbarrel->options->favicon); |
| 32 | /* template options */ |
| 33 | $page->assign('template', $bbarrel->options->template); |
| 34 | $page->assign('templates', $page->getTemplates()); |
| 35 | if ($bbarrel->hasFlag('tpl')) { |
| 36 | $page->assign('template_dir', $bbarrel->options->template_dir); |
| 37 | $res = $globals->db->query("SELECT PID,location from {$bbarrel->table_page} ORDER BY location"); |
| 38 | while (list($myPID,$myLocation) = mysql_fetch_row($res)) |
| 39 | $template_dirs[$myPID] = $myLocation ? $myLocation : "<home>"; |
| 40 | mysql_free_result($res); |
| 41 | $page->assign('template_dirs', $template_dirs); |
| 42 | } |
| 43 | |
| 44 | /* menu options */ |
| 45 | $page->assign('menu_hide_diogeness', array(0 => __("no"), 1 => __("yes"))); |
| 46 | $page->assign('menu_hide_diogenes', $bbarrel->options->menu_hide_diogenes); |
| 47 | $page->assign('menu_styles', $globals->menu_styles); |
| 48 | $page->assign('menu_style', $bbarrel->options->menu_style); |
| 49 | if ($bbarrel->options->menu_style == 1 || $bbarrel->options->menu_style == 2) { |
| 50 | $page->assign('menu_themes', $globals->menu_themes); |
| 51 | $page->assign('menu_theme', $bbarrel->options->menu_theme); |
| 52 | } |
| 53 | $page->assign('menu_levels',array(0=> __("fully expanded"), 1=>'1', 2=>'2', 3=>'3', 4=>'4')); |
| 54 | $page->assign('menu_min_level', $bbarrel->options->menu_min_level); |
| 55 | |
| 56 | /* RSS feed options */ |
| 57 | $page->assign('feed_enable_vals', array(0 => __("no"), 1 => __("yes"))); |
| 58 | $page->assign('feed_enable', $bbarrel->options->feed_enable); |
| 59 | |
| 60 | // translations |
| 61 | $page->assign('msg_general_options', __("general options")); |
| 62 | $page->assign('msg_title', __("title")); |
| 63 | $page->assign('msg_description', __("description")); |
| 64 | $page->assign('msg_keywords', __("keywords")); |
| 65 | $page->assign('msg_favicon', __("favicon")); |
| 66 | $page->assign('msg_favicon_hint', __("(relative url to a PNG image)")); |
| 67 | $page->assign('msg_display_options', __("display options")); |
| 68 | $page->assign('msg_site_template_dir', __("templates directory")); |
| 69 | $page->assign('msg_site_template', __("default template")); |
| 70 | $page->assign('msg_menu_hide_diogenes', __("hide Diogenes menu")); |
| 71 | $page->assign('msg_menu_style', __("menu style")); |
| 72 | $page->assign('msg_menu_theme', __("menu theme")); |
| 73 | $page->assign('msg_menu_min_level', __("minimum menu levels to expand")); |
| 74 | $page->assign('msg_feed_options', __("RSS feed options")); |
| 75 | $page->assign('msg_feed_enable', __("enable RSS feed")); |
| 76 | $page->assign('msg_submit', __("Submit")); |
| 77 | $page->display('admin-options.tpl'); |
| 78 | ?> |