]> git.wh0rd.org - tt-rss.git/commitdiff
move getArticleFeed to Article
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 4 May 2017 11:26:44 +0000 (14:26 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 4 May 2017 11:26:44 +0000 (14:26 +0300)
move print_label_select to controls

classes/article.php
classes/feeds.php
include/controls.php
include/functions2.php

index 2e7a05e0bb1db7e125242adcef0b9182e5895d52..b842ea40bf724cfce139f13d04da9505f23e11a9 100644 (file)
@@ -80,7 +80,7 @@ class Article extends Handler_Protected {
                        WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
                }
 
-               $feed_id = getArticleFeed($id);
+               $feed_id = $this->getArticleFeed($id);
                ccache_update($feed_id, $_SESSION["uid"]);
        }
 
@@ -371,6 +371,16 @@ class Article extends Handler_Protected {
                print json_encode($reply);
        }
 
+       function getArticleFeed($id) {
+               $result = db_query("SELECT feed_id FROM ttrss_user_entries
+                       WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+
+               if (db_num_rows($result) != 0) {
+                       return db_fetch_result($result, 0, "feed_id");
+               } else {
+                       return 0;
+               }
+       }
 
 
 }
index 4c4972d76d3d17ca4f74fa924f1d31bdb69a5551..4d4707a94a6e11bbf8f5e56283dd76ad28c48d47 100755 (executable)
@@ -1241,5 +1241,7 @@ class Feeds extends Handler_Protected {
                <?php
 
        }
+
+
 }
 ?>
index 0c5683082db0ea272fd84838d951425f6ffb1fe8..3ddf4fd9d17a3efd7b5728ba078b7329ecf536a8 100644 (file)
@@ -300,3 +300,28 @@ function format_inline_player($url, $ctype) {
 
        return "";
 }
+
+function print_label_select($name, $value, $attributes = "") {
+
+       $result = db_query("SELECT caption FROM ttrss_labels2
+                       WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption");
+
+       print "<select default=\"$value\" name=\"" . htmlspecialchars($name) .
+               "\" $attributes>";
+
+       while ($line = db_fetch_assoc($result)) {
+
+               $issel = ($line["caption"] == $value) ? "selected=\"1\"" : "";
+
+               print "<option value=\"".htmlspecialchars($line["caption"])."\"
+                               $issel>" . htmlspecialchars($line["caption"]) . "</option>";
+
+       }
+
+#              print "<option value=\"ADD_LABEL\">" .__("Add label...") . "</option>";
+
+       print "</select>";
+
+
+}
+
index c89e572f2857c953d7eb36b68897a04e32729455..e922023508f6df56e715e5abcd3c62573451da3a 100644 (file)
                return false;
        }
 
-       function getArticleFeed($id) {
-               $result = db_query("SELECT feed_id FROM ttrss_user_entries
-                       WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
-
-               if (db_num_rows($result) != 0) {
-                       return db_fetch_result($result, 0, "feed_id");
-               } else {
-                       return 0;
-               }
-       }
-
        /**
         * Fixes incomplete URLs by prepending "http://".
         * Also replaces feed:// with http://, and
                return is_html(fetch_file_contents($url, false, $login, $pass));
        }
 
-       function print_label_select($name, $value, $attributes = "") {
-
-               $result = db_query("SELECT caption FROM ttrss_labels2
-                       WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption");
-
-               print "<select default=\"$value\" name=\"" . htmlspecialchars($name) .
-                       "\" $attributes>";
-
-               while ($line = db_fetch_assoc($result)) {
-
-                       $issel = ($line["caption"] == $value) ? "selected=\"1\"" : "";
-
-                       print "<option value=\"".htmlspecialchars($line["caption"])."\"
-                               $issel>" . htmlspecialchars($line["caption"]) . "</option>";
-
-               }
-
-#              print "<option value=\"ADD_LABEL\">" .__("Add label...") . "</option>";
-
-               print "</select>";
-
-
-       }
-
        function format_article_enclosures($id, $always_display_enclosures,
                                        $article_content, $hide_images = false) {