Commit 45f4a1e1 authored by Dries's avatar Dries

- Patch #482816 by sun, Rob Loach: make a consistent wrapper around submit buttons.

parent 3e547ae0
......@@ -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;
......@@ -2428,6 +2434,23 @@ function form_process_checkboxes($element) {
return $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.
*
......
......@@ -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'),
......
......@@ -109,13 +109,14 @@ function aggregator_form_feed($form, &$form_state, stdClass $feed = NULL) {
'#description' => t('New feed items are automatically filed in the checked categories.'),
);
}
$form['submit'] = array(
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
if (!empty($feed->fid)) {
$form['delete'] = array(
$form['actions']['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete'),
);
......@@ -270,7 +271,8 @@ function aggregator_form_opml($form, &$form_state) {
'#description' => t('New feed items are automatically filed in the checked categories.'),
);
}
$form['submit'] = array(
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Import')
);
......@@ -478,7 +480,7 @@ function aggregator_admin_form($form, $form_state) {
// Implementing modules will expect an array at $form['modules'].
$form['modules'] = array();
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
......@@ -512,10 +514,10 @@ function aggregator_form_category($form, &$form_state, $edit = array('title' =>
'#title' => t('Description'),
'#default_value' => $edit['description'],
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save'));
if ($edit['cid']) {
$form['delete'] = array('#type' => 'submit', '#value' => t('Delete'));
$form['actions']['delete'] = array('#type' => 'submit', '#value' => t('Delete'));
$form['cid'] = array('#type' => 'hidden', '#value' => $edit['cid']);
}
......
......@@ -199,7 +199,7 @@ function aggregator_categorize_items($items, $feed_source = '') {
'#multiple' => TRUE
);
}
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save categories'));
return $form;
......
......@@ -104,8 +104,7 @@ function block_admin_display_form($form, &$form_state, $blocks, $theme) {
$form['actions'] = array(
'#tree' => FALSE,
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
'#type' => 'actions',
);
$form['actions']['submit'] = array(
'#type' => 'submit',
......@@ -351,7 +350,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
'#default_value' => isset($block->custom) ? $block->custom : 0,
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save block'),
......
......@@ -1906,11 +1906,7 @@ function comment_form($form, &$form_state, $comment) {
// already previewing the submission. However, if there are form errors,
// we hide the save button no matter what, so that optional form elements
// (e.g., captchas) can be updated.
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
'#weight' => 100,
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
......
......@@ -108,10 +108,7 @@ function contact_category_edit_form($form, &$form_state, array $category = array
'#type' => 'value',
'#value' => $category['cid'],
);
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
......
......@@ -101,10 +101,7 @@ function contact_site_form($form, &$form_state) {
'#title' => t('Send yourself a copy.'),
'#access' => $user->uid,
);
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Send message'),
......@@ -235,10 +232,7 @@ function contact_personal_form($form, &$form_state, $recipient) {
'#title' => t('Send yourself a copy.'),
'#access' => $user->uid,
);
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Send message'),
......
......@@ -312,8 +312,8 @@ function dblog_filter_form($form) {
}
$form['filters']['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions', 'container-inline')),
'#type' => 'actions',
'#attributes' => array('class' => array('container-inline')),
);
$form['filters']['actions']['submit'] = array(
'#type' => 'submit',
......
......@@ -274,7 +274,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle
$form['#field_rows'][] = $name;
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save'));
return $form;
}
......@@ -624,7 +625,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund
}
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save'));
return $form;
}
......@@ -859,7 +861,7 @@ function field_ui_field_settings_form($form, &$form_state, $instance) {
$form['#entity_type'] = $entity_type;
$form['#bundle'] = $bundle;
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save field settings'));
return $form;
}
......@@ -922,7 +924,8 @@ function field_ui_widget_type_form($form, &$form_state, $instance) {
);
$form['#instance'] = $instance;
$form['submit'] = array('#type' => 'submit', '#value' => t('Continue'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Continue'));
$form['#validate'] = array();
$form['#submit'] = array('field_ui_widget_type_form_submit');
......@@ -1160,7 +1163,8 @@ function field_ui_field_edit_form($form, &$form_state, $instance) {
$form['field']['settings'] = $additions;
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save settings'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save settings'));
return $form;
}
......
......@@ -36,7 +36,7 @@ function filter_admin_overview($form) {
$form['formats'][$id]['delete'] = array('#type' => 'link', '#title' => t('delete'), '#href' => 'admin/config/content/formats/' . $id . '/delete', '#access' => !$form['formats'][$id]['#is_fallback']);
$form['formats'][$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
}
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save changes'));
return $form;
}
......@@ -230,7 +230,7 @@ function filter_admin_format_form($form, &$form_state, $format) {
if (!empty($format->format)) {
$form['format'] = array('#type' => 'value', '#value' => $format->format);
}
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
return $form;
......
......@@ -55,7 +55,7 @@ function forum_form_forum($form, &$form_state, $edit = array()) {
);
$form['vid'] = array('#type' => 'hidden', '#value' => variable_get('forum_nav_vocabulary', ''));
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit' ] = array('#type' => 'submit', '#value' => t('Save'));
if ($edit['tid']) {
$form['actions']['delete'] = array('#type' => 'submit', '#value' => t('Delete'));
......@@ -160,7 +160,7 @@ function forum_form_container($form, &$form_state, $edit = array()) {
'#type' => 'hidden',
'#value' => variable_get('forum_nav_vocabulary', ''),
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save')
......
......@@ -141,14 +141,15 @@ function image_style_form($form, &$form_state, $style) {
);
// Show the Override or Submit button for this style.
$form['override'] = array(
$form['actions'] = array('#type' => 'actions');
$form['actions']['override'] = array(
'#type' => 'submit',
'#value' => t('Override defaults'),
'#validate' => array(),
'#submit' => array('image_style_form_override_submit'),
'#access' => !$editable,
);
$form['submit'] = array(
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Update style'),
'#access' => $editable,
......@@ -393,7 +394,7 @@ function image_effect_form($form, &$form_state, $style, $effect) {
'#value' => isset($_GET['weight']) ? intval($_GET['weight']) : (isset($effect['weight']) ? $effect['weight'] : count($style['effects'])),
);
$form['actions'] = array('#tree' => FALSE, '#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#tree' => FALSE, '#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => isset($effect['ieid']) ? t('Update effect') : t('Add effect'),
......
......@@ -43,7 +43,7 @@ function locale_languages_overview_form() {
'#options' => $options,
'#default_value' => language_default('language'),
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
$form['#theme'] = 'locale_languages_overview_form';
......@@ -168,7 +168,7 @@ function locale_languages_predefined_form($form) {
'#options' => $predefined,
'#description' => t('Use the <em>Custom language</em> section below if your desired language does not appear in this list.'),
);
$form['language list']['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['language list']['actions'] = array('#type' => 'actions');
$form['language list']['actions']['submit'] = array('#type' => 'submit', '#value' => t('Add language'));
return $form;
}
......@@ -183,7 +183,7 @@ function locale_languages_custom_form($form) {
'#collapsed' => TRUE,
);
_locale_languages_common_controls($form['custom language']);
$form['custom language']['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['custom language']['actions'] = array('#type' => 'actions');
$form['custom language']['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Add custom language')
......@@ -203,7 +203,7 @@ function locale_languages_custom_form($form) {
function locale_languages_edit_form($form, &$form_state, $langcode) {
if ($language = db_query("SELECT * FROM {languages} WHERE language = :language", array(':language' => $langcode))->fetchObject()) {
_locale_languages_common_controls($form, $language);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save language')
......@@ -483,7 +483,7 @@ function locale_languages_configure_form() {
_locale_languages_configure_form_language_table($form, $type);
}
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save settings'),
......@@ -862,7 +862,10 @@ function locale_translation_filter_form() {
}
}
$form['filters']['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions', 'container-inline')));
$form['filters']['actions'] = array(
'#type' => 'actions',
'#attributes' => array('class' => array('container-inline')),
);
$form['filters']['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Filter'),
......@@ -1053,7 +1056,8 @@ function locale_translate_export_po_form($form, &$form_state, $names) {
'#default_value' => 'default',
'#options' => module_invoke_all('locale', 'groups'),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Export'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Export'));
return $form;
}
......@@ -1071,7 +1075,8 @@ function locale_translate_export_pot_form() {
'#default_value' => 'default',
'#options' => module_invoke_all('locale', 'groups'),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Export'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Export'));
// Reuse PO export submission callback.
$form['#submit'][] = 'locale_translate_export_po_form_submit';
return $form;
......@@ -1160,7 +1165,8 @@ function locale_translate_edit_form($form, &$form_state, $lid) {
$form['translations'][$translation->language]['#default_value'] = $translation->translation;
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save translations'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save translations'));
return $form;
}
......@@ -1385,7 +1391,7 @@ function locale_date_format_form($form, &$form_state, $langcode) {
);
}
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
......
......@@ -72,7 +72,7 @@ function menu_overview_form($form, &$form_state, $menu) {
$form['#menu'] = $menu;
if (element_children($form)) {
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
......@@ -339,7 +339,8 @@ function menu_edit_item($form, &$form_state, $type, $item, $menu) {
'#default_value' => $item['weight'],
'#description' => t('Optional. In the menu, the heavier links will sink and the lighter links will be positioned nearer the top.'),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save'));
return $form;
}
......@@ -467,12 +468,13 @@ function menu_edit_menu($form, &$form_state, $type, $menu = array()) {
'#title' => t('Description'),
'#default_value' => $menu['description'],
);
$form['submit'] = array(
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
// Only custom menus may be deleted.
$form['delete'] = array(
$form['actions']['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete'),
'#access' => $type == 'edit' && !isset($system_menus[$menu['menu_name']]),
......
......@@ -245,7 +245,7 @@ function node_type_form($form, &$form_state, $type = NULL) {
'#value' => $type->locked,
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save content type'),
......
......@@ -188,9 +188,9 @@ function node_filter_form() {
}
$form['filters']['actions'] = array(
'#type' => 'container',
'#type' => 'actions',
'#id' => 'node-admin-buttons',
'#attributes' => array('class' => array('form-actions', 'container-inline')),
'#attributes' => array('class' => array('container-inline')),
);
$form['filters']['actions']['submit'] = array('#type' => 'submit', '#value' => (count($session) ? t('Refine') : t('Filter')));
if (count($session)) {
......
......@@ -247,11 +247,7 @@ function node_form($form, &$form_state, $node) {
);
// Add the buttons.
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
'#weight' => 100,
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#access' => variable_get('node_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_REQUIRED || (!form_get_errors() && isset($form_state['node_preview'])),
......
......@@ -109,7 +109,8 @@ function openid_redirect_form($form, &$form_state, $url, $message) {
'#value' => $value,
);
}
$form['submit'] = array(
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#prefix' => '<noscript>',
'#suffix' => '</noscript>',
......
......@@ -73,7 +73,7 @@ function openid_user_add() {
'#type' => 'textfield',
'#title' => t('OpenID'),
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Add an OpenID'));
return $form;
}
......
......@@ -122,10 +122,7 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali
'#value' => $path['language']
);
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
......
......@@ -894,7 +894,8 @@ function poll_cancel_form($form, &$form_state, $nid) {
// Store the nid so we can get to it in submit functions.
$form['#nid'] = $nid;
$form['submit'] = array(
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Cancel your vote'),
'#submit' => array('poll_cancel')
......
......@@ -40,7 +40,8 @@ function profile_admin_overview($form) {
// Display the submit button only when there's more than one field
if (count($form) > 1) {
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
}
else {
// Disable combo boxes when there isn't a submit button
......@@ -105,7 +106,7 @@ function theme_profile_admin_overview($variables) {
drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css');
// Add javascript if there's more than one field.
if (isset($form['submit'])) {
if (isset($form['actions'])) {
drupal_add_js(drupal_get_path('module', 'profile') . '/profile.js');
}
......@@ -127,7 +128,7 @@ function theme_profile_admin_overview($variables) {
$rows[] = array('data' => array(array('data' => '<em>' . t('No fields in this category. If this category remains empty when saved, it will be removed.') . '</em>', 'colspan' => 7)), 'class' => array('category-' . $category_number . '-message', 'category-message', 'category-populated'));
// Make it draggable only if there is more than one field
if (isset($form['submit'])) {
if (isset($form['actions'])) {
drupal_add_tabledrag('profile-fields', 'order', 'sibling', 'profile-weight', 'profile-weight-' . $category_number);
drupal_add_tabledrag('profile-fields', 'match', 'sibling', 'profile-category', 'profile-category-' . $category_number);
}
......@@ -143,7 +144,7 @@ function theme_profile_admin_overview($variables) {
$row[] = drupal_render($field['title']);
$row[] = drupal_render($field['name']);
$row[] = drupal_render($field['type']);
if (isset($form['submit'])) {
if (isset($form['actions'])) {
$row[] = drupal_render($field['category']);
$row[] = drupal_render($field['weight']);
}
......@@ -154,7 +155,7 @@ function theme_profile_admin_overview($variables) {
}
$header = array(t('Title'), t('Name'), t('Type'));
if (isset($form['submit'])) {
if (isset($form['actions'])) {
$header[] = t('Category');
$header[] = t('Weight');
}
......@@ -286,7 +287,7 @@ function profile_field_form($form, &$form_state, $arg = NULL) {
'#default_value' => $edit['register'],
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit',
'#value' => t('Save field'),
);
......
......@@ -935,7 +935,8 @@ function search_box($form, &$form_state, $form_id) {
'#default_value' => '',
'#attributes' => array('title' => t('Enter the terms you wish to search for.')),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Search'));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Search'));
$form['#submit'][] = 'search_box_form_submit';
return $form;
......
......@@ -85,7 +85,7 @@ function shortcut_set_switch($form, &$form_state, $account = NULL) {
'js' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'),
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Change set'),
......@@ -193,7 +193,7 @@ function shortcut_set_add_form($form, &$form_state) {
'#description' => t('The new set is created by copying items from your default shortcut set.'),
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Create new set'),
......@@ -269,7 +269,7 @@ function shortcut_set_customize($form, &$form_state, $shortcut_set) {
'js' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'),
);
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save changes'),
......@@ -453,7 +453,7 @@ function _shortcut_link_form_elements($shortcut_link = NULL) {
$form['#validate'][] = 'shortcut_link_edit_validate';
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
......@@ -562,11 +562,7 @@ function shortcut_set_edit_form($form, &$form_state, $shortcut_set) {
'#required' => TRUE,
'#weight' => -5,
);
$form['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('form-actions')),
'#weight' => 100,
);
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
......
......@@ -345,7 +345,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) {
'#title' => t('Use the administration theme when editing or creating content'),
'#default_value' => variable_get('node_admin_theme', '0'),
);
$form['admin_theme']['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['admin_theme']['actions'] = array('#type' => 'actions');
$form['admin_theme']['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
......@@ -950,7 +950,7 @@ function system_modules($form, $form_state = array()) {
);
}
$form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
......@@ -1307,7 +1307,7 @@ function system_modules_uninstall($form, $form_state = NULL) {