You are here

function follow_block_configure in Follow 7.2

Same name and namespace in other branches
  1. 5 follow.module \follow_block_configure()
  2. 6 follow.module \follow_block_configure()
  3. 7 follow.module \follow_block_configure()

Implements hook_block_configure().

File

./follow.module, line 203

Code

function follow_block_configure($delta = '') {
  switch ($delta) {
    case 'site':
      $form['follow_title'] = array(
        '#type' => 'radios',
        '#title' => t('Default block title'),
        '#default_value' => variable_get('follow_site_block_title', FOLLOW_NAME),
        '#options' => array(
          FOLLOW_NAME => t('Follow @name on', array(
            '@name' => variable_get('site_name', 'Drupal'),
          )),
          FOLLOW_ME => t('Follow me on'),
          FOLLOW_US => t('Follow us on'),
        ),
      );
      $form['follow_user'] = array(
        '#type' => 'checkbox',
        '#title' => t('User pages'),
        '#description' => t('Should this block display on user profile pages?'),
        '#default_value' => variable_get('follow_site_block_user', TRUE),
      );
      break;
    case 'user':
      $form['follow_title'] = array(
        '#type' => 'radios',
        '#title' => t('Default block title'),
        '#default_value' => variable_get('follow_user_block_title', FOLLOW_NAME),
        '#options' => array(
          FOLLOW_NAME => t('Follow [username] on'),
          FOLLOW_ME => t('Follow me on'),
        ),
      );
      break;
  }

  // Allow changing which icon style to use on the global service links.
  $form['follow_alignment'] = array(
    '#type' => 'select',
    '#title' => t('Alignment'),
    '#options' => array(
      'vertical' => t('Vertical'),
      'horizontal' => t('Horizontal'),
    ),
    '#description' => t('Whether the icons are to appear horizontally beside each other, or one after another in a list.'),
    '#default_value' => variable_get("follow_{$delta}_alignment", 'vertical'),
  );

  // Allow hiding of the text.
  $form['follow_hide_text'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide Text'),
    '#description' => t('Would you like to hide the text next to the icons?'),
    '#default_value' => variable_get("follow_{$delta}_hide_text", FALSE),
  );

  // Allow changing which icon style to use on the global service links.
  $form['follow_icon_style'] = array(
    '#type' => 'select',
    '#title' => t('Icon Style'),
    '#options' => follow_icon_style_options(),
    '#description' => t('How the Follow icons should appear.'),
    '#default_value' => variable_get("follow_{$delta}_icon_style", 'small'),
  );
  return $form;
}