]> git.mjollnir.org Git - moodle.git/commitdiff
Deletes the embeded media when deleting the assessment dimension
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 17:49:53 +0000 (17:49 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 17:49:53 +0000 (17:49 +0000)
mod/workshop/grading/accumulative/strategy.php

index c23eac13da06d37d69a724ed00e9e6a7e544b47a..25130b8b9d8ac0481fb08f051b8944a6e01bfca3 100644 (file)
@@ -196,7 +196,11 @@ class workshop_accumulative_strategy extends workshop_base_strategy implements w
                 $PAGE->context, 'workshop_dimension_description', $local->id);
             $DB->update_record('workshop_forms_accumulative', $local);
         }
-        // todo unlink embedded files
+        // unlink embedded files and delete emptied dimensions
+        $fs = get_file_storage();
+        foreach ($todeletelocal as $itemid) {
+            $fs->delete_area_files($PAGE->context->id, 'workshop_dimension_description', $itemid);
+        }
         $DB->delete_records_list('workshop_forms_accumulative', 'id', $todeletelocal);
         $DB->delete_records_list('workshop_forms', 'id', $todeletemaster);
     }