diff --git a/index.php b/index.php index 63769d0..33412f7 100644 --- a/index.php +++ b/index.php @@ -36,6 +36,8 @@ 'delete' => '' ); +$description = ''; + // We could be a course or a category. switch ($context->contextlevel) { case \CONTEXT_COURSE: @@ -48,6 +50,7 @@ ); $recyclebin = new \local_recyclebin\course($context->instanceid); + $description = get_string('description_course', 'local_recyclebin'); break; case \CONTEXT_COURSECAT: @@ -61,10 +64,11 @@ ); $recyclebin = new \local_recyclebin\category($context->instanceid); + $description = get_string('description_coursecat', 'local_recyclebin'); break; default: - print_error("Invalid context supplied."); + print_error('invalidcontext', 'local_recyclebin'); break; } @@ -131,7 +135,6 @@ } // Start with a description. -$description = get_string('description', 'local_recyclebin'); $expiry = get_config('local_recyclebin', 'expiry'); if ($expiry > 0) { $description .= ' ' . get_string('descriptionexpiry', 'local_recyclebin', $expiry); diff --git a/lang/en/local_recyclebin.php b/lang/en/local_recyclebin.php index f4a2a2c..2f5f11c 100644 --- a/lang/en/local_recyclebin.php +++ b/lang/en/local_recyclebin.php @@ -28,7 +28,7 @@ $string['cleanrecyclebin'] = 'Clean recycle bin'; $string['expiry'] = 'Item lifetime'; -$string['expiry_desc'] = 'How long should a deleted activity remain in the recycle bin?'; +$string['expiry_desc'] = 'How long should a deleted item remain in the recycle bin?'; $string['autohide'] = 'Auto hide?'; $string['autohide_desc'] = 'Automatically hides the recycle bin link when the bin is empty.'; @@ -57,9 +57,12 @@ $string['event_restored_description'] = 'Item with ID {$a->objectid} restored.'; $string['event_purged_description'] = 'Item with ID {$a->objectid} purged.'; -$string['description'] = 'Items that have been deleted from a course can be restored and will appear at the bottom of the section from which they were deleted.'; +$string['description_course'] = 'Items that have been deleted from a course can be restored if they are still in the recyclebin, and will appear at the bottom of the section from which they were deleted.'; +$string['description_coursecat'] = 'Items that have been deleted from a category can be restored if they are still in the recyclebin.'; $string['descriptionexpiry'] = 'Contents will be permanently deleted after {$a} days.'; $string['emptybin'] = 'There are no items in the recycle bin.'; $string['emptyconfirm'] = 'Are you sure you want to delete all items in the recycle bin?'; -$string['deleteconfirm'] = 'Are you sure you want to delete the selected item in the recycle bin?'; +$string['deleteconfirm'] = 'Are you sure you want to delete the selected item from the recycle bin?'; + +$string['invalidcontext'] = 'Invalid context supplied.';