]> git.wh0rd.org Git - tt-rss.git/blob - prefs.php
do not enforce strict mode for plugins
[tt-rss.git] / prefs.php
1 <?php
2         if (file_exists("install") && !file_exists("config.php")) {
3                 header("Location: install/");
4         }
5
6         set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
7                 get_include_path());
8
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
15         require_once "autoload.php";
16         require_once "sessions.php";
17         require_once "functions.php";
18         require_once "sanity_check.php";
19         require_once "version.php";
20         require_once "config.php";
21         require_once "db-prefs.php";
22
23         if (!init_plugins()) return;
24
25         login_sequence();
26
27         header('Content-Type: text/html; charset=utf-8');
28 ?>
29 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
30         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
31 <html>
32 <head>
33         <title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
34     <meta name="viewport" content="initial-scale=1,width=device-width" />
35
36         <script type="text/javascript">
37                 var __ttrss_version = "<?php echo VERSION ?>"
38         </script>
39
40         <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
41
42         <?php if ($_SESSION["uid"]) {
43                 $theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false);
44                 if ($theme && theme_valid("$theme")) {
45                         echo stylesheet_tag(get_theme_path($theme));
46                 } else {
47                         echo stylesheet_tag("css/default.css");
48                 }
49         }
50         ?>
51
52         <?php print_user_stylesheet() ?>
53
54         <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
55         <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
56
57         <script>
58                 dojoConfig = {
59                         async: true,
60                         cacheBust: new Date(),
61                         packages: [
62                                 { name: "lib", location: "../" },
63                                 { name: "fox", location: "../../js" },
64                         ]
65                 };
66         </script>
67
68         <?php
69         foreach (array("lib/prototype.js",
70                                 "lib/scriptaculous/scriptaculous.js?load=effects,controls",
71                                 "lib/dojo/dojo.js",
72                                 "lib/dojo/tt-rss-layer.js",
73                                 "errors.php?mode=js") as $jsfile) {
74
75                 echo javascript_tag($jsfile);
76
77         } ?>
78
79         <script type="text/javascript">
80                 'use strict';
81                 require({cache:{}});
82         <?php
83                 require_once 'lib/jshrink/Minifier.php';
84
85                 print get_minified_js(["functions.js", "prefs.js"]);
86         ?>
87         </script>
88         <script type="text/javascript">
89         <?php
90                 foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
91                         if (method_exists($p, "get_prefs_js")) {
92                                 echo "try {";
93                                 echo JShrink\Minifier::minify($p->get_prefs_js());
94                                 echo "} catch (e) {
95                                         console.warn('failed to initialize plugin JS: $n');
96                                         console.warn(e);
97                                 }";
98                         }
99                 }
100
101                 init_js_translations();
102         ?>
103         </script>
104
105         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
106
107         <script type="text/javascript">
108                 Event.observe(window, 'load', function() {
109                         init();
110                 });
111         </script>
112
113 </head>
114
115 <body class="claro ttrss_main ttrss_prefs">
116
117 <div id="notify" class="notify"></div>
118 <div id="cmdline" style="display : none"></div>
119
120 <div id="overlay">
121         <div id="overlay_inner">
122                 <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
123                 <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
124              progress="0" maximum="100">
125                 </div>
126                 <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
127         </div>
128 </div>
129
130 <div id="header" dojoType="dijit.layout.ContentPane" region="top">
131         <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
132         <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
133 </div>
134
135 <div id="main" dojoType="dijit.layout.BorderContainer">
136
137 <div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs">
138 <div id="genConfigTab" dojoType="dijit.layout.ContentPane"
139         href="backend.php?op=pref-prefs"
140         title="<?php echo __('Preferences') ?>"></div>
141 <div id="feedConfigTab" dojoType="dijit.layout.ContentPane"
142         href="backend.php?op=pref-feeds"
143         title="<?php echo __('Feeds') ?>"></div>
144 <div id="filterConfigTab" dojoType="dijit.layout.ContentPane"
145         href="backend.php?op=pref-filters"
146         title="<?php echo __('Filters') ?>"></div>
147 <div id="labelConfigTab" dojoType="dijit.layout.ContentPane"
148         href="backend.php?op=pref-labels"
149         title="<?php echo __('Labels') ?>"></div>
150 <?php if ($_SESSION["access_level"] >= 10) { ?>
151         <div id="userConfigTab" dojoType="dijit.layout.ContentPane"
152                 href="backend.php?op=pref-users"
153                 title="<?php echo __('Users') ?>"></div>
154         <div id="systemConfigTab" dojoType="dijit.layout.ContentPane"
155                 href="backend.php?op=pref-system"
156                 title="<?php echo __('System') ?>"></div>
157 <?php } ?>
158 <?php
159         PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TABS,
160                 "hook_prefs_tabs", false);
161 ?>
162 </div>
163
164 <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
165         <a class="insensitive" target="_blank" href="http://tt-rss.org/">
166         Tiny Tiny RSS</a>
167         <?php if (!defined('HIDE_VERSION')) { ?>
168                  v<?php echo VERSION ?>
169         <?php } ?>
170         &copy; 2005-<?php echo date('Y') ?>
171         <a class="insensitive" target="_blank"
172         href="http://fakecake.org/">Andrew Dolgov</a>
173 </div> <!-- footer -->
174
175 </div>
176
177 </body>
178 </html>