function panels_panel_context_edit_content in Panels 6.3
Same name and namespace in other branches
- 7.3 plugins/task_handlers/panel_context.inc \panels_panel_context_edit_content()
Present the panels drag & drop editor to edit the display attached to the task handler.
1 string reference to 'panels_panel_context_edit_content'
- panel_context.inc in plugins/
task_handlers/ panel_context.inc - This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.
File
- plugins/
task_handlers/ panel_context.inc, line 657 - This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.
Code
function panels_panel_context_edit_content(&$form, &$form_state) {
ctools_include('ajax');
ctools_include('plugins', 'panels');
ctools_include('common', 'panels');
ctools_include('context');
ctools_include('context-task-handler');
$cache = panels_edit_cache_get('panel_context:' . $form_state['task_name'] . ':' . $form_state['handler_id']);
$form_state['renderer'] = panels_get_renderer_handler('editor', $cache->display);
$form_state['renderer']->cache =& $cache;
$form_state['display'] =& $cache->display;
$form_state['content_types'] = $cache->content_types;
// Tell the Panels form not to display buttons.
$form_state['no buttons'] = TRUE;
$form_state['display_title'] = !empty($cache->display_title);
$form_state['no preview'] = TRUE;
$form_state['page']->display_cache[$form_state['handler_id']] = $cache;
$form = array_merge($form, panels_edit_display_form($form_state));
// Make sure the theme will work since our form id is different.
$form['#theme'] = 'panels_edit_display_form';
if (!isset($form_state['type']) || $form_state['type'] != 'add' && !empty($form_state['handler_id']) && !empty($form['buttons'])) {
$form['buttons']['preview'] = $form['buttons']['return'];
$form['buttons']['preview']['#value'] = t('Update and preview');
}
}