make it possible to replace the current CSS file by a preset stylesheet
[diogenes.git] / htdocs / toplevel / options.php
CommitLineData
6855525e
JL
1<?php
2require_once 'diogenes.common.inc.php';
3require_once 'diogenes.toplevel.inc.php';
4require_once 'diogenes/diogenes.logger-view.inc.php';
5// dependency on PEAR
6require_once 'System.php';
7
8$page = new $globals->toplevel(true);
9
10$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : "";
11
aa2b3c61
JL
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
6855525e
JL
16switch ($action) {
17case "options":
aa2b3c61
JL
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 }
6855525e
JL
28 break;
29}
30
31
32// fill out values
aa2b3c61
JL
33$all_opts = array_merge($ro_opts, $rw_str_opts, $ro_opts);
34$all_opts = array_merge($all_opts, $rw_bool_opts);
35foreach ($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/*
6855525e
JL
44if ($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}
aa2b3c61 48*/
6855525e
JL
49$page->assign('templates', $page->getTemplates());
50
6855525e
JL
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"));
f7c51650 66$page->assign('msg_barrel_style_sheet', __("default style sheet for new barrels"));
6855525e
JL
67$page->assign('msg_submit', __("Submit"));
68
69$page->display('toplevel-options.tpl');
70
71?>