コード例 #1
0
 function process(\cmu\html\products\AbstractHtmlDisplayClient $formclient)
 {
     $processarray = ['Add', 'Update', 'Confirm Delete'];
     $confirmarray = ['Delete'];
     ////////PROCESS
     if (null !== $formclient->getRequestKey('action') && $formclient->getDisplay()->validateForm() && in_array($formclient->getRequestKey('action'), $processarray)) {
         //set properties?  //check here to see if we need to add CONFIRM to button
         $formclient->processAndRedir();
         return;
     }
     /////////////BUTTONS
     if (!empty($formclient->getRequestKey('dn')[0])) {
         ///we have data passed
         if (in_array($formclient->getRequestKey('action'), $confirmarray)) {
             // 'Confirm" is not in button, echo confirmation button
             (new FormButtonsConfirm($formclient))->addToForm();
             //show the form with a 'confirm' button
         } else {
             (new FormButtonsExisting($formclient))->addToForm();
             //errors or existing, re-display buttons
         }
         return;
     }
     (new FormButtonsAdd($formclient))->addToForm();
     //Add, default
 }