You are here

function vud_node_admin_settings in Vote Up/Down 7

Same name and namespace in other branches
  1. 6.3 vud_node/vud_node.module \vud_node_admin_settings()
  2. 6.2 vud_node/vud_node.module \vud_node_admin_settings()

Advanced menu settings callback.

1 string reference to 'vud_node_admin_settings'
vud_node_menu in vud_node/vud_node.module
Implementation of hook_menu().

File

vud_node/vud_node.module, line 89
Adds a voting widget to nodes.

Code

function vud_node_admin_settings() {
  $form['vud_node_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Node types'),
    '#description' => t('Select the node types for which you want to activate voting.'),
    '#default_value' => variable_get('vud_node_types', array()),
    '#options' => node_type_get_names(),
  );
  $form['vud_node_widget'] = array(
    '#title' => t('Widget selection'),
    '#description' => t('Select the voting widget theme that will be displayed.'),
    '#type' => 'radios',
    '#default_value' => variable_get('vud_node_widget', 'updown'),
    '#options' => vud_widget_get_names(),
  );
  $form['vud_node_widget_show'] = array(
    '#type' => 'select',
    '#title' => t('Widget and votes display'),
    '#description' => t('When will the vote widget be displayed?'),
    '#default_value' => variable_get('vud_node_widget_show', VUD_NODE_DISPLAY_BOTH),
    '#options' => array(
      VUD_NODE_DISPLAY_TEASER_ONLY => 'Teaser only',
      VUD_NODE_DISPLAY_FULL_ONLY => 'Full display only',
      VUD_NODE_DISPLAY_BOTH => 'Both teaser and full',
    ),
  );
  $form['vud_node_widget_vote_on_teaser'] = array(
    '#type' => 'checkbox',
    '#title' => t('Voting on teasers'),
    '#description' => t('Do you want to allow voting on teasers?'),
    '#default_value' => variable_get('vud_node_widget_vote_on_teaser', TRUE),
  );
  $form['vud_node_votes'] = array(
    '#type' => 'select',
    '#description' => t('When will the total vote count be displayed?'),
    '#default_value' => variable_get('vud_node_votes', VUD_NODE_DISPLAY_BOTH),
    '#options' => array(
      VUD_NODE_DISPLAY_NO => 'Don\'t display',
      VUD_NODE_DISPLAY_TEASER_ONLY => 'Teaser only',
      VUD_NODE_DISPLAY_FULL_ONLY => 'Full display only',
      VUD_NODE_DISPLAY_BOTH => 'Both teaser and full',
    ),
  );
  $form['vud_node_reset'] = array(
    '#type' => 'radios',
    '#title' => t('Votes reset'),
    '#description' => t('Choose if users are allowed to reset their votes on a node.'),
    '#default_value' => variable_get('vud_node_reset', 0),
    '#options' => array(
      0 => 'No',
      1 => 'Yes',
    ),
  );
  return system_settings_form($form);
}