MDL-43526 category: added restore course link to admin structure
authorSam Hemelryk <sam@moodle.com>
Mon, 6 Jan 2014 21:26:48 +0000 (10:26 +1300)
committerDan Poltawski <dan@moodle.com>
Tue, 7 Jan 2014 04:08:34 +0000 (12:08 +0800)
lib/navigationlib.php

index 5a2dbf9..4ae18b2 100644 (file)
@@ -4317,6 +4317,12 @@ class settings_navigation extends navigation_node {
             $categorynode->add(get_string('filters', 'admin'), $url, self::TYPE_SETTING, null, 'filters', new pix_icon('i/filter', ''));
         }
 
+        // Restore.
+        if (has_capability('moodle/course:create', $this->context)) {
+            $url = new moodle_url('/backup/restorefile.php', array('contextid' => $this->context->id));
+            $categorynode->add(get_string('restorecourse', 'admin'), $url, self::TYPE_SETTING, null, 'restorecourse', new pix_icon('i/restore', ''));
+        }
+
         return $categorynode;
     }