summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc25
-rw-r--r--includes/install.core.inc8
2 files changed, 28 insertions, 5 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 4b8972a01..5c3b012fe 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1237,7 +1237,7 @@ function form_builder($form_id, $element, &$form_state) {
$element['#processed'] = FALSE;
// Use element defaults.
- if (isset($element['#type']) && ($info = element_info($element['#type']))) {
+ if (isset($element['#type']) && empty($element['#defaults_loaded']) && ($info = element_info($element['#type']))) {
// Overlay $info onto $element, retaining preexisting keys in $element.
$element += $info;
$element['#defaults_loaded'] = TRUE;
@@ -1315,6 +1315,12 @@ function form_builder($form_id, $element, &$form_state) {
$array_parents[] = $key;
$element[$key]['#array_parents'] = $array_parents;
+ // Prior to handling #weight, default element properties need to be applied.
+ if (isset($element[$key]['#type']) && empty($element[$key]['#defaults_loaded']) && ($info = element_info($element[$key]['#type']))) {
+ $element[$key] += $info;
+ $element[$key]['#defaults_loaded'] = TRUE;
+ }
+
// Assign a decimal placeholder weight to preserve original array order.
if (!isset($element[$key]['#weight'])) {
$element[$key]['#weight'] = $count/1000;
@@ -2429,6 +2435,23 @@ function form_process_checkboxes($element) {
}
/**
+ * Processes a form actions container element.
+ *
+ * @param $element
+ * An associative array containing the properties and children of the
+ * form actions container.
+ * @param $form_state
+ * The $form_state array for the form this element belongs to.
+ *
+ * @return
+ * The processed element.
+ */
+function form_process_actions($element, &$form_state) {
+ $element['#attributes']['class'][] = 'form-actions';
+ return $element;
+}
+
+/**
* Processes a container element.
*
* @param $element
diff --git a/includes/install.core.inc b/includes/install.core.inc
index 5078f76c9..7e0b91c0c 100644
--- a/includes/install.core.inc
+++ b/includes/install.core.inc
@@ -928,7 +928,7 @@ function install_settings_form($form, &$form_state, &$install_state) {
'#description' => st('If more than one application will be sharing this database, enter a table prefix such as %prefix for your @drupal site here.', array('@drupal' => drupal_install_profile_distribution_name(), '%prefix' => $db_prefix)),
);
- $form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
+ $form['actions'] = array('#type' => 'actions');
$form['actions']['save'] = array(
'#type' => 'submit',
'#value' => st('Save and continue'),
@@ -1146,7 +1146,7 @@ function install_select_profile_form($form, &$form_state, $profile_files) {
'#parents' => array('profile'),
);
}
- $form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
+ $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => st('Save and continue'),
@@ -1280,7 +1280,7 @@ function install_select_locale_form($form, &$form_state, $locales, $profilename
'#markup' => '<p><a href="install.php?profile=' . $profilename . '&amp;localize=true">' . st('Learn how to install Drupal in other languages') . '</a></p>',
);
}
- $form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
+ $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => st('Save and continue'),
@@ -1689,7 +1689,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
'#weight' => 15,
);
- $form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
+ $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => st('Save and continue'),