You are here

function hosting_update_6010 in Hosting 7.4

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

Implements hook_update_N().

Add url aliases for the context names that are registered.

File

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

Code

function hosting_update_6010() {

  // We include the file instead of enabling the module,
  // because we do not want the overhead of having all the
  // path UI stuff on nodes.
  require_once "./modules/path/path.module";
  $ret = array();
  $result = db_query("SELECT nid, name FROM {hosting_context}");
  while ($obj = db_fetch_object($result)) {
    path_set_alias("node/{$obj->nid}", "hosting/c/{$obj->name}");
  }
  return $ret;
}