- switch ($type)
- {
- case "EXTENSION": // Install new extensions
- $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 .= LOAD_TEMPLATE("admin_ext_reg_form", true, array(
- 'id' => bigintval($id),
- 'ext_name' => $ext_name
- ));
- } else {
- // Task is closed so nothing is todo
- $OUT .= "<FONT class=\"admin_failed\">".ADMIN_EXT_ALREADY_REGISTERED."</FONT>\n";
-
- // Close task but not already closes or deleted or update tasks
- if (($status != "CLOSED") && ($status != "DELETED") && ($type != "EXTENSION_UPDATE")) {
- ADMIN_SOLVE_TASK($tid);
+ // @TODO Rewrite this to something with include files
+ switch ($type) {
+ case 'EXTENSION': // Install new extensions
+ $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' => $ext_name
+ ));
+ } else {
+ // Task is closed so nothing is todo
+ $OUT .= "<div class=\"admin_failed\">{--ADMIN_EXT_ALREADY_REGISTERED--}</div>\n";
+
+ // Close task but not already closes or deleted or update tasks
+ if ((!in_array($status, array('CLOSED','DELETED','SOLVED'))) && ($type != 'EXTENSION_UPDATE')) {
+ // Solve the task
+ runFilterChain('solve_task', $tid);
+ } // END - if