function dynamic_background_image_style_form in Dynamic Background 7
Same name and namespace in other branches
- 7.2 dynamic_background.module \dynamic_background_image_style_form()
Build the image style selection form, which can be used in sub-modules to add support for image manipulation.
Parameters
type $form_key:
Return value
type
7 calls to dynamic_background_image_style_form()
- dynamic_background_admin_settings in includes/
settings.admin.inc - The dynamic background administration settings form.
- dynamic_background_blog_admin_form in modules/
dynamic_background_blog/ dynamic_background_blog.module - Build the administration interface for dynamic background nodes and enables administrators to select which content types have enable background selection.
- dynamic_background_context_admin_form in modules/
dynamic_background_context/ dynamic_background_context.module - Build the administration interface for dynamic background context and enables administrators to set image style and css targets.
- dynamic_background_node_admin_form in modules/
dynamic_background_node/ dynamic_background_node.module - Build the administration interface for dynamic background nodes and enables administrators to select which content types have enable background selection.
- dynamic_background_panels_admin_form in modules/
dynamic_background_panels/ dynamic_background_panels.module - Build the administration interface for dynamic background panels and enables administrators enter css to used for insertion of backgrounds.
File
- ./
dynamic_background.module, line 376 - This module enables administrators to upload images used as background on the site. The selected background image link is exposed as either $background in the page.tpl file or as /background.css.
Code
function dynamic_background_image_style_form($form_key) {
$form = array();
$form[$form_key] = array(
'#type' => 'fieldset',
'#title' => t('Image style'),
'#description' => 'You can apply differect effects to your background image using image styles. If you don\'t want to add effects to the selected background image, just select "No style".',
'#collapsed' => FALSE,
'#collapsible' => TRUE,
'#tree' => TRUE,
);
// Get image style information.
$options = array(
0 => t('No style'),
);
$styles = image_styles();
foreach ($styles as $stylename => $settings) {
$options[$stylename] = $stylename;
}
// Load default form values (current selected image style)
$default = variable_get($form_key, array());
$form[$form_key]['style'] = array(
'#type' => 'select',
'#title' => t('Choose a style to apply to background images.'),
'#description' => t('To create an image style, go to <a href="@url">image style configuration</a>.', array(
'@url' => '/admin/config/media/image-styles',
)),
'#options' => $options,
'#default_value' => isset($default['style']) ? $default['style'] : 0,
);
return $form;
}