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