function views_foundation_plugin_style_clearing::options_form in Views Foundation 7
Same name and namespace in other branches
- 7.4 view/views_foundation_plugin_style_clearing.inc \views_foundation_plugin_style_clearing::options_form()
Provide a form for setting options.
Overrides views_plugin_style::options_form
File
- view/
views_foundation_plugin_style_clearing.inc, line 35 - Views Foundation Clearing plugin.
Class
- views_foundation_plugin_style_clearing
- Style plugin to render rows in a Foundation Clearing plugin.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
// Pre-build all of our option lists for the dials and switches that follow.
$fields = array(
'' => t('- None -'),
);
foreach ($this->display->handler
->get_handlers('field') as $field => $handler) {
if ($label = $handler
->label()) {
$fields[$field] = $handler
->label() . ': ' . $handler->options['settings']['image_style'];
}
else {
$fields[$field] = $handler
->ui_name();
}
}
$form['image'] = array(
'#type' => 'select',
'#title' => t('Image'),
'#required' => TRUE,
'#options' => $fields,
'#default_value' => $this->options['image'],
'#description' => t('Select the field that will be used as the image.'),
);
$form['thumbnail'] = array(
'#type' => 'select',
'#title' => t('Thumbnail'),
'#options' => $fields,
'#default_value' => $this->options['thumbnail'],
'#description' => t('Select the field that will be used as the thumbnail.(optional)'),
);
$form['caption'] = array(
'#type' => 'select',
'#title' => t('Caption'),
'#options' => $fields,
'#default_value' => $this->options['caption'],
'#description' => t('Select the field that will be used as the image caption.(optional)'),
);
$form['thumb_border'] = array(
'#type' => 'checkbox',
'#title' => t('Thumbnail border'),
'#description' => t('Select this checkbox if you want thumbnails border'),
'#default_value' => $this->options['thumb_border'],
);
$form['thumb_columns'] = array(
'#type' => 'select',
'#title' => t('Grid size'),
'#description' => t('Specify the size of grid with thumbnails'),
'#required' => TRUE,
'#options' => views_foundation_columns(),
'#default_value' => $this->options['thumb_columns'],
);
$form['thumb_columns_mobile'] = array(
'#type' => 'select',
'#title' => t('Mobile grid size'),
'#description' => t('Specify the size of mobile grid with thumbnails'),
'#required' => TRUE,
'#options' => views_foundation_columns(4),
'#default_value' => $this->options['thumb_columns_mobile'],
);
}