function getProfileFormEditForm() { global $sourceFolder, $moduleFolder; $moduleComponentId = 0; require_once "{$sourceFolder}/{$moduleFolder}/form/editformelement.php"; require_once "{$sourceFolder}/{$moduleFolder}/form/editform.php"; /// $_GET['subsubaction'] would be set to editprofileform whenever this function is called /// Check $_GET['subaction'] to determine whether something must be done to the profile form /// if there is no subaction, and a $_POST['submittedform_desc'] is set, submit the profile form if (isset($_GET['subaction'])) { $subAction = escape($_GET['subaction']); require_once "{$sourceFolder}/{$moduleFolder}/form/editformelement.php"; if ($_GET['subaction'] == 'editformelement' && isset($_POST['elementid']) && ctype_digit($_POST['elementid']) && isset($_POST['txtElementDesc']) && isset($_POST['selElementType']) && isset($_POST['txtToolTip']) && isset($_POST['txtElementName'])) { submitEditFormElementDescData($moduleComponentId, escape($_POST['elementid'])); } elseif (isset($_GET['elementid']) && ctype_digit($_GET['elementid'])) { if ($_GET['subaction'] == 'editformelement') { return generateEditFormElementDescBody($moduleComponentId, escape($_GET['elementid']), 'admin&subsubaction=editprofileform'); } elseif ($_GET['subaction'] == 'deleteformelement') { deleteFormElement($moduleComponentId, escape($_GET['elementid'])); } elseif ($_GET['subaction'] == 'moveUp' || $_GET['subaction'] == 'moveDown') { moveFormElement($moduleComponentId, escape($_GET['subaction']), escape($_GET['elementid'])); } } } if (isset($_POST['addformelement_descsubmit'])) { addDefaultFormElement($moduleComponentId); } return generateFormElementDescBody($moduleComponentId, 'admin&subsubaction=editprofileform'); }
/** * Performs the action "Edit Form" on a form */ public function actionEditform() { global $sourceFolder; global $moduleFolder; if (isset($_GET['subaction']) && $_GET['subaction'] == 'editformelement' && isset($_POST['elementid']) && ctype_digit($_POST['elementid']) && isset($_POST['txtElementDesc']) && isset($_POST['selElementType']) && isset($_POST['txtToolTip']) && isset($_POST['txtElementName'])) { submitEditFormElementDescData($this->moduleComponentId, escape($_POST['elementid'])); } if (isset($_GET['subaction']) && $_GET['subaction'] == 'editformelement' && isset($_GET['elementid']) && ctype_digit($_GET['elementid'])) { return generateEditFormElementDescBody($this->moduleComponentId, escape($_GET['elementid'])); } if (isset($_POST['addformelement_descsubmit'])) { addDefaultFormElement($this->moduleComponentId); } if (isset($_GET['subaction']) && $_GET['subaction'] == 'deleteformelement' && isset($_GET['elementid'])) { deleteFormElement($this->moduleComponentId, escape($_GET['elementid'])); } if (isset($_GET['subaction']) && ($_GET['subaction'] == 'moveUp' || $_GET['subaction'] == 'moveDown') && isset($_GET['elementid'])) { moveFormElement($this->moduleComponentId, escape($_GET['subaction']), escape($_GET['elementid'])); } $html = generateFormDescBody($this->moduleComponentId) . generateFormElementDescBody($this->moduleComponentId); global $ICONS; return "<fieldset><legend>{$ICONS['Form Edit']['small']}Edit Form</legend>{$html}</fieldset>"; }