You are here

function glossary_block_configure in Glossary 7

Implements hook_block_configure().

File

./glossary.module, line 1378
Glossary terms will be automatically marked with links to their descriptions.

Code

function glossary_block_configure($delta) {

  // TODO Rename block deltas (e.g. glossary-search) to readable strings.
  $form = array();
  switch ($delta) {
    case 'glossary-random':
      $vids = array();
      $vid_list = _glossary_get_filter_vids();
      foreach ($vid_list as $vid) {
        $voc = taxonomy_vocabulary_load($vid);
        $vids[$vid] = check_plain($voc->name);
      }
      $form['vids'] = array(
        '#type' => 'checkboxes',
        '#title' => t('Choose from'),
        '#description' => t('Select the vocabularies from which to choose a term.'),
        '#options' => $vids,
        '#default_value' => variable_get("glossary_block_{$delta}_vids", array()),
        '#prefix' => '<div class="glossary_checkboxes">',
        '#suffix' => '</div>',
      );
      $form['interval'] = array(
        '#type' => 'textfield',
        '#size' => 4,
        '#maxlength' => 3,
        '#default_value' => variable_get("glossary_block_{$delta}_interval", 0),
        '#field_prefix' => '<strong>' . t('Update every') . '</strong>&nbsp;',
        '#prefix' => '<div class="container-inline glossary-interval">',
      );
      $form['step'] = array(
        '#type' => 'select',
        '#default_value' => variable_get("glossary_block_{$delta}_step", 0),
        '#options' => array(
          1 => t('seconds'),
          60 => t('minutes'),
          3600 => t('hours'),
          86400 => t('days'),
        ),
        '#suffix' => '</div>',
        '#description' => t('How often do you want a new term? Leaving this blank or zero means every time.'),
      );
      $form['link'] = array(
        '#type' => 'checkbox',
        '#title' => t('Show term as link'),
        '#default_value' => variable_get("glossary_block_{$delta}_link", TRUE),
        '#description' => t('If selected, this option causes the term name to be made a link to the glossary entry.'),
      );
      return $form;
  }
  return $form;
}