Esempio n. 1
0
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');
}
Esempio n. 2
0
 public function createModule($compId)
 {
     global $sourceFolder, $moduleFolder;
     $query = "INSERT INTO `form_desc` (`page_modulecomponentid`, `form_heading`,`form_loginrequired`,`form_headertext`)\n\t\t\t\t\tVALUES ('" . $compId . "', '',1,'Coming up Soon');";
     $result = mysql_query($query) or die(mysql_error() . "form.lib L:157");
     addDefaultFormElement($moduleComponentId);
 }