You are here

function simplified_menu_admin_preprocess_table in Simplified Menu Administration 7

Implements MODULE_preprocess_HOOK().

File

./simplified_menu_admin.module, line 50
Simplifies the Menu and Shortcut modules by merging "List links" and "Edit menu" into a single administration page.

Code

function simplified_menu_admin_preprocess_table(&$variables) {
  $item = menu_get_item();

  // Modify the table shown on the menu overview page to get rid of the "list
  // links" operation.
  if ($item['page_callback'] == 'menu_overview_page') {
    foreach ($variables['rows'] as $index => &$row) {
      unset($row[1]);
    }
    $variables['header'][1]['colspan']--;
  }
  elseif ($item['page_callback'] == 'shortcut_set_admin') {
    $shortcut_set_names = array_keys(shortcut_sets());
    foreach ($variables['rows'] as $index => &$row) {
      unset($row[1]);
      $set_name = $shortcut_set_names[$index];
      $row[2] = l(t('edit set'), "admin/config/user-interface/shortcut/{$set_name}/edit");
    }
    $variables['header'][1]['colspan']--;
  }
}