You are here

function taxonomy_image_blocks_form_alter in Taxonomy Image 5

Same name and namespace in other branches
  1. 6 contributed/taxonomy_image_blocks/taxonomy_image_blocks.module \taxonomy_image_blocks_form_alter()

Implementation of hook_form_alter(). This modifies the title field for the "node images" block.

File

contributed/taxonomy_image_blocks/taxonomy_image_blocks.module, line 163
Add a block to show the images attached to the terms of a node.

Code

function taxonomy_image_blocks_form_alter($form_id, &$form) {
  if ($form_id == 'block_admin_configure') {
    if ($form['module']['#value'] == 'taxonomy_image' && $form['delta']['#value'] == 0) {
      $form['block_settings']['title']['#description'] = t('Use <em>&lt;none&gt;</em> to display no title.
        You may use the following placeholders for a dynamic title:
        <em>@title</em> (node title),
        <em>!nid</em> (node id),
        <em>!vid</em> (node version id),
        <em>!type</em> (node type)');
      if (empty($form['block_settings']['title']['#default_value'])) {
        $form['block_settings']['title']['#default_value'] = variable_get('taxonomy_image_block_title', 'Term Images for "@title"');
      }
    }
  }
}