} // END - if
// Construct FQFN for extension file
- $extInclude = sprintf("inc/extensions/ext-%s.php", $ext_name);
+ $FQFN = sprintf("%sinc/extensions/ext-%s.php",
+ constant('PATH'),
+ $ext_name
+ );
// Is the extension file NOT there?
- if (!FILE_READABLE($extInclude)) {
+ if (!FILE_READABLE($FQFN)) {
// Debug message
DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Extension %s not found.", $ext_name));
// Include the extension file
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Extension loaded.");
- LOAD_INC($extInclude);
+ require($FQFN);
// Is this extension deprecated?
if ($EXT_DEPRECATED == "Y") {
}
} elseif (($task_id > 0) && (!empty($ext_name))) {
// Remove task from system when id and extension's name is valid
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND status='NEW' LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND `status`='NEW' LIMIT 1",
array(bigintval($task_id)), __FILE__, __LINE__);
}
if (!$dry_run) {
// Create task
- CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), $ext_name, $cacheArray['update_ver'][$ext_name], addslashes($NOTES));
+ CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), $ext_name, $cacheArray['update_ver'][$ext_name], SQL_ESCAPE($NOTES));
// Update extension's version
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE ext_name='%s' LIMIT 1",
}
// Output verbose SQL table for extension
-function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUTED_ON_REMOVAL, $dashed = "", $switch = false, $width = "100%") {
+function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = "", $dashed = "", $switch = false, $width = "100%") {
global $SQLs;
+ // Empty title?
+ if (empty($title)) {
+ // Then fix it to default
+ $title = getMessage('ADMIN_SQLS_EXECUTED_ON_REMOVAL');
+ } // END - if
+
// Are there some queries in $queries?
if (count($queries) > 0) {
// Then use them instead!
CREATE_EXTENSION_DEACTIVATION_TASK($ext_name);
// Notify the admin
- SEND_ADMIN_NOTIFICATION(ADMIN_SUBJECT_EXTENSION_DEACTIVATED, "admin_ext_deactivated", array('ext_name' => $ext_name));
+ SEND_ADMIN_NOTIFICATION(
+ getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
+ "admin_ext_deactivated",
+ array('ext_name' => $ext_name)
+ );
} // END - if
}
// Creates a new task for updated extension
function CREATE_EXTENSION_UPDATE_TASK ($admin_id, $ext_name, $ext_ver, $notes) {
// Create subject line
- $subject = "[UPDATE-".$ext_name."-".$ext_ver.":] {!ADMIN_UPDATE_EXT_SUBJ!}";
+ $subject = "[UPDATE-".$ext_name."-".$ext_ver.":] {--ADMIN_UPDATE_EXT_SUBJ--}";
// Is the extension there?
if (GET_EXT_VERSION($ext_name) != "") {
array(
$admin_id,
$subject,
- addslashes($msg),
+ SQL_ESCAPE($msg),
), __FILE__, __LINE__, true, false
);
} // END - if
// Creates a task for automatically deactivated (deprecated) extension
function CREATE_EXTENSION_DEACTIVATION_TASK ($ext) {
// Create subject line
- $subject = sprintf("[%s:] %s", $ext, TASK_SUBJ_EXTENSION_DEACTIVATED);
+ $subject = sprintf("[%s:] %s", $ext, getMessage('TASK_SUBJ_EXTENSION_DEACTIVATED'));
// Not installed and do we have created a task for the admin?
if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) != "")) {
VALUES (0,0,'NEW','EXTENSION_DEACTIVATION','%s','%s',UNIX_TIMESTAMP())",
array(
$subject,
- addslashes(LOAD_TEMPLATE("task_ext_deactivated", true, $ext)),
+ SQL_ESCAPE(LOAD_TEMPLATE("task_ext_deactivated", true, $ext)),
), __FILE__, __LINE__, true, false
);
} // END - if
// Initial release
$content = array(
'ver' => $ver,
- 'notes' => INITIAL_RELEASE
+ 'notes' => getMessage('INITIAL_RELEASE')
);
} else {
// No update notes found!
$content = array(
'ver' => $ver,
- 'notes' => NO_UPDATE_NOTES
+ 'notes' => getMessage('NO_UPDATE_NOTES')
);
}