]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/feeds.php
Merge branch 'hook_feed_basic_info' of wn/tt-rss into master
[tt-rss.git] / classes / pref / feeds.php
index 78e0f2f2bf70ee1fe6d93d3f67eef8aabd0c5bc4..b0f82e7e4228a044460a868bde43133a936dd90c 100755 (executable)
@@ -339,7 +339,7 @@ class Pref_Feeds extends Handler_Protected {
                                owner_uid = " . $_SESSION["uid"]);
                }
 
-               $order_id = 0;
+               $order_id = 1;
 
                $cat = $data_map[$item_id];
 
@@ -784,20 +784,8 @@ class Pref_Feeds extends Handler_Protected {
                        <button class=\"danger\" dojoType=\"dijit.form.Button\" onclick='return unsubscribeFeed($feed_id, \"$title\")'>".
                                __('Unsubscribe')."</button>";
 
-               if (PUBSUBHUBBUB_ENABLED) {
-                       $pubsub_state = $this->dbh->fetch_result($result, 0, "pubsub_state");
-                       $pubsub_btn_disabled = ($pubsub_state == 2) ? "" : "disabled=\"1\"";
-
-                       print "<button dojoType=\"dijit.form.Button\" id=\"pubsubReset_Btn\" $pubsub_btn_disabled
-                                       onclick='return resetPubSub($feed_id, \"$title\")'>".__('Resubscribe to push updates').
-                                       "</button>";
-               }
-
                print "</div>";
 
-               print "<div dojoType=\"dijit.Tooltip\" connectId=\"pubsubReset_Btn\" position=\"below\">".
-                       __('Resets PubSubHubbub subscription status for push-enabled feeds.')."</div>";
-
                print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedEditDlg').execute()\">".__('Save')."</button>
                        <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedEditDlg').hide()\">".__('Cancel')."</button>
                </div>";
@@ -1118,16 +1106,6 @@ class Pref_Feeds extends Handler_Protected {
                return;
        }
 
-       function resetPubSub() {
-
-               $ids = $this->dbh->escape_string($_REQUEST["ids"]);
-
-               $this->dbh->query("UPDATE ttrss_feeds SET pubsub_state = 0 WHERE id IN ($ids)
-                       AND owner_uid = " . $_SESSION["uid"]);
-
-               return;
-       }
-
        function remove() {
 
                $ids = explode(",", $this->dbh->escape_string($_REQUEST["ids"]));
@@ -1489,7 +1467,7 @@ class Pref_Feeds extends Handler_Protected {
 
                        print "<button onclick='window.navigator.registerContentHandler(" .
                       "\"application/vnd.mozilla.maybe.feed\", " .
-                      "\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
+                      "\"" . $this->subscribe_to_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
                                                         __('Click here to register this site as a feed reader.') .
                                "</button>";
 
@@ -1972,4 +1950,11 @@ class Pref_Feeds extends Handler_Protected {
 
                print (int) $this->dbh->fetch_result($result, 0, "num_inactive");
        }
+
+       static function subscribe_to_feed_url() {
+               $url_path = get_self_url_prefix() .
+                       "/public.php?op=subscribe&feed_url=%s";
+               return $url_path;
+       }
+
 }
\ No newline at end of file