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