You are here

function theme_rate_ui_layout in Rate 7.2

Theme function for rate ui layout.

1 theme call to theme_rate_ui_layout()
rate_ui_widget_form_step_layout in ui/rate_ui.form.inc
Generate form fields for the sixth step in the rate widget form.

File

ui/rate_ui.module, line 165
Main module file for the Rate UI module.

Code

function theme_rate_ui_layout($element) {
  $header = array(
    t('Element'),
    t('Mode'),
    t('Prefix HTML'),
    t('Suffix HTML'),
    t('Weight'),
  );
  $rows = array();
  foreach ($element['element'] as $type => $item) {
    if ($type[0] == '#') {
      continue;
    }
    $item["element_{$type}_prefix"]['#title'] = '';
    $item["element_{$type}_suffix"]['#title'] = '';
    $item["element_{$type}_weight"]['#title'] = '';
    $item["element_{$type}_weight"]['#attributes']['class'] = array(
      'rate-layout-order-weight',
    );
    $rows[] = array(
      'data' => array(
        drupal_render($item["element_{$type}"]),
        array(
          'class' => 'rate-elements-inline',
          'data' => drupal_render($item['mode']),
        ),
        drupal_render($item["element_{$type}_prefix"]),
        drupal_render($item["element_{$type}_suffix"]),
        drupal_render($item["element_{$type}_weight"]),
      ),
      'class' => array(
        'draggable',
      ),
    );
  }
  drupal_add_tabledrag('rate-layout', 'order', 'sibling', 'rate-layout-order-weight');
  $table_variables = array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'rate-layout',
    ),
  );
  return theme('table', $table_variables);
}