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


PHP FormValidator::getAttribute方法代码示例

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


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

示例1: array

$form->addElement('select_language', 'language', get_lang('Language'));
// Send email
$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'), ' ', false);
// Registration User and Date
$creatorInfo = api_get_user_info($user_data['creator_id']);
$date = sprintf(get_lang('CreatedByXYOnZ'), 'user_information.php?user_id=' . $user_data['creator_id'], $creatorInfo['username'], $user_data['registration_date']);
$form->addElement('html', '<div class="control-group"><label class="control-label">' . get_lang('RegistrationDate') . '</label><div class="controls">' . $date . '</div></div>');
if (!$user_data['platform_admin']) {
    // 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
$return_params = UserManager::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
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:user_edit.php

示例2: getElementById

        }
        $form->addElement('select', 'backup_server', '', $options, 'style="margin-left: 50px;"');
        $form->addElement('html', '<script type="text/javascript">document.import_backup_form.backup_server.disabled=true;</script>');
    } else {
        $form->addElement('radio', '', '', '<i>' . get_lang('NoBackupsAvailable') . '</i>', '', 'disabled="true"');
    }
    $form->addElement('html', '<br /><br />');
    $form->addElement('radio', 'import_option', '', get_lang('ImportFullBackup'), 'full_backup', 'id="import_option_1" class="checkbox"');
    $form->addElement('radio', 'import_option', '', get_lang('LetMeSelectItems'), 'select_items', 'id="import_option_2" class="checkbox"');
    $form->addElement('html', '<br /><br />');
    $form->addElement('html', get_lang('SameFilename'));
    $form->addElement('html', '<br /><br />');
    $form->addElement('radio', 'same_file_name_option', '', get_lang('SameFilenameSkip'), FILE_SKIP, 'id="same_file_name_option_1" class="checkbox"');
    $form->addElement('radio', 'same_file_name_option', '', get_lang('SameFilenameRename'), FILE_RENAME, 'id="same_file_name_option_2" class="checkbox"');
    $form->addElement('radio', 'same_file_name_option', '', get_lang('SameFilenameOverwrite'), FILE_OVERWRITE, 'id="same_file_name_option_3" class="checkbox"');
    $form->addElement('html', '<br />');
    $form->addElement('style_submit_button', null, get_lang('ImportBackup'), 'class="save"');
    $values['backup_type'] = 'local';
    $values['import_option'] = 'full_backup';
    $values['same_file_name_option'] = FILE_OVERWRITE;
    $form->setDefaults($values);
    $form->add_progress_bar();
    // When progress bar appears we have to hide the title "Select backup file".
    $form->updateAttributes(array('onsubmit' => str_replace('javascript: ', 'javascript: page_title = getElementById(\'page_title\'); if (page_title) { setTimeout(\'page_title.style.display = \\\'none\\\';\', 2000); } ', $form->getAttribute('onsubmit'))));
    // Add Security token
    $token = Security::get_token();
    $form->addElement('hidden', 'sec_token');
    $form->setConstants(array('sec_token' => $token));
    $form->display();
}
Display::display_footer();
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:import_backup.php


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