move labels subtoolbar section into a function
This commit is contained in:
parent
73495fd16f
commit
79c88e11a0
|
@ -3961,25 +3961,7 @@
|
||||||
//print "<li><span class=\"insensitive\">--------</span></li>";
|
//print "<li><span class=\"insensitive\">--------</span></li>";
|
||||||
print "<li class=\"insensitive\">".__('Assign label:')."</li>";
|
print "<li class=\"insensitive\">".__('Assign label:')."</li>";
|
||||||
|
|
||||||
print "<li onclick=\"javascript:addLabel()\">
|
print_labels_headlines_dropdown($link, $feed_id);
|
||||||
".__("Create label...")."</li>";
|
|
||||||
|
|
||||||
$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 "<li onclick=\"javascript:selectionRemoveLabel($label_id)\">
|
|
||||||
$label_caption ".__('(remove)')."</li>";
|
|
||||||
} else {
|
|
||||||
print "<li onclick=\"javascript:selectionAssignLabel($label_id)\">
|
|
||||||
$label_caption</li>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</ul>";
|
print "</ul>";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
@ -6021,4 +6003,28 @@
|
||||||
|
|
||||||
db_query($link, "COMMIT");
|
db_query($link, "COMMIT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function print_labels_headlines_dropdown($link, $feed_id) {
|
||||||
|
print "<li onclick=\"javascript:addLabel()\">
|
||||||
|
".__("Create label...")."</li>";
|
||||||
|
|
||||||
|
$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 "<li id=\"LHDL-$id\"
|
||||||
|
onclick=\"javascript:selectionRemoveLabel($label_id)\">
|
||||||
|
$label_caption ".__('(remove)')."</li>";
|
||||||
|
} else {
|
||||||
|
print "<li id=\"LHDL-$id\"
|
||||||
|
onclick=\"javascript:selectionAssignLabel($label_id)\">
|
||||||
|
$label_caption</li>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue