You are here

function panels_ajax_style_settings in Panels 6.2

AJAX incoming to deal with the style settings modal

Related topics

1 string reference to 'panels_ajax_style_settings'
panels_menu in ./panels.module
Implementation of hook_menu

File

includes/display-layout-settings.inc, line 299
Form and ajax handling for edit layout settings

Code

function panels_ajax_style_settings($did = NULL, $panel = NULL, $name = NULL) {
  panels_load_include('plugins');
  panels_load_include('ajax');
  if ($name == '0') {
    panels_ajax_render(t('There are no style settings to edit.'), t('Edit default style settings'));
  }
  $style = panels_get_style($name);
  $style_settings = panels_cache_get('style_settings', $did);
  if (!isset($style_settings)) {
    panels_ajax_render();
  }
  if (!isset($style_settings[$panel])) {
    $style_settings[$panel] = array();
  }
  $form_state = array(
    'did' => $did,
    'style' => $style,
    'style_settings' => &$style_settings[$panel],
    'ajax' => TRUE,
    'title' => t('Edit style settings for @style', array(
      '@style' => $style['title'],
    )),
  );
  $output = panels_ajax_form_wrapper('panels_style_settings_form', $form_state);
  if (!$output) {

    // no output means submit
    panels_cache_set('style_settings', $did, $style_settings);
    $output = 'dismiss';
  }
  panels_ajax_render($output);
}