]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | if (file_exists("install") && !file_exists("config.php")) { | |
3 | header("Location: install/"); | |
4 | } | |
5 | ||
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 | ||
12 | // we need a separate check here because functions.php might get parsed | |
13 | // incorrectly before 5.3 because of :: syntax. | |
14 | if (version_compare(PHP_VERSION, '5.3.0', '<')) { | |
15 | print "<b>Fatal Error</b>: PHP version 5.3.0 or newer required.\n"; | |
16 | exit; | |
17 | } | |
18 | ||
19 | set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . | |
20 | get_include_path()); | |
21 | ||
22 | require_once "autoload.php"; | |
23 | require_once "sessions.php"; | |
24 | require_once "functions.php"; | |
25 | require_once "sanity_check.php"; | |
26 | require_once "version.php"; | |
27 | require_once "config.php"; | |
28 | require_once "db-prefs.php"; | |
29 | require_once "lib/Mobile_Detect.php"; | |
30 | ||
31 | $mobile = new Mobile_Detect(); | |
32 | ||
33 | if (!init_plugins()) return; | |
34 | ||
35 | if (!$_REQUEST['mobile']) { | |
36 | if ($mobile->isTablet() && PluginHost::getInstance()->get_plugin("digest")) { | |
37 | header('Location: backend.php?op=digest'); | |
38 | exit; | |
39 | } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("mobile")) { | |
40 | header('Location: backend.php?op=mobile'); | |
41 | exit; | |
42 | } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("digest")) { | |
43 | header('Location: backend.php?op=digest'); | |
44 | exit; | |
45 | } | |
46 | } | |
47 | ||
48 | login_sequence(); | |
49 | ||
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> | |
57 | <title>Tiny Tiny RSS</title> | |
58 | <meta name="viewport" content="initial-scale=1,width=device-width" /> | |
59 | ||
60 | <script type="text/javascript"> | |
61 | var __ttrss_version = "<?php echo VERSION ?>" | |
62 | </script> | |
63 | ||
64 | <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?> | |
65 | <?php echo stylesheet_tag("css/layout.css"); ?> | |
66 | ||
67 | <?php if ($_SESSION["uid"]) { | |
68 | $theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false); | |
69 | if ($theme && theme_valid("$theme")) { | |
70 | echo stylesheet_tag(get_theme_path($theme)); | |
71 | } else { | |
72 | echo stylesheet_tag("themes/default.php"); | |
73 | } | |
74 | } | |
75 | ?> | |
76 | ||
77 | <?php print_user_stylesheet() ?> | |
78 | ||
79 | <style type="text/css"> | |
80 | <?php | |
81 | foreach (PluginHost::getInstance()->get_plugins() as $n => $p) { | |
82 | if (method_exists($p, "get_css")) { | |
83 | echo $p->get_css(); | |
84 | } | |
85 | } | |
86 | ?> | |
87 | </style> | |
88 | ||
89 | <link rel="shortcut icon" type="image/png" href="images/favicon.png"/> | |
90 | <link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" /> | |
91 | ||
92 | <script> | |
93 | dojoConfig = { | |
94 | async: true, | |
95 | cacheBust: new Date(), | |
96 | packages: [ | |
97 | { name: "fox", location: "../../js" }, | |
98 | ] | |
99 | }; | |
100 | </script> | |
101 | ||
102 | <?php | |
103 | foreach (array("lib/prototype.js", | |
104 | "lib/scriptaculous/scriptaculous.js?load=effects,controls", | |
105 | "lib/dojo/dojo.js", | |
106 | "lib/dojo/tt-rss-layer.js", | |
107 | "errors.php?mode=js") as $jsfile) { | |
108 | ||
109 | echo javascript_tag($jsfile); | |
110 | ||
111 | } ?> | |
112 | ||
113 | <script type="text/javascript"> | |
114 | require({cache:{}}); | |
115 | <?php | |
116 | require_once 'lib/jshrink/Minifier.php'; | |
117 | ||
118 | print get_minified_js(array("tt-rss", | |
119 | "functions", "feedlist", "viewfeed", "PluginHost")); | |
120 | ||
121 | foreach (PluginHost::getInstance()->get_plugins() as $n => $p) { | |
122 | if (method_exists($p, "get_js")) { | |
123 | echo "try {"; | |
124 | echo JShrink\Minifier::minify($p->get_js()); | |
125 | echo "} catch (e) { | |
126 | console.warn('failed to initialize plugin JS: $n'); | |
127 | console.warn(e); | |
128 | }"; | |
129 | } | |
130 | } | |
131 | ||
132 | init_js_translations(); | |
133 | ?> | |
134 | </script> | |
135 | ||
136 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
137 | <meta name="referrer" content="no-referrer"/> | |
138 | ||
139 | <script type="text/javascript"> | |
140 | Event.observe(window, 'load', function() { | |
141 | init(); | |
142 | }); | |
143 | </script> | |
144 | </head> | |
145 | ||
146 | <body id="ttrssMain" class="claro"> | |
147 | ||
148 | <div id="overlay" style="display : block"> | |
149 | <div id="overlay_inner"> | |
150 | <div class="insensitive"><?php echo __("Loading, please wait...") ?></div> | |
151 | <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar" | |
152 | progress="0" maximum="100"> | |
153 | </div> | |
154 | <noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript> | |
155 | </div> | |
156 | </div> | |
157 | ||
158 | <div id="notify" class="notify"></div> | |
159 | <div id="cmdline" style="display : none"></div> | |
160 | ||
161 | <div id="main" dojoType="dijit.layout.BorderContainer"> | |
162 | ||
163 | <div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true"> | |
164 | <div id="feedlistLoading"> | |
165 | <img src='images/indicator_tiny.gif'/> | |
166 | <?php echo __("Loading, please wait..."); ?></div> | |
167 | <div id="feedTree"></div> | |
168 | </div> | |
169 | ||
170 | <div dojoType="dijit.layout.BorderContainer" region="center" id="header-wrap" gutters="false"> | |
171 | <div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap"> | |
172 | ||
173 | <div id="toolbar" dojoType="dijit.layout.ContentPane" region="top"> | |
174 | <div id="main-toolbar" dojoType="dijit.Toolbar"> | |
175 | ||
176 | <?php | |
177 | foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON) as $p) { | |
178 | echo $p->hook_main_toolbar_button(); | |
179 | } | |
180 | ?> | |
181 | ||
182 | <form id="headlines-toolbar" action="" onsubmit='return false'> | |
183 | ||
184 | </form> | |
185 | ||
186 | <form id="main_toolbar_form" action="" onsubmit='return false'> | |
187 | ||
188 | <select name="view_mode" title="<?php echo __('Show articles') ?>" | |
189 | onchange="viewModeChanged()" | |
190 | dojoType="dijit.form.Select"> | |
191 | <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option> | |
192 | <option value="all_articles"><?php echo __('All Articles') ?></option> | |
193 | <option value="marked"><?php echo __('Starred') ?></option> | |
194 | <option value="published"><?php echo __('Published') ?></option> | |
195 | <option value="unread"><?php echo __('Unread') ?></option> | |
196 | <option value="has_note"><?php echo __('With Note') ?></option> | |
197 | <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> --> | |
198 | </select> | |
199 | ||
200 | <select title="<?php echo __('Sort articles') ?>" | |
201 | onchange="viewModeChanged()" | |
202 | dojoType="dijit.form.Select" name="order_by"> | |
203 | <option selected="selected" value="default"><?php echo __('Default') ?></option> | |
204 | <option value="feed_dates"><?php echo __('Newest first') ?></option> | |
205 | <option value="date_reverse"><?php echo __('Oldest first') ?></option> | |
206 | <option value="title"><?php echo __('Title') ?></option> | |
207 | </select> | |
208 | ||
209 | <div dojoType="dijit.form.ComboButton" onclick="catchupCurrentFeed()"> | |
210 | <span><?php echo __('Mark as read') ?></span> | |
211 | <div dojoType="dijit.DropDownMenu"> | |
212 | <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1day')"> | |
213 | <?php echo __('Older than one day') ?> | |
214 | </div> | |
215 | <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('1week')"> | |
216 | <?php echo __('Older than one week') ?> | |
217 | </div> | |
218 | <div dojoType="dijit.MenuItem" onclick="catchupCurrentFeed('2week')"> | |
219 | <?php echo __('Older than two weeks') ?> | |
220 | </div> | |
221 | </div> | |
222 | </div> | |
223 | ||
224 | </form> | |
225 | ||
226 | <div class="actionChooser"> | |
227 | ||
228 | <?php | |
229 | foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_TOOLBAR_BUTTON) as $p) { | |
230 | echo $p->hook_toolbar_button(); | |
231 | } | |
232 | ?> | |
233 | ||
234 | <button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true" | |
235 | title="<?php echo __("Communication problem with server.") ?>"> | |
236 | <img src="images/error.png" /> | |
237 | </button> | |
238 | ||
239 | <div dojoType="dijit.form.DropDownButton"> | |
240 | <span><?php echo __('Actions...') ?></span> | |
241 | <div dojoType="dijit.Menu" style="display: none"> | |
242 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcPrefs')"><?php echo __('Preferences...') ?></div> | |
243 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcSearch')"><?php echo __('Search...') ?></div> | |
244 | <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div> | |
245 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div> | |
246 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div> | |
247 | <!-- <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRescoreFeed')"><?php echo __('Rescore feed') ?></div> --> | |
248 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div> | |
249 | <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div> | |
250 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div> | |
251 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div> | |
252 | <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div> | |
253 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div> | |
254 | <!-- <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div> | |
255 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div> --> | |
256 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div> | |
257 | ||
258 | <?php | |
259 | foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ACTION_ITEM) as $p) { | |
260 | echo $p->hook_action_item(); | |
261 | } | |
262 | ?> | |
263 | ||
264 | <?php if (!$_SESSION["hide_logout"]) { ?> | |
265 | <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcLogout')"><?php echo __('Logout') ?></div> | |
266 | <?php } ?> | |
267 | </div> | |
268 | </div> | |
269 | ||
270 | <button id="updatesIcon" dojoType="dijit.form.Button" style="display : none"> | |
271 | <img src="images/new_version.png" title="<?php echo __('Updates are available from Git.') ?>"/> | |
272 | </button> | |
273 | </div> | |
274 | </div> <!-- toolbar --> | |
275 | </div> <!-- toolbar pane --> | |
276 | ||
277 | <div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center"> | |
278 | ||
279 | <div id="floatingTitle" style="visibility : hidden"></div> | |
280 | ||
281 | <div id="headlines-frame" dojoType="dijit.layout.ContentPane" tabindex="0" | |
282 | onscroll="headlines_scroll_handler(this)" region="center"> | |
283 | <div id="headlinesInnerContainer"> | |
284 | <div class="whiteBox"><?php echo __('Loading, please wait...') ?></div> | |
285 | </div> | |
286 | </div> | |
287 | ||
288 | <div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom" | |
289 | style="height : 50%" splitter="true"></div> | |
290 | ||
291 | </div> | |
292 | </div> | |
293 | </div> | |
294 | </div> | |
295 | ||
296 | </body> | |
297 | </html> |