You are here

function hosting_update_6005 in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 hosting.install \hosting_update_6005()
  2. 7.3 hosting.install \hosting_update_6005()

Implements hook_update_N().

Move some menu items to the primary links menu.

File

./hosting.install, line 176
Define database schemas and update functions for the hosting module.

Code

function hosting_update_6005() {
  drupal_install_modules(array(
    'hosting_server',
  ));
  menu_rebuild();
  install_include(array(
    'menu',
  ));
  $menu_name = variable_get('menu_primary_links_source', 'primary-links');
  $items = install_menu_get_items('hosting/servers');
  $item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $items[0]['mlid']));
  $item['menu_name'] = $menu_name;
  $item['customized'] = 1;
  $item['options'] = unserialize($item['options']);
  install_menu_update_menu_item($item);
  $items = install_menu_get_items('hosting/sites');
  $item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $items[0]['mlid']));
  $item['menu_name'] = $menu_name;
  $item['customized'] = 1;
  $item['options'] = unserialize($item['options']);
  install_menu_update_menu_item($item);
  menu_rebuild();
  return array();
}