function panelizer_default_context_form in Panelizer 6
Same name and namespace in other branches
- 7.3 includes/common.inc \panelizer_default_context_form()
- 7 includes/common.inc \panelizer_default_context_form()
- 7.2 includes/common.inc \panelizer_default_context_form()
Form to edit contexts that go with a panelizer panel.
2 string references to 'panelizer_default_context_form'
- panelizer_default_context_page in includes/
admin.inc - Page to configure what content is available for a given node type.
- panelizer_edit_node_context_page in includes/
node.inc - Page to edit basic settings on a panelized node.
File
- includes/
common.inc, line 100 - Contains common forms and routines that different object types use.
Code
function panelizer_default_context_form(&$form_state) {
$form = array();
ctools_include('context-admin');
ctools_context_admin_includes();
$panelizer =& $form_state['panelizer'];
$panelizer->base_contexts = panelizer_get_base_context($form_state['panelizer id']);
if (!empty($panelizer->cached)) {
$form['markup'] = array(
'#prefix' => '<div class="messages warning">',
'#value' => t('This form contains unsaved changes that will not be stored until the Save button is clicked.'),
'#suffix' => '</div>',
);
}
$form['right'] = array(
'#prefix' => '<div class="clear-block"><div class="right-container">',
'#suffix' => '</div>',
);
$form['left'] = array(
'#prefix' => '<div class="left-container">',
'#suffix' => '</div></div>',
);
$module = 'panelizer-' . $form_state['panelizer type'];
ctools_context_add_context_form($module, $form, $form_state, $form['right']['contexts_table'], $panelizer, $form_state['cache key']);
ctools_context_add_relationship_form($module, $form, $form_state, $form['right']['relationships_table'], $panelizer, $form_state['cache key']);
// Set an additional description if CCK and Token are enabled, to notify of unlisted keywords
if (module_exists('content') && module_exists('token')) {
$description = t('Note that CCK fields may be used as keywords using patterns like <em>%node:field_name-formatted</em>.');
}
elseif (!module_exists('token')) {
$description = t('More keywords will be available if you install the Token module, see http://drupal.org/project/token.');
}
else {
$description = '';
}
$form['left']['summary'] = array(
'#prefix' => '<div class="page-manager-contexts">',
'#suffix' => '</div>',
'#value' => theme('ctools_context_list', $panelizer, t('Summary of contexts'), $description),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#write' => TRUE,
);
$form['cancel'] = array(
'#type' => 'submit',
'#value' => t('Cancel'),
);
return $form;
}