]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Typo fixed :(
[mailer.git] / inc / extensions-functions.php
index d918bc5fd96efb9590aaed0e0a800ccab98075be..dc7660b24cd40c10b207bc8dad6b3398158821d0 100644 (file)
@@ -356,21 +356,21 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'insert=' . getCurrentExtensionName() . '/' . getCurrentExtensionVersion() . ' - INSERT!');
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        // New way, with CSS
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'insert=' . getCurrentExtensionName() . '/' . getCurrentExtensionVersion() . ' - INSERT!');
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        // New way, with CSS
-                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . getCurrentExtensionName() . ',always_active=' . getExtensionAlwaysActive() . ', ext_ver=' . getCurrentExtensionVersion() . 'ext_css=' . getExtensionHasCss());
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . getCurrentExtensionName() . ',always_active=' . getThisExtensionAlwaysActive() . ', ext_ver=' . getCurrentExtensionVersion() . 'ext_css=' . getExtensionHasCss());
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_extensions` (`ext_name`, `ext_active`, `ext_version`,`ext_has_css`) VALUES ('%s','%s','%s','%s')",
                                                array(
                                                        getCurrentExtensionName(),
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_extensions` (`ext_name`, `ext_active`, `ext_version`,`ext_has_css`) VALUES ('%s','%s','%s','%s')",
                                                array(
                                                        getCurrentExtensionName(),
-                                                       getExtensionAlwaysActive(),
+                                                       getThisExtensionAlwaysActive(),
                                                        getCurrentExtensionVersion(),
                                                        getExtensionHasCss()
                                                ), __FUNCTION__, __LINE__);
                                } else {
                                        // Old way, no CSS
                                                        getCurrentExtensionVersion(),
                                                        getExtensionHasCss()
                                                ), __FUNCTION__, __LINE__);
                                } else {
                                        // Old way, no CSS
-                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . getCurrentExtensionName() . ',always_active=' . getExtensionAlwaysActive() . ', ext_ver=' . getCurrentExtensionVersion());
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . getCurrentExtensionName() . ',always_active=' . getThisExtensionAlwaysActive() . ', ext_ver=' . getCurrentExtensionVersion());
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_extensions` (`ext_name`, `ext_active`, `ext_version`) VALUES ('%s','%s','%s')",
                                                array(
                                                        getCurrentExtensionName(),
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_extensions` (`ext_name`, `ext_active`, `ext_version`) VALUES ('%s','%s','%s')",
                                                array(
                                                        getCurrentExtensionName(),
-                                                       getExtensionAlwaysActive(),
+                                                       getThisExtensionAlwaysActive(),
                                                        getCurrentExtensionVersion()
                                                ), __FUNCTION__, __LINE__);
                                }
                                                        getCurrentExtensionVersion()
                                                ), __FUNCTION__, __LINE__);
                                }
@@ -1175,13 +1175,13 @@ function setExtensionAlwaysActive ($active) {
 }
 
 // Getter for EXT_ALWAYS_ACTIVE flag
 }
 
 // Getter for EXT_ALWAYS_ACTIVE flag
-function getExtensionAlwaysActive () {
+function getThisExtensionAlwaysActive () {
        return $GLOBALS['ext_always_active'][getCurrentExtensionName()];
 }
 
 // Checks wether the current extension is always active
        return $GLOBALS['ext_always_active'][getCurrentExtensionName()];
 }
 
 // Checks wether the current extension is always active
-function isExtensionAlwaysActive () {
-       return (getExtensionAlwaysActive() == 'Y');
+function isThisExtensionAlwaysActive () {
+       return (getThisExtensionAlwaysActive() == 'Y');
 }
 
 // Setter for EXT_VERSION flag
 }
 
 // Setter for EXT_VERSION flag
@@ -1883,6 +1883,18 @@ function addSponsorMenuSql ($action, $what, $title, $active, $sort) {
        }
 }
 
        }
 }
 
+// Add configuration entry if not found for actual extension
+function addConfigAddSql ($columnName, $columnSql) {
+       // Is the column there?
+       if (!isSqlTableColumnFound('{?_MYSQL_PREFIX?}_config', $columnName)) {
+               // Not found, so add it
+               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `' . $columnName . '` ' . $columnSql);
+       } else {
+               // Add debug line
+               logDebugMessage(__FUNCTION__, __LINE__, 'Configuration entry ' . $columnName . ' already created. columnSql=' . $columnSql);
+       }
+}
+
 // Enables/disables productive mode for current extension (used only while
 // registration).
 function enableExtensionProductive ($isProductive = true) {
 // Enables/disables productive mode for current extension (used only while
 // registration).
 function enableExtensionProductive ($isProductive = true) {
@@ -1956,5 +1968,6 @@ function isExtensionLibraryLoaded ($ext_name) {
        // Is it there?
        return ((isset($GLOBALS['ext_loaded']['library'][$ext_name])) && ($GLOBALS['ext_loaded']['library'][$ext_name] === true));
 }
        // Is it there?
        return ((isset($GLOBALS['ext_loaded']['library'][$ext_name])) && ($GLOBALS['ext_loaded']['library'][$ext_name] === true));
 }
+
 // [EOF]
 ?>
 // [EOF]
 ?>