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