You are here

function cumulus_configure_form in Cumulus 7

Implements hook_block_configure().

1 call to cumulus_configure_form()
_cumulus_block_configure in ./cumulus.admin.inc
Implements hook_block_configure().

File

./cumulus.admin.inc, line 181

Code

function cumulus_configure_form($form, &$form_state) {
  $config = array();

  // Get the config from the form state.
  if (!empty($form_state['values'])) {
    $config = $form_state['values'];
  }

  // Merge in the default configuration.
  $config += cumulus_get_config();
  $form['info'] = array(
    '#type' => 'textfield',
    '#title' => t('Block description'),
    '#default_value' => $config['info'],
    '#maxlength' => 64,
    '#description' => t('A brief description of your block. Used on the <a href="@overview">Blocks administration page</a>.', array(
      '@overview' => url('admin/structure/block'),
    )),
    '#required' => TRUE,
    '#weight' => -19,
  );
  $form['vid'] = array(
    '#type' => 'textfield',
    '#title' => t('Vocabulary IDs to be included'),
    '#default_value' => $config['vid'],
    '#maxlength' => 10,
    '#description' => t('The IDs of the vocabularies that will be displayed. Separate the IDs by commas only (eg: 1, 3, 4)'),
  );
  $form['tagadelic_step'] = array(
    '#type' => 'textfield',
    '#title' => t('Tag size interval'),
    '#default_value' => $config['tagadelic_step'],
    '#maxlength' => 2,
    '#description' => t('The number of tag sizes you want to use.'),
  );
  $form['tagadelic_limit'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of tags to display'),
    '#default_value' => $config['tagadelic_limit'],
    '#maxlength' => 2,
    '#description' => t('The maximum number of tags that will be displayed.'),
  );
  $form['flash_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width of cumulus'),
    '#default_value' => $config['flash_width'],
    '#maxlength' => 3,
    '#description' => t('The width of the cumulus in pixels.'),
  );
  $form['flash_height'] = array(
    '#type' => 'textfield',
    '#title' => t('Height of cumulus'),
    '#default_value' => $config['flash_height'],
    '#maxlength' => 3,
    '#description' => t('The height of the cumulus in pixels.'),
  );
  $form['flash_background'] = array(
    '#type' => 'textfield',
    '#title' => t('Background color of cumulus'),
    '#default_value' => $config['flash_background'],
    '#maxlength' => 6,
    '#description' => t('The hex color value for the background of the cumulus. E.g. ffffff. If "Background transparency" is enabled, this option will have no effect.'),
  );
  $form['flash_transparency'] = array(
    '#type' => 'select',
    '#title' => t('Background transparency'),
    '#default_value' => $config['flash_transparency'],
    '#options' => array(
      'false' => t('no'),
      'true' => t('yes'),
    ),
    '#description' => t('Enabling background transparency might cause issues with some (mostly older) browsers.<br />Under Linux, transparency doesn\'t work at all due to a known limitation in the current Flash player.'),
  );
  $form['flash_color'] = array(
    '#type' => 'textfield',
    '#title' => t('Font color of cumulus'),
    '#default_value' => $config['flash_color'],
    '#maxlength' => 6,
    '#description' => t('The hex color value you would like to use for the tags. E.g. 000000.'),
  );
  $form['flash_color2'] = array(
    '#type' => 'textfield',
    '#title' => t('Second font color of cumulus'),
    '#default_value' => $config['flash_color2'],
    '#maxlength' => 6,
    '#description' => t('Second tag color. If supplied, tags will get a color from a gradient between both colors based on their popularity.'),
  );
  $form['flash_hicolor'] = array(
    '#type' => 'textfield',
    '#title' => t('Highlight color of cumulus'),
    '#default_value' => $config['flash_hicolor'],
    '#maxlength' => 6,
    '#description' => t('The hex color value you would like to use for the tag mouseover/hover color'),
  );
  $form['flash_speed'] = array(
    '#type' => 'textfield',
    '#title' => t('Rotation speed'),
    '#default_value' => $config['flash_speed'],
    '#maxlength' => 3,
    '#description' => t('Set the speed of the cumulus. Options between 25 and 500 work best.'),
  );
  $form['flash_distribute'] = array(
    '#type' => 'select',
    '#title' => t('Distribute tags evenly on cumulus'),
    '#default_value' => $config['flash_distribute'],
    '#options' => array(
      'false' => t('no'),
      'true' => t('yes'),
    ),
    '#description' => t('When enabled, the movie will attempt to distribute the tags evenly over the surface of the cumulus.'),
  );
  $form['flash_font_size'] = array(
    '#type' => 'textfield',
    '#title' => t('Font size'),
    '#default_value' => $config['flash_font_size'],
    '#maxlength' => 2,
    '#description' => t('Set the font size of the tag with the lowest tag-size in pixels (level 1).'),
  );
  $form['flash_font_size_interval'] = array(
    '#type' => 'textfield',
    '#title' => t('Font size interval'),
    '#default_value' => $config['flash_font_size_interval'],
    '#maxlength' => 1,
    '#description' => t('Set the font size interval used for the different tag-sizes (level 2 and higher).'),
  );
  return $form;
}