diff --git a/app/phrases/phrase_edit.php b/app/phrases/phrase_edit.php index 035fcf2e95..5ca3e8aad2 100644 --- a/app/phrases/phrase_edit.php +++ b/app/phrases/phrase_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2025 + Portions created by the Initial Developer are Copyright (C) 2008-2026 the Initial Developer. All Rights Reserved. Contributor(s): @@ -217,6 +217,22 @@ } } + //update phrase detail order if drag and drop was used + if (!empty($_POST['phrase_details_order'])) { + $phrase_details_order = explode(",", $_POST["phrase_details_order"]); + $x = 0; + + foreach ($phrase_details_order as $phrase) { + list($uuid, $order) = explode("|", $phrase); + + $array['phrase_details'][$x]['phrase_detail_uuid'] = $uuid; + $array['phrase_details'][$x]['phrase_detail_order'] = $order; + $x++; + } + $p = permissions::new(); + $p->add('phrase_detail_edit', 'temp'); + } + //execute update/insert $p = permissions::new(); $p->add('phrase_detail_add', 'temp'); @@ -224,6 +240,7 @@ $database->save($array); unset($array); + $p->delete('phrase_detail_edit', 'temp'); $p->delete('phrase_detail_add', 'temp'); //remove checked phrase details @@ -484,6 +501,7 @@ echo "".$text['label-structure'].""; echo ""; echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -517,7 +535,7 @@ $phrase_detail_function = $field['phrase_detail_function']; $phrase_detail_data = $field['phrase_detail_data']; } - echo "\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \n"; @@ -525,12 +543,16 @@ if (is_uuid($field['phrase_detail_uuid'])) { echo " \n"; echo " \n"; + echo " \n"; } echo " \n"; echo "\n"; } } unset($phrase_details, $field); + echo "\n"; echo " \n"; echo " \n"; + echo "\n"; echo "
".$text['label-function']."".$text['label-action']."
".escape($phrase_detail_function)." ".escape($phrase_detail_data)." ".$field['phrase_detail_order']." \n"; + echo " \n"; + echo "
\n"; echo "
\n"; echo " ".$text['description-structure']."\n"; @@ -633,6 +656,50 @@ } echo "\n"; + //include sortablejs + echo ""; + + //phrase details drag and drop + echo "\n"; + ?> + + + "; //include the footer