summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-20 07:11:37 +0000
committerGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-20 07:11:37 +0000
commit297ed741f8d32569b82ea44ea144e332f595933b (patch)
tree6805754a09793c41ae3b1929a183a082b7476c32
parent4e9a12ddb8f3d3c986aa9213df1ee7f0bd90f655 (diff)
downloadbrdo-297ed741f8d32569b82ea44ea144e332f595933b.tar.gz
brdo-297ed741f8d32569b82ea44ea144e332f595933b.tar.bz2
#58221, Turn #after_build into a functions array in order to make validation of date fields possible. Patch by yched, tenrapid
Also makes forms API more consistent (see #pre_render)
-rw-r--r--includes/form.inc9
-rw-r--r--modules/comment.module2
-rw-r--r--modules/comment/comment.module2
-rw-r--r--modules/node.module2
-rw-r--r--modules/node/node.module2
-rw-r--r--modules/system.module4
-rw-r--r--modules/system/system.module4
7 files changed, 14 insertions, 11 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 2f9e9e76a..4c77f9c59 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -424,9 +424,12 @@ function form_builder($form_id, $form) {
$count++;
}
- if (isset($form['#after_build']) && function_exists($form['#after_build']) && !isset($form['#after_build_done'])) {
- $function = $form['#after_build'];
- $form = $function($form, $form_values);
+ if (isset($form['#after_build']) && !isset($form['#after_build_done'])) {
+ foreach ($form['#after_build'] as $function) {
+ if (function_exists($function)) {
+ $form = $function($form, $form_values);
+ }
+ }
$form['#after_build_done'] = TRUE;
}
diff --git a/modules/comment.module b/modules/comment.module
index af8b51d1a..8a3db48b8 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -1355,7 +1355,7 @@ function comment_form($edit, $title = NULL) {
}
if ($op == t('Preview comment')) {
- $form['#after_build'] = 'comment_form_add_preview';
+ $form['#after_build'] = array('comment_form_add_preview');
}
if ($_REQUEST['destination']) {
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index af8b51d1a..8a3db48b8 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1355,7 +1355,7 @@ function comment_form($edit, $title = NULL) {
}
if ($op == t('Preview comment')) {
- $form['#after_build'] = 'comment_form_add_preview';
+ $form['#after_build'] = array('comment_form_add_preview');
}
if ($_REQUEST['destination']) {
diff --git a/modules/node.module b/modules/node.module
index d4a58bd3d..1357eaa77 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1651,7 +1651,7 @@ function node_form_array($node) {
$form['delete'] = array('#type' => 'button', '#value' => t('Delete'), '#weight' => 50);
}
- $form['#after_build'] = 'node_form_add_preview';
+ $form['#after_build'] = array('node_form_add_preview');
return $form;
}
diff --git a/modules/node/node.module b/modules/node/node.module
index d4a58bd3d..1357eaa77 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1651,7 +1651,7 @@ function node_form_array($node) {
$form['delete'] = array('#type' => 'button', '#value' => t('Delete'), '#weight' => 50);
}
- $form['#after_build'] = 'node_form_add_preview';
+ $form['#after_build'] = array('node_form_add_preview');
return $form;
}
diff --git a/modules/system.module b/modules/system.module
index 8a57230a6..4763534c2 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -360,7 +360,7 @@ function system_view_general() {
'#default_value' => file_directory_path(),
'#maxlength' => 255,
'#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'),
- '#after_build' => 'system_check_directory',
+ '#after_build' => array('system_check_directory'),
);
$form['files']['file_directory_temp'] = array(
@@ -369,7 +369,7 @@ function system_view_general() {
'#default_value' => file_directory_temp(),
'#maxlength' => 255,
'#description' => t('Location where uploaded files will be kept during previews. Relative paths will be resolved relative to the Drupal installation directory.'),
- '#after_build' => 'system_check_directory',
+ '#after_build' => array('system_check_directory'),
);
$form['files']['file_downloads'] = array(
diff --git a/modules/system/system.module b/modules/system/system.module
index 8a57230a6..4763534c2 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -360,7 +360,7 @@ function system_view_general() {
'#default_value' => file_directory_path(),
'#maxlength' => 255,
'#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'),
- '#after_build' => 'system_check_directory',
+ '#after_build' => array('system_check_directory'),
);
$form['files']['file_directory_temp'] = array(
@@ -369,7 +369,7 @@ function system_view_general() {
'#default_value' => file_directory_temp(),
'#maxlength' => 255,
'#description' => t('Location where uploaded files will be kept during previews. Relative paths will be resolved relative to the Drupal installation directory.'),
- '#after_build' => 'system_check_directory',
+ '#after_build' => array('system_check_directory'),
);
$form['files']['file_downloads'] = array(