setIcon("Cross.svg"); switch ($Mode) { case "Add": $AddButton = new HtmlButton("Add"); $AddButton->setIcon("Plus.svg"); $Buttons = [$AddButton, $CancelButton]; break; case "Edit": $SaveButton = new HtmlButton("Save"); $SaveButton->setIcon("Disk.svg"); $DuplicateButton = new HtmlButton("Duplicate"); $DuplicateButton->setIcon("Copy.svg"); $DeleteButton = new HtmlButton("Delete"); $DeleteButton->setIcon("Delete.svg"); $DeleteButton->addSemanticClass("btn-danger"); $Buttons = [$SaveButton, $DuplicateButton, $DeleteButton, $CancelButton]; break; case "Confirm Delete": $ConfirmButton = new HtmlButton("Confirm"); $ConfirmButton->setIcon("Check.svg"); $ConfirmButton->addSemanticClass("btn-danger"); $Buttons = [$ConfirmButton, $CancelButton]; break; default: $Buttons = []; break; } foreach ($Buttons as $Button) { print $Button->getHtml() . " "; } } # ----- SETUP ---------------------------------------------------------------- if (!isset($H_ErrorNoResource) || !is_bool($H_ErrorNoResource)) { throw new Exception("Variable \$H_ErrorNoResource not set or is the wrong type."); } if (!isset($H_Mode) || !is_string($H_Mode)) { throw new Exception("Variable \$H_Mode not set or is the wrong type."); } if (!$H_ErrorNoResource) { if (!isset($H_Resource) || !($H_Resource instanceof Record)) { throw new Exception("Variable \$H_Resource not set or is the wrong type."); } if (!isset($H_ResourceId) || !is_string($H_ResourceId)) { throw new Exception("Variable \$H_ResourceId not set or is the wrong type."); } if (!isset($H_RecordEditingUI) || !($H_RecordEditingUI instanceof RecordEditingUI)) { throw new Exception("Variable \$H_RecordEditingUI not set or is the wrong type."); } } $AF = ApplicationFramework::getInstance(); $SafeResourceName = isset($H_Resource) ? $H_Resource->getSchema()->resourceName() : "Record"; # set page title $AF->setPageTitle($H_Mode." ".$SafeResourceName); # handle error reporting if ($H_ErrorNoResource) { print "

# ".$H_Mode." ".$SafeResourceName."

" ."

"; if (!isset($H_ResourceId)) { print "No ". $SafeResourceName." ID was specified.

"; return; } elseif ($H_ResourceId == "NEW") { print "Insufficient privileges to create " . $SafeResourceName . ""; return; } print "No ".$SafeResourceName." found with the specified ID."; return; } # get HTML for any extra buttons # (need to use $H_Resource->id() instead of $H_ResourceId # because $H_ResourceId is "NEW" when making a new record) $TopButtonInsertionHtml = $AF->formatInsertionKeyword( "EDITRESOURCE-TOP-BUTTONS", ["RecordId" => $H_Resource->id()] ); $BottomButtonInsertionHtml = $AF->formatInsertionKeyword( "EDITRESOURCE-BOTTOM-BUTTONS", ["RecordId" => $H_Resource->id()] ); # ----- DISPLAY -------------------------------------------------------------- ?>

#

(required fields are circled)

Once deleted, all data associated with this will be purged from the system and CANNOT be recovered.

has been deleted.

signalEvent( "EVENT_HTML_INSERTION_POINT", [ $AF->getPageName(), "Above Edit Form", [ "Resource" => $H_Resource, "AddingNewResource" => $H_Resource->isTempRecord(), ] ] ); ?>
displayErrorBlock(); ?> displayFormTable(); ?>
signalEvent( "EVENT_HTML_INSERTION_POINT", [ $AF->getPageName(), "Bottom of Edit Form", [ "Resource" => $H_Resource, "AddingNewResource" => $H_Resource->isTempRecord(), ] ] ); ?>