You are here

function rate_ui_sprite_classes_table in Rate 7.2

Generate formfields to inform about classes for sprite generators.

Parameters

int $start First button number:

int $end Last button number:

1 call to rate_ui_sprite_classes_table()
rate_ui_widget_form_step_images in ui/rate_ui.form.inc
Generate form fields for the fifth step in the rate widget form.

File

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

Code

function rate_ui_sprite_classes_table($start, $end) {
  $form = array();
  $form['buttons'] = array(
    '#type' => 'fieldset',
    '#title' => t('Button classes'),
    '#collapsible' => TRUE,
    '#description' => t('Theming can be separated per button. The list below outlines the button classes and possible combinations with or without highlighted classes.'),
  );
  $items = array();
  for ($i = $start; $i <= $end; ++$i) {
    $item = array(
      'data' => ".button{$i}",
    );
    if ($i > 0) {
      $item['children'] = array(
        '(default)',
        '.highlighted',
      );
    }
    $items[] = $item;
  }
  $form['buttons']['list'] = array(
    '#theme' => 'item_list',
    '#items' => $items,
  );
  $form['widget'] = array(
    '#type' => 'fieldset',
    '#title' => t('Widget classes'),
    '#collapsible' => TRUE,
    '#description' => t('The list below outlines all possible combinations of widget classes (i.e. ".voted.user-rating.enabled").'),
  );
  $items = array(
    array(
      'data' => '.voted',
      'children' => array(
        array(
          'data' => '.average-rating',
          'children' => array(
            '.enabled',
            '.disabled',
          ),
        ),
        array(
          'data' => '.user-rating',
          'children' => array(
            '.enabled',
            '.disabled',
          ),
        ),
      ),
    ),
    array(
      'data' => '.not-voted',
      'children' => array(
        array(
          'data' => '.average-rating',
          'children' => array(
            '.enabled',
            '.disabled',
          ),
        ),
        array(
          'data' => '.user-rating',
          'children' => array(
            '.enabled',
            '.disabled',
          ),
        ),
      ),
    ),
  );
  $form['widget']['list'] = array(
    '#theme' => 'item_list',
    '#items' => $items,
  );
  return $form;
}