Phrases - Edit: Button updates.

This commit is contained in:
Nate
2020-02-05 19:48:43 -07:00
parent 4265a82a78
commit 780c72448b

View File

@@ -265,10 +265,10 @@
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//show the header
require_once "resources/header.php";
//include the header
if ($action == 'add') { $document['title'] = $text['title-add_phrase']; }
if ($action == 'update') { $document['title'] = $text['title-edit_phrase']; }
require_once "resources/header.php";
//js to control action form input
echo "<script type='text/javascript'>\n";
@@ -391,26 +391,31 @@
echo "</script>\n";
//show the content
echo "<form method='post' name='frm' action=''>\n";
echo "<form method='post' name='frm'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'>";
if ($action == "add") {
echo "<b>".$text['title-add_phrase']."</b>";
}
if ($action == "update") {
echo "<b>".$text['title-edit_phrase']."</b>";
}
echo " </div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'phrases.php']);
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'style'=>'margin-left: 15px;']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo " <td align='left' width='30%' nowrap valign='top'>";
if ($action == "add") { echo "<b>".$text['title-add_phrase']."</b>"; }
if ($action == "update") { echo "<b>".$text['title-edit_phrase']."</b>"; }
echo " <br /><br />";
echo " </td>\n";
echo "<td width='70%' align='right' valign='top'>";
echo " <input type='button' class='btn' alt='".$text['button-back']."' onclick=\"window.location='phrases.php'\" value='".$text['button-back']."'>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-name']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='phrase_name' maxlength='255' value=\"".escape($phrase_name)."\">\n";
echo " <br />\n";
echo " ".$text['description-name']."\n";
@@ -431,11 +436,11 @@
echo "<tr>";
echo "<td class='vncell' valign='top'>".$text['label-structure']."</td>";
echo "<td class='vtable' align='left'>";
echo " <table border='0' cellpadding='0' cellspacing='0'>\n";
echo " <table cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vtable'>".$text['label-function']."</td>\n";
echo " <td class='vtable'>".$text['label-action']."</td>\n";
echo " <td class='vtable' style='text-align: center;'>".$text['label-order']."</td>\n";
echo " <td class='vtable'><strong>".$text['label-function']."</strong></td>\n";
echo " <td class='vtable'><strong>".$text['label-action']."</strong></td>\n";
echo " <td class='vtable' style='text-align: center;'><strong>".$text['label-order']."</strong></td>\n";
echo " <td></td>\n";
echo " </tr>\n";
if (is_array($phrase_details) && @sizeof($phrase_details) != 0) {
@@ -497,7 +502,7 @@
echo " </select>\n";
echo " </td>\n";
echo " <td>\n";
echo " <input type='submit' class='btn' alt=\"".$text['button-add']."\" value=\"".$text['button-add']."\">\n";
echo button::create(['type'=>'submit','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'style'=>'white-space: nowrap;']);
echo " </td>\n";
echo " </tr>\n";
@@ -557,22 +562,17 @@
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td colspan='2' align='right'>\n";
echo "</table>";
echo "<br><br>";
if ($action == "update") {
echo " <input type='hidden' name='phrase_uuid' value='".escape($phrase_uuid)."'>\n";
}
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo " <br />";
echo " <input type='submit' name='submit' class='btn' alt=\"".$text['button-save']."\" value='".$text['button-save']."'>\n";
echo "</td>\n";
echo "</tr>";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</table>";
echo "<br><br>";
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>
?>