You are here

function copyright_block_block_configure in Copyright Block module 7

Same name and namespace in other branches
  1. 7.2 copyright_block.module \copyright_block_block_configure()

Implements hook_block_configure().

Creates the form data to set the copyright holder and the inception year.

File

./copyright_block.module, line 88
Module file for "Copyright block".

Code

function copyright_block_block_configure($delta = '') {
  $form = array();
  if ($delta == 'copyright') {
    $form['copyright_block'] = array(
      '#type' => 'fieldset',
      '#title' => t('Copyright settings'),
    );

    // Plain text field for the name of the copyright holder.
    $form['copyright_block']['copyright_block_copyrightholder'] = array(
      '#type' => 'textfield',
      '#title' => t('Copyright holder'),
      '#size' => 64,
      '#description' => t('Name of the copyright holder. Leave empty to use the site name.'),
      '#default_value' => variable_get('copyright_block_copyrightholder'),
    );

    // Plain text field for the year the copyright starts.
    $inceptionyear = variable_get('copyright_block_inceptionyear');
    $form['copyright_block']['copyright_block_inceptionyear'] = array(
      '#type' => 'textfield',
      '#title' => t('Copyright starting year'),
      '#size' => 8,
      '#description' => t('Year the copyright starts. Leave empty to only show current year.'),
      '#default_value' => $inceptionyear ? $inceptionyear : '',
    );
    $form['copyright_block_display'] = array(
      '#type' => 'fieldset',
      '#title' => t('Copyright display settings'),
    );

    // Template to use to display the copyright
    $template = variable_get('copyright_block_template');
    $form['copyright_block_display']['copyright_block_template'] = array(
      '#type' => 'textfield',
      '#title' => t('Display template'),
      '#size' => 64,
      '#description' => t('Template to be used to display the copyright. [year] will be replaced by the date range, [holder] will be replaced by the copyright holder.'),
      '#default_value' => $template ? $template : '[holder] [year]',
    );

    // Template to use to display the copyright
    $template = variable_get('copyright_block_spacertemplate');
    $form['copyright_block_display']['copyright_block_spacertemplate'] = array(
      '#type' => 'textfield',
      '#title' => t('Spacer template'),
      '#size' => 64,
      '#description' => t('Template that will be used to separate the year values (only used if the inception year is in the past).'),
      '#default_value' => $template ? $template : ' - ',
    );
  }
  return $form;
}