You are here

function panels_renderer_editor::get_display_links in Panels 7.3

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

Get the links for a panel display.

This is abstracted out for easy ajax replacement.

1 call to panels_renderer_editor::get_display_links()
panels_renderer_editor::command_update_display_links in plugins/display_renderers/panels_renderer_editor.class.php
Create a command to update the links on a display after a change was made.

File

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

Class

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

Code

function get_display_links() {
  $links = array();
  if (user_access('administer panels display styles')) {
    $style_links = $this
      ->get_style_links('display');
    $links[] = array(
      'title' => '<span class="dropdown-header">' . t('Style') . '</span>' . theme_links(array(
        'links' => $style_links,
        'attributes' => array(),
        'heading' => array(),
      )),
      'html' => TRUE,
      'attributes' => array(
        'class' => array(
          'panels-sub-menu',
        ),
      ),
    );
  }
  if (user_access('use panels caching features')) {
    $links[] = array(
      'title' => '<hr />',
      'html' => TRUE,
    );
    $method = isset($this->display->cache['method']) ? $this->display->cache['method'] : 0;
    $info = panels_get_cache($method);
    $cache_method = isset($info['title']) ? $info['title'] : t('No caching');
    $cache_links[] = array(
      'title' => $cache_method,
      'attributes' => array(
        'class' => array(
          'panels-text',
        ),
      ),
    );
    $cache_links[] = array(
      'title' => t('Change'),
      'href' => $this
        ->get_url('cache-method', 'display'),
      'attributes' => array(
        'class' => array(
          'ctools-use-modal',
        ),
      ),
    );
    if (panels_plugin_get_function('cache', $info, 'settings form')) {
      $cache_links[] = array(
        'title' => t('Settings'),
        'href' => $this
          ->get_url('cache-settings', 'display'),
        'attributes' => array(
          'class' => array(
            'ctools-use-modal',
          ),
        ),
      );
    }
    $links[] = array(
      'title' => '<span class="dropdown-header">' . t('Caching') . '</span>' . theme_links(array(
        'links' => $cache_links,
        'attributes' => array(),
        'heading' => array(),
      )),
      'html' => TRUE,
      'attributes' => array(
        'class' => array(
          'panels-sub-menu',
        ),
      ),
    );
  }
  return theme('ctools_dropdown', array(
    'title' => t('Display settings'),
    'links' => $links,
    'class' => 'panels-display-links',
  ));
}