本文整理汇总了PHP中HTML_QuickForm类的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm类的具体用法?PHP HTML_QuickForm怎么用?PHP HTML_QuickForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTML_QuickForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct('authorize_new_users');
if ($this->loginError) {
return;
}
$this->loadHttpVars(true, true);
$this->users = pdUserList::getNotVerified($this->db);
echo '<h2>Users Requiring Authentication</h2>';
if ($this->users == null || count($this->users) == 0) {
echo 'All users authorized.';
return;
}
$form = new HTML_QuickForm('authorizeUsers', 'post');
foreach ($this->users as $user) {
$form->addGroup(array(HTML_QuickForm::createElement('advcheckbox', "submit[auth][{$user->login}]", null, null, null, array('no', 'yes')), HTML_QuickForm::createElement('select', "submit[access][{$user->login}]", null, AccessLevel::getAccessLevels()), HTML_QuickForm::createElement('static', null, null, $user->login), HTML_QuickForm::createElement('static', null, null, $user->name), HTML_QuickForm::createElement('static', null, null, $user->email)), 'all', null, '</td><td class="stats_odd">', false);
}
$form->addElement('submit', null, 'Submit');
$this->form =& $form;
if ($form->validate()) {
$this->processForm();
} else {
$this->renderForm();
}
}
开发者ID:papersdb,项目名称:papersdb,代码行数:25,代码来源:authorize_new_users.php
示例2: __construct
public function __construct()
{
parent::__construct('aicml_stats');
if ($this->loginError) {
return;
}
$this->loadHttpVars(true, false);
if (isset($this->csv_output)) {
assert('isset($_SESSION["aicml_stats"])');
$this->stats =& $_SESSION['aicml_stats'];
return;
}
$pubs =& $this->getMachineLearningPapers();
// populate $this->aicml_pi_authors
$this->getPiAuthors();
// populate $this->aicml_pdf_students_staff_authors
$this->getPdfStudentsAndStaffAuthors();
$this->collectStats($pubs);
$_SESSION['aicml_stats'] =& $this->stats;
$form = new HTML_QuickForm('aicml_stats', 'get', 'aicml_stats.php');
$form->addElement('submit', 'csv_output', 'Export to CSV');
// create a new renderer because $form->defaultRenderer() creates
// a single copy
$renderer = new HTML_QuickForm_Renderer_Default();
$form->accept($renderer);
echo $renderer->toHtml();
echo $this->allPiPublicationTable();
echo $this->fiscalYearTotalsTable('pi', 'PI Fiscal Year Totals');
foreach ($this->aicml_pi_authors as $pi_author) {
echo $this->piPublicationsTable($pi_author);
}
echo $this->staffPublicationsTable();
echo $this->fiscalYearTotalsTable('staff', 'Staff Fiscal Year Totals');
echo $this->studentTotalsTable();
}
开发者ID:papersdb,项目名称:papersdb,代码行数:35,代码来源:aicml_stats.php
示例3: array
/**
* Defines how a radio button widget should be built.
*
* @param Dataface_Record $record The Dataface_Record that is being edited.
* @param array &$field The field configuration data structure that the widget is being generated for.
* @param HTML_QuickForm The form to which the field is to be added.
* @param string $formFieldName The name of the field in the form.
* @param boolean $new Whether this widget is being built for a new record form.
* @return HTML_QuickForm_element The element that can be added to a form.
*
*/
function &buildWidget(&$record, &$field, &$form, $formFieldName, $new = false)
{
$widget =& $field['widget'];
if (!@$widget['separator']) {
$widget['separator'] = '<br />';
}
if (isset($field['vocabulary']) and $field['vocabulary']) {
$radios = array();
$dummyForm = new HTML_QuickForm();
$options =& Dataface_FormTool::getVocabulary($record, $field);
$options__classes = Dataface_FormTool::getVocabularyClasses($record, $field);
// CSS classes
foreach ($options as $opt_val => $opt_text) {
if ($opt_val === '') {
continue;
}
$radios[] =& $dummyForm->createElement('radio', null, null, $opt_text, $opt_val, array('class' => 'radio-of-' . $field['name'] . ' ' . @$options__classes[$opt_val]));
}
$factory =& Dataface_FormTool::factory();
$el =& $factory->addGroup($radios, $field['name'], $widget['label']);
} else {
error_log("Your field {$formFieldName} is missing the vocabulary directive.");
throw new Exception("Your field {$formFieldName} is missing the vocabulary directive.");
}
return $el;
}
开发者ID:JerOrc,项目名称:xataface-module-radio,代码行数:37,代码来源:widget.php
示例4: factory
/**
* factory
*
* Factory method
*
* @param mixed $name name of the form
* @param mixed $url action url
*
* @static
* @access public
* @return Object HTML_QuickForm Object
*/
static function factory($name, $url)
{
$form = new HTML_QuickForm($name, 'post', $url);
$star = '<span style="color: #ff0000">*</span> ';
$form->setRequiredNote($star . _('denotes required field'));
return $form;
}
开发者ID:shupp,项目名称:toasteradmin,代码行数:19,代码来源:Form.php
示例5: renderHtml
function renderHtml()
{
$kursus = new VIH_Model_LangtKursus($this->context->name());
if ($this->query("addrate")) {
if (!$kursus->addRate($this->query("addrate"))) {
throw new Exception('Kunne ikke tilføje rate.', E_USER_ERROR);
}
}
$this->document->setTitle('Opdater rater');
$pris = array('kursus' => $kursus);
if ($kursus->antalRater() == 0) {
$form = new HTML_QuickForm('rater', 'POST', $this->url());
$form->addElement('text', 'antal', 'Antal rater');
$form->addElement('text', 'foerste_rate_dato', 'Første rate dato', 'dd-mm-YYYY');
$form->addElement('submit', 'opret_rater', 'Opret rater');
$form_html = $form->toHTML();
} else {
$data = array('kursus' => $kursus);
$tpl = $this->template->create('langekurser/rater_form');
$form_html = $tpl->render($this, $data);
}
$this->document->setTitle('Rater for betaling ' . $kursus->get('kursusnavn'));
$this->document->addOption('Til kurset', $this->context->url());
$tpl = $this->template->create('langekurser/pris');
return '<p><strong>Periode</strong>: ' . $kursus->getDateStart()->format('%d-%m-%Y') . ' — ' . $kursus->getDateEnd()->format('%d-%m-%Y') . '</p>
' . $tpl->render($this, $pris) . $form_html;
}
开发者ID:vih,项目名称:intranet.vih.dk,代码行数:27,代码来源:Rater.php
示例6: getForm
function getForm()
{
if ($this->form) {
return $this->form;
}
$form = new HTML_QuickForm('search', 'GET', $this->url());
$form->addElement('text', 'search');
$form->addElement('submit', null, 'Søg efter bundtnummer');
return $this->form = $form;
}
开发者ID:vih,项目名称:intranet.vih.dk,代码行数:10,代码来源:Index.php
示例7: otherFormatForm
/**
*
*/
public function otherFormatForm($result_pubs)
{
if ($result_pubs == null) {
return;
}
$form = new HTML_QuickForm('otherFormatForm');
$form->addElement('hidden', 'pub_ids', implode(",", $result_pubs));
$form->addGroup(array(HTML_QuickForm::createElement('submit', 'cv_format', 'Show results in CV format'), HTML_QuickForm::createElement('submit', 'bibtex_format', 'Show results in BibTex format')), null, null, ' ');
return $form;
}
开发者ID:papersdb,项目名称:papersdb,代码行数:13,代码来源:search_results.php
示例8: getForm
function getForm()
{
if ($this->form) {
return $this->form;
}
$form = new HTML_QuickForm('holdliste', 'GET', $this->url());
$form->addElement('date', 'date', 'date');
$form->addElement('submit', null, 'Hent');
return $this->form = $form;
}
开发者ID:vih,项目名称:intranet.vih.dk,代码行数:10,代码来源:Holdliste.php
示例9: execute
function execute(ActionMapping $map, ActionForm $form, Request $req)
{
global $papyrine;
$papyrine->entries =& $papyrine->getEntries();
// Instantiate the HTML_QuickForm object
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/group.php';
$form = new HTML_QuickForm('create_entry');
$form->addElement('text', 'title', 'Title:');
$form->addElement('text', 'date', 'Date:');
$form->addElement('text', 'status', 'Status:');
// Get the default handler
$form->addElement('text', 'body', 'Body:');
$form->addElement('submit', null, 'Create');
// Define filters and validation rules
$form->applyFilter('name', 'trim');
$form->addRule('name', 'Please enter your name', 'required', null, 'client');
//get classes registered for entry
//call method
$plugin = new PapyrinePlugin(BASE . 'plugins/categories/');
$object = $plugin->getInstance();
$object->recieveNewEntryForm($form);
$plugin = new PapyrinePlugin(BASE . 'plugins/comments/');
$object = $plugin->getInstance();
$object->recieveNewEntryForm($form);
// Output the form
$papyrine->form = $form->toHTML();
header("Content-Type: application/xhtml+xml;charset=UTF-8");
$papyrine->display('admin/header.html');
$papyrine->display($map->getParameter());
$papyrine->display('admin/footer.html');
}
开发者ID:BackupTheBerlios,项目名称:papyrine-svn,代码行数:32,代码来源:EntryAdministrationAction.php
示例10: dirname
/**
* Renvoit l'instance d'un formulaire
*
* Un formulaire est instancié, configuré puis renvoyé
*
* @param string $url URL pour l'attribut "action" du formulaire
* @param string $nom Nom du formulaire
* @return object
*/
function &instancierFormulaire($url = null, $nom = 'formulaire')
{
if (is_null($url)) {
$url = $_SERVER['REQUEST_URI'];
}
require_once dirname(__FILE__) . '/../../dependencies/PEAR/HTML/QuickForm.php';
require_once dirname(__FILE__) . '/../../dependencies/PEAR/HTML/QuickForm/altselect.php';
$formulaire = new HTML_QuickForm($nom, 'post', $url);
$formulaire->removeAttribute('name');
return $formulaire;
}
开发者ID:fferriere,项目名称:web,代码行数:20,代码来源:fonctions.php
示例11: getForm
function getForm()
{
if ($this->form) {
return $this->form;
}
$date_options = array('minYear' => date('Y') - 10, 'maxYear' => date('Y') + 5);
$form = new HTML_QuickForm('holdliste', 'GET', $this->url() . '.txt');
$form->addElement('date', 'date', 'date', $date_options);
$form->addElement('submit', null, 'Hent');
return $this->form = $form;
}
开发者ID:vih,项目名称:intranet.vih.dk,代码行数:11,代码来源:ExportCSV.php
示例12: display
function display($self_link)
{
$form = new HTML_QuickForm('adminConfigInfoForm', 'get', $self_link);
$consts = get_defined_constants();
$form->addElement('header', '', 'Configuration Settings (from conf/general)');
foreach ($consts as $const => $value) {
if (preg_match("/^OPTION_/", $const)) {
$form->addElement('static', "static{$const}", null, "{$const} = {$value}");
}
}
admin_render_form($form);
}
开发者ID:palfrey,项目名称:phplib,代码行数:12,代码来源:admin-configinfo.php
示例13: getForm
function getForm()
{
if ($this->form) {
return $this->form;
}
$form = new HTML_QuickForm('confirm', 'POST', $this->url());
$form->addElement('header', null, 'Accepterer du betingelserne?');
$form->addElement('checkbox', 'confirm', null, 'Ja, jeg accepterer betingelserne', 'id="confirm"');
$form->addElement('submit', null, 'Send');
$form->addRule('confirm', 'Du skal acceptere betingelserne', 'required');
return $this->form = $form;
}
开发者ID:vih,项目名称:vih.dk,代码行数:12,代码来源:Confirm.php
示例14: getForm
function getForm()
{
if ($this->form) {
return $this->form;
}
$form = new HTML_QuickForm('fotogalleri', 'POST', $this->url());
$form->addElement('hidden', 'id');
$form->addElement('text', 'description', 'Beskrivelse');
$form->addElement('checkbox', 'active', '', 'Aktiv');
$form->addElement('submit', null, 'Gem og tilføj billeder');
return $this->form = $form;
}
开发者ID:vih,项目名称:intranet.vih.dk,代码行数:12,代码来源:Edit.php
示例15: handle
function handle(&$params)
{
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();
$this->table =& Dataface_Table::loadTable($query['-table']);
$translations =& $this->table->getTranslations();
foreach (array_keys($translations) as $trans) {
$this->table->getTranslation($trans);
}
//print_r($translations);
if (!isset($translations) || count($translations) < 2) {
// there are no translations to be made
trigger_error('Attempt to translate a record in a table "' . $this->table->tablename . '" that contains no translations.', E_USER_ERROR);
}
$this->translatableLanguages = array_keys($translations);
$translatableLanguages =& $this->translatableLanguages;
$this->languageCodes = new I18Nv2_Language($app->_conf['lang']);
$languageCodes =& $this->languageCodes;
$currentLanguage = $languageCodes->getName($app->_conf['lang']);
if (count($translatableLanguages) < 2) {
return PEAR::raiseError(df_translate('Not enough languages to translate', 'There aren\'t enough languages available to translate.'), DATAFACE_E_ERROR);
}
//$defaultSource = $translatableLanguages[0];
//$defaultDest = $translatableLanguages[1];
$options = array();
foreach ($translatableLanguages as $lang) {
$options[$lang] = $languageCodes->getName($lang);
}
unset($options[$app->_conf['default_language']]);
$tt = new Dataface_TranslationTool();
$form = new HTML_QuickForm('StatusForm', 'POST');
$form->addElement('select', '--language', 'Translation', $options);
$form->addElement('select', '--status', 'Status', $tt->translation_status_codes);
//$form->setDefaults( array('-sourceLanguage'=>$defaultSource, '-destinationLanguage'=>$defaultDest));
$form->addElement('submit', '--set_status', 'Set Status');
foreach ($query as $key => $value) {
$form->addElement('hidden', $key);
$form->setDefaults(array($key => $value));
}
if ($form->validate()) {
$res = $form->process(array(&$this, 'processForm'));
if (PEAR::isError($res)) {
return $res;
} else {
header('Location: ' . $app->url('-action=list&-sourceLanguage=&-destinationLanguage=&-translate=') . '&--msg=' . urlencode('Translation status successfully set.'));
exit;
}
}
ob_start();
$form->display();
$out = ob_get_contents();
ob_end_clean();
$records =& $this->getRecords();
df_display(array('form' => $out, 'translationTool' => &$tt, 'records' => &$records, 'translations' => &$options, 'context' => &$this), 'Dataface_set_translation_status.html');
}
开发者ID:promoso,项目名称:HVAC,代码行数:55,代码来源:set_translation_status.php
示例16: build
function build()
{
if ($this->_isBuilt) {
return;
}
$this->isBuilt = true;
$options = $this->relationship->getAddableValues($this->record);
$boxes = array();
foreach ($options as $opt_val => $opt_text) {
if (!$opt_val) {
continue;
}
$boxes[] =& HTML_QuickForm::createElement('advcheckbox', $opt_val, null, $opt_text, array('class' => 'relationship-checkbox-of-' . $opt_val . ' ' . @$options__classes[$opt_val]));
}
$el =& $this->addGroup($boxes, '--related-checkboxes', df_translate('scripts.Dataface_RelationshipCheckboxForm.LABEL_' . $this->relationship->_name . '_CHECKBOXES', 'Related ' . $this->relationship->_name . ' Records'));
$defaults = $this->getCheckedRecordsDefaults();
$this->setDefaults(array('--related-checkboxes' => $defaults));
// Now let's add hidden fields for the keys of the current record
// to the form.
$factory = new HTML_QuickForm('factory');
// a dummy quickform object to be used tgo create elements.
$keyEls = array();
//
$keyDefaults = array();
foreach (array_keys($this->record->_table->keys()) as $key) {
$keyEls[] = $factory->addElement('hidden', $key);
$keyDefaults[$key] = $this->record->strval($key);
}
$this->addGroup($keyEls, '--__keys__');
$this->setConstants(array('--__keys__' => $keyDefaults));
// Now let's add a trail that will allow us to get back to here
$app =& Dataface_Application::getInstance();
$q =& $app->getQuery();
$this->addElement('hidden', '--query');
if (isset($_POST['--query'])) {
$this->setDefaults(array('--query' => $_POST['--query']));
} else {
$this->setDefaults(array('--query' => $app->url('')));
}
$this->addElement('hidden', '-table');
$this->addElement('hidden', '-action');
$this->addElement('hidden', '-relationship');
$this->setDefaults(array('-table' => $q['-table'], '-action' => $q['-action'], '-relationship' => $q['-relationship']));
$this->addElement('submit', 'save', df_translate('scripts.Dataface_RelationshipCheckboxForm.LABEL_SUBMIT', 'Save'));
$perms = $this->record->getPermissions(array('relationship' => $q['-relationship']));
if (!@$perms['add existing related record'] and !@$perms['remove related record']) {
$this->freeze();
}
}
开发者ID:minger11,项目名称:Pipeline,代码行数:49,代码来源:RelationshipCheckboxForm.php
示例17: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
require_once 'CRM/Utils/Money.php';
$this->_first = true;
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage');
// name
$this->add('text', 'title', ts('Title'), $attributes['title'], true);
$this->add('select', 'contribution_type_id', ts('Contribution Type'), CRM_Contribute_PseudoConstant::contributionType(), true);
$this->addWysiwyg('intro_text', ts('Introductory Message'), $attributes['intro_text']);
$this->addWysiwyg('footer_text', ts('Footer Message'), $attributes['footer_text']);
// is on behalf of an organization ?
$this->addElement('checkbox', 'is_organization', ts('Allow individuals to contribute and / or signup for membership on behalf of an organization?'), null, array('onclick' => "showHideByValue('is_organization',true,'for_org_text','table-row','radio',false);showHideByValue('is_organization',true,'for_org_option','table-row','radio',false);"));
$options = array();
$options[] = HTML_QuickForm::createElement('radio', null, null, ts('Optional'), 1);
$options[] = HTML_QuickForm::createElement('radio', null, null, ts('Required'), 2);
$this->addGroup($options, 'is_for_organization', ts(''));
$this->add('textarea', 'for_organization', ts('On behalf of Label'), $attributes['for_organization']);
// collect goal amount
$this->add('text', 'goal_amount', ts('Goal Amount'), array('size' => 8, 'maxlength' => 12));
$this->addRule('goal_amount', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
// is this page active ?
$this->addElement('checkbox', 'is_active', ts('Is this Online Contribution Page Active?'));
// should the honor be enabled
$this->addElement('checkbox', 'honor_block_is_active', ts('Honoree Section Enabled'), null, array('onclick' => "showHonor()"));
$this->add('text', 'honor_block_title', ts('Honoree Section Title'), $attributes['honor_block_title']);
$this->add('textarea', 'honor_block_text', ts('Honoree Introductory Message'), $attributes['honor_block_text']);
// add optional start and end dates
$this->addDateTime('start_date', ts('Start Date'));
$this->addDateTime('end_date', ts('End Date'));
$this->addFormRule(array('CRM_Contribute_Form_ContributionPage_Settings', 'formRule'));
parent::buildQuickForm();
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:38,代码来源:Settings.php
示例18: buildQuickForm
/**
* Function to actually build the form
*
* @return None
* @access public
*/
function buildQuickForm()
{
//Setting Upload File Size
$config =& new CRM_Core_Config();
if ($config->maxImportFileSize >= 8388608) {
$uploadFileSize = 8388608;
} else {
$uploadFileSize = $config->maxImportFileSize;
}
$uploadSize = round($uploadFileSize / (1024 * 1024), 2);
$this->assign('uploadSize', $uploadSize);
$this->add('file', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=60', true);
$this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
$this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
$this->setMaxFileSize($uploadFileSize);
$this->addRule('uploadFile', ts('Input file must be in CSV format'), 'asciiFile');
$this->addElement('checkbox', 'skipColumnHeader', ts('First row contains column headers'));
$duplicateOptions = array();
$duplicateOptions[] = HTML_QuickForm::createElement('radio', null, null, ts('Skip'), CRM_CONTRIBUTE_IMPORT_PARSER_DUPLICATE_SKIP);
$duplicateOptions[] = HTML_QuickForm::createElement('radio', null, null, ts('Update'), CRM_CONTRIBUTE_IMPORT_PARSER_DUPLICATE_UPDATE);
$duplicateOptions[] = HTML_QuickForm::createElement('radio', null, null, ts('Fill'), CRM_CONTRIBUTE_IMPORT_PARSER_DUPLICATE_FILL);
// for contributions NOCHECK == SKIP
// $duplicateOptions[] = HTML_QuickForm::createElement('radio',
// null, null, ts('No Duplicate Checking'), CRM_Contribute_Import_Parser::DUPLICATE_NOCHECK);
$this->addGroup($duplicateOptions, 'onDuplicate', ts('On duplicate entries'));
$this->setDefaults(array('onDuplicate' => CRM_CONTRIBUTE_IMPORT_PARSER_DUPLICATE_SKIP));
//build date formats
require_once 'CRM/Core/Form/Date.php';
CRM_Core_Form_Date::buildAllowedDateFormats($this);
$this->addButtons(array(array('type' => 'upload', 'name' => ts('Continue >>'), 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:37,代码来源:UploadFile.php
示例19: add_elements_to_form
/**
* Adds a (multi)select widget to the form, depending on the base type config.
*/
function add_elements_to_form($attributes)
{
// Let us try to be a bit smarter here, avoiding an all-out load for read-only
// fields.
// TODO: This doesn't support Access control yet.
if ($this->_field['readonly']) {
$this->_all_elements = array();
foreach ($this->_type->selection as $key) {
$this->_all_elements[$key] = $this->_type->get_name_for_key($key);
}
} else {
$this->_all_elements = $this->_type->list_all();
}
$select_attributes = array_merge($attributes, array('class' => $this->_type->allow_multiple ? 'list' : 'dropdown', 'id' => "{$this->_namespace}{$this->name}"));
$select_attributes['class'] .= ' selectcomponent';
$select_element = HTML_QuickForm::createElement('select', $this->name, $this->_translate($this->_field['title']), array(), $select_attributes);
// Translate and add
foreach ($this->_all_elements as $key => $value) {
$option_attributes = array();
$icon = midcom::get('componentloader')->get_component_icon($key, false);
if ($icon) {
$option_attributes['style'] = 'background-image: url("' . MIDCOM_STATIC_URL . '/' . midcom::get('componentloader')->get_component_icon($key) . '")';
}
$select_element->addOption($this->_translate($value), $key, $option_attributes);
}
$select_element->setMultiple($this->_type->allow_multiple);
if ($this->_type->allow_multiple) {
$select_element->setSize($this->height);
}
$this->_select_element = $this->_form->addElement($select_element);
}
开发者ID:nemein,项目名称:openpsa,代码行数:34,代码来源:selectcomponent.php
示例20: formPoolData
function formPoolData($name)
{
$lang = services::getService('lang');
$params = services::getService('pageParams');
$cats = services::getService('cats');
$this->form($name);
// Add some elements to the form
$this->addElement('text', 'poolname', $lang->getMsg('pooldata_form_name'), array('size' => 30, 'maxlength' => 50));
$this->addElement('textarea', 'pooldesc', $lang->getMsg('pooldata_form_description'), array('rows' => 8, 'cols' => 50));
$this->addElement('text', 'poolarea', $lang->getMsg('pooldata_form_area'), array('size' => 30, 'maxlength' => 50));
/*$is_located = array();
$is_located[] = HTML_QuickForm::createElement('radio', null, null, $lang->getMsg('pooldata_form_is_located_no'), 0);
$is_located[] = HTML_QuickForm::createElement('radio', null, null, $lang->getMsg('pooldata_form_is_located_yes'), 1);
$this->addGroup($is_located, 'is_located', $lang->getMsg('pooldata_form_is_located'), '<br>');*/
$countries = services::getService('countries');
$this->addElement('select', 'poolcountry', $lang->getMsg('pooldata_form_country'), $countries->getAsArray());
$adress[] =& HTML_QuickForm::createElement('text', 'plz1', null, array('size' => 2, 'maxlength' => 2));
$adress[] =& HTML_QuickForm::createElement('text', 'plz2', null, array('size' => 3, 'maxlength' => 3));
$adress[] =& HTML_QuickForm::createElement('text', 'city', null, array('size' => 20, 'maxlength' => 30));
$this->addGroup($adress, 'pooladress', $lang->getMsg('userdata_adress2'), ' ');
$this->addElement('select', 'is_public', $lang->getMsg('pooldata_form_is_public'), array("0" => $lang->getMsg('pooldata_form_is_located_no'), "1" => $lang->getMsg('pooldata_form_is_located_yes')));
if ($params->getParam('pool_id')) {
$this->addElement('hidden', 'pool_id', $params->getParam('pool_id'));
}
$this->addElement('submit', 'submit', $lang->getMsg('pooldata_form_submit'));
// Define filters and validation rules
$this->registerRule('securehtml', 'callback', 'secureHtml');
$this->addRule('poolname', $lang->getMsg('pooldata_form_namenecessary'), 'required');
$this->addRule('pooldesc', $lang->getMsg('pooldata_form_descnecessary'), 'required');
$this->addRule('pooldesc', $lang->getMsg('pooldata_form_securehtml'), 'securehtml');
$this->addRule('poolarea', $lang->getMsg('pooldata_form_areanecessary'), 'required');
$adressrules['plz1'][] = array($lang->getMsg('userdata_plz_numeric'), 'numeric');
$adressrules['plz2'][] = array($lang->getMsg('userdata_plz_numeric'), 'numeric');
$this->addGroupRule('pooladress', $adressrules);
}
开发者ID:BackupTheBerlios,项目名称:cosmopool-multi-svn,代码行数:35,代码来源:formPoolData.php
注:本文中的HTML_QuickForm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论