]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions.php
Fixed a lot typos, thanks to profi-concept
[mailer.git] / inc / extensions.php
index 91646a16cc79a8a65afc9976cacc9e67042c16b5..90a5af3374eab55fb16506297fa3fc5e4a24bbd4 100644 (file)
@@ -55,7 +55,10 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // END - if
 
        // Construct FQFN for extension file
-       $extInclude = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
+       $FQFN = sprintf("%sinc/extensions/ext-%s.php",
+               constant('PATH'),
+               $ext_name
+       );
 
        // Is the extension file NOT there?
        if (!FILE_READABLE($extInclude)) {
@@ -67,25 +70,25 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // END - if
 
        // Construct FQFN for language file
-       $langInclude = sprintf("%sinc/language/%s_%s.php", PATH, $ext_name, GET_LANGUAGE());
+       $langInclude = sprintf("inc/language/%s_%s.php", $ext_name, GET_LANGUAGE());
 
        // Is this include there?
        if ((FILE_READABLE($langInclude)) && (!isset($EXT_LOADED['lang'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Language loaded.");
                $EXT_LOADED['lang'][$ext_name] = true;
-               require($langInclude);
+               LOAD_INC_ONCE($langInclude);
        } // END - if
 
        // Construct FQFN for functions file
-       $funcsInclude = sprintf("%sinc/libs/%s_functions.php", PATH, $ext_name);
+       $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
 
        // Is this include there?
        if ((FILE_READABLE($funcsInclude)) && (!isset($EXT_LOADED['funcs'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Functions loaded.");
                $EXT_LOADED['funcs'][$ext_name] = true;
-               require($funcsInclude);
+               LOAD_INC_ONCE($funcsInclude);
        } // END - if
 
        // Extensions are not deprecated by default
@@ -243,7 +246,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr
                }
        } 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__);
        }
 
@@ -496,9 +499,15 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
 }
 
 // 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!
@@ -628,7 +637,11 @@ function DEACTIVATE_EXTENSION($ext_name) {
                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
 }
 
@@ -648,7 +661,7 @@ function EXT_VERSION_IS_OLDER ($ext_name, $ext_ver) {
 // 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) != "") {
@@ -667,7 +680,7 @@ function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
        if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) == "")) {
                // Template file
                $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
-                       PATH,
+                       constant('PATH'),
                        GET_LANGUAGE(),
                        $ext
                );
@@ -696,7 +709,7 @@ VALUES (%s,0,'NEW','EXTENSION','%s','%s',UNIX_TIMESTAMP())",
 // 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) != "")) {
@@ -825,13 +838,13 @@ function ADD_EXTENSION_NOTES ($ver, &$UPDATE_NOTES) {
                        // 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')
                        );
                }