]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/feeds.php
Merge pull request #179 from nottwo/$link-cleanup
[tt-rss.git] / classes / pref / feeds.php
index 054ea4e8c09dfe51a0279d351018784ba0349da3..ab280a98e9a8eb67fd8c0d5e4d1659b5c0337a50 100644 (file)
@@ -124,9 +124,7 @@ class Pref_Feeds extends Handler_Protected {
 
                        /* Plugin feeds for -1 */
 
-                       global $pluginhost;
-
-                       $feeds = $pluginhost->get_feeds(-1);
+                       $feeds = PluginHost::getInstance()->get_feeds(-1);
 
                        if ($feeds) {
                                foreach ($feeds as $feed) {
@@ -502,14 +500,8 @@ class Pref_Feeds extends Handler_Protected {
                                if ($this->dbh->num_rows($result) != 0) {
                                        @unlink(ICONS_DIR . "/$feed_id.ico");
                                        if (rename($icon_file, ICONS_DIR . "/$feed_id.ico")) {
-
-                                               require_once "colors.php";
-
-                                               $favicon_color = $this->dbh->escape_string(
-                                                       calculate_avg_color(ICONS_DIR . "/$feed_id.ico"));
-
                                                $this->dbh->query("UPDATE ttrss_feeds SET
-                                                       favicon_avg_color = '$favicon_color'
+                                                       favicon_avg_color = ''
                                                        WHERE id = '$feed_id'");
 
                                                $rc = 0;
@@ -750,6 +742,9 @@ class Pref_Feeds extends Handler_Protected {
 
                print "</div>";
 
+               PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_EDIT_FEED,
+                       "hook_prefs_edit_feed", $feed_id);
+
                $title = htmlspecialchars($title, ENT_QUOTES);
 
                print "<div class='dlgButtons'>
@@ -1001,6 +996,9 @@ class Pref_Feeds extends Handler_Protected {
                                mark_unread_on_update = $mark_unread_on_update
                        WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
 
+                       PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_SAVE_FEED,
+                               "hook_prefs_save_feed", $feed_id);
+
                } else {
                        $feed_data = array();
 
@@ -1456,8 +1454,7 @@ class Pref_Feeds extends Handler_Protected {
                print "<button dojoType=\"dijit.form.Button\" onclick=\"return displayDlg('".__("Public OPML URL")."','pubOPMLUrl')\">".
                        __('Display published OPML URL')."</button> ";
 
-               global $pluginhost;
-               $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB_SECTION,
+               PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION,
                        "hook_prefs_tab_section", "prefFeedsOPML");
 
                print "</div>"; # pane
@@ -1503,15 +1500,12 @@ class Pref_Feeds extends Handler_Protected {
                print "<button dojoType=\"dijit.form.Button\" onclick=\"return clearArticleAccessKeys()\">".
                        __('Unshare all articles')."</button> ";
 
-               global $pluginhost;
-               $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB_SECTION,
+               PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION,
                        "hook_prefs_tab_section", "prefFeedsPublishedGenerated");
 
                print "</div>"; #pane
 
-               global $pluginhost;
-
-               $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+               PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB,
                        "hook_prefs_tab", "prefFeeds");
 
                print "</div>"; #container
@@ -1600,7 +1594,6 @@ class Pref_Feeds extends Handler_Protected {
 
                while ($line = $this->dbh->fetch_assoc($result)) {
 
-                       $class = ($lnum % 2) ? "even" : "odd";
                        $feed_id = $line["id"];
                        $this_row_id = "id=\"FUPDD-$feed_id\"";
 
@@ -1670,7 +1663,6 @@ class Pref_Feeds extends Handler_Protected {
 
                while ($line = $this->dbh->fetch_assoc($result)) {
 
-                       $class = ($lnum % 2) ? "even" : "odd";
                        $feed_id = $line["id"];
                        $this_row_id = "id=\"FERDD-$feed_id\"";