}
// Output verbose SQL table for extension
-function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = '', $dashed = '', $switch = false, $width = "100%") {
+function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = '', $dashed = '', $switch = false, $width = '100%') {
// Empty title?
if (empty($title)) {
// Then fix it to default
// Shall I list SQL commands assigned to an extension installation or update task?
if (((GET_EXT_VERSION('sql_patches') != '') && (getConfig('verbose_sql') == 'Y')) || (!EXT_IS_ACTIVE('sql_patches'))) {
+ // Extract extension name from subject
$ext_name = substr($subj, 1, strpos($subj, ':') - 1);
+
+ // Update task or extension task?
if ($type == 'EXTENSION') {
// Load SQL commands for registering
REGISTER_EXTENSION($ext_name, $id, true);
// Prepare extension name and version
$ext_name = substr($ext_name, 7);
$ext_name = substr($ext_name, 0, strpos($ext_name, '-'));
- $test = '[UPDATE-'.$ext_name.'-';
+ $test = '[UPDATE-' . $ext_name . '-';
$ext_ver = substr($subj, strlen($test));
$ext_ver = substr($ext_ver, 0, strpos($ext_ver, ':'));
$ext_name = '';
}
- // Add SQLs to a table
+ // Auto-init SQL handler
if (!IS_SQLS_VALID()) INIT_SQLS();
- if (empty($title)) $title = '';
+
+ // Add SQLs to a table
if ((!empty($ext_name)) && (GET_EXT_VERSION('sql_patches')) && (getConfig('verbose_sql') == 'Y')) {
// Add verbose SQL table
- $text .= EXTENSION_VERBOSE_TABLE($title, " class=\"admin_table top2 left2 right2\"", true, "100%")."<br />\n";
+ $text .= EXTENSION_VERBOSE_TABLE($title, " class=\"admin_table top2 left2 right2\"", true, '100%')."<br />\n";
} // END - if
} elseif ((!empty($ext_name)) && (!empty($ext_ver))) {
// Run SQL commands in dry mode but only return the notes
$text .= EXT_GET_NOTES();
} else {
// This should not normally happen!
- debug_report_bug('ext_name(' . $ext_name . ') or ext_ver (' . $ext_ver . ') is empty!');
+ debug_report_bug('ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! sql_patches=' . GET_EXT_VERSION('sql_patches') . '/verbose_sql=' . getConfig('verbose_sql'));
}
// Prepare array for the template