]> git.wh0rd.org - tt-rss.git/blobdiff - index.php
move digest to a separate plugin
[tt-rss.git] / index.php
index 3a68c90f67b202d1f68af8e814e8e5fa476f2041..b86cd0e664c62d14ee6435a54c718feb51897eca 100644 (file)
--- a/index.php
+++ b/index.php
@@ -5,8 +5,8 @@
                exit;
        }
 
-       set_include_path(get_include_path() . PATH_SEPARATOR .
-               dirname(__FILE__) ."/include");
+       set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+               get_include_path());
 
        require_once "functions.php";
        require_once "sessions.php";
 
        $mobile = new Mobile_Detect();
 
+       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
+
+       if (!init_connection($link)) return;
+
+       global $pluginhost;
+
        if (!$_REQUEST['mobile']) {
-               if ($mobile->isTablet()) {
-                       header('Location: digest.php');
+               if ($mobile->isTablet() && $pluginhost->get_plugin("digest")) {
+                       header('Location: backend.php?op=digest');
                        exit;
                } else if ($mobile->isMobile()) {
                        header('Location: mobile/index.php');
@@ -28,9 +34,6 @@
                }
        }
 
-       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
-       if (!init_connection($link)) return;
 
        login_sequence($link);
 
        <?php
                require 'lib/jsmin.php';
 
-               foreach (explode(",", ARTICLE_BUTTON_PLUGINS) as $p) {
-                       $jsf = "js/".trim($p)."_button.js";
-                       if (file_exists($jsf)) {
-                               echo JSMin::minify(file_get_contents($jsf));
+               global $pluginhost;
+
+               foreach ($pluginhost->get_plugins() as $n => $p) {
+                       if (method_exists($p, "get_js")) {
+                               echo JSMin::minify($p->get_js());
                        }
                }
 
 </div>
 
 <div id="header">
-       <?php if (!SINGLE_USER_MODE && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) { ?>
+       <?php if (!$_SESSION["hide_hello"]) { ?>
                        <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
        <?php } ?>
        <a href="prefs.php"><?php echo __('Preferences') ?></a>
                                <?php echo __('Comments?') ?></a>
        <?php } ?>
 
-       <?php if (!SINGLE_USER_MODE && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) { ?>
+       <?php if (!$_SESSION["hide_logout"]) { ?>
                        | <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
        <?php } ?>
 
                        <option value="score"><?php echo __('Score') ?></option>
                </select>
 
-               &nbsp;
-
-               <!-- <input dojoType="dijit.form.CheckBox" type="checkbox"
-                       onchange="viewCurrentFeed()"
-                       name="include_children" id="include_children">
-               <label id="include_children_label" for="include_children">
-                       <?php echo __('With subcategories') ?></label> -->
-
-               <button dojoType="dijit.form.ToggleButton" name="include_children"
-                       id="include_children"
-                       onchange="viewCurrentFeed()">
-                       <?php echo __('With subcategories') ?></button>
-
                <button dojoType="dijit.form.Button" name="update"
-                       onclick="scheduleFeedUpdate()">
+                       onclick="viewCurrentFeed()">
                        <?php echo __('Update') ?></button>
 
                <button dojoType="dijit.form.Button"
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
                                        <div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
+                                       <?php if ($pluginhost->get_plugin("digest")) { ?>
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcDigest')"><?php echo __('Switch to digest...') ?></div>
-                                       <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
+                                       <?php } ?>
+                                               <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagSelect')"><?php echo __('Select by tags...') ?></div>
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div>
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div>