// Initialize variables (no title for SQL commands by default)
$ext_name = ''; $ext_ver = '';
- $title = '{--TASK_NO_TITLE--}';
+ $title = '{--ADMIN_TASK_NO_SQL_TITLE--}';
// Shall I list SQL commands assigned to an extension installation or update task?
if ((isVerboseSqlEnabled()) || (!isExtensionInstalled('sql_patches'))) {
// Add SQLs to a table
if ((!empty($ext_name)) && (isVerboseSqlEnabled())) {
// Add verbose SQL table
- $taskData['text'] .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . "<br />\n";
+ $taskData['text'] .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . '<br />';
} // END - if
} elseif ((!empty($ext_name)) && (!empty($ext_ver))) {
// Run SQL commands in dry mode but only return the notes
switch ($taskData['task_type']) {
case 'EXTENSION': // Install new extensions
$ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
- $result_lines = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
- array($ext_name), __FILE__, __LINE__);
- $lines = SQL_NUMROWS($result_lines);
- SQL_FREERESULT($result_lines);
- if ($lines == '0') {
- // New extension found
+ if (!isExtensionInstalled($ext_name)) {
+ // New (not yet installed) extension found
$OUT .= loadTemplate('admin_extension_reg_form', true, array(
'id' => bigintval($taskId),
'ext_name' => $ext_name
));
} else {
- // Task is closed so nothing is todo
+ // Extension is already installed
$OUT .= '<div class="admin_failed">{--ADMIN_EXTENSION_ALREADY_REGISTERED--}</div>';
// Close task but not already closed, solved, deleted or update tasks