1 layout_renderer_editor.inc protected LayoutRendererEditor::getRegionLinks($region_id)

Render the links to display when editing a region.

File

core/modules/layout/plugins/renderers/layout_renderer_editor.inc, line 159
Class file to control the main Layout editor.

Class

LayoutRendererEditor

Code

protected function getRegionLinks($region_id) {
  $links = array();
  if ($region_id == 'title') {
    $links['title'] = array(
      'title' => t('Configure'),
      'href' => $this->getUrl('edit-title', $region_id),
      'attributes' => array(
        'class' => array('use-ajax'),
        'data-dialog' => TRUE,
        'data-dialog-options' => json_encode(array('dialogClass' => 'layout-dialog')),
      ),
    );
  }
  else {
    $links['add'] = array(
      'title' => t('Add block'),
      'href' => $this->getUrl('add-block', $region_id),
      'attributes' => array(
        'class' => array('use-ajax'),
        'data-dialog' => TRUE,
        'data-dialog-options' => json_encode(array('dialogClass' => 'layout-dialog')),
      ),
    );
    $links['configure'] = array(
      'title' => t('Configure region'),
      'href' => $this->getUrl('configure-region', $region_id),
      'attributes' => array(
        'class' => array('use-ajax'),
        'data-dialog' => TRUE,
        'data-dialog-options' => json_encode(array('dialogClass' => 'layout-dialog')),
      ),
    );
  }

  $dropbutton = array(
    '#type' => 'dropbutton',
    '#links' => $links,
  );

  return backdrop_render($dropbutton);
}