You are here

function cck_blocks_block_configure in CCK Blocks 7

Implements hook_block_configure().

@todo test and implement user tokens (see http://drupal.org/node/1067708 for why they are left out)

File

./cck_blocks.module, line 67

Code

function cck_blocks_block_configure() {
  $form = array();

  // Provide information about available tokens, if the token ui module is installed.
  if (module_exists('token')) {
    $token_tree = array(
      '#theme' => 'token_tree',
      '#token_types' => array(
        'node',
        'taxonomy',
      ),
      // Specific token types to include.
      '#global_types' => TRUE,
      // Whether or not to include global token types like current-user, date, etc.
      '#click_insert' => TRUE,
      // Make tokens clickable & insert into last focused textfield
      '#recursion_limit' => 2,
    );
    $form['view']['token_help'] = array(
      '#type' => 'fieldset',
      '#title' => t('Replacement patterns'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => t('You may use the following replacement patterns in the block title. Note that node tokens will only work for fields attached to nodes, and taxonomy tokens for fields attached to terms.') . theme('token_tree', $token_tree),
    );
  }
  return $form;
}