]> git.wh0rd.org - tt-rss.git/blobdiff - index.php
Merge pull request #186 from EyesX/master
[tt-rss.git] / index.php
index cb95b96f0219afdc4fe7e359e3a0a41597588611..29b8b173d6c08d02af21ef0d9746a4508be5a40b 100644 (file)
--- a/index.php
+++ b/index.php
 
        $mobile = new Mobile_Detect();
 
-       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
        if (!init_plugins()) return;
 
-       global $pluginhost;
-
        if (!$_REQUEST['mobile']) {
-               if ($mobile->isTablet() && $pluginhost->get_plugin("digest")) {
+               if ($mobile->isTablet() && PluginHost::getInstance()->get_plugin("digest")) {
                        header('Location: backend.php?op=digest');
                        exit;
-               } else if ($mobile->isMobile() && $pluginhost->get_plugin("mobile")) {
+               } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("mobile")) {
                        header('Location: backend.php?op=mobile');
                        exit;
-               } else if ($mobile->isMobile() && $pluginhost->get_plugin("digest")) {
+               } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("digest")) {
                        header('Location: backend.php?op=digest');
                        exit;
                }
 <head>
        <title>Tiny Tiny RSS</title>
 
-       <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
-       <?php echo stylesheet_tag("tt-rss.css"); ?>
-       <?php echo stylesheet_tag("cdm.css"); ?>
+       <?php stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
+       <?php stylesheet_tag("tt-rss.css"); ?>
+       <?php stylesheet_tag("cdm.css"); ?>
 
        <?php if ($_SESSION["uid"]) {
                $theme = get_pref( "USER_CSS_THEME", $_SESSION["uid"], false);
                if ($theme) {
-                       echo stylesheet_tag("themes/$theme");
+                       stylesheet_tag("themes/$theme");
                }
        }
        ?>
@@ -76,7 +72,7 @@
 
        <style type="text/css">
        <?php
-               foreach ($pluginhost->get_plugins() as $n => $p) {
+               foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
                        if (method_exists($p, "get_css")) {
                                echo $p->get_css();
                        }
@@ -95,7 +91,7 @@
                                "lib/dojo/tt-rss-layer.js",
                                "errors.php?mode=js") as $jsfile) {
 
-               echo javascript_tag($jsfile);
+               javascript_tag($jsfile);
 
        } ?>
 
                require 'lib/jshrink/Minifier.php';
 
                print get_minified_js(array("tt-rss",
-                       "functions", "feedlist", "viewfeed", "FeedTree"));
+                       "functions", "feedlist", "viewfeed", "FeedTree", "PluginHost"));
 
-               global $pluginhost;
-
-               foreach ($pluginhost->get_plugins() as $n => $p) {
+               foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
                        if (method_exists($p, "get_js")) {
                                echo JShrink\Minifier::minify($p->get_js());
                        }
                <div class="actionChooser">
 
                        <?php
-                               global $pluginhost;
-                               foreach ($pluginhost->get_hooks($pluginhost::HOOK_TOOLBAR_BUTTON) as $p) {
+                               foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_TOOLBAR_BUTTON) as $p) {
                                         echo $p->hook_toolbar_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>
-                                       <?php } ?> -->
-                                               <!-- <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div> -->
-                                               <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div>
+                                       <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></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> -->
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div>
 
                                        <?php
-                                               foreach ($pluginhost->get_hooks($pluginhost::HOOK_ACTION_ITEM) as $p) {
+                                               foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ACTION_ITEM) as $p) {
                                                 echo $p->hook_action_item();
                                                }
                                        ?>
 </div>
 </div>
 
-<?php db_close(); ?>
-
 </body>
 </html>