You are here

function rate_ui_widget_form_step_theming in Rate 7.2

Generate form fields for the fourth step in the rate widget form.

1 call to rate_ui_widget_form_step_theming()
rate_ui_widget_form in ui/rate_ui.form.inc
Implements hook_form().

File

ui/rate_ui.form.inc, line 287
This file contains the differtent Rate UI forms.

Code

function rate_ui_widget_form_step_theming($form, &$form_state, $widget_type = NULL) {
  $options = array(
    FALSE => t('Text'),
    TRUE => t('Images'),
  );
  $form['images'] = array(
    '#type' => 'radios',
    '#title' => t('Display type of options'),
    '#default_value' => isset($form_state['storage']['images']) ? $form_state['storage']['images'] : TRUE,
    '#options' => $options,
  );
  $options = array(
    TRUE => t('Use sprites'),
    FALSE => t('Use image tags'),
  );
  $form['sprites'] = array(
    '#type' => 'radios',
    '#title' => t('Sprites'),
    '#default_value' => isset($form_state['storage']['sprites']) ? $form_state['storage']['sprites'] : TRUE,
    '#options' => $options,
  );
  $options = array(
    TRUE => t('Different for each button'),
    FALSE => t('Same for all buttons'),
  );
  if (empty($form_state['storage']['button0_label'])) {
    $description = '';
  }
  else {
    $description = 'Does not include the revoke button.';
  }
  $form['separate_images'] = array(
    '#type' => 'radios',
    '#title' => t('Separate images?'),
    '#default_value' => isset($form_state['storage']['separate_images']) ? $form_state['storage']['separate_images'] : TRUE,
    '#options' => $options,
    '#description' => t($description),
  );
  $options = array(
    'upload' => t('Upload images'),
    'filepath' => t('Provide filepath'),
    'spritegenerator' => t('Use CSS from sprite generator'),
  );
  $form['imagesource'] = array(
    '#type' => 'radios',
    '#title' => t('Image source'),
    '#default_value' => isset($form_state['storage']['imagesource']) ? $form_state['storage']['imagesource'] : 'upload',
    '#options' => $options,
  );
  $options = array(
    0 => t('Don\'t highlight button'),
    1 => t('Highlight button'),
    1 + 2 => t('Highlight button and buttons before'),
    1 + 4 => t('Highlight button and buttons after'),
    1 + 2 + 4 => t('Highlight all buttons'),
  );
  $form['highlight_voted'] = array(
    '#type' => 'radios',
    '#title' => t('Highlight voted button?'),
    '#default_value' => isset($form_state['storage']['highlight_voted']) ? $form_state['storage']['highlight_voted'] : 1,
    '#options' => $options,
  );
  $options = array(
    0 => t('Don\'t highlight button'),
    1 => t('Highlight button'),
    1 + 2 => t('Highlight button and buttons before'),
    1 + 4 => t('Highlight button and buttons after'),
    1 + 2 + 4 => t('Highlight all buttons'),
  );
  $form['highlight_mouseover'] = array(
    '#type' => 'radios',
    '#title' => t('Highlight on mouseover?'),
    '#default_value' => isset($form_state['storage']['highlight_mouseover']) ? $form_state['storage']['highlight_mouseover'] : 0,
    '#options' => $options,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['previous'] = array(
    '#type' => 'submit',
    '#value' => t('Previous'),
  );
  $form['actions']['next'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
  );
  return $form;
}