From 103d30ad3f92ed03156fee400801d9a38f946b34 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Feb 2021 22:16:17 +0300 Subject: batch subscribe: use client dialog --- include/controls.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'include/controls.php') diff --git a/include/controls.php b/include/controls.php index 8f49e99c5..e6678db9a 100755 --- a/include/controls.php +++ b/include/controls.php @@ -181,11 +181,19 @@ function print_feed_multi_select($id, $default_ids = [], } } -function print_feed_cat_select($id, $default_id, - $attributes, $include_all_cats = true, $root_id = null, $nest_level = 0) { +function print_feed_cat_select($id, $default_id, $attributes, $include_all_cats = true, + $root_id = null, $nest_level = 0) { + + print format_feed_cat_select($id, $default_id, $attributes, $include_all_cats, $root_id, $nest_level); +} + +function format_feed_cat_select($id, $default_id, $attributes, $include_all_cats = true, + $root_id = null, $nest_level = 0) { + + $ret = ""; if (!$root_id) { - print ""; } $pdo = Db::pdo(); @@ -215,18 +223,18 @@ function print_feed_cat_select($id, $default_id, $line["title"] = " " . $line["title"]; if ($line["title"]) - printf("", + $ret .= sprintf("", $line["id"], htmlspecialchars($line["title"])); if ($line["num_children"] > 0) - print_feed_cat_select($id, $default_id, $attributes, + $ret .= format_feed_cat_select($id, $default_id, $attributes, $include_all_cats, $line["id"], $nest_level+1); } if (!$root_id) { if ($include_all_cats) { if ($found > 0) { - print ""; + $ret .= ""; } if ($default_id == 0) { @@ -235,10 +243,12 @@ function print_feed_cat_select($id, $default_id, $is_selected = ""; } - print ""; + $ret .= ""; } - print ""; + $ret .= ""; } + + return $ret; } function stylesheet_tag($filename, $id = false) { -- cgit v1.2.3