]>
Commit | Line | Data |
---|---|---|
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 | ||
35 | <script type="text/javascript"> | |
36 | var __ttrss_version = "<?php echo VERSION ?>" | |
37 | </script> | |
38 | ||
39 | <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?> | |
40 | <?php echo stylesheet_tag("css/layout.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("themes/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 | packages: [ | |
61 | { name: "lib", location: "../" }, | |
62 | { name: "fox", location: "../../js" }, | |
63 | ] | |
64 | }; | |
65 | </script> | |
66 | ||
67 | <?php | |
68 | foreach (array("lib/prototype.js", | |
69 | "lib/scriptaculous/scriptaculous.js?load=effects,controls", | |
70 | "lib/dojo/dojo.js", | |
71 | "lib/dojo/tt-rss-layer.js", | |
72 | "errors.php?mode=js") as $jsfile) { | |
73 | ||
74 | echo javascript_tag($jsfile); | |
75 | ||
76 | } ?> | |
77 | ||
78 | <script type="text/javascript"> | |
79 | require({cache:{}}); | |
80 | <?php | |
81 | require_once 'lib/jshrink/Minifier.php'; | |
82 | ||
83 | foreach (PluginHost::getInstance()->get_plugins() as $n => $p) { | |
84 | if (method_exists($p, "get_prefs_js")) { | |
85 | echo "try {"; | |
86 | echo JShrink\Minifier::minify($p->get_prefs_js()); | |
87 | echo "} catch (e) { | |
88 | console.warn('failed to initialize plugin JS: $n'); | |
89 | console.warn(e); | |
90 | }"; | |
91 | } | |
92 | } | |
93 | ||
94 | print get_minified_js(array("functions", "deprecated", "prefs")); | |
95 | ||
96 | init_js_translations(); | |
97 | ?> | |
98 | </script> | |
99 | ||
100 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
101 | ||
102 | <script type="text/javascript"> | |
103 | Event.observe(window, 'load', function() { | |
104 | init(); | |
105 | }); | |
106 | </script> | |
107 | ||
108 | </head> | |
109 | ||
110 | <body id="ttrssPrefs" class="claro"> | |
111 | ||
112 | <div id="notify" class="notify"></div> | |
113 | <div id="cmdline" style="display : none"></div> | |
114 | ||
115 | <div id="overlay"> | |
116 | <div id="overlay_inner"> | |
117 | <div class="insensitive"><?php echo __("Loading, please wait...") ?></div> | |
118 | <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar" | |
119 | progress="0" maximum="100"> | |
120 | </div> | |
121 | <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript> | |
122 | </div> | |
123 | </div> | |
124 | ||
125 | <div id="header" dojoType="dijit.layout.ContentPane" region="top"> | |
126 | <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | --> | |
127 | <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a> | |
128 | </div> | |
129 | ||
130 | <div id="main" dojoType="dijit.layout.BorderContainer"> | |
131 | ||
132 | <div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs"> | |
133 | <div id="genConfigTab" dojoType="dijit.layout.ContentPane" | |
134 | href="backend.php?op=pref-prefs" | |
135 | title="<?php echo __('Preferences') ?>"></div> | |
136 | <div id="feedConfigTab" dojoType="dijit.layout.ContentPane" | |
137 | href="backend.php?op=pref-feeds" | |
138 | title="<?php echo __('Feeds') ?>"></div> | |
139 | <div id="filterConfigTab" dojoType="dijit.layout.ContentPane" | |
140 | href="backend.php?op=pref-filters" | |
141 | title="<?php echo __('Filters') ?>"></div> | |
142 | <div id="labelConfigTab" dojoType="dijit.layout.ContentPane" | |
143 | href="backend.php?op=pref-labels" | |
144 | title="<?php echo __('Labels') ?>"></div> | |
145 | <?php if ($_SESSION["access_level"] >= 10) { ?> | |
146 | <div id="userConfigTab" dojoType="dijit.layout.ContentPane" | |
147 | href="backend.php?op=pref-users" | |
148 | title="<?php echo __('Users') ?>"></div> | |
149 | <div id="systemConfigTab" dojoType="dijit.layout.ContentPane" | |
150 | href="backend.php?op=pref-system" | |
151 | title="<?php echo __('System') ?>"></div> | |
152 | <?php } ?> | |
153 | <?php | |
154 | PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TABS, | |
155 | "hook_prefs_tabs", false); | |
156 | ?> | |
157 | </div> | |
158 | ||
159 | <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom"> | |
160 | <a class="insensitive" target="_blank" href="http://tt-rss.org/"> | |
161 | Tiny Tiny RSS</a> | |
162 | <?php if (!defined('HIDE_VERSION')) { ?> | |
163 | v<?php echo VERSION ?> | |
164 | <?php } ?> | |
165 | © 2005-<?php echo date('Y') ?> | |
166 | <a class="insensitive" target="_blank" | |
167 | href="http://fakecake.org/">Andrew Dolgov</a> | |
168 | </div> <!-- footer --> | |
169 | ||
170 | </div> | |
171 | ||
172 | </body> | |
173 | </html> |