foreach ($this->course->resources as $type => $resources)
@ -60,8 +61,16 @@ class CourseRecycler
{
$sql = "DELETE FROM ".$table_linked_resources." WHERE (source_type = '".$type."' AND source_id = '".$id."') OR (resource_type = '".$type."' AND resource_id = '".$id."') ";
api_sql_query($sql,__FILE__,__LINE__);
if(is_numeric($id))
{
$sql = "DELETE FROM ".$table_item_properties." WHERE tool ='".$resource->get_tool()."' AND ref=".$id;
api_sql_query($sql);
api_sql_query($sql, __FILE__, __LINE__);
}
elseif ($type == RESOURCE_TOOL_INTRO)
{
$sql = "DELETE FROM $table_tool_intro WHERE id='$id'";