| @@ 6238-6246 (lines=9) @@ | ||
| 6235 | public static function purgeDocument($id, $courseInfo, $sessionId = 0) |
|
| 6236 | { |
|
| 6237 | $document = self::getDeletedDocument($id, $courseInfo, $sessionId); |
|
| 6238 | if (!empty($document)) { |
|
| 6239 | $path = $document['path']; |
|
| 6240 | $coursePath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document/'; |
|
| 6241 | my_delete($coursePath.$path); |
|
| 6242 | // Hard delete. |
|
| 6243 | self::deleteDocumentFromDb($id, $courseInfo, $sessionId, true); |
|
| 6244 | ||
| 6245 | return true; |
|
| 6246 | } |
|
| 6247 | return false; |
|
| 6248 | } |
|
| 6249 | ||
| @@ 4610-4625 (lines=16) @@ | ||
| 4607 | $documentData['comment'] |
|
| 4608 | ); |
|
| 4609 | ||
| 4610 | if (!empty($documentId)) { |
|
| 4611 | ||
| 4612 | if ($deleteWavFile) { |
|
| 4613 | $coursePath = $courseInfo['directory'].'/document'; |
|
| 4614 | $documentPath = api_get_path(SYS_COURSE_PATH).$coursePath; |
|
| 4615 | self::delete_document( |
|
| 4616 | $courseInfo, |
|
| 4617 | null, |
|
| 4618 | $documentPath, |
|
| 4619 | $sessionId, |
|
| 4620 | $documentData['id'] |
|
| 4621 | ); |
|
| 4622 | } |
|
| 4623 | ||
| 4624 | return $documentId; |
|
| 4625 | } |
|
| 4626 | } |
|
| 4627 | } |
|
| 4628 | ||