You are here

function dynamic_background_css_behaviour_form in Dynamic Background 7

Same name and namespace in other branches
  1. 6 dynamic_background.module \dynamic_background_css_behaviour_form()

Builds the CSS behaviour part of the form, this should be used by every sub-module. The parameter is the variable name in which the css behaviour is stored.

Parameters

string $form_key:

Return value

array $form

7 calls to dynamic_background_css_behaviour_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 338
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_css_behaviour_form($form_key) {
  $form = array();

  // Add CSS behaviour options
  $default = variable_get($form_key, array());
  $form[$form_key] = array(
    '#type' => 'fieldset',
    '#title' => t('CSS behaviour'),
    '#collapsed' => FALSE,
    '#collapsible' => TRUE,
    '#tree' => TRUE,
  );
  $form[$form_key]['selector'] = array(
    '#type' => 'textfield',
    '#title' => t('CSS selector'),
    '#description' => t('The CSS selector string to target with the background image e.g. body #container.'),
    '#required' => TRUE,
    '#default_value' => isset($default['selector']) ? $default['selector'] : '',
  );
  $form[$form_key]['css'] = array(
    '#type' => 'textarea',
    '#title' => t('CSS'),
    '#description' => t('The CSS to insert with the background image e.g background-size: cover;.'),
    '#default_value' => isset($default['css']) ? $default['css'] : '',
  );
  return $form;
}