You are here

function dynamic_background_image_presents_form in Dynamic Background 6

Build the imagecahce present 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_presents_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.

... See full list

File

./dynamic_background.module, line 228
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_presents_form($form_key) {
  $form = array();
  $form[$form_key] = array(
    '#type' => 'fieldset',
    '#title' => t('Imagecache preset'),
    '#description' => 'You can apply differect effects to your background image using imagecahce presets. If you don\'t want to add effects to the selected background image, just select "No preset".',
    '#collapsed' => FALSE,
    '#collapsible' => TRUE,
    '#tree' => TRUE,
  );

  // Get imagechache presets information, there will a least be one as this
  // module have implemented on for background image thumbnails.
  $options = array(
    0 => t('No preset'),
  );
  $presets = imagecache_presets(TRUE);
  foreach ($presets as $id => $preset) {
    $options[$preset['presetname']] = $preset['presetname'];
  }

  // Load default form values (current selected image present)
  $default = variable_get($form_key, array());
  $form[$form_key]['present'] = array(
    '#type' => 'select',
    '#title' => t('Choose a preset to apply to background images.'),
    '#description' => t('To create am imagecache preset, go to <a href="@url">image cache settings</a>.', array(
      '@url' => '/admin/build/imagecache/list',
    )),
    '#options' => $options,
    '#default_value' => isset($default['present']) ? $default['present'] : 0,
  );
  return $form;
}