function hosting_task_set_title in Hosting 6.2
Same name and namespace in other branches
- 5 task/hosting_task.module \hosting_task_set_title()
- 7.4 task/hosting_task.module \hosting_task_set_title()
- 7.3 task/hosting_task.module \hosting_task_set_title()
Set the title of tasks automatically and in a consistent way
Tasks should always be named 'task_type node_title'.
2 calls to hosting_task_set_title()
- hosting_task_insert in task/
hosting_task.module - Implementation of hook_insert().
- hosting_task_update in task/
hosting_task.module - Implementation of hook_update().
File
- task/
hosting_task.module, line 501 - Web server node type is defined here.
Code
function hosting_task_set_title(&$node) {
$ref = db_fetch_object(db_query("SELECT vid, nid, title, type FROM {node} WHERE nid=%d", $node->rid));
$tasks = hosting_available_tasks($ref->type);
$node->title = drupal_ucfirst($tasks[$node->task_type]['title']) . ': ' . $ref->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);
}