You are here

function theme_mostpopular_config_services_form in Drupal Most Popular 6

1 theme call to theme_mostpopular_config_services_form()
mostpopular_services_form in ./mostpopular.admin.inc

File

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

Code

function theme_mostpopular_config_services_form($form) {
  drupal_add_tabledrag('mostpopular-services', 'order', 'sibling', 'sort');
  $header = array(
    '',
    t('Enabled'),
    t('Status'),
    t('Service Name'),
    t('Title'),
    t('Weight'),
    '',
  );
  $rows = array();
  $output = '';
  foreach (element_children($form['services']) as $key) {
    $item =& $form['services'][$key];

    // Add class to group weight fields for drag and drop
    $item['weight']['#attributes']['class'] = 'sort';
    $row = array(
      '',
    );
    $row[] = drupal_render($item['enabled']);
    $row[] = drupal_render($item['status']);
    $row[] = $item['name']['#markup'];
    $row[] = drupal_render($item['title']);
    $row[] = drupal_render($item['weight']);
    $row[] = $item['config']['#markup'];
    $rows[] = array(
      'data' => $row,
      'class' => 'draggable',
    );
  }
  $output .= theme('table', $header, $rows, array(
    'id' => 'mostpopular-services',
  ));
  $output .= drupal_render($form);
  return $output;
}