function panels_everywhere_variant_template in Panels Everywhere 6
Same name and namespace in other branches
- 7 panels_everywhere.module \panels_everywhere_variant_template()
Handle the form to add a template setting to any variant.
1 string reference to 'panels_everywhere_variant_template'
- panels_everywhere_page_manager_variant_operations_alter in ./
panels_everywhere.module - Alter the panel context settings form.
File
- ./
panels_everywhere.module, line 385 - panels_everywhere.module
Code
function panels_everywhere_variant_template(&$form, &$form_state) {
$handler = $form_state['handler'];
$templates = panels_everywhere_get_site_templates();
$defaults = array(
'' => t('- Let the system choose -'),
'-1' => t('- No template -'),
);
// We can use simple array addition because the default values are not valid
// so no worries about collisions.
$options = $defaults + $templates;
if (empty($handler->conf['panels_everywhere_site_template'])) {
$handler->conf['panels_everywhere_site_template'] = '';
}
$form['panels_everywhere_site_template'] = array(
'#type' => 'select',
'#title' => t('Site template'),
'#default_value' => $handler->conf['panels_everywhere_site_template'],
'#options' => $options,
);
}