From 84774c552c4fe5d87819c7e932cc7d24f297a000 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 18 Jul 2008 22:18:47 +0000 Subject: [PATCH] upgrade_mod_savepoint() implemented in XMLDB Editor generators. MDL-15343 --- .../view_structure_php/view_structure_php.class.php | 12 ++++++++++-- .../actions/view_table_php/view_table_php.class.php | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/admin/xmldb/actions/view_structure_php/view_structure_php.class.php b/admin/xmldb/actions/view_structure_php/view_structure_php.class.php index bdd805d28e..7abb8d607e 100644 --- a/admin/xmldb/actions/view_structure_php/view_structure_php.class.php +++ b/admin/xmldb/actions/view_structure_php/view_structure_php.class.php @@ -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; } diff --git a/admin/xmldb/actions/view_table_php/view_table_php.class.php b/admin/xmldb/actions/view_table_php/view_table_php.class.php index 0d74d1dc99..b6d5c7daf7 100644 --- a/admin/xmldb/actions/view_table_php/view_table_php.class.php +++ b/admin/xmldb/actions/view_table_php/view_table_php.class.php @@ -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; } -- 2.39.5