]> git.wh0rd.org - tt-rss.git/blame - prefs.php
reinstate error handlers; better DB error reporting on failed queries
[tt-rss.git] / prefs.php
CommitLineData
1d3a17c7 1<?php
d0c6dd29
AD
2 if (file_exists("install") && !file_exists("config.php")) {
3 header("Location: install/");
4 }
5
88e8fb3a
AD
6 set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
7 get_include_path());
107d0cf3 8
d0c6dd29
AD
9 if (!file_exists("config.php")) {
10 print "<b>Fatal Error</b>: You forgot to copy
11 <b>config.php-dist</b> to <b>config.php</b> and edit it.\n";
12 exit;
13 }
14
404e2e36 15 require_once "autoload.php";
1df0f48b 16 require_once "sessions.php";
23419d11 17 require_once "functions.php";
66581886 18 require_once "sanity_check.php";
da497bab 19 require_once "version.php";
ab49d368
AD
20 require_once "config.php";
21 require_once "db-prefs.php";
22
da497bab 23 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
c93f38c4 24
ba68b681 25 if (!init_plugins($link)) return;
324944f3 26
b8aa49bc 27 login_sequence($link);
53515ff1 28
03208748 29 header('Content-Type: text/html; charset=utf-8');
ab49d368 30?>
da497bab 31<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3f59e8cd 32 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
007bda35
AD
33<html>
34<head>
99534a3d 35 <title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
b5d4716a
AD
36
37 <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
38 <?php echo stylesheet_tag("tt-rss.css"); ?>
f820f205 39 <?php echo stylesheet_tag("prefs.css"); ?>
ab49d368 40
5d40efc9
AD
41 <?php if ($_SESSION["uid"]) {
42 $theme = get_pref($link, "USER_CSS_THEME", $_SESSION["uid"], false);
43 if ($theme) {
44 echo stylesheet_tag("themes/$theme");
45 }
46 }
47 ?>
48
88e4e597 49 <?php print_user_stylesheet($link) ?>
da497bab 50
74d5c8fa 51 <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
efc7243c 52 <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
c0266b88 53
b5d4716a
AD
54 <?php
55 foreach (array("lib/prototype.js",
56 "lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls",
57 "lib/dojo/dojo.js",
58 "lib/dijit/dijit.js",
8314db43 59 "lib/CheckBoxTree.js",
b5d4716a 60 "lib/dojo/tt-rss-layer.js",
b5d4716a
AD
61 "errors.php?mode=js") as $jsfile) {
62
63 echo javascript_tag($jsfile);
a7750ac6 64
b5d4716a 65 } ?>
14f69488 66
6065f3ad
AD
67 <script type="text/javascript">
68 <?php
107997e6 69 require 'lib/jshrink/Minifier.php';
6065f3ad
AD
70
71 global $pluginhost;
72
73 foreach ($pluginhost->get_plugins() as $n => $p) {
74 if (method_exists($p, "get_prefs_js")) {
107997e6 75 echo JShrink\Minifier::minify($p->get_prefs_js());
6065f3ad
AD
76 }
77 }
78
8314db43 79 print get_minified_js(array("functions", "deprecated", "prefs", "PrefFeedTree", "PrefFilterTree", "PrefLabelTree"));
c670a80d 80
bcbb2ec7 81 init_js_translations();
6065f3ad
AD
82 ?>
83 </script>
b1895692 84
74d5c8fa 85 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
da497bab 86
362698ad 87 <script type="text/javascript">
44258fa9
AD
88 Event.observe(window, 'load', function() {
89 init();
90 });
362698ad 91 </script>
44258fa9 92
007bda35
AD
93</head>
94
e331188f
AD
95<body id="ttrssPrefs" class="claro">
96
95437e9e 97<div id="notify" class="notify" style="display : none"></div>
d62796de
AD
98<div id="cmdline" style="display : none"></div>
99
08827aaf
AD
100<div id="overlay">
101 <div id="overlay_inner">
fcc36744
AD
102 <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
103 <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
104 progress="0" maximum="100">
08827aaf 105 </div>
5a941e7e 106 <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
08827aaf 107 </div>
da497bab 108</div>
08827aaf 109
d62796de 110<div id="header" dojoType="dijit.layout.ContentPane" region="top">
b8cb4d08 111 <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
da497bab 112 <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
3f59e8cd
AD
113</div>
114
da497bab
AD
115<div id="main" dojoType="dijit.layout.BorderContainer">
116
d62796de 117<div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs">
da497bab 118<div id="genConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
119 href="backend.php?op=pref-prefs"
120 title="<?php echo __('Preferences') ?>"></div>
da497bab 121<div id="feedConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
122 href="backend.php?op=pref-feeds"
123 title="<?php echo __('Feeds') ?>"></div>
da497bab 124<div id="filterConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
125 href="backend.php?op=pref-filters"
126 title="<?php echo __('Filters') ?>"></div>
da497bab 127<div id="labelConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
128 href="backend.php?op=pref-labels"
129 title="<?php echo __('Labels') ?>"></div>
130<?php if ($_SESSION["access_level"] >= 10) { ?>
da497bab 131 <div id="userConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
132 href="backend.php?op=pref-users"
133 title="<?php echo __('Users') ?>"></div>
2cbdc95b
AD
134 <div id="systemConfigTab" dojoType="dijit.layout.ContentPane"
135 href="backend.php?op=pref-system"
136 title="<?php echo __('System') ?>"></div>
207d8118 137<?php } ?>
6cbe53c9
AD
138<?php
139 $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TABS,
140 "hook_prefs_tabs", false);
141?>
1f8274d3 142</div>
3f59e8cd 143
d62796de 144<div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
da497bab 145 <a class="insensitive" target="_blank" href="http://tt-rss.org/">
9e662b4d
AD
146 Tiny Tiny RSS</a>
147 <?php if (!defined('HIDE_VERSION')) { ?>
148 v<?php echo VERSION ?>
149 <?php } ?>
150 &copy; 2005-<?php echo date('Y') ?>
da497bab
AD
151 <a class="insensitive" target="_blank"
152 href="http://fakecake.org/">Andrew Dolgov</a>
d62796de
AD
153</div> <!-- footer -->
154
23c2a4e7
AD
155</div>
156
1d3a17c7 157<?php db_close($link); ?>
007bda35
AD
158
159</body>
160</html>