backup MDL-23918 Fixed up wording in the backup and restore stages.
[moodle.git] / backup / moodle2 / restore_section_task.class.php
index 962f171..454487c 100644 (file)
@@ -110,6 +110,26 @@ class restore_section_task extends restore_task {
         }
     }
 
+    /**
+     * Define the contents in the course that must be
+     * processed by the link decoder
+     */
+    static public function define_decode_contents() {
+        $contents = array();
+
+        $contents[] = new restore_decode_content('course_sections', 'summary', 'course_section');
+
+        return $contents;
+    }
+
+    /**
+     * Define the decoding rules for links belonging
+     * to the sections to be executed by the link decoder
+     */
+    static public function define_decode_rules() {
+        return array();
+    }
+
 // Protected API starts here
 
     /**
@@ -125,6 +145,12 @@ class restore_section_task extends restore_task {
         // Define section_included (to decide if the whole task must be really executed)
         $settingname = $settingprefix . 'included';
         $section_included = new restore_section_included_setting($settingname, base_setting::IS_BOOLEAN, true);
+        if (is_number($this->info->title)) {
+            $label = get_string('includesection', 'backup', $this->info->title);
+        } else {
+            $label = $this->info->title;
+        }
+        $section_included->get_ui()->set_label($label);
         $this->add_setting($section_included);
 
         // Define section_userinfo. Dependent of:
@@ -133,7 +159,7 @@ class restore_section_task extends restore_task {
         $settingname = $settingprefix . 'userinfo';
         $selectvalues = array(0=>get_string('no')); // Safer options
         $defaultvalue = false;                      // Safer default
-        if (isset($info->settings[$settingname]) && $info->settings[$settingname]) { // Only enabled when available
+        if (isset($this->info->settings[$settingname]) && $this->info->settings[$settingname]) { // Only enabled when available
             $selectvalues = array(1=>get_string('yes'), 0=>get_string('no'));
             $defaultvalue = true;
         }