Extensions - Edit: Hide User select if empty.

This commit is contained in:
Nate 2020-04-15 13:11:29 -06:00
parent 6aef809c72
commit 86bba631c1
1 changed files with 11 additions and 10 deletions

View File

@ -969,17 +969,18 @@
echo " </table>\n";
echo " <br />\n";
}
echo " <select name='extension_users[0][user_uuid]' id='user_uuid' class='formfld' style='width: auto;'>\n";
echo " <option value=''></option>\n";
foreach($users as $field) {
echo " <option value='".escape($field['user_uuid'])."'>".escape($field['username'])."</option>\n";
if (is_array($users) && @sizeof($users) != 0) {
echo " <select name='extension_users[0][user_uuid]' id='user_uuid' class='formfld' style='width: auto;'>\n";
echo " <option value=''></option>\n";
foreach($users as $field) {
echo " <option value='".escape($field['user_uuid'])."'>".escape($field['username'])."</option>\n";
}
echo " </select>";
if ($action == "update") {
echo button::create(['type'=>'submit','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add']]);
}
echo " <br>\n";
}
echo " </select>";
if ($action == "update") {
echo button::create(['type'=>'submit','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add']]);
}
echo " <br>\n";
echo " ".$text['description-user_list']."\n";
echo " <br />\n";
echo " </td>";