]> git.wh0rd.org - tt-rss.git/blame - index.php
Merge branch 'master' of github.com:gothfox/Tiny-Tiny-RSS
[tt-rss.git] / index.php
CommitLineData
107d0cf3 1<?php
d0c6dd29
AD
2 if (file_exists("install") && !file_exists("config.php")) {
3 header("Location: install/");
4 }
5
9da0e4a2
AD
6 if (!file_exists("config.php")) {
7 print "<b>Fatal Error</b>: You forgot to copy
8 <b>config.php-dist</b> to <b>config.php</b> and edit it.\n";
9 exit;
10 }
11
d2ef966e
AD
12 // we need a separate check here because functions.php might get parsed
13 // incorrectly before 5.3 because of :: syntax.
1b113281 14 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
d2ef966e
AD
15 print "<b>Fatal Error</b>: PHP version 5.3.0 or newer required.\n";
16 exit;
17 }
18
88e8fb3a
AD
19 set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
20 get_include_path());
107d0cf3 21
404e2e36 22 require_once "autoload.php";
107d0cf3 23 require_once "sessions.php";
23419d11 24 require_once "functions.php";
107d0cf3
AD
25 require_once "sanity_check.php";
26 require_once "version.php";
27 require_once "config.php";
28 require_once "db-prefs.php";
955d4f82
AD
29 require_once "lib/Mobile_Detect.php";
30
31 $mobile = new Mobile_Detect();
32
6322ac79 33 if (!init_plugins()) return;
ac220751 34
310fa2dd 35 if (!$_REQUEST['mobile']) {
1ffe3391 36 if ($mobile->isTablet() && PluginHost::getInstance()->get_plugin("digest")) {
ac220751 37 header('Location: backend.php?op=digest');
310fa2dd 38 exit;
1ffe3391 39 } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("mobile")) {
4aac8355 40 header('Location: backend.php?op=mobile');
d8cfe195 41 exit;
1ffe3391 42 } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("digest")) {
a543e86d
AD
43 header('Location: backend.php?op=digest');
44 exit;
310fa2dd 45 }
955d4f82 46 }
107d0cf3 47
6322ac79 48 login_sequence();
107d0cf3 49
107d0cf3
AD
50 header('Content-Type: text/html; charset=utf-8');
51
52?>
53<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
54 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
55<html>
56<head>
99534a3d 57 <title>Tiny Tiny RSS</title>
b5d4716a 58
6f7798b6 59 <?php stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
6938c036 60 <?php stylesheet_tag("css/layout.css"); ?>
107d0cf3 61
5d40efc9 62 <?php if ($_SESSION["uid"]) {
6322ac79 63 $theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false);
5bbc4bb4 64 if ($theme && file_exists("themes/$theme")) {
6f7798b6 65 stylesheet_tag("themes/$theme");
5bbc4bb4
AD
66 } else {
67 stylesheet_tag("themes/default.css");
5d40efc9
AD
68 }
69 }
70 ?>
71
6322ac79 72 <?php print_user_stylesheet() ?>
107d0cf3 73
9a2885da
AD
74 <style type="text/css">
75 <?php
1ffe3391 76 foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
9a2885da
AD
77 if (method_exists($p, "get_css")) {
78 echo $p->get_css();
79 }
80 }
81 ?>
82 </style>
f9ac31d6 83
107d0cf3 84 <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
efc7243c 85 <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
107d0cf3 86
b5d4716a
AD
87 <?php
88 foreach (array("lib/prototype.js",
89 "lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls",
90 "lib/dojo/dojo.js",
b5d4716a 91 "lib/dojo/tt-rss-layer.js",
b5d4716a
AD
92 "errors.php?mode=js") as $jsfile) {
93
6f7798b6 94 javascript_tag($jsfile);
107d0cf3 95
b5d4716a 96 } ?>
107d0cf3 97
04150375 98 <script type="text/javascript">
c8d3fd5b 99 require({cache:{}});
04150375 100 <?php
36840743 101 require_once 'lib/jshrink/Minifier.php';
04150375 102
d94fba61 103 print get_minified_js(array("tt-rss",
8d388f32 104 "functions", "feedlist", "viewfeed", "FeedTree", "PluginHost"));
d94fba61 105
1ffe3391 106 foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
19c73507 107 if (method_exists($p, "get_js")) {
107997e6 108 echo JShrink\Minifier::minify($p->get_js());
04150375
AD
109 }
110 }
111
bcbb2ec7 112 init_js_translations();
04150375
AD
113 ?>
114 </script>
115
107d0cf3
AD
116 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
117
118 <script type="text/javascript">
119 Event.observe(window, 'load', function() {
120 init();
121 });
122 </script>
123</head>
124
125<body id="ttrssMain" class="claro">
126
127<div id="overlay" style="display : block">
128 <div id="overlay_inner">
129 <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
130 <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
131 progress="0" maximum="100">
132 </div>
133 <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
134 </div>
135</div>
136
95437e9e 137<div id="notify" class="notify" style="display : none"></div>
107d0cf3 138<div id="cmdline" style="display : none"></div>
107d0cf3
AD
139<div id="headlines-tmp" style="display : none"></div>
140
141<div id="main" dojoType="dijit.layout.BorderContainer">
142
143<div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
144 <div id="feedlistLoading">
145 <img src='images/indicator_tiny.gif'/>
146 <?php echo __("Loading, please wait..."); ?></div>
147 <div id="feedTree"></div>
148</div>
149
150<div dojoType="dijit.layout.BorderContainer" region="center" id="header-wrap" gutters="false">
38325ad6 151<div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap">
107d0cf3
AD
152
153<div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
154 <div id="main-toolbar" dojoType="dijit.Toolbar">
155
156 <form id="main_toolbar_form" action="" onsubmit='return false'>
157
158 <button dojoType="dijit.form.Button" id="collapse_feeds_btn"
159 onclick="collapse_feedlist()"
618e80ee 160 title="<?php echo __('Collapse feedlist') ?>" style="display : none">
107d0cf3
AD
161 &lt;&lt;</button>
162
163 <select name="view_mode" title="<?php echo __('Show articles') ?>"
41759103 164 onchange="viewModeChanged()"
107d0cf3
AD
165 dojoType="dijit.form.Select">
166 <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
167 <option value="all_articles"><?php echo __('All Articles') ?></option>
168 <option value="marked"><?php echo __('Starred') ?></option>
169 <option value="published"><?php echo __('Published') ?></option>
170 <option value="unread"><?php echo __('Unread') ?></option>
2e4faaac 171 <option value="unread_first"><?php echo __('Unread First') ?></option>
127aaaa0 172 <option value="has_note"><?php echo __('With Note') ?></option>
107d0cf3 173 <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
107d0cf3
AD
174 </select>
175
176 <select title="<?php echo __('Sort articles') ?>"
41759103 177 onchange="viewModeChanged()"
107d0cf3
AD
178 dojoType="dijit.form.Select" name="order_by">
179 <option selected="selected" value="default"><?php echo __('Default') ?></option>
8aa01d79 180 <option value="feed_dates"><?php echo __('Newest first') ?></option>
56b61583 181 <option value="date_reverse"><?php echo __('Oldest first') ?></option>
f3b2e7d4 182 <option value="title"><?php echo __('Title') ?></option>
107d0cf3
AD
183 </select>
184
e3ca32a8
AD
185 <div dojoType="dijit.form.ComboButton" onclick="catchupCurrentFeed()">
186 <span><?php echo __('Mark as read') ?></span>
187 <div dojoType="dijit.DropDownMenu">
188 <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1day')">
189 <?php echo __('Older than one day') ?>
190 </div>
191 <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1week')">
192 <?php echo __('Older than one week') ?>
193 </div>
194 <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('2week')">
195 <?php echo __('Older than two weeks') ?>
196 </div>
197 </div>
198 </div>
107d0cf3
AD
199
200 </form>
201
202 <div class="actionChooser">
2d1282d4 203
97e2c731 204 <?php
1ffe3391 205 foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_TOOLBAR_BUTTON) as $p) {
97e2c731
AD
206 echo $p->hook_toolbar_button();
207 }
208 ?>
209
2d1282d4
AD
210 <button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
211 title="<?php echo __("Communication problem with server.") ?>">
212 <img
baf3fcf9 213 src="images/error.png" />
2d1282d4
AD
214 </button>
215
216 <button id="newVersionIcon" dojoType="dijit.form.Button" style="display : none">
217 <img onclick="newVersionDlg()"
2a3b6de0 218 src="images/new_version.png"
2d1282d4
AD
219 title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>" />
220 </button>
221
222
107d0cf3
AD
223 <div dojoType="dijit.form.DropDownButton">
224 <span><?php echo __('Actions...') ?></span>
225 <div dojoType="dijit.Menu" style="display: none">
2d1282d4 226 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcPrefs')"><?php echo __('Preferences...') ?></div>
107d0cf3
AD
227 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcSearch')"><?php echo __('Search...') ?></div>
228 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div>
229 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div>
230 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div>
a57c8149 231 <!-- <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRescoreFeed')"><?php echo __('Rescore feed') ?></div> -->
107d0cf3
AD
232 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div>
233 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div>
234 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
235 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
236 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
1ffe3391 237 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div>
107d0cf3 238 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagSelect')"><?php echo __('Select by tags...') ?></div>
a57c8149
AD
239 <!-- <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div>
240 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div> -->
107d0cf3 241 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div>
ceb78471
AD
242
243 <?php
1ffe3391 244 foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ACTION_ITEM) as $p) {
ceb78471
AD
245 echo $p->hook_action_item();
246 }
247 ?>
248
2d1282d4
AD
249 <?php if (!$_SESSION["hide_logout"]) { ?>
250 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcLogout')"><?php echo __('Logout') ?></div>
251 <?php } ?>
107d0cf3
AD
252 </div>
253 </div>
254 </div>
255 </div> <!-- toolbar -->
256</div> <!-- toolbar pane -->
257
258 <div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center">
259
260 <div id="headlines-toolbar" dojoType="dijit.layout.ContentPane" region="top">
261 </div>
262
08820be7
AD
263 <div id="floatingTitle" style="display : none"></div>
264
107d0cf3
AD
265 <div id="headlines-frame" dojoType="dijit.layout.ContentPane"
266 onscroll="headlines_scroll_handler(this)" region="center">
267 <div id="headlinesInnerContainer">
268 <div class="whiteBox"><?php echo __('Loading, please wait...') ?></div>
269 </div>
270 </div>
271
107d0cf3
AD
272 <div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom"
273 style="height : 50%" splitter="true"></div>
107d0cf3
AD
274
275 </div>
276</div>
277</div>
278</div>
107d0cf3 279
107d0cf3
AD
280</body>
281</html>