You are here

function vote_up_down_admin_settings in Vote Up/Down 6

Same name and namespace in other branches
  1. 5 vote_up_down.module \vote_up_down_admin_settings()

Implementation of hook_settings().

1 string reference to 'vote_up_down_admin_settings'
vote_up_down_menu in ./vote_up_down.module
Implementation of hook_menu().

File

./vote_up_down.module, line 44

Code

function vote_up_down_admin_settings() {
  $form['vote_node_types'] = array(
    '#type' => 'fieldset',
    '#title' => t('Node types'),
    '#description' => t('Select the node types you want to activate voting on.'),
  );
  $form['vote_node_types']['vote_up_down_node_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Types'),
    '#default_value' => variable_get('vote_up_down_node_types', array()),
    '#options' => node_get_types('names'),
  );
  $form['vote_widget_settings_node'] = array(
    '#type' => 'fieldset',
    '#title' => t('Vote widget settings for nodes'),
    '#description' => t('For more control over the voting widget placement, it can be inserted directly in the theme. See the included template.php and node-storylink.tpl.php for an example. When this method is used, turn off the widget display here.'),
  );
  $form['vote_widget_settings_node']['vote_up_down_widget_style_node'] = array(
    '#type' => 'radios',
    '#title' => t('Vote widget style'),
    '#default_value' => variable_get('vote_up_down_widget_style_node', 0),
    '#options' => array(
      0 => t('Default +1/-1 vote style'),
      1 => t('Alternative +1 vote style'),
    ),
    '#description' => t('If set to alternative style, it\'s recomended to turn off the link display of vote points.'),
  );
  $form['vote_widget_settings_node']['vote_up_down_widget_node'] = array(
    '#type' => 'select',
    '#title' => t('Vote widget display'),
    '#default_value' => variable_get('vote_up_down_widget_node', 3),
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Teaser view'),
      2 => t('Full-page view'),
      3 => t('Teasers and full-page view'),
    ),
    '#description' => t('When to display the vote widget for nodes?'),
  );
  $form['vote_widget_settings_node']['vote_up_down_link_node'] = array(
    '#type' => 'select',
    '#title' => t('Link display of vote points'),
    '#default_value' => variable_get('vote_up_down_link_node', 3),
    '#options' => array(
      0 => t('Disabled'),
      1 => t('Teaser view'),
      2 => t('Full-page view'),
      3 => t('Teasers and full-page view'),
    ),
    '#description' => t('When to display vote points for nodes?'),
  );
  $form['vote_widget_settings_comment'] = array(
    '#type' => 'fieldset',
    '#title' => t('Vote widget settings for comments'),
    '#description' => t('For more control over the voting widget placement, it can be inserted directly in the theme. See the included node-storylink.tpl.php for an example. When this method is used, turn off the widget display here.'),
  );
  $form['vote_widget_settings_comment']['vote_up_down_widget_style_comment'] = array(
    '#type' => 'radios',
    '#title' => t('Vote widget style'),
    '#default_value' => variable_get('vote_up_down_widget_style_comment', 0),
    '#options' => array(
      0 => t('Default +1/-1 vote style'),
      1 => t('Alternative +1 vote style'),
    ),
    '#description' => t('If set to alternative style, it\'s recomended to turn off the link display of vote points.'),
  );
  $form['vote_widget_settings_comment']['vote_up_down_widget_comment'] = array(
    '#type' => 'radios',
    '#title' => t('Vote widget display'),
    '#default_value' => variable_get('vote_up_down_widget_comment', 1),
    '#options' => array(
      0 => t('Do not display widget'),
      1 => t('Display widget'),
    ),
  );
  $form['vote_widget_settings_comment']['vote_up_down_link_comment'] = array(
    '#type' => 'radios',
    '#title' => t('Link display of vote points'),
    '#default_value' => variable_get('vote_up_down_link_comment', 1),
    '#options' => array(
      0 => t('Do not display link'),
      1 => t('Display link'),
    ),
  );
  return system_settings_form($form);
}