]> git.mjollnir.org Git - moodle.git/commitdiff
portfolio/glossary MDL-21158 make sure full glossary export is in a leap2a selection
authorPenny Leach <penny@liip.ch>
Mon, 4 Jan 2010 03:57:47 +0000 (03:57 +0000)
committerPenny Leach <penny@liip.ch>
Mon, 4 Jan 2010 03:57:47 +0000 (03:57 +0000)
mod/glossary/locallib.php

index e25b8f64b461a7b87350b4ffc5760c3fbb48a338..03b925c1782a6c548e63b607fc06591c8db2cd0b 100644 (file)
@@ -136,6 +136,7 @@ class glossary_full_portfolio_caller extends portfolio_module_caller_base {
             $this->exporter->write_new_file($csv, clean_filename($this->cm->name) . '.csv', false);
             return;
         } else if ($this->get('exporter')->get('formatclass') == PORTFOLIO_FORMAT_LEAP2A) {
+            $ids = array(); // keep track of these to make into a selection later
             global $USER, $DB;
             $writer = $this->get('exporter')->get('format')->leap2a_writer($USER);
             $format = $this->exporter->get('format');
@@ -168,7 +169,11 @@ class glossary_full_portfolio_caller extends portfolio_module_caller_base {
                     }
                 }
                 $writer->add_entry($entry);
+                $ids[] = $entry->id;
             }
+            $selection = new portfolio_format_leap2a_entry('wholeglossary' . $this->glossary->id, get_string('modulename', 'glossary'), 'selection');
+            $writer->add_entry($selection);
+            $writer->make_selection($selection, $ids, 'Grouping');
             $content = $writer->to_xml();
         }
         $this->exporter->write_new_file($content, $filename, true);