# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/backup/moodle2/backup_activity_task.class.php
--- moodle/backup/moodle2/backup_activity_task.class.php Base (1.6)
+++ moodle/backup/moodle2/backup_activity_task.class.php Locally Modified (Based On 1.6)
@@ -223,6 +223,7 @@
         // - section_included setting (if exists)
         $settingname = $settingprefix . 'included';
         $activity_included = new backup_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);
+        $activity_included->get_ui()->set_icon(new pix_icon('icon', get_string('pluginname', $this->modulename), $this->modulename));
         $this->add_setting($activity_included);
         // Look for "activities" root setting
         $activities = $this->plan->get_setting('activities');
@@ -240,7 +241,8 @@
         // - activity_included setting
         $settingname = $settingprefix . 'userinfo';
         $activity_userinfo = new backup_activity_userinfo_setting($settingname, base_setting::IS_BOOLEAN, true);
-        $activity_userinfo->get_ui()->set_label(get_string('includeuserinfo','backup'));
+        //$activity_userinfo->get_ui()->set_label(get_string('includeuserinfo','backup'));
+        $activity_userinfo->get_ui()->set_label('-');
         $this->add_setting($activity_userinfo);
         // Look for "users" root setting
         $users = $this->plan->get_setting('users');
Index: moodle/backup/moodle2/backup_section_task.class.php
--- moodle/backup/moodle2/backup_section_task.class.php Base (1.6)
+++ moodle/backup/moodle2/backup_section_task.class.php Locally Modified (Based On 1.6)
@@ -135,15 +135,20 @@
      * Define the common setting that any backup section will have
      */
     protected function define_settings() {
+        global $DB;
 
         // All the settings related to this activity will include this prefix
         $settingprefix = 'section_' . $this->sectionid . '_';
 
         // All these are common settings to be shared by all sections
 
+        $section = $DB->get_record('course_sections', array('id' => $this->sectionid), '*', MUST_EXIST);
+        $course = $DB->get_record('course', array('id' => $section->course), '*', MUST_EXIST);
+
         // Define section_included (to decide if the whole task must be really executed)
         $settingname = $settingprefix . 'included';
         $section_included = new backup_section_included_setting($settingname, base_setting::IS_BOOLEAN, true);
+        $section_included->get_ui()->set_label(get_section_name($course, $section));
         $this->add_setting($section_included);
 
         // Define section_userinfo. Dependent of:
Index: moodle/backup/moodle2/restore_activity_task.class.php
--- moodle/backup/moodle2/restore_activity_task.class.php Base (1.5)
+++ moodle/backup/moodle2/restore_activity_task.class.php Locally Modified (Based On 1.5)
@@ -241,6 +241,7 @@
         // - section_included setting (if exists)
         $settingname = $settingprefix . 'included';
         $activity_included = new restore_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);
+        $activity_included->get_ui()->set_icon(new pix_icon('icon', get_string('pluginname', $this->modulename), $this->modulename));
         $this->add_setting($activity_included);
         // Look for "activities" root setting
         $activities = $this->plan->get_setting('activities');
Index: moodle/backup/util/includes/backup_includes.php
--- moodle/backup/util/includes/backup_includes.php Base (1.3)
+++ moodle/backup/util/includes/backup_includes.php Locally Modified (Based On 1.3)
@@ -93,4 +93,5 @@
 require_once($CFG->dirroot . '/backup/util/ui/backup_ui_setting.class.php');
 
 // And some moodle stuff too
+require_once($CFG->dirroot.'/course/lib.php');
 require_once($CFG->libdir.'/gradelib.php');
Index: moodle/backup/util/ui/backup_ui_setting.class.php
--- moodle/backup/util/ui/backup_ui_setting.class.php Base (1.8)
+++ moodle/backup/util/ui/backup_ui_setting.class.php Locally Modified (Based On 1.8)
@@ -57,6 +57,11 @@
      */
     protected $type;
     /**
+     * An icon to display next to this setting in the UI
+     * @var pix_icon
+     */
+    protected $icon = false;
+    /**
      * The setting this UI belongs to (parent reference)
      * @var base_setting|backup_setting
      */
@@ -123,9 +128,30 @@
     public function disable() {
        $this->attributes['disabled'] = 'disabled';
     }
+
+    /**
+     * Sets the icon to display next to this item
+     *
+     * @param pix_icon $icon
+     */
+    public function set_icon(pix_icon $icon) {
+        $this->icon = $icon;
 }
 
 /**
+     * Returns the icon to display next to this item, or false if there isn't one.
+     *
+     * @return pix_icon|false
+     */
+    public function get_icon() {
+        if (!empty($this->icon)) {
+            return $this->icon;
+        }
+        return false;
+    }
+}
+
+/**
  * Abstract class to represent the user interface backup settings have
  * 
  * @copyright 2010 Sam Hemelryk
@@ -200,7 +226,7 @@
      * Get element properties that can be used to make a quickform element
      * @return array
      */
-    abstract public function get_element_properties(base_task $task=null);
+    abstract public function get_element_properties(base_task $task=null, renderer_base $output=null);
     /**
      * Applies config options to a given properties array and then returns it
      * @param array $properties
@@ -283,9 +309,15 @@
      * @param backup_task|null $task
      * @return array (element, name, label, attributes)
      */
-    public function get_element_properties(base_task $task=null) {
+    public function get_element_properties(base_task $task=null, renderer_base $output=null) {
+        // name, label, text, attributes
+        $icon = $this->get_icon();
+        $label = $this->get_label($task);
+        if (!empty($icon)) {
+            $label .= '&nbsp;'.$output->render($icon);
+        }
         // name, label, attributes
-        return $this->apply_options(array('element'=>'text','name'=>self::NAME_PREFIX.$this->name, 'label'=>$this->get_label($task), 'attributes'=>$this->attributes));
+        return $this->apply_options(array('element'=>'text','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'attributes'=>$this->attributes));
     }
 
 }
@@ -327,10 +359,16 @@
      * @param backup_task|null $task
      * @return array (element, name, label, text, attributes);
      */
-    public function get_element_properties(base_task $task=null) {
+    public function get_element_properties(base_task $task=null, renderer_base $output=null) {
         // name, label, text, attributes
-        return $this->apply_options(array('element'=>'checkbox','name'=>self::NAME_PREFIX.$this->name, 'label'=>$this->get_label($task), 'text'=>$this->text, 'attributes'=>$this->attributes));
+        
+        $icon = $this->get_icon();
+        $label = $this->get_label($task);
+        if (!empty($icon)) {
+            $label .= '&nbsp;'.$output->render($icon);
     }
+        return $this->apply_options(array('element'=>'checkbox','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'text'=>$this->text, 'attributes'=>$this->attributes));
+    }
     /**
      * Sets the text for the element
      * @param string $text
@@ -340,14 +378,16 @@
     }
     /**
      * Gets the static value for the element
+     * @global core_renderer $OUTPUT
      * @return string
      */
     public function get_static_value() {
+        global $OUTPUT;
         // Checkboxes are always yes or no
         if ($this->get_value()) {
-            return get_string('yes');
+            return $OUTPUT->pix_icon('i/tick_green_big', get_string('yes'));
         } else {
-            return get_string('no');
+            return $OUTPUT->pix_icon('i/cross_red_big', get_string('no'));
         }
     }
 
@@ -413,9 +453,15 @@
      * @param backup_task|null $task
      * @return array (element, name, label, text, value, attributes)
      */
-    public function get_element_properties(base_task $task=null) {
+    public function get_element_properties(base_task $task=null, renderer_base $output=null) {
+        // name, label, text, attributes
+        $icon = $this->get_icon();
+        $label = $this->get_label($task);
+        if (!empty($icon)) {
+            $label .= '&nbsp;'.$output->render($icon);
+        }
         // name, label, text, value, attributes
-        return $this->apply_options(array('element'=>'radio','name'=>self::NAME_PREFIX.$this->name, 'label'=>$this->get_label($task), 'text'=>$this->text, 'value'=>$this->value, 'attributes'=>$this->attributes));
+        return $this->apply_options(array('element'=>'radio','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'text'=>$this->text, 'value'=>$this->value, 'attributes'=>$this->attributes));
     }
     /**
      * Sets the text next to this input
@@ -472,9 +518,15 @@
      * @param backup_task|null $task
      * @return array (element, name, label, options, attributes)
      */
-    public function get_element_properties(base_task $task = null) {
+    public function get_element_properties(base_task $task = null, renderer_base $output=null) {
+        // name, label, text, attributes
+        $icon = $this->get_icon();
+        $label = $this->get_label($task);
+        if (!empty($icon)) {
+            $label .= '&nbsp;'.$output->render($icon);
+        }
         // name, label, options, attributes
-        return $this->apply_options(array('element'=>'select','name'=>self::NAME_PREFIX.$this->name, 'label'=>$this->get_label($task), 'options'=>$this->values, 'attributes'=>$this->attributes));
+        return $this->apply_options(array('element'=>'select','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'options'=>$this->values, 'attributes'=>$this->attributes));
     }
     /**
      * Sets the options for the select box
@@ -505,11 +557,11 @@
 }
 
 class backup_setting_ui_dateselector extends backup_setting_ui_text {
-    public function get_element_properties(base_task $task = null) {
+    public function get_element_properties(base_task $task = null, renderer_base $output=null) {
         if (!array_key_exists('optional', $this->attributes)) {
             $this->attributes['optional'] = false;
         }
-        $properties = parent::get_element_properties($task);
\ No newline at end of file
+        $properties = parent::get_element_properties($task, $output);
\ No newline at end of file
         $properties['element'] = 'date_selector';
         return $properties;
     }
Index: moodle/backup/util/ui/backup_ui_stage.class.php
--- moodle/backup/util/ui/backup_ui_stage.class.php Base (1.9)
+++ moodle/backup/util/ui/backup_ui_stage.class.php Locally Modified (Based On 1.9)
@@ -249,7 +249,7 @@
                     // setting. We only want schema settings to be editable
                     foreach ($task->get_settings() as $setting) {
                         if ($setting->get_name() != 'filename') {
-                            $form->add_fixed_setting($setting);
+                            $form->add_fixed_setting($setting, $task);
                         }
                     }
                 }
@@ -353,7 +353,7 @@
                 foreach ($task->get_settings() as $setting) {
                     // For this stage only the filename setting should be editable
                     if ($setting->get_name() != 'filename') {
-                        $form->add_fixed_setting($setting);
+                        $form->add_fixed_setting($setting, $task);
                     }
                 }
             }
Index: moodle/backup/util/ui/base_moodleform.class.php
--- moodle/backup/util/ui/base_moodleform.class.php Base (1.4)
+++ moodle/backup/util/ui/base_moodleform.class.php Locally Modified (Based On 1.4)
@@ -136,17 +136,18 @@
      * @return bool
      */
     function add_setting(backup_setting $setting, base_task $task=null) {
+        global $OUTPUT;
 
         // If the setting cant be changed or isn't visible then add it as a fixed setting.
         if (!$setting->get_ui()->is_changeable() || $setting->get_visibility() != backup_setting::VISIBLE) {
-            return $this->add_fixed_setting($setting);
+            return $this->add_fixed_setting($setting, $task);
         }
 
         // First add the formatting for this setting
         $this->add_html_formatting($setting);
 
         // The call the add method with the get_element_properties array
-        call_user_method_array('addElement', $this->_form, $setting->get_ui()->get_element_properties($task));
+        call_user_method_array('addElement', $this->_form, $setting->get_ui()->get_element_properties($task, $OUTPUT));
         $this->_form->setDefault($setting->get_ui_name(), $setting->get_value());
         if ($setting->has_help()) {
             list($identifier, $component) = $setting->get_help();
@@ -223,7 +224,7 @@
      * Adds a fixed or static setting to the form
      * @param backup_setting $setting
      */
-    function add_fixed_setting(backup_setting $setting) {
+    function add_fixed_setting(backup_setting $setting, base_task $task) {
         global $OUTPUT;
         $settingui = $setting->get_ui();
         if ($setting->get_visibility() == backup_setting::VISIBLE) {
@@ -242,7 +243,12 @@
                     $icon = '';
                     break;
             }
-            $this->_form->addElement('static', 'static_'.$settingui->get_name(), $settingui->get_label(), $settingui->get_static_value().$icon);
\ No newline at end of file
+            $label = $settingui->get_label($task);
+            $labelicon = $settingui->get_icon();
+            if (!empty($labelicon)) {
+                $label .= '&nbsp;'.$OUTPUT->render($labelicon);
+            }
+            $this->_form->addElement('static', 'static_'.$settingui->get_name(), $label, $settingui->get_static_value().$icon);
\ No newline at end of file
             $this->_form->addElement('html', html_writer::end_tag('div'));
         }
         $this->_form->addElement('hidden', $settingui->get_name(), $settingui->get_value());
Index: moodle/backup/util/ui/base_ui.class.php
--- moodle/backup/util/ui/base_ui.class.php Base (1.1)
+++ moodle/backup/util/ui/base_ui.class.php Locally Modified (Based On 1.1)
@@ -90,7 +90,7 @@
         }
         $this->progress = self::PROGRESS_PROCESSED;
 
-        if (optional_param('previous', false, PARAM_BOOL) && $this->stage->get_stage() > self::STAGE_INITIAL) {
\ No newline at end of file
+        if (optional_param('previous', false, PARAM_BOOL) && $this->stage->get_stage() > $this->get_first_stage_id()) {
\ No newline at end of file
             $this->stage = $this->initialise_stage($this->stage->get_prev_stage(), $this->stage->get_params());
             return false;
         }
Index: moodle/backup/util/ui/renderer.php
--- moodle/backup/util/ui/renderer.php Base (1.10)
+++ moodle/backup/util/ui/renderer.php Locally Modified (Based On 1.10)
@@ -133,8 +133,10 @@
                     $table->attributes = array('class'=>'activitytable generaltable');
                     $table->data = array();
                 }
+                $name = get_string('pluginname', $activity->modulename);
+                $icon = new pix_icon('icon', $name, $activity->modulename);
                 $table->data[] = array(
-                    get_string('pluginname', $activity->modulename),
+                    $this->output->render($icon).'&nbsp;'.$name,
                     $activity->title,
                     ($activity->settings[$activitykey.'_userinfo'])?$yestick:$notick,
                 );
Index: moodle/backup/util/ui/restore_ui_stage.class.php
--- moodle/backup/util/ui/restore_ui_stage.class.php Base (1.3)
+++ moodle/backup/util/ui/restore_ui_stage.class.php Locally Modified (Based On 1.3)
@@ -445,7 +445,7 @@
                     // setting. We only want schema settings to be editable
                     foreach ($task->get_settings() as $setting) {
                         if ($setting->get_name() != 'filename') {
-                            $form->add_fixed_setting($setting);
+                            $form->add_fixed_setting($setting, $task);
                         }
                     }
                 }
@@ -518,7 +518,7 @@
                 }
                 // Iterate all settings, doesnt need to happen by reference
                 foreach ($task->get_settings() as $setting) {
-                    $form->add_fixed_setting($setting);
\ No newline at end of file
+                    $form->add_fixed_setting($setting, $task);
\ No newline at end of file
                 }
             }
             $this->stageform = $form;
Index: moodle/theme/standard/style/core.css
--- moodle/theme/standard/style/core.css Base (1.17)
+++ moodle/theme/standard/style/core.css Locally Modified (Based On 1.17)
@@ -354,6 +354,7 @@
 .path-backup .mform .grouped_settings.section_level {border:1px solid #aaa;margin:10px;clear:both;background-color:#EEE;}
 .path-backup .mform .grouped_settings.section_level .grouped_settings.activity_level  {background-color:#fff;border:1px solid #fff;border-top-color:#DDD;}
 .path-backup .mform .grouped_settings.section_level .include_setting {font-weight:bold;}
+.path-backup .mform .grouped_settings.activity_level .include_setting label {font-weight:normal;}
 .path-backup .backup_progress {margin:10px;}
 .path-backup .backup_progress .backup_stage {margin:5px 20px;}
 .path-backup .backup_progress .backup_stage.backup_stage_complete {}
