You are here

function vud_comment_admin_settings in Vote Up/Down 7

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

Menu callback for administration settings.

1 string reference to 'vud_comment_admin_settings'
vud_comment_menu in vud_comment/vud_comment.module
Implementation of hook_menu().

File

vud_comment/vud_comment.module, line 47
Adds a voting widget to comments.

Code

function vud_comment_admin_settings() {
  $form['vud_comment_node_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Node types'),
    '#description' => t('Select the node types for which voting on comments will be activated.'),
    '#default_value' => variable_get('vud_comment_node_types', array()),
    '#options' => node_type_get_names(),
  );
  $form['vud_comment_widget'] = array(
    '#type' => 'radios',
    '#title' => t('Widget selection'),
    '#description' => t('Select the voting widget theme that will be displayed.'),
    '#default_value' => variable_get('vud_comment_widget', 'plain'),
    '#options' => vud_widget_get_names(),
  );
  $form['vud_comment_widget_display'] = array(
    '#type' => 'radios',
    '#title' => t('Widget display'),
    '#description' => t('Select how the voting widget will be displayed.'),
    '#default_value' => variable_get('vud_comment_widget_display', VUD_COMMENT_DISPLAY_NORMAL),
    '#options' => array(
      VUD_COMMENT_DISPLAY_NORMAL => t('Append to the comment content.'),
      VUD_COMMENT_DISPLAY_HIDDEN => t('Do not append. I will manually insert <code>$comment->vud_comment_widget</code> variable on my theme.'),
    ),
  );
  $form['vud_comment_votes'] = array(
    '#type' => 'radios',
    '#title' => t('Votes display'),
    '#description' => t('Choose if the total number of votes will be displayed in the links part.'),
    '#default_value' => variable_get('vud_comment_votes', 1),
    '#options' => array(
      0 => 'No',
      1 => 'Yes',
    ),
  );
  $form['vud_comment_reset'] = array(
    '#type' => 'radios',
    '#title' => t('Votes reset'),
    '#description' => t('Choose if users are allowed to reset their vote on a comment.'),
    '#default_value' => variable_get('vud_comment_reset', 0),
    '#options' => array(
      0 => 'No',
      1 => 'Yes',
    ),
  );
  ctools_include('dependent');
  $form['vud_comment_dim_active'] = array(
    '#type' => 'radios',
    '#title' => t('Dim comments'),
    '#description' => t('Choose if comments should be dimmed.'),
    '#default_value' => variable_get('vud_comment_dim_active', 0),
    '#options' => array(
      0 => 'No',
      1 => 'Yes',
    ),
  );
  $form['vud_comment_dim_threshold'] = array(
    '#type' => 'textfield',
    '#title' => t('Dim threshold'),
    '#default_value' => variable_get('vud_comment_dim_threshold', 0),
    '#description' => t('Comments with total votes less or equal to this values will be dimmed.'),
    '#process' => array(
      'ctools_dependent_process',
    ),
    '#dependency' => array(
      'radio:vud_comment_dim_active' => array(
        1,
      ),
    ),
  );
  return system_settings_form($form);
}