f0e8f09ff3b5460a48a8a36ed936a185a301b751
[diogenes.git] / htdocs / toplevel / options.php
1 <?php
2 require_once 'diogenes.common.inc.php';
3 require_once 'diogenes.toplevel.inc.php';
4 require_once 'diogenes/diogenes.logger-view.inc.php';
5 // dependency on PEAR
6 require_once 'System.php';
7
8 $page = new $globals->toplevel(true);
9
10 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : "";
11
12 $rw_str_opts = array ('menu_style', 'menu_theme', 'template_dir', 'template', 'html_editor', 'word_import', 'barrel_style_sheet');
13 $rw_bool_opts = array('debugdatabase', 'debugplugins', 'validatepages');
14 $ro_opts = array ('menu_styles', 'menu_themes', 'html_editors', 'word_imports', 'style_sheets');
15
16 switch ($action) {
17 case "options":
18 foreach ($rw_str_opts as $opt_name)
19 {
20 if (isset($_REQUEST[$opt_name]))
21 $globals->updateOption($opt_name, $_REQUEST[$opt_name]);
22 }
23 foreach ($rw_bool_opts as $opt_name)
24 {
25 if (isset($_REQUEST[$opt_name]))
26 $globals->updateOption($opt_name, $_REQUEST[$opt_name] ? 1 : 0);
27 }
28 break;
29 }
30
31
32 // fill out values
33 $all_opts = array_merge($ro_opts, $rw_str_opts, $ro_opts);
34 $all_opts = array_merge($all_opts, $rw_bool_opts);
35 foreach ($all_opts as $opt_name)
36 {
37 if (!isset($globals->$opt_name)) {
38 $page->info("warning : unknown option '$opt_name'");
39 } else {
40 $page->assign($opt_name, $globals->$opt_name);
41 }
42 }
43 /*
44 if ($globals->menu_style == 1 || $globals->menu_style == 2) {
45 $page->assign('menu_themes', $globals->menu_themes);
46 $page->assign('menu_theme', $globals->menu_theme);
47 }
48 */
49 $page->assign('templates', $page->getTemplates());
50
51 // translations
52 $page->assign('greeting', __("Global options"));
53 $page->toolbar(__("Mode"), array( __("standard"), array(__("expert"), "options_expert.php")));
54 $page->assign('msg_display_options', __("display options"));
55 $page->assign('msg_menu_style', __("menu style"));
56 $page->assign('msg_menu_theme', __("menu theme"));
57 $page->assign('msg_site_template_dir', __("templates directory"));
58 $page->assign('msg_site_template', __("default template"));
59 $page->assign('msg_validate_pages', __("display W3C validator links for barrel pages"));
60 $page->assign('msg_system_options', __("system options"));
61 $page->assign('msg_html_editor', __("HTML editor"));
62 $page->assign('msg_word_import', __("Word document import"));
63 $page->assign('msg_debug_options', __("debugging options"));
64 $page->assign('msg_debug_database', __("debug database"));
65 $page->assign('msg_debug_plugins', __("debug plugins"));
66 $page->assign('msg_barrel_style_sheet', __("default style sheet for new barrels"));
67 $page->assign('msg_submit', __("Submit"));
68
69 $page->display('toplevel-options.tpl');
70
71 ?>