| @@ 6153-6161 (lines=9) @@ | ||
| 6150 | public static function purgeDocument($id, $courseInfo, $sessionId = 0) |
|
| 6151 | { |
|
| 6152 | $document = self::getDeletedDocument($id, $courseInfo, $sessionId); |
|
| 6153 | if (!empty($document)) { |
|
| 6154 | $path = $document['path']; |
|
| 6155 | $coursePath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document/'; |
|
| 6156 | my_delete($coursePath.$path); |
|
| 6157 | // Hard delete. |
|
| 6158 | self::deleteDocumentFromDb($id, $courseInfo, $sessionId, true); |
|
| 6159 | ||
| 6160 | return true; |
|
| 6161 | } |
|
| 6162 | return false; |
|
| 6163 | } |
|
| 6164 | ||
| @@ 4543-4558 (lines=16) @@ | ||
| 4540 | $documentData['comment'] |
|
| 4541 | ); |
|
| 4542 | ||
| 4543 | if (!empty($documentId)) { |
|
| 4544 | ||
| 4545 | if ($deleteWavFile) { |
|
| 4546 | $coursePath = $courseInfo['directory'].'/document'; |
|
| 4547 | $documentPath = api_get_path(SYS_COURSE_PATH).$coursePath; |
|
| 4548 | self::delete_document( |
|
| 4549 | $courseInfo, |
|
| 4550 | null, |
|
| 4551 | $documentPath, |
|
| 4552 | $sessionId, |
|
| 4553 | $documentData['id'] |
|
| 4554 | ); |
|
| 4555 | } |
|
| 4556 | ||
| 4557 | return $documentId; |
|
| 4558 | } |
|
| 4559 | } |
|
| 4560 | } |
|
| 4561 | ||