3 * Copyright (C) 2003-2004 Polytechnique.org
4 * http://opensource.polytechnique.org/
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 require_once 'diogenes/diogenes.core.globals.inc.php';
24 /** This class describes Diogenes' global settings.
26 class DiogenesGlobals
extends DiogenesCoreGlobals
{
27 /** Absolute directory location of Diogenes root. */
29 /** Absolute directory location of Diogenes spool directory. */
31 /** Absolute directory location of Diogenes RCS. */
33 /** The Diogenes root URL */
35 /** The Diogenes version */
36 var $version = "@VERSION@";
38 /** A barrel's stylesheet */
39 var $cssfile = "style.css";
40 /** The file containing a barrel page definition */
41 var $htmlfile = "page.html";
42 /** The Word file containing a barrel page definition */
43 var $wordfile = "page.doc";
45 /** The revision control system (DiogenesRcs or DiogenesCvs).
46 * This can be set from the toplevel interface
48 var $rcs = "DiogenesRcs";
49 /** The class for display toplevel pages. */
50 var $toplevel = 'DiogenesToplevel';
51 /** The class for displaying sites. */
52 var $barrel = 'DiogenesBarrel';
53 /** The class to use for session handling. */
54 var $session = 'DiogenesSession';
55 /** The class to use for WebDAV operations. */
56 var $webdav = 'DiogenesWebDAV';
58 /** The database table holding the global options */
59 var $table_global_options = "diogenes_option";
61 /** The database table holding the plugins */
62 var $table_plugins = "diogenes_plugin";
64 /** The tables for authentication */
65 var $tauth = array('native'=>"diogenes_auth");
66 /** Labels for the authentication tables */
67 var $tlabel = array('native'=>"Diogenes");
69 /** Should we display W3C validator links from user-created pages ? */
70 var $validatepages = 0;
72 /** Should we debug database calls ? */
73 var $debugdatabase = 0;
75 /** Should we show plugin debugging information ? */
76 var $debugplugins = 0;
78 /** What file should we write the WebDAV log to? (empty = none) */
79 var $debugwebdav = '';
81 /** Should we capture all WebDAV output to a log? */
82 var $debugwebdav_capture = 0;
84 /** Invalid locations for barrel pages */
85 var $invalidlocations = array("admin", "webdav");
87 /** Invalid barrel names */
88 var $invalidaliases = array("CVSROOT", "templates_c", "tree_c", "diogenes");
90 /** Available HTML editors */
91 var $html_editors = array(
92 'kafenio' => "Kafenio",
96 /** Availables languages */
100 'fr_FR'=> "Français",
101 'nl_NL'=> "Nederlands",
105 /** Available menu styles */
106 var $menu_styles = array(
109 2=> "dynamic tree, save state"
112 /** Available menu themes */
113 var $menu_themes = array(
115 'gorilla' => 'gorilla',
117 'mozilla' => 'mozilla'
120 /** The HTML editor to use (ekit, kafenio) */
121 var $html_editor = "kafenio";
123 /** Toplevel menu style */
126 /** Toplevel menu theme */
127 var $menu_theme = "gorilla";
129 /** Template directory */
130 var $template_dir = "";
132 /** Default template for barrel pages */
135 /** Utility to use for Word file import.
136 * set 'wvHtml' to make us of wv for Word import
137 * otherwise leave empty to disable word import.
139 //var $word_import = 'wvHtml';
140 var $word_import = '';
142 /** Available Word import utilities */
143 var $word_imports = array(
149 /** Check that RootURL is a full URL */
150 function checkRootUrl()
152 return preg_match('/^http(s)?:\/\/.*/i', $this->rooturl
);
156 /** Read extra options from database.
158 function readOptions()
160 $res = $this->db
->query("select name,value from {$this->table_global_options} where barrel=''");
162 // we only accept options which already exist in this
164 while (list($key,$value) = mysql_fetch_row($res)) {
165 if (isset($this->$key))
166 $this->$key = $value;
171 /** Store a preference to database.
173 function updateOption($name,$value)
175 $this->$name = stripslashes($value);
176 $this->db
->query("replace into {$this->table_global_options} set barrel='',name='$name',value='$value'");