]> git.wh0rd.org - tt-rss.git/blob - index.php
French translation update
[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 }
39 }
40
41
42 login_sequence($link);
43
44 no_cache_incantation();
45
46 header('Content-Type: text/html; charset=utf-8');
47
48 ?>
49 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
50 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
51 <html>
52 <head>
53 <title>Tiny Tiny RSS</title>
54
55 <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
56 <?php echo stylesheet_tag("tt-rss.css"); ?>
57 <?php echo stylesheet_tag("cdm.css"); ?>
58
59 <?php print_user_stylesheet($link) ?>
60
61 <style type="text/css">
62 <?php
63 foreach ($pluginhost->get_plugins() as $n => $p) {
64 if (method_exists($p, "get_css")) {
65 echo $p->get_css();
66 }
67 }
68 ?>
69 </style>
70
71 <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
72 <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
73
74 <?php
75 foreach (array("lib/prototype.js",
76 "lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls",
77 "lib/dojo/dojo.js",
78 "lib/dijit/dijit.js",
79 "lib/dojo/tt-rss-layer.js",
80 "localized_js.php",
81 "errors.php?mode=js") as $jsfile) {
82
83 echo javascript_tag($jsfile);
84
85 } ?>
86
87 <script type="text/javascript">
88 <?php
89 require 'lib/jshrink/Minifier.php';
90
91 global $pluginhost;
92
93 foreach ($pluginhost->get_plugins() as $n => $p) {
94 if (method_exists($p, "get_js")) {
95 echo JShrink\Minifier::minify($p->get_js());
96 }
97 }
98
99 print get_minified_js(array("tt-rss",
100 "functions", "feedlist", "viewfeed", "FeedTree"));
101
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 </head>
113
114 <body id="ttrssMain" class="claro">
115
116 <div id="overlay" style="display : block">
117 <div id="overlay_inner">
118 <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
119 <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
120 progress="0" maximum="100">
121 </div>
122 <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
123 </div>
124 </div>
125
126 <div id="header">
127 <img id="net-alert" style="display : none"
128 title="<?php echo __("Communication problem with server.") ?>"
129 src="images/alert.png"/>
130
131 <img id="newVersionIcon" style="display:none" onclick="newVersionDlg()"
132 width="13" height="13"
133 src="images/new_version.png"
134 title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>"
135 alt="new_version_icon"/>
136 </div>
137
138 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
139 <div id="cmdline" style="display : none"></div>
140 <div id="auxDlg" style="display : none"></div>
141 <div id="headlines-tmp" style="display : none"></div>
142
143 <div id="main" dojoType="dijit.layout.BorderContainer">
144
145 <div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
146 <div id="feedlistLoading">
147 <img src='images/indicator_tiny.gif'/>
148 <?php echo __("Loading, please wait..."); ?></div>
149 <div id="feedTree"></div>
150 </div>
151
152 <div dojoType="dijit.layout.BorderContainer" region="center" id="header-wrap" gutters="false">
153 <div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap">
154
155 <div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
156 <div id="main-toolbar" dojoType="dijit.Toolbar">
157
158 <form id="main_toolbar_form" action="" onsubmit='return false'>
159
160 <button dojoType="dijit.form.Button" id="collapse_feeds_btn"
161 onclick="collapse_feedlist()"
162 title="<?php echo __('Collapse feedlist') ?>" style="display : inline">
163 &lt;&lt;</button>
164
165 <select name="view_mode" title="<?php echo __('Show articles') ?>"
166 onchange="viewModeChanged()"
167 dojoType="dijit.form.Select">
168 <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
169 <option value="all_articles"><?php echo __('All Articles') ?></option>
170 <option value="marked"><?php echo __('Starred') ?></option>
171 <option value="published"><?php echo __('Published') ?></option>
172 <option value="unread"><?php echo __('Unread') ?></option>
173 <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
174 <option value="updated"><?php echo __('Updated') ?></option>
175 </select>
176
177 <select title="<?php echo __('Sort articles') ?>"
178 onchange="viewModeChanged()"
179 dojoType="dijit.form.Select" name="order_by">
180 <option selected="selected" value="default"><?php echo __('Default') ?></option>
181 <option value="date"><?php echo __('Date') ?></option>
182 <option value="title"><?php echo __('Title') ?></option>
183 <option value="score"><?php echo __('Score') ?></option>
184 </select>
185
186 <!-- deprecated -->
187 <button dojoType="dijit.form.Button" name="update" style="display : none"
188 onclick="viewCurrentFeed()">
189 <?php echo __('Update') ?></button>
190
191 <button dojoType="dijit.form.Button"
192 onclick="catchupCurrentFeed()">
193 <?php echo __('Mark as read') ?></button>
194
195 </form>
196
197 <div class="actionChooser">
198
199 <button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
200 title="<?php echo __("Communication problem with server.") ?>">
201 <img
202 src="images/alert.png" />
203 </button>
204
205 <button id="newVersionIcon" dojoType="dijit.form.Button" style="display : none">
206 <img onclick="newVersionDlg()"
207 src="images/new_version.png"
208 title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>" />
209 </button>
210
211
212 <div dojoType="dijit.form.DropDownButton">
213 <span><?php echo __('Actions...') ?></span>
214 <div dojoType="dijit.Menu" style="display: none">
215 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcPrefs')"><?php echo __('Preferences...') ?></div>
216 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcSearch')"><?php echo __('Search...') ?></div>
217 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div>
218 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div>
219 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div>
220 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRescoreFeed')"><?php echo __('Rescore feed') ?></div>
221 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div>
222 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div>
223 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
224 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
225 <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
226 <?php if ($pluginhost->get_plugin("digest")) { ?>
227 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcDigest')"><?php echo __('Switch to digest...') ?></div>
228 <?php } ?>
229 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
230 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
231 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div>
232 <?php } ?>
233 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagSelect')"><?php echo __('Select by tags...') ?></div>
234 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div>
235 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div>
236 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div>
237 <?php if (!$_SESSION["hide_logout"]) { ?>
238 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcLogout')"><?php echo __('Logout') ?></div>
239 <?php } ?>
240 </div>
241 </div>
242 </div>
243 </div> <!-- toolbar -->
244 </div> <!-- toolbar pane -->
245
246 <div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center">
247
248 <div id="headlines-toolbar" dojoType="dijit.layout.ContentPane" region="top">
249 </div>
250
251 <div id="headlines-frame" dojoType="dijit.layout.ContentPane"
252 onscroll="headlines_scroll_handler(this)" region="center">
253 <div id="headlinesInnerContainer">
254 <div class="whiteBox"><?php echo __('Loading, please wait...') ?></div>
255 </div>
256 </div>
257
258 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
259 <div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom"
260 style="height : 50%" splitter="true"></div>
261 <?php } ?>
262
263 </div>
264 </div>
265 </div>
266 </div>
267
268 <?php db_close($link); ?>
269
270 </body>
271 </html>