make feed/cat nested dropdowns a bit more readable

This commit is contained in:
Andrew Dolgov 2021-02-10 08:58:31 +03:00
parent d630a92c40
commit 7833760fa0
1 changed files with 7 additions and 7 deletions

View File

@ -102,7 +102,7 @@ function print_feed_multi_select($id, $default_ids = [],
while ($line = $sth->fetch()) { while ($line = $sth->fetch()) {
for ($i = 0; $i < $nest_level; $i++) for ($i = 0; $i < $nest_level; $i++)
$line["title"] = " - " . $line["title"]; $line["title"] = "" . $line["title"];
$is_selected = in_array("CAT:".$line["id"], $default_ids) ? "selected=\"1\"" : ""; $is_selected = in_array("CAT:".$line["id"], $default_ids) ? "selected=\"1\"" : "";
@ -121,10 +121,10 @@ function print_feed_multi_select($id, $default_ids = [],
while ($fline = $f_sth->fetch()) { while ($fline = $f_sth->fetch()) {
$is_selected = (in_array($fline["id"], $default_ids)) ? "selected=\"1\"" : ""; $is_selected = (in_array($fline["id"], $default_ids)) ? "selected=\"1\"" : "";
$fline["title"] = " + " . $fline["title"]; $fline["title"] = "" . $fline["title"];
for ($i = 0; $i < $nest_level; $i++) for ($i = 0; $i < $nest_level; $i++)
$fline["title"] = " - " . $fline["title"]; $fline["title"] = "" . $fline["title"];
printf("<option $is_selected value='%d'>%s</option>", printf("<option $is_selected value='%d'>%s</option>",
$fline["id"], htmlspecialchars($fline["title"])); $fline["id"], htmlspecialchars($fline["title"]));
@ -144,10 +144,10 @@ function print_feed_multi_select($id, $default_ids = [],
while ($fline = $f_sth->fetch()) { while ($fline = $f_sth->fetch()) {
$is_selected = in_array($fline["id"], $default_ids) ? "selected=\"1\"" : ""; $is_selected = in_array($fline["id"], $default_ids) ? "selected=\"1\"" : "";
$fline["title"] = " + " . $fline["title"]; $fline["title"] = "" . $fline["title"];
for ($i = 0; $i < $nest_level; $i++) for ($i = 0; $i < $nest_level; $i++)
$fline["title"] = " - " . $fline["title"]; $fline["title"] = "" . $fline["title"];
printf("<option $is_selected value='%d'>%s</option>", printf("<option $is_selected value='%d'>%s</option>",
$fline["id"], htmlspecialchars($fline["title"])); $fline["id"], htmlspecialchars($fline["title"]));
@ -204,7 +204,7 @@ function print_feed_cat_select($id, $default_id,
} }
for ($i = 0; $i < $nest_level; $i++) for ($i = 0; $i < $nest_level; $i++)
$line["title"] = " - " . $line["title"]; $line["title"] = "" . $line["title"];
if ($line["title"]) if ($line["title"])
printf("<option $is_selected value='%d'>%s</option>", printf("<option $is_selected value='%d'>%s</option>",
@ -218,7 +218,7 @@ function print_feed_cat_select($id, $default_id,
if (!$root_id) { if (!$root_id) {
if ($include_all_cats) { if ($include_all_cats) {
if ($found > 0) { if ($found > 0) {
print "<option disabled=\"1\">--------</option>"; print "<option disabled=\"1\">―――――――――――――――</option>";
} }
if ($default_id == 0) { if ($default_id == 0) {