- Patch #38349 by chx: form API bugfixes.

4.7.x
Dries Buytaert 2005-11-23 08:21:08 +00:00
parent fa771b971b
commit 5736cc3e94
4 changed files with 8 additions and 8 deletions

View File

@ -770,7 +770,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT) {
$form['format'] = array('#type' => 'fieldset', '#title' => t('Input format'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -16); $form['format'] = array('#type' => 'fieldset', '#title' => t('Input format'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -16);
// Multiple formats available: display radio buttons with tips. // Multiple formats available: display radio buttons with tips.
foreach ($formats as $format) { foreach ($formats as $format) {
$form['format'][$format->format] = array('#type' => 'filter_format', '#title' => $format->name, '#default_value' => $value, '#return_value' => $format->format, '#parents' => array('format'), '#description' => theme('filter_tips', _filter_tips($format->format, false)), '#valid' => 'filter_form'); $form['format'][$format->format] = array('#type' => 'filter_format', '#title' => $format->name, '#default_value' => $value, '#return_value' => $format->format, '#parents' => array('format'), '#description' => theme('filter_tips', _filter_tips($format->format, false)), '#validate' => 'filter_form_validate');
} }
return $form; return $form;
} }
@ -797,7 +797,7 @@ function theme_filter_format($element) {
return $output; return $output;
} }
function filter_form_valid($element) { function filter_form_validate($element) {
static $validated; static $validated;
if ($validated) { if ($validated) {
return; return;

View File

@ -770,7 +770,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT) {
$form['format'] = array('#type' => 'fieldset', '#title' => t('Input format'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -16); $form['format'] = array('#type' => 'fieldset', '#title' => t('Input format'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -16);
// Multiple formats available: display radio buttons with tips. // Multiple formats available: display radio buttons with tips.
foreach ($formats as $format) { foreach ($formats as $format) {
$form['format'][$format->format] = array('#type' => 'filter_format', '#title' => $format->name, '#default_value' => $value, '#return_value' => $format->format, '#parents' => array('format'), '#description' => theme('filter_tips', _filter_tips($format->format, false)), '#valid' => 'filter_form'); $form['format'][$format->format] = array('#type' => 'filter_format', '#title' => $format->name, '#default_value' => $value, '#return_value' => $format->format, '#parents' => array('format'), '#description' => theme('filter_tips', _filter_tips($format->format, false)), '#validate' => 'filter_form_validate');
} }
return $form; return $form;
} }
@ -797,7 +797,7 @@ function theme_filter_format($element) {
return $output; return $output;
} }
function filter_form_valid($element) { function filter_form_validate($element) {
static $validated; static $validated;
if ($validated) { if ($validated) {
return; return;

View File

@ -59,8 +59,8 @@ function system_elements() {
// Inputs // Inputs
$type['checkbox'] = array('#input' => TRUE, '#return_value' => 1); $type['checkbox'] = array('#input' => TRUE, '#return_value' => 1);
$type['submit'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#execute' => TRUE); $type['submit'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#form_submitted' => TRUE);
$type['button'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#execute' => FALSE); $type['button'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#form_submitted' => FALSE);
$type['textfield'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#autocomplete_path' => FALSE); $type['textfield'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#autocomplete_path' => FALSE);
$type['password'] = array('#input' => TRUE, '#size' => 30, '#maxlength' => 64); $type['password'] = array('#input' => TRUE, '#size' => 30, '#maxlength' => 64);
$type['textarea'] = array('#input' => TRUE, '#cols' => 60, '#rows' => 5); $type['textarea'] = array('#input' => TRUE, '#cols' => 60, '#rows' => 5);

View File

@ -59,8 +59,8 @@ function system_elements() {
// Inputs // Inputs
$type['checkbox'] = array('#input' => TRUE, '#return_value' => 1); $type['checkbox'] = array('#input' => TRUE, '#return_value' => 1);
$type['submit'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#execute' => TRUE); $type['submit'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#form_submitted' => TRUE);
$type['button'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#execute' => FALSE); $type['button'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#form_submitted' => FALSE);
$type['textfield'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#autocomplete_path' => FALSE); $type['textfield'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#autocomplete_path' => FALSE);
$type['password'] = array('#input' => TRUE, '#size' => 30, '#maxlength' => 64); $type['password'] = array('#input' => TRUE, '#size' => 30, '#maxlength' => 64);
$type['textarea'] = array('#input' => TRUE, '#cols' => 60, '#rows' => 5); $type['textarea'] = array('#input' => TRUE, '#cols' => 60, '#rows' => 5);