You are here

function theme_menu_badges_tabs_admin_form in Menu Badges 7

Form theming for tab admin form.

Parameters

$variables:

File

./menu_badges.admin.inc, line 128
Menu Badges admin forms.

Code

function theme_menu_badges_tabs_admin_form($variables) {
  $form =& $variables['form'];
  $output = '';
  $output .= drupal_render($form['search']);
  $rows = array();
  $types = array(
    MENU_DEFAULT_LOCAL_TASK => t('Tab (MENU_DEFAULT_LOCAL_TASK)'),
    MENU_LOCAL_TASK => t('Tab (MENU_LOCAL_TASK)'),
    MENU_LOCAL_ACTION => t('Action Link (MENU_LOCAL_ACTION)'),
  );
  foreach ($form['results'] as $path => $path_info) {
    if (is_array($path_info) && !empty($path_info['path']['#value'])) {
      $row = array();
      $row[] = $path_info['title']['#value'];
      $row[] = $path_info['path']['#value'];
      $row[] = $types[$path_info['type']['#value']];
      $row[] = drupal_render($form['results'][$path]['menu_badges_callback']);
      $rows[] = $row;
    }
  }
  $output .= theme('table', array(
    'header' => array(
      t('Title'),
      t('Menu Path'),
      t('Menu Type'),
      t('Menu Badge'),
    ),
    'rows' => $rows,
  ));
  $output .= theme('pager');
  $output .= drupal_render_children($form);
  return $output;
}