]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19058 xmldb editor & enums - detect used/unused enums when loading XML files
authorstronk7 <stronk7>
Tue, 26 May 2009 18:45:02 +0000 (18:45 +0000)
committerstronk7 <stronk7>
Tue, 26 May 2009 18:45:02 +0000 (18:45 +0000)
lib/xmldb/xmldb_field.php

index 61ed7cede62de2811b5c606cb17daa82e81cf8cc..4b8090623c96dcdf512b9682864493a9fb3eb2cf 100644 (file)
@@ -358,6 +358,15 @@ class xmldb_field extends xmldb_object {
             $this->next = trim($xmlarr['@']['NEXT']);
         }
 
+    /// TODO: Drop this check in Moodle 2.1
+    /// Detect if there is old enum information in the XML file
+        if (isset($xmlarr['@']['ENUM']) && isset($xmlarr['@']['ENUMVALUES'])) {
+            $this->hasenums = true;
+            if ($xmlarr['@']['ENUM'] == 'true') {
+                $this->hasenumsenabled = true;
+            }
+        }
+
     /// Set some attributes
         if ($result) {
             $this->loaded = true;