]> git.mjollnir.org Git - moodle.git/commitdiff
upgrade_mod_savepoint() implemented in XMLDB Editor generators. MDL-15343
authorstronk7 <stronk7>
Fri, 18 Jul 2008 22:18:47 +0000 (22:18 +0000)
committerstronk7 <stronk7>
Fri, 18 Jul 2008 22:18:47 +0000 (22:18 +0000)
admin/xmldb/actions/view_structure_php/view_structure_php.class.php
admin/xmldb/actions/view_table_php/view_table_php.class.php

index bdd805d28eec535a1d8d5a2a345a37e57d3a7e6e..7abb8d607ed8c8c02d362f89242def4651cdfba7 100644 (file)
@@ -323,12 +323,20 @@ class view_structure_php extends XMLDBAction {
 
         $result = '';
 
-        switch ($path) {
-            case 'lib/db':
+    /// Split path into components
+        $patharr = explode('/', $path);
+
+        switch ($patharr[0]) {
+            case 'lib':
                 $result = XMLDB_LINEFEED .
                          '    /// Main savepoint reached' . XMLDB_LINEFEED .
                          '        upgrade_main_savepoint($result, XXXXXXXXXX);' . XMLDB_LINEFEED;
                 break;
+            case 'mod':
+                $result = XMLDB_LINEFEED .
+                         '    /// ' . $patharr[1] . ' savepoint reached' . XMLDB_LINEFEED .
+                         '        upgrade_mod_savepoint($result, XXXXXXXXXX, ' . "'$patharr[1]'" . ');' . XMLDB_LINEFEED;
+                break;
         }
         return $result;
     }
index 0d74d1dc9952efeb18525fc47fe443a59b4c7797..b6d5c7daf7e431cbf14de0a73a67e3a7247aa744 100644 (file)
@@ -1043,12 +1043,20 @@ class view_table_php extends XMLDBAction {
 
         $result = '';
 
-        switch ($path) {
-            case 'lib/db':
+    /// Split path into components
+        $patharr = explode('/', $path);
+
+        switch ($patharr[0]) {
+            case 'lib':
                 $result = XMLDB_LINEFEED .
                           '    /// Main savepoint reached' . XMLDB_LINEFEED .
                           '        upgrade_main_savepoint($result, XXXXXXXXXX);' . XMLDB_LINEFEED;
                 break;
+            case 'mod':
+                $result = XMLDB_LINEFEED .
+                          '    /// ' . $patharr[1] . ' savepoint reached' . XMLDB_LINEFEED .
+                          '        upgrade_mod_savepoint($result, XXXXXXXXXX, ' . "'$patharr[1]'" . ');' . XMLDB_LINEFEED;
+                break;
         }
         return $result;
     }