function activity_delete in Activity 6
Same name and namespace in other branches
- 5.4 activity.module \activity_delete()
- 6.2 activity.module \activity_delete()
- 7 activity.module \activity_delete()
Function to allow a single activity record to be deleted.
Parameters
$aid: Activity id.
1 string reference to 'activity_delete'
- activity_menu in ./
activity.module - Implementation of hook_menu().
File
- ./
activity.module, line 527 - activity.module
Code
function activity_delete($aid = NULL) {
if ($aid && is_numeric($aid)) {
if (module_exists('activityhistory')) {
db_query('DELETE FROM {activity_history} WHERE aid = %d', $aid);
}
db_query('DELETE FROM {activity_targets} WHERE aid = %d', $aid);
db_query('DELETE FROM {activity} WHERE aid = %d', $aid);
db_query('DELETE FROM {activity_comments} WHERE aid = %d', $aid);
}
drupal_goto(drupal_get_destination());
}