From 16454b0f1cbe4fd569d56ae16ac363465a833dbd Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 26 May 2009 18:45:02 +0000 Subject: [PATCH] MDL-19058 xmldb editor & enums - detect used/unused enums when loading XML files --- lib/xmldb/xmldb_field.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/xmldb/xmldb_field.php b/lib/xmldb/xmldb_field.php index 61ed7cede6..4b8090623c 100644 --- a/lib/xmldb/xmldb_field.php +++ b/lib/xmldb/xmldb_field.php @@ -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; -- 2.39.5