You are here

function hosting_client_set_title in Hosting 5

2 calls to hosting_client_set_title()
hosting_client_insert in client/hosting_client.module
Implementation of hook_insert().
hosting_client_update in client/hosting_client.module
Implementation of hook_update().

File

client/hosting_client.module, line 202

Code

function hosting_client_set_title(&$node) {
  if ($node->organization && $node->name) {
    $node->title = $node->client_name . ' (' . $node->organization . ')';
  }
  elseif ($node->name) {
    $node->title = $node->client_name . ' (' . $node->email . ')';
  }
  elseif ($node->organization) {
    $node->title = $node->organization . ' (' . $node->email . ')';
  }
  else {
    $node->title = $node->email;
  }
  $node->title = filter_xss($node->title);
  db_query("UPDATE {node} SET title='%s' WHERE nid=%d", $node->title, $node->nid);
  db_query("UPDATE {node_revisions} SET title='%s' WHERE vid=%d", $node->title, $node->vid);
}