You are here

function panels_renderer_editor::get_region_links in Panels 6.3

Same name and namespace in other branches
  1. 7.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_renderer_editor::get_region_links()

Render the links to display when editing a region.

2 calls to panels_renderer_editor::get_region_links()
panels_renderer_editor::command_update_region_links in plugins/display_renderers/panels_renderer_editor.class.php
Create a command to update the links on a region after a change was made.
panels_renderer_editor::render_region in plugins/display_renderers/panels_renderer_editor.class.php
Render a single panel region.

File

plugins/display_renderers/panels_renderer_editor.class.php, line 257
Class file to control the main Panels editor.

Class

panels_renderer_editor
@file Class file to control the main Panels editor.

Code

function get_region_links($region_id) {
  $links = array();
  $links[] = array(
    'title' => t('Add content'),
    'href' => $this
      ->get_url('select-content', $region_id),
    'attributes' => array(
      'class' => 'ctools-use-modal',
    ),
  );
  if (user_access('administer panels styles')) {
    $links[] = array(
      'title' => '<hr />',
      'html' => TRUE,
    );
    $style_links = $this
      ->get_style_links('region', $region_id);
    $links[] = array(
      'title' => '<span class="dropdown-header">' . t('Style') . '</span>' . theme_links($style_links),
      'html' => TRUE,
      'attributes' => array(
        'class' => 'panels-sub-menu',
      ),
    );
  }
  return theme('ctools_dropdown', theme('image', ctools_image_path('icon-addcontent.png', 'panels')), $links, TRUE, 'pane-add-link panels-region-links-' . $region_id);
}