- $ext_name = substr($subj, 1, strpos($subj, ':') - 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
- $OUT .= loadTemplate('admin_ext_reg_form', true, array(
- 'id' => bigintval($id),
+ $ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
+ if (!isExtensionInstalled($ext_name)) {
+ // New (not yet installed) extension found
+ $OUT .= loadTemplate('admin_extension_reg_form', true, array(
+ 'id' => bigintval($taskId),