You are here

function panels_renderer_editor::ajax_access_settings 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::ajax_access_settings()

AJAX entry point to configure access settings for a pane.

Parameters

$pid: The pane id to edit.

File

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

Class

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

Code

function ajax_access_settings($pid = NULL) {
  if (empty($this->display->content[$pid])) {
    ctools_modal_render(t('Error'), t('Invalid pane id.'));
  }
  $pane =& $this->display->content[$pid];
  $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
  $form_state = array(
    'display' => &$this->display,
    'pane' => &$pane,
    'ajax' => TRUE,
    'title' => t('Access settings on !subtype_title', array(
      '!subtype_title' => $subtype['title'],
    )),
  );
  $output = ctools_modal_form_wrapper('panels_edit_configure_access_settings_form', $form_state);
  if (empty($form_state['executed'])) {
    $this->commands = $output;
    return;
  }
  panels_edit_cache_set($this->cache);
  $this
    ->command_update_pane($pid);
  $this->commands[] = ctools_modal_command_dismiss();
}