]> git.mjollnir.org Git - moodle.git/commitdiff
xmldb: added $CFG options for disabling next / previous value checkings & enforced...
authormjollnir_ <mjollnir_>
Fri, 20 Apr 2007 00:10:52 +0000 (00:10 +0000)
committermjollnir_ <mjollnir_>
Fri, 20 Apr 2007 00:10:52 +0000 (00:10 +0000)
config-dist.php
lib/xmldb/classes/XMLDBObject.class.php
lib/xmldb/classes/XMLDBStructure.class.php
lib/xmldb/classes/XMLDBTable.class.php

index 86d15ea0bd1a47a9bce4222a03a61d7e48c9c57d..a28282ebc10f019434961c83947e885a1fec8721 100644 (file)
@@ -281,7 +281,12 @@ $CFG->admin = 'admin';
 //     $CFG->allowvisiblecoursesinhiddencategories = true;
 // 
 // NOTE: if you are using custompix in your theme, see /fixpix.php.
-
+// 
+// special magic evil developer only wanting to edit the xmldb files manually
+// uncomment these if you're lazy like Penny
+// $CFG->xmldbdisablecommentchecking = true;
+// $CFG->xmldbdisablenextprevchecking = true;
+//
 //=========================================================================
 // ALL DONE!  To continue installation, visit your main page with a browser
 //=========================================================================
index 10a90b971a24d9d713cd27bcd37199fb796b587e..4aec0d87a7daf34ae0236022411f9d2ab68c20f1 100644 (file)
@@ -194,6 +194,10 @@ class XMLDBObject {
      * have a consistent info in their previous/next fields
      */
     function checkPreviousNextValues(&$arr) {
+        global $CFG;
+        if (!empty($CFG->xmldbdisablenextprevchecking)) {
+            return true;
+        }
         $result = true;
     /// Check that only one element has the previous not set
         if ($arr) {
@@ -271,7 +275,11 @@ class XMLDBObject {
      * the previous/next rules
      */
     function orderElements($arr) {
+        global $CFG;
         $result = true;
+        if (!empty($CFG->xmldbdisablenextprevchecking)) {
+            return $arr;
+        }
     /// Create a new array
         $newarr = array();
         if (!empty($arr)) {
index 3d051a5e858b1d422463f485c9d0b00f3dbe8845..e37aacadc994b334938d065eae0c1312faff5ede 100644 (file)
@@ -330,6 +330,8 @@ class XMLDBStructure extends XMLDBObject {
      */
     function arr2XMLDBStructure($xmlarr) {
 
+        global $CFG;
+
         $result = true;
 
     /// Debug the structure
@@ -354,6 +356,8 @@ class XMLDBStructure extends XMLDBObject {
         }
         if (isset($xmlarr['XMLDB']['@']['COMMENT'])) {
             $this->comment = trim($xmlarr['XMLDB']['@']['COMMENT']);
+        } else if (!empty($CFG->xmldbdisablecommentchecking)) {
+            $this->comment = '';
         } else {
             $this->errormsg = 'Missing COMMENT attribute';
             $this->debug($this->errormsg);
index 621d1a8e16dd4a72c692937a6d2786526078e952..55a2c2d99c746016ff3e12ed93c5dcecc8c34430 100644 (file)
@@ -434,6 +434,8 @@ class XMLDBTable extends XMLDBObject {
      */
     function arr2XMLDBTable($xmlarr) {
 
+        global $CFG;
+
         $result = true;
 
     /// Debug the table
@@ -451,6 +453,8 @@ class XMLDBTable extends XMLDBObject {
         }
         if (isset($xmlarr['@']['COMMENT'])) {
             $this->comment = trim($xmlarr['@']['COMMENT']);
+        } else if (!empty($CFG->xmldbdisablecommentchecking)) {
+            $this->comment = '';
         } else {
             $this->errormsg = 'Missing COMMENT attribute';
             $this->debug($this->errormsg);