function template_preprocess_panopoly_magic_preview in Panopoly 7
Same name and namespace in other branches
- 8.2 modules/panopoly/panopoly_magic/panopoly_magic.module \template_preprocess_panopoly_magic_preview()
Prepares variables for theme_panopoly_magic_preview().
File
- modules/
panopoly/ panopoly_magic/ panopoly_magic.module, line 1808
Code
function template_preprocess_panopoly_magic_preview(&$vars) {
if (!empty($vars['single'])) {
// The id really should be 'panopoly-magic-preview' but don't want to
// break 3rd party themes or modules that depend on it.
$vars['attributes_array']['id'] = 'panopoly-form-widget-preview';
$vars['classes_array'][] = 'panopoly-magic-preview-single';
}
// For backcompat with themes that depend on the old class names.
$vars['classes_array'][] = 'widget-preview';
if (!empty($vars['single'])) {
$vars['classes_array'][] = 'widget-preview-single';
}
// A class identifying the widget.
if (isset($vars['preview_subtype_name'])) {
$vars['classes_array'][] = 'panopoly-magic-preview-' . str_replace(':', '-', $vars['preview_subtype_name']);
}
// For backcompat with themes that depend on the fieldset markup.
$vars['use_legacy_fieldset'] = variable_get('panopoly_magic_preview_use_legacy_fieldset', FALSE);
}