Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Deep Learning/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,10 @@
++$count;
$sql[$count][0] = '0.3.00';
$sql[$count][1] = "
";

//v0.3.01
++$count;
$sql[$count][0] = '0.3.01';
$sql[$count][1] = "
";
4 changes: 4 additions & 0 deletions Deep Learning/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

v0.3.01
-------
Added file cleanup feature after a record is deleted

v0.3.00
-------
Added comprehensive file upload tracking system to monitor and manage all file uploads across the system
Expand Down
3 changes: 3 additions & 0 deletions Deep Learning/events_manage_deleteProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Contracts\Filesystem\FileHandler;
use Gibbon\Data\Validator;
use Gibbon\Module\DeepLearning\Domain\EventGateway;
use Gibbon\Module\DeepLearning\Domain\EventDateGateway;
Expand Down Expand Up @@ -53,6 +54,8 @@
exit;
}

$deletedFile = $container->get(FileHandler::class)->deleteFile('deepLearningEvent', $deepLearningEventID, 'backgroundImage');

$deleted = $eventGateway->delete($deepLearningEventID);

// Clean up any dates attached to this event
Expand Down
2 changes: 1 addition & 1 deletion Deep Learning/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = "view.php";
$type = "Additional";
$category = 'Learn';
$version = '0.3.00';
$version = '0.3.01';
$author = "Gibbon Foundation";
$url = "https://gibbonedu.org";

Expand Down
14 changes: 14 additions & 0 deletions Deep Learning/unit_manage_deleteProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Contracts\Filesystem\FileHandler;
use Gibbon\Data\Validator;
use Gibbon\Module\DeepLearning\Domain\UnitGateway;
use Gibbon\Module\DeepLearning\Domain\UnitPhotoGateway;

require_once '../../gibbon.php';

Expand Down Expand Up @@ -49,6 +51,18 @@
exit;
}

// Clean up photos and their file data
$unitPhotoGateway = $container->get(UnitPhotoGateway::class);
$photos = $unitPhotoGateway->selectBy(['deepLearningUnitID' => $deepLearningUnitID], ['deepLearningUnitPhotoID'])->fetchAll();

foreach ($photos as $photo) {
$photoDeleted = $container->get(FileHandler::class)->deleteFile('deepLearningUnitPhoto', $photo['deepLearningUnitPhotoID'], 'filePath');
}

$unitPhotoGateway->deleteWhere(['deepLearningUnitID' => $deepLearningUnitID]);

$fileDeleted = $container->get(FileHandler::class)->deleteFile('deepLearningUnit', $deepLearningUnitID, 'headerImage');

$deleted = $unitGateway->delete($deepLearningUnitID);

$URL .= !$deleted
Expand Down
2 changes: 1 addition & 1 deletion Deep Learning/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
/**
* Sets version information
*/
$moduleVersion = '0.3.00';
$moduleVersion = '0.3.01';
$coreVersion = '31.0.00';