1 layout_renderer_flexible.inc protected LayoutRendererFlexible::getRowButtons($region_id)

Render the links to display when editing a region.

File

core/modules/layout/plugins/renderers/layout_renderer_flexible.inc, line 145

Class

LayoutRendererFlexible
The renderer for the flexible template editor.

Code

protected function getRowButtons($region_id) {
  $links = array();
  $links['configure'] = array(
    'title' => t('Configure'),
    'href' => 'admin/structure/layouts/settings/flexible-template/' . $this->layout_info['name'] . '/row/' . $region_id . '/configure',
    'attributes' => array(
      'class' => array('use-ajax'),
      'data-dialog' => TRUE,
      'data-dialog-options' => json_encode(array('dialogClass' => 'layout-dialog')),
    ),
  );
  $links['delete'] = array(
    'title' => t('Delete row'),
    'href' => 'admin/structure/layouts/settings/flexible-template/' . $this->layout_info['name'] . '/row/' . $region_id . '/delete',
    'query' => array(
      'token' => backdrop_get_token('layout-region-' . $region_id)
    ),
    'attributes' => array(
      'class' => array('use-ajax'),
    ),
  );

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

  return backdrop_render($dropbutton);
}