daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 14th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. /**
  4.  * @file
  5.  * This file contains a script to build an initial menu for use with the Quickbar module.
  6.  *
  7.  * This can be easily executed using the drush scr command.
  8.  */
  9.  
  10.   $menu = array(
  11.     'menu_name' => 'menu-quickbar',
  12.     'title' => 'Quickbar',
  13.     'description' => 'Contains items displayed on Quick Bar menu.'
  14.   );
  15.   drupal_write_record('menu_custom', $menu);
  16.  
  17.   // Top-level menu.
  18.  
  19.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/content', 'link_title' => 'Content', 'weight' => -50);
  20.   $mlid_content = menu_link_save($link);
  21.  
  22.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/build', 'link_title' => 'Structure', 'weight' => -49);
  23.   $mlid_build = menu_link_save($link);
  24.  
  25.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/settings', 'link_title' => 'Configuration', 'weight' => -48);
  26.   $mlid_settings = menu_link_save($link);
  27.  
  28.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/build/themes', 'link_title' => 'Appearance', 'plid' => 0, 'weight' => -47);
  29.   menu_link_save($link);
  30.  
  31.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/build/modules', 'link_title' => 'Modules', 'plid' => 0, 'weight' => -46);
  32.   menu_link_save($link);
  33.  
  34.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/user', 'link_title' => 'People', 'weight' => -45);
  35.   $mlid_user = menu_link_save($link);
  36.  
  37.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/reports', 'link_title' => 'Reports', 'weight' => -44);
  38.   $mlid_reports = menu_link_save($link);
  39.  
  40.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'user', 'link_title' => 'My account', 'weight' => -43);
  41.   menu_link_save($link);
  42.  
  43.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'logout', 'link_title' => 'Logout', 'weight' => 0);
  44.   menu_link_save($link);
  45.  
  46.   // Content sub-menu.
  47.  
  48.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'node/add', 'link_title' => 'Add', 'plid' => $mlid_content, 'weight' => -50);
  49.   menu_link_save($link);
  50.  
  51.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/content/node', 'link_title' => 'Edit', 'plid' => $mlid_content, 'weight' => -49);
  52.   menu_link_save($link);
  53.  
  54.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/content/backup_migrate', 'link_title' => 'Backup and migrate', 'plid' => $mlid_content, 'weight' => -48);
  55.   menu_link_save($link);
  56.  
  57.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/content/types', 'link_title' => 'Content types', 'plid' => $mlid_content, 'weight' => 0);
  58.   menu_link_save($link);
  59.  
  60.   // Structure sub-menu.
  61.  
  62.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/build/block', 'link_title' => 'Blocks', 'plid' => $mlid_build, 'weight' => 0);
  63.   menu_link_save($link);
  64.  
  65.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/build/menu', 'link_title' => 'Menus', 'plid' => $mlid_build, 'weight' => 0);
  66.   menu_link_save($link);
  67.  
  68.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/build/path', 'link_title' => 'URL aliases', 'plid' => $mlid_build, 'weight' => 0);
  69.   menu_link_save($link);
  70.  
  71.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/build/views', 'link_title' => 'Views', 'plid' => $mlid_build, 'weight' => 0);
  72.   menu_link_save($link);
  73.  
  74.   // Configuration sub-menu.
  75.  
  76.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/settings/filters', 'link_title' => 'Input formats', 'plid' => $mlid_settings, 'weight' => 0);
  77.   menu_link_save($link);
  78.  
  79.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/settings/performance', 'link_title' => 'Performance', 'plid' => $mlid_settings, 'weight' => 0);
  80.   menu_link_save($link);
  81.  
  82.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/settings/site-information', 'link_title' => 'Site information', 'plid' => $mlid_settings, 'weight' => 0);
  83.   menu_link_save($link);
  84.  
  85.   // People sub-menu.
  86.  
  87.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/user/permissions', 'link_title' => 'Permissions', 'plid' => $mlid_user, 'weight' => 0);
  88.   menu_link_save($link);
  89.  
  90.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/user/user', 'link_title' => 'Users', 'plid' => $mlid_user, 'weight' => 0);
  91.   menu_link_save($link);
  92.  
  93.   // Reports sub-menu.
  94.  
  95.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/reports/dblog', 'link_title' => 'Recent log entries', 'plid' => $mlid_reports, 'weight' => 0);
  96.   menu_link_save($link);
  97.  
  98.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/reports/status', 'link_title' => 'Status report', 'plid' => $mlid_reports, 'weight' => 0);
  99.   menu_link_save($link);
  100.  
  101.   $link = array('menu_name' => 'menu-quickbar', 'link_path' => 'admin/reports/updates', 'link_title' => 'Available updates', 'plid' => $mlid_reports, 'weight' => 0);
  102.   menu_link_save($link);
  103.  
  104.   menu_rebuild();
RAW Paste Data
Top