function course_token_values in Course 6
Implements hook_token_values().
File
- ./
course.module, line 1805 - course.module Core functionality for Courses.
Code
function course_token_values($type, $object = NULL, $options = array()) {
$values = array();
if ($type == 'node') {
$sql = 'SELECT * FROM {course_node} WHERE nid = %d';
if ($course = db_fetch_object(db_query($sql, $object->nid))) {
foreach ($course as $key => $value) {
$values["course-{$key}"] = $value;
}
}
}
return $values;
}