You are here

function panels_renderer_ipe::add_meta in Panels 6.3

Same name and namespace in other branches
  1. 7.3 panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php \panels_renderer_ipe::add_meta()

Attach out-of-band page metadata (e.g., CSS and JS).

This must be done before render, because panels-within-panels must have their CSS added in the right order: inner content before outer content.

Overrides panels_renderer_editor::add_meta

File

panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php, line 15

Class

panels_renderer_ipe
Renderer class for all In-Place Editor (IPE) behavior.

Code

function add_meta() {
  ctools_include('display-edit', 'panels');
  ctools_include('content');
  if (empty($this->display->cache_key)) {
    $this->cache = panels_edit_cache_get_default($this->display);
  }

  // @todo we may need an else to load the cache, but I am not sure we
  // actually need to load it if we already have our cache key, and doing
  // so is a waste of resources.
  ctools_include('cleanstring');
  $this->clean_key = ctools_cleanstring($this->display->cache_key);
  panels_ipe_get_cache_key($this->clean_key);
  ctools_include('ajax');
  ctools_include('modal');
  ctools_modal_add_js();
  ctools_add_css('panels_dnd', 'panels');
  ctools_add_css('panels_admin', 'panels');
  ctools_add_js('panels_ipe', 'panels_ipe');
  ctools_add_css('panels_ipe', 'panels_ipe');
  $settings = array(
    'formPath' => url($this
      ->get_url('save-form')),
  );
  drupal_add_js(array(
    'PanelsIPECacheKeys' => array(
      $this->clean_key,
    ),
  ), 'setting');
  drupal_add_js(array(
    'PanelsIPESettings' => array(
      $this->clean_key => $settings,
    ),
  ), 'setting');
  jquery_ui_add(array(
    'ui.draggable',
    'ui.droppable',
    'ui.sortable',
  ));
  parent::add_meta();
}