function panels_renderer_editor::ajax_style_settings in Panels 6.3
Same name and namespace in other branches
- 7.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_renderer_editor::ajax_style_settings()
AJAX entry point to configure the style for a display, region or pane.
Parameters
string $type: Either display, region or pane
$pid: The pane id, if a pane. The region id, if a region.
1 call to panels_renderer_editor::ajax_style_settings()
- panels_renderer_editor::ajax_style_type in plugins/
display_renderers/ panels_renderer_editor.class.php - AJAX entry point to select the style for a display, region or pane.
File
- plugins/
display_renderers/ panels_renderer_editor.class.php, line 1155 - Class file to control the main Panels editor.
Class
- panels_renderer_editor
- @file Class file to control the main Panels editor.
Code
function ajax_style_settings($type, $pid = '') {
$info = $this
->get_style($type, $pid);
$style = $info[0];
$conf =& $info[1];
switch ($type) {
case 'display':
$title = t('Style settings for @style (display)', array(
'@style' => $style['title'],
));
break;
case 'region':
$title = t('Style settings for style @style (Region "!region")', array(
'@style' => $style['title'],
'!region' => $this->plugins['layout']['panels'][$pid],
));
break;
case 'pane':
ctools_include('content');
$pane =& $this->display->content[$pid];
$subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
$title = t('Style settings for style @style (Pane "!pane")', array(
'@style' => $style['title'],
'!pane' => $subtype['title'],
));
break;
}
$form_state = array(
'display' => &$this->display,
'type' => $type,
'pid' => $pid,
'conf' => &$conf,
'style' => $style,
'ajax' => TRUE,
'title' => $title,
'url' => url($this
->get_url('style-settings', $type, $pid), array(
'absolute' => TRUE,
)),
'renderer' => &$this,
);
$output = ctools_modal_form_wrapper('panels_edit_style_settings_form', $form_state);
if (!empty($output)) {
$this->commands = $output;
return;
}
if (isset($this->cache->style)) {
unset($this->cache->style);
}
// $conf was a reference so it should just modify.
panels_edit_cache_set($this->cache);
$this->commands[] = ctools_modal_command_dismiss();
if ($type == 'pane') {
$this
->command_update_pane($pane);
}
else {
if ($type == 'region') {
$this
->command_update_region_links($pid);
}
else {
$this
->command_update_display_links();
}
}
}