]> git.wh0rd.org - tt-rss.git/blob - index.php
Revert "Removes redirection to mobile/"
[tt-rss.git] / index.php
1 <?php
2 if (!file_exists("config.php")) {
3 print "<b>Fatal Error</b>: You forgot to copy
4 <b>config.php-dist</b> to <b>config.php</b> and edit it.\n";
5 exit;
6 }
7
8 // we need a separate check here because functions.php might get parsed
9 // incorrectly before 5.3 because of :: syntax.
10 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
11 print "<b>Fatal Error</b>: PHP version 5.3.0 or newer required.\n";
12 exit;
13 }
14
15 set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
16 get_include_path());
17
18 require_once "sessions.php";
19 require_once "functions.php";
20 require_once "sanity_check.php";
21 require_once "version.php";
22 require_once "config.php";
23 require_once "db-prefs.php";
24 require_once "lib/Mobile_Detect.php";
25
26 $mobile = new Mobile_Detect();
27
28 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
29
30 if (!init_connection($link)) return;
31
32 global $pluginhost;
33
34 if (!$_REQUEST['mobile']) {
35 if ($mobile->isTablet() && $pluginhost->get_plugin("digest")) {
36 header('Location: backend.php?op=digest');
37 exit;
38 } else if ($mobile->isMobile()) {
39 header('Location: mobile/index.php');
40 exit;
41 }
42 }
43
44
45 login_sequence($link);
46
47 no_cache_incantation();
48
49 header('Content-Type: text/html; charset=utf-8');
50
51 ?>
52 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
53 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54 <html>
55 <head>
56 <title>Tiny Tiny RSS</title>
57
58 <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
59 <?php echo stylesheet_tag("tt-rss.css"); ?>
60 <?php echo stylesheet_tag("cdm.css"); ?>
61
62 <?php print_user_stylesheet($link) ?>
63
64 <style type="text/css">
65 <?php
66 foreach ($pluginhost->get_plugins() as $n => $p) {
67 if (method_exists($p, "get_css")) {
68 echo $p->get_css();
69 }
70 }
71 ?>
72 </style>
73
74 <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
75 <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
76
77 <?php
78 foreach (array("lib/prototype.js",
79 "lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls",
80 "lib/dojo/dojo.js",
81 "lib/dijit/dijit.js",
82 "lib/dojo/tt-rss-layer.js",
83 "errors.php?mode=js") as $jsfile) {
84
85 echo javascript_tag($jsfile);
86
87 } ?>
88
89 <script type="text/javascript">
90 <?php
91 require 'lib/jshrink/Minifier.php';
92
93 global $pluginhost;
94
95 foreach ($pluginhost->get_plugins() as $n => $p) {
96 if (method_exists($p, "get_js")) {
97 echo JShrink\Minifier::minify($p->get_js());
98 }
99 }
100
101 print get_minified_js(array("tt-rss",
102 "functions", "feedlist", "viewfeed", "FeedTree"));
103
104 init_js_translations();
105 ?>
106 </script>
107
108 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
109
110 <script type="text/javascript">
111 Event.observe(window, 'load', function() {
112 init();
113 });
114 </script>
115 </head>
116
117 <body id="ttrssMain" class="claro">
118
119 <div id="overlay" style="display : block">
120 <div id="overlay_inner">
121 <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
122 <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
123 progress="0" maximum="100">
124 </div>
125 <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
126 </div>
127 </div>
128
129 <div style="display : none" onclick="Element.hide(this)" id="small_article_preview"></div>
130
131 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
132 <div id="cmdline" style="display : none"></div>
133 <div id="auxDlg" style="display : none"></div>
134 <div id="headlines-tmp" style="display : none"></div>
135
136 <div id="main" dojoType="dijit.layout.BorderContainer">
137
138 <div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
139 <div id="feedlistLoading">
140 <img src='images/indicator_tiny.gif'/>
141 <?php echo __("Loading, please wait..."); ?></div>
142 <div id="feedTree"></div>
143 </div>
144
145 <div dojoType="dijit.layout.BorderContainer" region="center" id="header-wrap" gutters="false">
146 <div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap">
147
148 <div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
149 <div id="main-toolbar" dojoType="dijit.Toolbar">
150
151 <form id="main_toolbar_form" action="" onsubmit='return false'>
152
153 <button dojoType="dijit.form.Button" id="collapse_feeds_btn"
154 onclick="collapse_feedlist()"
155 title="<?php echo __('Collapse feedlist') ?>" style="display : inline">
156 &lt;&lt;</button>
157
158 <select name="view_mode" title="<?php echo __('Show articles') ?>"
159 onchange="viewModeChanged()"
160 dojoType="dijit.form.Select">
161 <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
162 <option value="all_articles"><?php echo __('All Articles') ?></option>
163 <option value="marked"><?php echo __('Starred') ?></option>
164 <option value="published"><?php echo __('Published') ?></option>
165 <option value="unread"><?php echo __('Unread') ?></option>
166 <option value="unread_first"><?php echo __('Unread First') ?></option>
167 <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
168 </select>
169
170 <select title="<?php echo __('Sort articles') ?>"
171 onchange="viewModeChanged()"
172 dojoType="dijit.form.Select" name="order_by">
173 <option selected="selected" value="default"><?php echo __('Default') ?></option>
174 <option value="date"><?php echo __('Date') ?></option>
175 <option value="title"><?php echo __('Title') ?></option>
176 <option value="score"><?php echo __('Score') ?></option>
177 </select>
178
179 <!-- deprecated -->
180 <button dojoType="dijit.form.Button" name="update" style="display : none"
181 onclick="viewCurrentFeed()">
182 <?php echo __('Update') ?></button>
183
184 <button dojoType="dijit.form.Button"
185 onclick="catchupCurrentFeed()">
186 <?php echo __('Mark as read') ?></button>
187
188 </form>
189
190 <div class="actionChooser">
191
192 <button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
193 title="<?php echo __("Communication problem with server.") ?>">
194 <img
195 src="images/alert.png" />
196 </button>
197
198 <button id="newVersionIcon" dojoType="dijit.form.Button" style="display : none">
199 <img onclick="newVersionDlg()"
200 src="images/new_version.png"
201 title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>" />
202 </button>
203
204
205 <div dojoType="dijit.form.DropDownButton">
206 <span><?php echo __('Actions...') ?></span>
207 <div dojoType="dijit.Menu" style="display: none">
208 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcPrefs')"><?php echo __('Preferences...') ?></div>
209 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcSearch')"><?php echo __('Search...') ?></div>
210 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div>
211 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div>
212 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div>
213 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRescoreFeed')"><?php echo __('Rescore feed') ?></div>
214 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div>
215 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div>
216 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
217 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
218 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
219 <?php if ($pluginhost->get_plugin("digest")) { ?>
220 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcDigest')"><?php echo __('Switch to digest...') ?></div>
221 <?php } ?>
222 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
223 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
224 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div>
225 <?php } ?>
226 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagSelect')"><?php echo __('Select by tags...') ?></div>
227 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div>
228 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div>
229 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div>
230 <?php if (!$_SESSION["hide_logout"]) { ?>
231 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcLogout')"><?php echo __('Logout') ?></div>
232 <?php } ?>
233 </div>
234 </div>
235 </div>
236 </div> <!-- toolbar -->
237 </div> <!-- toolbar pane -->
238
239 <div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center">
240
241 <div id="headlines-toolbar" dojoType="dijit.layout.ContentPane" region="top">
242 </div>
243
244 <div id="headlines-frame" dojoType="dijit.layout.ContentPane"
245 onscroll="headlines_scroll_handler(this)" region="center">
246 <div id="headlinesInnerContainer">
247 <div class="whiteBox"><?php echo __('Loading, please wait...') ?></div>
248 </div>
249 </div>
250
251 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
252 <div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom"
253 style="height : 50%" splitter="true"></div>
254 <?php } ?>
255
256 </div>
257 </div>
258 </div>
259 </div>
260
261 <?php db_close($link); ?>
262
263 </body>
264 </html>