From 79c88e11a0b9fdd9c3e98008e77509a69d7fbc9a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 23 Jan 2009 07:39:29 +0100 Subject: [PATCH] move labels subtoolbar section into a function --- functions.php | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/functions.php b/functions.php index 23144f53..0fb1fc28 100644 --- a/functions.php +++ b/functions.php @@ -3961,25 +3961,7 @@ //print "
  • --------
  • "; print "
  • ".__('Assign label:')."
  • "; - print "
  • -   ".__("Create label...")."
  • "; - - $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 WHERE - owner_uid = '".$_SESSION["uid"]."' ORDER BY caption"); - - while ($line = db_fetch_assoc($result)) { - - $label_id = $line["id"]; - $label_caption = $line["caption"]; - - if ($feed_id < -10 && $feed_id == -11-$label_id) { - print "
  • -   $label_caption ".__('(remove)')."
  • "; - } else { - print "
  • -   $label_caption
  • "; - } - } + print_labels_headlines_dropdown($link, $feed_id); print ""; print ""; @@ -6021,4 +6003,28 @@ db_query($link, "COMMIT"); } + + function print_labels_headlines_dropdown($link, $feed_id) { + print "
  • +   ".__("Create label...")."
  • "; + + $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 WHERE + owner_uid = '".$_SESSION["uid"]."' ORDER BY caption"); + + while ($line = db_fetch_assoc($result)) { + + $label_id = $line["id"]; + $label_caption = $line["caption"]; + + if ($feed_id < -10 && $feed_id == -11-$label_id) { + print "
  • +   $label_caption ".__('(remove)')."
  • "; + } else { + print "
  • +   $label_caption
  • "; + } + } + } ?> -- 2.39.5