You are here

function theme_menu_breadcrumb_menus_table in Menu Breadcrumb 6

Same name and namespace in other branches
  1. 7 menu_breadcrumb.module \theme_menu_breadcrumb_menus_table()

Theme a drag-to-reorder table of menu selection checkboxes.

1 theme call to theme_menu_breadcrumb_menus_table()
menu_breadcrumb_admin_settings_form in ./menu_breadcrumb.module
Menu breadcrumb admin settings form.

File

./menu_breadcrumb.module, line 561
The main file for the menu_breadcrumb module.

Code

function theme_menu_breadcrumb_menus_table($element) {
  drupal_add_tabledrag('menu-breadcrumb-menus', 'order', 'sibling', 'menu-weight');
  $header = array(
    t('Menu'),
    t('Enabled'),
    t('Weight'),
  );

  // Generate table of draggable menu names.
  $rows = array();
  foreach (element_children($element) as $menu_name) {
    $element[$menu_name]['weight']['#attributes']['class'] = 'menu-weight';
    $rows[] = array(
      'data' => array(
        drupal_render($element[$menu_name]['title_display']),
        drupal_render($element[$menu_name]['enabled']),
        drupal_render($element[$menu_name]['weight']),
      ),
      'class' => 'draggable',
    );
  }
  return theme('table', $header, $rows, array(
    'id' => 'menu-breadcrumb-menus',
  ));
}