Initial attempt at allowing the destination button button

to dynamically change

This sets the UUID as the ID in the options list. The we use the javascript onclick listener to get the id(uuid) of the selected option and open the link to the edit page.
This commit is contained in:
Andrew Querol
2021-03-22 23:13:33 -05:00
parent 41a5cdf29d
commit 152955625c
2 changed files with 16 additions and 18 deletions

View File

@@ -30,7 +30,8 @@
echo " <select name='subaction' id='action' class='formfld' style='".$select_style."'>\n";
echo " <option value=''></option>\n";
foreach($destinations as $key => $rows) {
if ($key == $action && permission_exists($destination->singular($key)."_destinations")) {
$singular = $destination->singular($key);
if ($key == $action && permission_exists("{$singular}_destinations")) {
if (is_array($rows)) {
foreach($rows as $row) {
@@ -50,7 +51,7 @@
$select_label = str_replace('email-icon', '&#9993', $select_label);
//add the select option
echo " <option value='".$select_value."'>".$select_label."</option>\n";
echo " <option id='{$row[$singular.'_uuid']}' value='".$select_value."'>".$select_label."</option>\n";
}
}
}