You are here

function votingapi_generate_votes_form in Voting API 5

Same name and namespace in other branches
  1. 6.2 votingapi.admin.inc \votingapi_generate_votes_form()
  2. 7.3 votingapi.admin.inc \votingapi_generate_votes_form()
  3. 7.2 votingapi.admin.inc \votingapi_generate_votes_form()
1 string reference to 'votingapi_generate_votes_form'
votingapi_generate_menu in ./votingapi_generate.module

File

./votingapi_generate.module, line 75

Code

function votingapi_generate_votes_form() {
  $form['node_coverage'] = array(
    '#type' => 'textfield',
    '#title' => t('Node coverage'),
    '#description' => t('The chance that a given node will be voted on. To ensure that some nodes will always be left unvoted, set this lower than 100.'),
    '#default_value' => 100,
    '#size' => 10,
  );
  $form['user_chance'] = array(
    '#type' => 'textfield',
    '#title' => t('Per-user vote chance'),
    '#description' => t('The chance that a specific user will vote on a node. To force every user to vote on every node, set this to 100.'),
    '#default_value' => 50,
    '#size' => 10,
  );

  // Force this to percentage voting for now.
  $form['vote_type'] = array(
    '#type' => 'hidden',
    '#value' => 'percent',
    '#title' => t('Vote type'),
    '#options' => array(
      'percent' => t('Percentage scale'),
      'points' => t('Digg-style points'),
    ),
    '#default_value' => 'percent',
  );
  $form['vote_tags'] = array(
    '#type' => 'textfield',
    '#title' => t('Criteria'),
    '#description' => t('An optional comma-delimited array of multiple vote criteria.'),
  );
  $form['vote_clear'] = array(
    '#type' => 'checkbox',
    '#title' => t('Delete existing votes'),
    '#return_value' => 1,
    '#default_value' => 1,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Do it!'),
  );
  return $form;
}