]> git.wh0rd.org Git - tt-rss.git/blob - index.php
js: remove several commented out functions
[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         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         <?php if (!$_SESSION["hide_hello"]) { ?>
121                         <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
122         <?php } ?>
123         <a href="prefs.php"><?php echo __('Preferences') ?></a>
124
125         <?php if (defined('FEEDBACK_URL') && FEEDBACK_URL) { ?>
126                 | <a target="_blank" class="feedback" href="<?php echo FEEDBACK_URL ?>">
127                                 <?php echo __('Comments?') ?></a>
128         <?php } ?>
129
130         <?php if (!$_SESSION["hide_logout"]) { ?>
131                         | <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
132         <?php } ?>
133
134         <img id="newVersionIcon" style="display:none" onclick="newVersionDlg()"
135                 width="13" height="13"
136                 src="<?php echo theme_image($link, 'images/new_version.png') ?>"
137                 title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>"
138                 alt="new_version_icon"/>
139 </div>
140
141 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
142 <div id="cmdline" style="display : none"></div>
143 <div id="auxDlg" style="display : none"></div>
144 <div id="headlines-tmp" style="display : none"></div>
145
146 <div id="main" dojoType="dijit.layout.BorderContainer">
147
148 <div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
149         <div id="feedlistLoading">
150                 <img src='images/indicator_tiny.gif'/>
151                 <?php echo  __("Loading, please wait..."); ?></div>
152         <div id="feedTree"></div>
153 </div>
154
155 <div dojoType="dijit.layout.BorderContainer" region="center" id="header-wrap" gutters="false">
156 <div dojoType="dijit.layout.TabContainer" region="center" id="content-tabs">
157 <div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap"
158         title="<?php echo __("News") ?>">
159
160 <div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
161         <div id="main-toolbar" dojoType="dijit.Toolbar">
162
163                 <form id="main_toolbar_form" action="" onsubmit='return false'>
164
165                 <button dojoType="dijit.form.Button" id="collapse_feeds_btn"
166                         onclick="collapse_feedlist()"
167                         title="<?php echo __('Collapse feedlist') ?>" style="display : inline">
168                         &lt;&lt;</button>
169
170                 <select name="view_mode" title="<?php echo __('Show articles') ?>"
171                         onchange="viewModeChanged()"
172                         dojoType="dijit.form.Select">
173                         <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
174                         <option value="all_articles"><?php echo __('All Articles') ?></option>
175                         <option value="marked"><?php echo __('Starred') ?></option>
176                         <option value="published"><?php echo __('Published') ?></option>
177                         <option value="unread"><?php echo __('Unread') ?></option>
178                         <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
179                         <option value="updated"><?php echo __('Updated') ?></option>
180                 </select>
181
182                 <select title="<?php echo __('Sort articles') ?>"
183                         onchange="viewModeChanged()"
184                         dojoType="dijit.form.Select" name="order_by">
185                         <option selected="selected" value="default"><?php echo __('Default') ?></option>
186                         <option value="date"><?php echo __('Date') ?></option>
187                         <option value="title"><?php echo __('Title') ?></option>
188                         <option value="score"><?php echo __('Score') ?></option>
189                 </select>
190
191                 <button dojoType="dijit.form.Button" name="update"
192                         onclick="viewCurrentFeed()">
193                         <?php echo __('Update') ?></button>
194
195                 <button dojoType="dijit.form.Button"
196                         onclick="catchupCurrentFeed()">
197                         <?php echo __('Mark as read') ?></button>
198
199                 </form>
200
201                 <div class="actionChooser">
202                         <div dojoType="dijit.form.DropDownButton">
203                                 <span><?php echo __('Actions...') ?></span>
204                                 <div dojoType="dijit.Menu" style="display: none">
205                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcSearch')"><?php echo __('Search...') ?></div>
206                                         <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div>
207                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div>
208                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div>
209                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRescoreFeed')"><?php echo __('Rescore feed') ?></div>
210                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div>
211                                         <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div>
212                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
213                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
214                                         <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
215                                         <?php if ($pluginhost->get_plugin("digest")) { ?>
216                                         <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcDigest')"><?php echo __('Switch to digest...') ?></div>
217                                         <?php } ?>
218                                                 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
219                                                 <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div>
220
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                                 </div>
226                         </div>
227                 </div>
228         </div> <!-- toolbar -->
229 </div> <!-- toolbar pane -->
230
231         <div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center">
232
233                 <div id="headlines-toolbar" dojoType="dijit.layout.ContentPane" region="top">
234                 </div>
235
236                 <div id="headlines-frame" dojoType="dijit.layout.ContentPane"
237                                 onscroll="headlines_scroll_handler(this)" region="center">
238                         <div id="headlinesInnerContainer">
239                                 <div class="whiteBox"><?php echo __('Loading, please wait...') ?></div>
240                         </div>
241                 </div>
242
243                 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
244                 <div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom"
245                         style="height : 50%" splitter="true"></div>
246                 <?php } ?>
247
248         </div>
249 </div>
250 </div>
251 </div>
252 </div>
253
254 <?php db_close($link); ?>
255
256 </body>
257 </html>