diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index 0b3057e..ec865f3 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -140,6 +140,9 @@ protected function actions(array $form, array &$form_state) { ), 'delete' => array( '#value' => t('Delete'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), // No need to validate the form when deleting the entity. '#submit' => array( array($this, 'delete'), diff --git a/core/lib/Drupal/Core/Entity/EntityListController.php b/core/lib/Drupal/Core/Entity/EntityListController.php index 1fdb4ba..bb162af 100644 --- a/core/lib/Drupal/Core/Entity/EntityListController.php +++ b/core/lib/Drupal/Core/Entity/EntityListController.php @@ -77,6 +77,9 @@ public function getOperations(EntityInterface $entity) { $operations['delete'] = array( 'title' => t('Delete'), 'href' => $uri['path'] . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'options' => $uri['options'], 'weight' => 100, ); diff --git a/core/modules/action/action.admin.inc b/core/modules/action/action.admin.inc index c9db258..dd8cda0 100644 --- a/core/modules/action/action.admin.inc +++ b/core/modules/action/action.admin.inc @@ -53,6 +53,9 @@ function action_admin_manage() { $links['delete'] = array( 'title' => t('delete'), 'href' => "admin/config/system/actions/delete/$action->aid", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); } $row[] = array( diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc index 3612e0c..24265d2 100644 --- a/core/modules/aggregator/aggregator.admin.inc +++ b/core/modules/aggregator/aggregator.admin.inc @@ -47,6 +47,9 @@ function aggregator_view() { $links['remove'] = array( 'title' => t('remove items'), 'href' => "admin/config/services/aggregator/remove/$feed->fid", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $links['update'] = array( 'title' => t('update items'), diff --git a/core/modules/ban/ban.admin.inc b/core/modules/ban/ban.admin.inc index 0ea23fc..f2d4b80 100644 --- a/core/modules/ban/ban.admin.inc +++ b/core/modules/ban/ban.admin.inc @@ -26,6 +26,9 @@ function ban_admin_page($default_ip = '') { $links['delete'] = array( 'title' => t('delete'), 'href' => "admin/config/people/ban/delete/$ip->iid", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $row[] = array( 'data' => array( diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc index 13f17ad..4193d62 100644 --- a/core/modules/block/block.admin.inc +++ b/core/modules/block/block.admin.inc @@ -150,6 +150,9 @@ function block_admin_display_form($form, &$form_state, $blocks, $theme, $block_r $links['delete'] = array( 'title' => t('delete'), 'href' => 'admin/structure/block/manage/' . $block['config_id'] . '/' . $theme . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $form['blocks'][$key]['operations'] = array( '#type' => 'operations', diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc index 5cf0bf7..cf122a8 100644 --- a/core/modules/book/book.pages.inc +++ b/core/modules/book/book.pages.inc @@ -160,6 +160,9 @@ function book_outline_form($form, &$form_state, Node $node) { '#value' => t('Remove from book outline'), '#access' => _book_node_is_removable($node), '#weight' => 20, + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#submit' => array('book_remove_button_submit'), ); diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 41af61d..088aa5d 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -925,6 +925,9 @@ function comment_links(Comment $comment, Node $node) { 'title' => t('delete'), 'href' => "comment/$comment->cid/delete", 'html' => TRUE, + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $links['comment-edit'] = array( 'title' => t('edit'), diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 13f5a76..44df0a8 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -61,6 +61,9 @@ function testList() { 'delete' => array ( 'title' => 'Delete', 'href' => 'admin/structure/config_test/manage/default/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'options' => $uri['options'], 'weight' => 100, ), diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php index 7e54e1c..f1f73b8 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php @@ -55,6 +55,9 @@ public function form(array $form, array &$form_state, EntityInterface $entity) { $form['actions']['delete'] = array( '#type' => 'submit', '#value' => 'Delete', + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); return $form; diff --git a/core/modules/field_ui/field_ui.admin.inc b/core/modules/field_ui/field_ui.admin.inc index 5764343..e620fc4 100644 --- a/core/modules/field_ui/field_ui.admin.inc +++ b/core/modules/field_ui/field_ui.admin.inc @@ -910,6 +910,9 @@ function field_ui_field_edit_form($form, &$form_state, $instance) { $form['actions']['delete'] = array( '#type' => 'submit', '#value' => t('Delete field'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#submit' => array('field_ui_field_edit_form_delete_submit'), ); return $form; diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index a977df9..93cb624 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -155,6 +155,9 @@ public function form(array $form, array &$form_state) { $links['delete'] = array( 'title' => t('delete'), 'href' => "$admin_field_path/delete", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'attributes' => array('title' => t('Delete instance.')), ); $table[$name]['operations']['data'] = array( diff --git a/core/modules/filter/filter.admin.inc b/core/modules/filter/filter.admin.inc index a62f8e3..ee9ecff 100644 --- a/core/modules/filter/filter.admin.inc +++ b/core/modules/filter/filter.admin.inc @@ -48,6 +48,9 @@ function filter_admin_overview($form) { $links['disable'] = array( 'title' => t('disable'), 'href' => "admin/config/content/formats/$id/disable", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); } diff --git a/core/modules/image/image.admin.inc b/core/modules/image/image.admin.inc index 933a4ad..746c913 100644 --- a/core/modules/image/image.admin.inc +++ b/core/modules/image/image.admin.inc @@ -93,6 +93,9 @@ function image_style_form($form, &$form_state, $style) { $links['delete'] = array( 'title' => t('delete'), 'href' => 'admin/config/media/image-styles/edit/' . $style->id() . '/effects/' . $key . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $form['effects'][$key]['operations'] = array( '#type' => 'operations', @@ -611,6 +614,9 @@ function theme_image_style_list($variables) { $links['delete'] = array( 'title' => t('delete'), 'href' => 'admin/config/media/image-styles/delete/' . $style->id(), + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'class' => array('image-style-link'), ); $row[] = array( diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index 11c6e62..82a2001 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -76,6 +76,9 @@ function language_admin_overview_form($form, &$form_state) { $links['delete'] = array( 'title' => t('delete'), 'href' => 'admin/config/regional/language/delete/' . $langcode, + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); } } @@ -928,6 +931,9 @@ function theme_language_negotiation_configure_browser_form_table($variables) { $links['delete'] = array( 'title' => t('Delete'), 'href' => "admin/config/regional/language/detection/browser/delete/$key", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'attributes' => array( 'class' => array('image-style-link'), ), diff --git a/core/modules/menu/menu.admin.inc b/core/modules/menu/menu.admin.inc index 4a78495..668924c 100644 --- a/core/modules/menu/menu.admin.inc +++ b/core/modules/menu/menu.admin.inc @@ -164,16 +164,36 @@ function _menu_overview_tree_form($tree, $delta = 50) { $links['delete'] = array( 'title' => t('delete'), 'href' => 'admin/structure/menu/item/' . $item['mlid'] . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), + ); + $operations['delete'] = array( + '#type' => 'link', + '#title' => t('delete'), + '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/delete', + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); - $operations['delete'] = array('#type' => 'link', '#title' => t('delete'), '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/delete'); } // Set the reset column. elseif ($item['module'] == 'system' && $item['customized']) { $links['reset'] = array( 'title' => t('reset'), 'href' => 'admin/structure/menu/item/' . $item['mlid'] . '/reset', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), + ); + $operations['reset'] = array( + '#type' => 'link', + '#title' => t('reset'), + '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/reset', + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); - $operations['reset'] = array('#type' => 'link', '#title' => t('reset'), '#href' => 'admin/structure/menu/item/' . $item['mlid'] . '/reset'); } $form[$mlid]['operations'] = array( '#type' => 'operations', @@ -343,6 +363,9 @@ function menu_edit_item($form, &$form_state, $type, $item, $menu) { '#type' => 'submit', '#value' => t('Delete'), '#access' => $item['mlid'], + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#submit' => array('menu_item_delete_submit'), '#weight' => 10, ); @@ -537,6 +560,9 @@ function menu_edit_menu($form, &$form_state, $type, $menu = array()) { '#type' => 'submit', '#value' => t('Delete'), '#access' => $type == 'edit' && !isset($system_menus[$menu['menu_name']]), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#submit' => array('menu_custom_delete_submit'), ); diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc index 538b19f..8a7a225 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -47,6 +47,9 @@ function node_overview_types() { $links['delete'] = array( 'title' => t('delete'), 'href' => 'admin/structure/types/manage/' . $type->type . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'weight' => 15, ); } @@ -277,6 +280,9 @@ function node_type_form($form, &$form_state, $type = NULL) { $form['actions']['delete'] = array( '#type' => 'submit', '#value' => t('Delete content type'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#weight' => 45, ); } diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc index 74f100c..5c798d1 100644 --- a/core/modules/node/node.admin.inc +++ b/core/modules/node/node.admin.inc @@ -568,6 +568,9 @@ function node_admin_nodes() { $operations['delete'] = array( 'title' => t('delete'), 'href' => 'node/' . $node->nid . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'query' => $destination, ); } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 9e8fbd3..5a26587 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -95,7 +95,16 @@ function node_help($path, $arg) { $message = t('The content access permissions need to be rebuilt.'); } else { - $message = t('The content access permissions need to be rebuilt. Rebuild permissions.', array('@node_access_rebuild' => url('admin/reports/status/rebuild'))); + $link = array( + '#type' => 'link', + '#href' => 'admin/reports/status/rebuild', + '#title' => t('Rebuild permissions'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), + ); + $link = drupal_render($link); + $message = t('The content access permissions need to be rebuilt. !link.', array('!link' => $link)); } drupal_set_message($message, 'error'); } @@ -3600,11 +3609,19 @@ function node_requirements($phase) { $value = t('Disabled'); } $description = t('If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Rebuilding will remove all privileges to content and replace them with permissions based on the current modules and settings. Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed, content will automatically use the new permissions.'); - + $link = array( + '#type' => 'link', + '#href' => 'admin/reports/status/rebuild', + '#title' => t('Rebuild permissions'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), + ); + $link = drupal_render($link); $requirements['node_access'] = array( 'title' => t('Node Access Permissions'), 'value' => $value, - 'description' => $description . ' ' . l(t('Rebuild permissions'), 'admin/reports/status/rebuild'), + 'description' => $description . ' ' . $link, ); } return $requirements; diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 245fef7..783b9ff 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -277,12 +277,18 @@ function node_revision_overview($node) { $links['revert'] = array( 'title' => t('revert'), 'href' => "node/$node->nid/revisions/$revision->vid/revert", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); } if ($delete_permission) { $links['delete'] = array( 'title' => t('delete'), 'href' => "node/$node->nid/revisions/$revision->vid/delete", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); } $row[] = array( diff --git a/core/modules/openid/openid.pages.inc b/core/modules/openid/openid.pages.inc index 81a5905..bb44662 100644 --- a/core/modules/openid/openid.pages.inc +++ b/core/modules/openid/openid.pages.inc @@ -56,6 +56,9 @@ function openid_user_identities($account) { $links['delete'] = array( 'title' => t('Delete'), 'href' => 'user/' . $account->uid . '/openid/delete/' . $identity->aid, + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $row[] = array( 'data' => array( diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc index 0535454..293b249 100644 --- a/core/modules/path/path.admin.inc +++ b/core/modules/path/path.admin.inc @@ -64,6 +64,9 @@ function path_admin_overview($keys = NULL) { $operations['delete'] = array( 'title' => t('delete'), 'href' => "admin/config/search/path/delete/$data->pid", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'query' => $destination, ); $row['data']['operations'] = array( @@ -187,6 +190,9 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali $form['actions']['delete'] = array( '#type' => 'submit', '#value' => t('Delete'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#submit' => array('path_admin_form_delete_submit'), ); } diff --git a/core/modules/search/search.admin.inc b/core/modules/search/search.admin.inc index ef70eb7..a85c463 100644 --- a/core/modules/search/search.admin.inc +++ b/core/modules/search/search.admin.inc @@ -63,7 +63,14 @@ function search_admin_settings($form, &$form_state) { $status = '

' . t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) . ' ' . $count . '

'; $form['status'] = array('#type' => 'details', '#title' => t('Indexing status')); $form['status']['status'] = array('#markup' => $status); - $form['status']['wipe'] = array('#type' => 'submit', '#value' => t('Re-index site'), '#submit' => array('search_admin_reindex_submit')); + $form['status']['wipe'] = array( + '#type' => 'submit', + '#value' => t('Re-index site'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), + '#submit' => array('search_admin_reindex_submit'), + ); $items = drupal_map_assoc(array(10, 20, 50, 100, 200, 500)); diff --git a/core/modules/shortcut/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc index 18ec1c3..c42f66b 100644 --- a/core/modules/shortcut/shortcut.admin.inc +++ b/core/modules/shortcut/shortcut.admin.inc @@ -176,6 +176,9 @@ function shortcut_set_admin() { $links['delete'] = array( 'title' => t('delete set'), 'href' => "admin/config/user-interface/shortcut/$set->set_name/delete", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); } $row[] = array( @@ -290,6 +293,9 @@ function shortcut_set_customize($form, &$form_state, $shortcut_set) { $links['delete'] = array( 'title' => t('delete'), 'href' => "admin/config/user-interface/shortcut/link/$mlid/delete", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $form['shortcuts']['links'][$mlid]['operations'] = array( '#type' => 'operations', diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index c3c2ce4..0d42136 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1289,6 +1289,9 @@ function system_modules_uninstall($form, $form_state = NULL) { $form['actions']['submit'] = array( '#type' => 'submit', '#value' => t('Uninstall'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $form['#action'] = url('admin/modules/uninstall/confirm'); } @@ -2565,6 +2568,9 @@ function system_date_time_formats() { $links['delete'] = array( 'title' => t('delete'), 'href' => 'admin/config/regional/date-time/formats/' . $date_format_id . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $row['operations'] = array('data' => array( '#type' => 'operations', @@ -2741,6 +2747,9 @@ function system_date_format_language_overview_page() { $links['reset'] = array( 'title' => t('reset'), 'href' => "admin/config/regional/date-time/locale/$langcode/reset", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $row[] = array( 'data' => array( diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 60cd4e0..cbcd776 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -3361,6 +3361,9 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, '#type' => 'link', '#title' => $no ? $no : t('Cancel'), '#href' => $options['path'], + '#attributes' => array( + 'class' => array('dialog-cancel'), + ), '#options' => $options, ); // By default, render the form using theme_confirm_form(). diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php index a65f06f..194ae4c 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php @@ -75,6 +75,17 @@ public function save(array $form, array &$form_state) { } /** + * Overrides Drupal\Core\Entity\EntityFormController::actions(). + */ + protected function actions(array $form, array &$form_state) { + $actions = parent::actions($form, $form_state); + // Can't test the delete confirmation form in a modal dialog, so remove + // #ajax. + unset($actions['delete']['#ajax']); + return $actions; + } + + /** * Overrides Drupal\Core\Entity\EntityFormController::delete(). */ public function delete(array $form, array &$form_state) { diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index 6305e48..d954430 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -287,7 +287,13 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { } $operations = array( 'edit' => array('title' => t('edit'), 'href' => 'taxonomy/term/' . $term->tid . '/edit', 'query' => $destination), - 'delete' => array('title' => t('delete'), 'href' => 'taxonomy/term/' . $term->tid . '/delete', 'query' => $destination), + 'delete' => array( + 'title' => t('delete'), + 'href' => 'taxonomy/term/' . $term->tid . '/delete', + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), + 'query' => $destination), ); if (module_invoke('translation_entity', 'translate_access', $term)) { $operations['translate'] = array( @@ -318,7 +324,10 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { ); $form['actions']['reset_alphabetical'] = array( '#type' => 'submit', - '#value' => t('Reset to alphabetical') + '#value' => t('Reset to alphabetical'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), ); $form_state['redirect'] = array(current_path(), (isset($_GET['page']) ? array('query' => array('page' => $_GET['page'])) : array())); } diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php index 36202eb..8178d4d 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php @@ -202,6 +202,9 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac '#type' => 'submit', '#value' => t('Delete translation'), '#weight' => $weight, + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#submit' => array(array($this, 'entityFormDeleteTranslation')), ); } diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module index fca7c4a..eda9089 100644 --- a/core/modules/translation_entity/translation_entity.module +++ b/core/modules/translation_entity/translation_entity.module @@ -663,6 +663,9 @@ function translation_entity_form_field_ui_field_settings_form_alter(array &$form '#prefix' => t('This field has data in existing content.') . ' ', '#title' => !$translatable ? t('Enable translation') : t('Disable translation'), '#href' => 'admin/config/regional/translation_entity/translatable/' . $field_name, + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#options' => array('query' => drupal_get_destination()), '#access' => user_access('administer entity translation'), ), diff --git a/core/modules/translation_entity/translation_entity.pages.inc b/core/modules/translation_entity/translation_entity.pages.inc index 294c97b..a65fa3c 100644 --- a/core/modules/translation_entity/translation_entity.pages.inc +++ b/core/modules/translation_entity/translation_entity.pages.inc @@ -100,6 +100,7 @@ function translation_entity_overview(EntityInterface $entity) { $source_name = isset($languages[$source]) ? $languages[$source]->name : t('n/a'); $links['delete'] = isset($delete_links->links[$langcode]['href']) ? $delete_links->links[$langcode] : array('href' => $delete_links, 'language' => $language); $links['delete']['title'] = t('delete'); + $links['delete']['ajax'] = array('dialog' => array('modal' => TRUE)); } } else { diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc index dcd76d7..1c93a9b 100644 --- a/core/modules/user/user.admin.inc +++ b/core/modules/user/user.admin.inc @@ -997,6 +997,9 @@ function user_admin_role($form, $form_state, $role) { '#type' => 'submit', '#value' => t('Delete role'), '#access' => !empty($role->rid) && !in_array($role->rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID)), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), '#submit' => array('user_admin_role_delete_submit'), ); diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index c8a2c96..345f788 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -84,10 +84,19 @@ public function form(array $form, array &$form_state, EntityInterface $view) { $form['#attributes']['class'] = array('form-edit'); if (isset($view->locked) && is_object($view->locked) && $view->locked->owner != $GLOBALS['user']->uid) { + $break_link = array( + '#type' => 'link', + '#href' => 'admin/structure/views/view/' . $view->get('name') . '/break-lock', + '#title' => t('break this lock'), + '#ajax' => array( + 'dialog' => array('modal' => TRUE), + ), + ); + $break_link = drupal_render($break_link); $form['locked'] = array( '#type' => 'container', '#attributes' => array('class' => array('view-locked', 'messages', 'warning')), - '#children' => t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to break this lock.', array('!user' => theme('username', array('account' => user_load($view->locked->owner))), '!age' => format_interval(REQUEST_TIME - $view->locked->updated), '!break' => url('admin/structure/views/view/' . $view->get('name') . '/break-lock'))), + '#children' => t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to !break_link.', array('!user' => theme('username', array('account' => user_load($view->locked->owner))), '!age' => format_interval(REQUEST_TIME - $view->locked->updated), '!break_link' => $break_link)), '#weight' => -10, ); } diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php index 46c139b..ff2f79f 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php @@ -123,6 +123,9 @@ public function getOperations(EntityInterface $view) { $definition['delete'] = array( 'title' => t('Delete'), 'href' => "$path/delete", + 'ajax' => array( + 'dialog' => array('modal' => TRUE), + ), 'weight' => 10, ); } @@ -141,9 +144,10 @@ public function getOperations(EntityInterface $view) { public function buildOperations(EntityInterface $entity) { $build = parent::buildOperations($entity); - // Allow operations to specify that they use AJAX. + // Allow operations to specify that they use AJAX, but don't add it for + // links using modals. foreach ($build['#links'] as &$operation) { - if (!empty($operation['ajax'])) { + if (!empty($operation['ajax']) && !is_array($operation['ajax'])) { $operation['attributes']['class'][] = 'use-ajax'; } }