You are here

function headerimage_settings_form in Header image 7

Same name and namespace in other branches
  1. 5 headerimage.module \headerimage_settings_form()
  2. 6 headerimage.admin.inc \headerimage_settings_form()

Header Image settings form

1 string reference to 'headerimage_settings_form'
headerimage_menu in ./headerimage.module
Implementation of hook_menu()

File

./headerimage.admin.inc, line 78
headerimage.admin.inc

Code

function headerimage_settings_form() {
  $form = array();
  $nodetype = array();
  $nodes = node_type_get_types();
  foreach ($nodes as $node) {
    $nodetype[$node->type] = check_plain($node->name);
  }
  $form['headerimage_node_type'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Content type'),
    '#description' => t('The Content type(s) that can be used with Header Image module.'),
    '#default_value' => variable_get('headerimage_node_type', array()),
    '#options' => $nodetype,
    '#multiple' => true,
    '#required' => true,
  );
  $form['headerimage_condition_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Condition types'),
    '#description' => t('Types of conditions by which nodes can be selected to be displayed.'),
    '#default_value' => variable_get('headerimage_condition_types', array(
      'nid',
    )),
    '#options' => headerimage_get_condition_types(),
    '#required' => true,
  );
  $form['headerimage_teaser'] = array(
    '#type' => 'checkbox',
    '#title' => t('Teaser'),
    '#description' => t('Display the Header Image node as teaser or full node.'),
    '#default_value' => variable_get('headerimage_teaser', true),
  );
  if (module_exists('ds')) {
    $form['headerimage_module_ds'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use Display Suite module'),
      '#description' => t('Display the Header Image with Display Suite settings'),
      '#default_value' => variable_get('headerimage_module_ds', true),
    );
  }
  if (module_exists('locale')) {
    $form['headerimage_language_support'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show only nodes in current language'),
      '#description' => t('Display only header images in the current language.'),
      '#default_value' => variable_get('headerimage_language_support', FALSE),
    );
    $form['headerimage_language_support_neutral'] = array(
      '#type' => 'checkbox',
      '#title' => t('Respect language neutral'),
      '#description' => t('Display only header images in the current language and respect language neutral. Both checkboxes need to be active to support this.'),
      '#default_value' => variable_get('headerimage_language_support_neutral', FALSE),
    );
  }
  return system_settings_form($form);
}