function context_layouts_reaction_block::options_form in Context 6.3
Same name and namespace in other branches
- 6 context_layouts/plugins/context_layouts_reaction_block.inc \context_layouts_reaction_block::options_form()
- 7.3 context_layouts/plugins/context_layouts_reaction_block.inc \context_layouts_reaction_block::options_form()
Override of options form.
Overrides context_reaction_block::options_form
File
- context_layouts/
plugins/ context_layouts_reaction_block.inc, line 115
Class
Code
function options_form($context) {
$form = parent::options_form($context);
$options = $this
->fetch_from_context($context);
// Only alter the options form if the theme provides layouts.
$theme_key = variable_get('theme_default', 'garland');
$layouts = $this
->get_layout_options();
if (!empty($layouts)) {
$form['layout'] = array(
'#title' => t('Layout'),
'#description' => t('Choose one of the layouts provided by the default theme.'),
'#options' => $layouts,
'#type' => 'select',
'#weight' => -100,
'#default_value' => $options['layout'] ? $options['layout'] : NULL,
'#attributes' => array(
'class' => 'context-blockform-layout',
),
);
// Add js.
// @TODO: Move this to a theme function or somewhere that will get called even
// if the form is using a cached version of itself (e.g. when validate fails).
drupal_add_js(drupal_get_path('module', 'context_layouts') . '/plugins/context_layouts_reaction_block.js');
drupal_add_js(array(
'contextLayouts' => array(
'layouts' => $this
->get_layout_regions(),
),
), 'setting');
}
return $form;
}