diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 8fa59ea..0edba58 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -6,6 +6,7 @@ */ use Drupal\Component\Plugin\Exception\PluginException; +use Drupal\Component\Utility\Json; use Drupal\Component\Utility\NestedArray; /** @@ -641,3 +642,29 @@ function block_library_info() { return $libraries; } + +/** + * Implements hook_form_FORM_ID_alter() for 'view_edit_form'. + */ +function block_form_view_edit_form_alter(array &$form, array &$form_state) { + $view = $form_state['controller']->getEntity(); + $display = $view->getExecutable()->current_display; + $actions = &$form['displays']['settings']['settings_content']['tab_content']['details']['top']['actions']; + $actions['suffix']['#weight'] = 10; + $actions['place_block'] = array( + '#type' => 'link', + '#title' => t('Place block'), + '#href' => 'admin/structure/block/add/views_block:' . $view->id() . '-' . $display, + '#options' => array( + 'attributes' => array( + 'class' => array('use-ajax'), + 'data-accepts' => 'application/vnd.drupal-modal', + 'data-dialog-options' => Json::encode(array( + 'width' => 700, + )), + ), + ), + '#prefix' => '
  • ', + "#suffix" => '
  • ', + ); +}