当前位置: 首页>>代码示例>>PHP>>正文


PHP ExtraField::set_extra_fields_in_form方法代码示例

本文整理汇总了PHP中ExtraField::set_extra_fields_in_form方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtraField::set_extra_fields_in_form方法的具体用法?PHP ExtraField::set_extra_fields_in_form怎么用?PHP ExtraField::set_extra_fields_in_form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExtraField的用法示例。


在下文中一共展示了ExtraField::set_extra_fields_in_form方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ExtraField

            $form->addRule('competences', get_lang('ThisFieldIsRequired'), 'required');
        }
        if (api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mydiplomas') == 'true') {
            $form->addRule('diplomas', get_lang('ThisFieldIsRequired'), 'required');
        }
        if (api_get_setting('extendedprofile_registration', 'myteach') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'myteach') == 'true') {
            $form->addRule('teach', get_lang('ThisFieldIsRequired'), 'required');
        }
        if (api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mypersonalopenarea') == 'true') {
            $form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required');
        }
    }
    // EXTRA FIELDS
    $extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
    $extraField = new ExtraField('user');
    $extraField->set_extra_fields_in_form($form, $extra_data, 'registration', false, null);
}
if (isset($_SESSION['user_language_choice']) && $_SESSION['user_language_choice'] != '') {
    $defaults['language'] = $_SESSION['user_language_choice'];
} else {
    $defaults['language'] = api_get_setting('platformLanguage');
}
if (!empty($_GET['username'])) {
    $defaults['username'] = Security::remove_XSS($_GET['username']);
}
if (!empty($_GET['email'])) {
    $defaults['email'] = Security::remove_XSS($_GET['email']);
}
if (!empty($_GET['phone'])) {
    $defaults['phone'] = Security::remove_XSS($_GET['phone']);
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:inscription.php

示例2: array

$group[] = $form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
$form->addGroup($group, 'mail', get_lang('SendMailToNewUser'), ' ', false);
// Registration Date
$form->addElement('static', 'registration_date', get_lang('RegistrationDate'), $user_data['registration_date']);
// Expiration Date
$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
$group = array();
$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('On'), 1);
$group[] = $form->createElement('datepicker', 'expiration_date', null, array('form_name' => $form->getAttribute('name'), 'onchange' => 'javascript: enable_expiration_date();'));
$form->addGroup($group, 'max_member_group', null, '', false);
// Active account or inactive account
$form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1);
$form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
// EXTRA FIELDS
$extraField = new ExtraField('user');
$return_params = $extraField->set_extra_fields_in_form($form, $extra_data, 'user_edit', true, $user_id);
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
	' . $jquery_ready_content . '
});
</script>';
// Submit button
$form->addElement('style_submit_button', 'submit', get_lang('ModifyInformation'), 'class="save"');
// Set default values
$user_data['reset_password'] = 0;
$expiration_date = $user_data['expiration_date'];
if ($expiration_date == '0000-00-00 00:00:00') {
    $user_data['radio_expiration_date'] = 0;
    $user_data['expiration_date'] = array();
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:user_edit.php

示例3: array

$group = array();
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
$form->addGroup($group, 'mail', get_lang('SendMailToNewUser'), '&nbsp;');
// Expiration Date
$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
$group = array();
$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('On'), 1);
$group[] = $form->createElement('datepicker', 'expiration_date', null, array('form_name' => $form->getAttribute('name'), 'onchange' => 'javascript: enable_expiration_date();'));
$form->addGroup($group, 'max_member_group', null, '', false);
// Active account or inactive account
$form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1);
$form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
$extra_data = UserManager::get_extra_user_data(0, true);
$extraField = new ExtraField('user');
$return_params = $extraField->set_extra_fields_in_form($form, $extra_data, 'user_add', false, null);
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
	' . $jquery_ready_content . '
});
</script>';
// Set default values
$defaults['mail']['send_mail'] = 0;
$defaults['password']['password_auto'] = 1;
$defaults['active'] = 1;
$defaults['expiration_date'] = array();
$days = api_get_setting('account_valid_duration');
$time = strtotime('+' . $days . ' day');
$defaults['expiration_date']['d'] = date('d', $time);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:user_add.php

示例4: array

}
//	PASSWORD, if auth_source is platform
if (is_platform_authentication() && api_is_profile_editable() && api_get_setting('profile', 'password') == 'true') {
    $form->addElement('password', 'password0', array(get_lang('Pass'), get_lang('Enter2passToChange')), array('size' => 40));
    $form->addElement('password', 'password1', get_lang('NewPass'), array('size' => 40));
    $form->addElement('password', 'password2', get_lang('Confirmation'), array('size' => 40));
    //	user must enter identical password twice so we can prevent some user errors
    $form->addRule(array('password1', 'password2'), get_lang('PassTwo'), 'compare');
    if (CHECK_PASS_EASY_TO_FIND) {
        $form->addRule('password1', get_lang('CurrentPasswordEmptyOrIncorrect'), 'callback', 'api_check_password');
    }
}
// EXTRA FIELDS
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
$extraField = new ExtraField('user');
$return_params = $extraField->set_extra_fields_in_form($form, $extra_data, 'profile', false, api_get_user_id());
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
	' . $jquery_ready_content . '
});
</script>';
if (api_get_setting('profile', 'apikeys') == 'true') {
    $form->addElement('html', '<div id="div_api_key">');
    $form->addElement('text', 'api_key_generate', get_lang('MyApiKey'), array('size' => 40, 'id' => 'id_api_key_generate'));
    $form->addElement('html', '</div>');
    $form->addElement('button', 'generate_api_key', get_lang('GenerateApiKey'), array('id' => 'id_generate_api_key', 'onclick' => 'generate_open_id_form()'));
    //generate_open_id_form()
}
//	SUBMIT
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:profile.php


注:本文中的ExtraField::set_extra_fields_in_form方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。