You are here

function theme_mostpopular_config_intervals_form in Drupal Most Popular 6

1 theme call to theme_mostpopular_config_intervals_form()
mostpopular_intervals_form in ./mostpopular.admin.inc

File

./mostpopular.admin.inc, line 322
Defines all the administration forms for the Most Popular module.

Code

function theme_mostpopular_config_intervals_form($form) {
  drupal_add_tabledrag('mostpopular-intervals', 'order', 'sibling', 'sort');
  $header = array(
    '',
    array(
      'data' => t('Title'),
      'colspan' => 2,
    ),
    t('Interval'),
    'Sort',
  );
  $rows = array();
  $output = '';
  foreach (element_children($form) as $key) {

    // Add class to group weight fields for drag and drop
    $form[$key]['weight']['#attributes']['class'] = 'sort';
    $row = array(
      '',
    );
    $row[] = array(
      'data' => 'Past',
      'width' => '10',
    );
    $row[] = drupal_render($form[$key]['title']);
    $row[] = drupal_render($form[$key]['string']);
    $row[] = drupal_render($form[$key]['weight']);
    $rows[] = array(
      'data' => $row,
      'class' => 'draggable',
    );
  }
  $output .= theme('table', $header, $rows, array(
    'id' => 'mostpopular-intervals',
  ));
  $output .= drupal_render($form);
  return $output;
}