]> git.wh0rd.org - tt-rss.git/blame - prefs.php
pngcrush.sh
[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
6322ac79 23 if (!init_plugins()) return;
324944f3 24
6322ac79 25 login_sequence();
53515ff1 26
03208748 27 header('Content-Type: text/html; charset=utf-8');
ab49d368 28?>
da497bab 29<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3f59e8cd 30 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
007bda35
AD
31<html>
32<head>
99534a3d 33 <title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
1d74979d 34 <meta name="viewport" content="initial-scale=1,width=device-width" />
b5d4716a 35
8b91b0be
AD
36 <script type="text/javascript">
37 var __ttrss_version = "<?php echo VERSION ?>"
38 </script>
39
cdbcb277 40 <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
ab49d368 41
5d40efc9 42 <?php if ($_SESSION["uid"]) {
803b8ead 43 $theme = get_pref("USER_CSS_THEME", false, false);
f6cbe9a5 44 if ($theme && theme_valid("$theme")) {
b9634eb8 45 echo stylesheet_tag(get_theme_path($theme));
5bbc4bb4 46 } else {
3f2a8714 47 echo stylesheet_tag("css/default.css");
5d40efc9
AD
48 }
49 }
50 ?>
51
6322ac79 52 <?php print_user_stylesheet() ?>
da497bab 53
74d5c8fa 54 <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
efc7243c 55 <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
c0266b88 56
fd539f28
AD
57 <script>
58 dojoConfig = {
59 async: true,
6f84bf7b 60 cacheBust: new Date(),
fd539f28
AD
61 packages: [
62 { name: "lib", location: "../" },
63 { name: "fox", location: "../../js" },
64 ]
65 };
66 </script>
67
b5d4716a
AD
68 <?php
69 foreach (array("lib/prototype.js",
6214a076 70 "lib/scriptaculous/scriptaculous.js?load=effects,controls",
b5d4716a 71 "lib/dojo/dojo.js",
b5d4716a 72 "lib/dojo/tt-rss-layer.js",
b5d4716a
AD
73 "errors.php?mode=js") as $jsfile) {
74
cdbcb277 75 echo javascript_tag($jsfile);
a7750ac6 76
b5d4716a 77 } ?>
14f69488 78
6065f3ad 79 <script type="text/javascript">
a7264325 80 'use strict';
010eb9c1 81 require({cache:{}});
6065f3ad 82 <?php
a7264325
AD
83 print get_minified_js(["functions.js", "prefs.js"]);
84 ?>
85 </script>
86 <script type="text/javascript">
87 <?php
1ffe3391 88 foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
6065f3ad 89 if (method_exists($p, "get_prefs_js")) {
fd539f28 90 echo "try {";
107997e6 91 echo JShrink\Minifier::minify($p->get_prefs_js());
fd539f28
AD
92 echo "} catch (e) {
93 console.warn('failed to initialize plugin JS: $n');
94 console.warn(e);
95 }";
6065f3ad
AD
96 }
97 }
98
bcbb2ec7 99 init_js_translations();
6065f3ad
AD
100 ?>
101 </script>
b1895692 102
74d5c8fa 103 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
da497bab 104
362698ad 105 <script type="text/javascript">
44258fa9
AD
106 Event.observe(window, 'load', function() {
107 init();
108 });
362698ad 109 </script>
44258fa9 110
007bda35
AD
111</head>
112
5e68e246 113<body class="claro ttrss_main ttrss_prefs">
e331188f 114
d9c93ebf 115<div id="notify" class="notify"></div>
d62796de
AD
116<div id="cmdline" style="display : none"></div>
117
08827aaf
AD
118<div id="overlay">
119 <div id="overlay_inner">
fcc36744
AD
120 <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
121 <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
122 progress="0" maximum="100">
08827aaf 123 </div>
5a941e7e 124 <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
08827aaf 125 </div>
da497bab 126</div>
08827aaf 127
d62796de 128<div id="header" dojoType="dijit.layout.ContentPane" region="top">
b8cb4d08 129 <!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
da497bab 130 <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
3f59e8cd
AD
131</div>
132
da497bab
AD
133<div id="main" dojoType="dijit.layout.BorderContainer">
134
d62796de 135<div dojoType="dijit.layout.TabContainer" region="center" id="pref-tabs">
da497bab 136<div id="genConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
137 href="backend.php?op=pref-prefs"
138 title="<?php echo __('Preferences') ?>"></div>
da497bab 139<div id="feedConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
140 href="backend.php?op=pref-feeds"
141 title="<?php echo __('Feeds') ?>"></div>
da497bab 142<div id="filterConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
143 href="backend.php?op=pref-filters"
144 title="<?php echo __('Filters') ?>"></div>
da497bab 145<div id="labelConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
146 href="backend.php?op=pref-labels"
147 title="<?php echo __('Labels') ?>"></div>
148<?php if ($_SESSION["access_level"] >= 10) { ?>
da497bab 149 <div id="userConfigTab" dojoType="dijit.layout.ContentPane"
d62796de
AD
150 href="backend.php?op=pref-users"
151 title="<?php echo __('Users') ?>"></div>
2cbdc95b
AD
152 <div id="systemConfigTab" dojoType="dijit.layout.ContentPane"
153 href="backend.php?op=pref-system"
154 title="<?php echo __('System') ?>"></div>
207d8118 155<?php } ?>
6cbe53c9 156<?php
1ffe3391 157 PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TABS,
6cbe53c9
AD
158 "hook_prefs_tabs", false);
159?>
1f8274d3 160</div>
3f59e8cd 161
d62796de 162<div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
da497bab 163 <a class="insensitive" target="_blank" href="http://tt-rss.org/">
9e662b4d
AD
164 Tiny Tiny RSS</a>
165 <?php if (!defined('HIDE_VERSION')) { ?>
166 v<?php echo VERSION ?>
167 <?php } ?>
d62796de
AD
168</div> <!-- footer -->
169
23c2a4e7
AD
170</div>
171
007bda35
AD
172</body>
173</html>