if ($field['mandatory']) { $form->addRule($field['name'] . '_groups', _THEFIELD . ' ' . $options['name'] . ' ' . _ISMANDATORY, 'required', null, 'client'); } } } #cpp#endif } } //if you want to display user profile fields with a specific order, fill in the array with the "Field name" (only those you are interested in) //$profileFieldsOrder = array("Field_one", "Field_two"); //$userProfileFields = array_unique(array_merge($profileFieldsOrder, $userProfileFields)); $smarty->assign("T_USER_PROFILE_FIELDS", $userProfileFields); } #cpp#endif // Added by Masoud Sadjadi on July 23, 2014 to allow a timezone field with just one line input $form->addElement("select", "timezone", _TIMEZONE, eF_getTimezones(), 'class = "inputText"'); $form->setDefaults(array('active' => 1, 'timezone' => $GLOBALS['configuration']['time_zone'], 'languages_NAME' => $GLOBALS['configuration']['default_language'])); // End modification by Masoud Sadjadi // Modified by Masoud Sadjadi on July 23, 2014 to allow a Company field with just one line input // $element = $form -> addElement('textarea', 'comments', _COMMENTS, 'class = "inputText" id = "comments"'); // $element -> setCols(40); // $element -> setRows(2); $element = $form->addElement('text', 'comments', _COMMENTS, 'class = "inputText"'); $form->addRule('comments', _THEFIELD . ' ' . _COMMENTS . ' ' . _ISMANDATORY, 'required', null, 'client'); // End modification by Masoud Sadjadi $form->addElement('submit', 'submit_register', _REGISTER, 'class = "flatButton"'); if (isset($_GET['ldap'])) { $result = eF_getLdapValues($GLOBALS['configuration']['ldap_uid'] . '=' . $_GET['login'], array($GLOBALS['configuration']['ldap_preferredlanguage'], $GLOBALS['configuration']['ldap_mail'], $GLOBALS['configuration']['ldap_cn'], $GLOBALS['configuration']['ldap_uid'])); $name_parts = explode(" ", $result[0]['cn'][0]); $first_name = array_shift($name_parts); sizeof($name_parts) == 0 ? $last_name = $first_name : ($last_name = implode(" ", $name_parts));
if (G_VERSIONTYPE != 'standard') { #cpp#ifndef STANDARD if (!in_array('ldap', $constrainAccess) && $constrainAccess != 'all' && $GLOBALS['configuration']['activate_ldap']) { $form->addElement('advcheckbox', 'ldap_user', _ISLDAPUSER, null, 'class = "inputCheckbox"', array(0, 1)); } } #cpp#endif } #cpp#endif $select = $form->addElement('select', 'user_type', _USERTYPE, $roles); $languages = EfrontSystem::getLanguages(true, true); if ($GLOBALS['configuration']['onelanguage']) { $languages = array($GLOBALS['configuration']['default_language'] => $languages[$GLOBALS['configuration']['default_language']]); } $form->addElement('select', 'languages_NAME', _LANGUAGE, $languages); $form->addElement("select", "timezone", _TIMEZONE, eF_getTimezones(), 'class = "inputText" style="width:20em"'); if ($GLOBALS['configuration']['social_modules_activated'] > 0) { $load_editor = true; $form->addElement('textarea', 'short_description', _SHORTDESCRIPTIONCV, 'class = "inputContentTextarea simpleEditor" style = "width:100%;height:14em;"'); } $form->addElement('textarea', 'comments', _COMMENTS, 'class = "inputContentTextarea" style = "width:100%;height:5em;"'); $form->registerRule('checkParameter', 'callback', 'eF_checkParameter'); //Register this rule for checking user input with our function, eF_checkParameter $form->registerRule('checkNotExist', 'callback', 'eF_checkNotExist'); $form->registerRule('checkRule', 'callback', 'eF_checkRule'); //Register this rule for checking user input with our function, eF_checkParameter $form->addRule('password_', str_replace("%x", $GLOBALS['configuration']['password_length'], _PASSWORDMUSTBE6CHARACTERS), 'minlength', $GLOBALS['configuration']['password_length'], 'client'); $form->addRule(array('password_', 'passrepeat'), _PASSWORDSDONOTMATCH, 'compare', null, 'client'); $form->addRule('name', _THEFIELD . ' ' . _FIRSTNAME . ' ' . _ISMANDATORY, 'required', null, 'client'); $form->addRule('surname', _THEFIELD . ' ' . _LASTNAME . ' ' . _ISMANDATORY, 'required', null, 'client'); $form->addRule('email', _THEFIELD . ' ' . _EMAILADDRESS . ' ' . _ISMANDATORY, 'required', null, 'client');
$generalLocaleForm = new HTML_QuickForm("general_locale", "post", basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=general&tab=locale", "", null, true); $generalLocaleForm->registerRule('checkParameter', 'callback', 'eF_checkParameter'); $defaultEncodings = array_combine(mb_list_encodings(), mb_list_encodings()); $encodings['UTF7-IMAP'] = 'UTF7-IMAP'; /* if (in_array(_CHARSET, $defaultEncodings)) { $encodings[_CHARSET] = _CHARSET; } */ $encodings['UTF-8'] = 'UTF-8'; $encodings = array_merge($encodings, $defaultEncodings); // Hard-coded cities per time zone - hopefully all are DST aware $generalLocaleForm->addElement("select", "default_language", _DEFAULTLANGUAGE, EfrontSystem::getLanguages(true, true), 'class = "inputSelect"'); $generalLocaleForm->addElement("advcheckbox", "onelanguage", _ONLYONELANGUAGE, null, 'class = "inputCheckBox"', array(0, 1)); $generalLocaleForm->addElement("select", "date_format", _DATEFORMAT, array("DD/MM/YYYY" => "DD/MM/YYYY", "MM/DD/YYYY" => "MM/DD/YYYY", "YYYY/MM/DD" => "YYYY/MM/DD")); $generalLocaleForm->addElement("select", "time_zone", _TIMEZONE, eF_getTimezones(), 'class = "inputText" style="width:40em"'); $generalLocaleForm->addElement("select", "currency", _CURRENCY, $CURRENCYNAMES); $generalLocaleForm->addElement("select", "currency_order", _SHOWCURRENCYSYMBOL, array(1 => _BEFOREPRICE, 0 => _AFTERPRICE)); //$generalLocaleForm -> addElement("text", "decimal_point", _DECIMALPOINT, 'class = "inputText" style = "width:50px"'); //$generalLocaleForm -> addElement("text", "thousands_sep", _THOUSANDSSEPARATOR, 'class = "inputText" style = "width:50px"'); $generalLocaleForm->addElement("select", "file_encoding", _TRANSLATEFILESYSTEM, $encodings, 'class = "inputSelect"'); $generalLocaleForm->setDefaults($GLOBALS['configuration']); if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') { $generalLocaleForm->freeze(); } else { $generalLocaleForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"'); if ($generalLocaleForm->isSubmitted() && $generalLocaleForm->validate()) { //If the form is submitted and validated $values = $generalLocaleForm->exportValues(); unset($values['submit']); foreach ($values as $key => $value) {