You are here

function theme_menu_block_menu_order in Menu Block 7.3

Same name and namespace in other branches
  1. 6.2 menu_block.admin.inc \theme_menu_block_menu_order()
  2. 7.2 menu_block.admin.inc \theme_menu_block_menu_order()

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

1 theme call to theme_menu_block_menu_order()
menu_block_admin_settings_form in ./menu_block.admin.inc
Menu callback: admin settings form.

File

./menu_block.admin.inc, line 558
Provides infrequently used functions and hooks for menu_block.

Code

function theme_menu_block_menu_order($variables) {
  $element = $variables['element'];
  drupal_add_tabledrag('menu-block-menus', 'order', 'sibling', 'menu-weight');
  $variables = array(
    'header' => array(
      t('Menu'),
      t('Available'),
      t('Weight'),
    ),
    'rows' => array(),
    'attributes' => array(
      'id' => 'menu-block-menus',
    ),
  );

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