Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / modules / admin / what-extensions.php
index af439d78c36529520ced37b279243b29008437b2..e9e8af84444012350c4640eb3985efb3c726dcad 100644 (file)
@@ -72,7 +72,7 @@ if (isGetRequestElementSet('register_ext')) {
                        } // END - if
 
                        // Update database
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1",
+                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1",
                                array(
                                        $active,
                                        bigintval($ext_id),
@@ -106,11 +106,11 @@ if (isGetRequestElementSet('register_ext')) {
                                // Update extension's record
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        // Update also CSS column when extensions ext-sql_patches is newer or exact v0.0.6
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='%s',`ext_active`='%s' WHERE `id`=%s LIMIT 1",
+                                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='%s',`ext_active`='%s' WHERE `id`=%s LIMIT 1",
                                                array(postRequestElement('css', $ext_id), $active, $ext_id), __FILE__, __LINE__);
                                } else {
                                        // When extension is older than v0.0.6 there is no column for the CSS information
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s LIMIT 1",
+                                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s LIMIT 1",
                                                array($active, $ext_id), __FILE__, __LINE__);
                                }
 
@@ -138,15 +138,15 @@ if (isGetRequestElementSet('register_ext')) {
 
                                // Load required data
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
-                                       $result = SQL_QUERY_ESC("SELECT `ext_has_css`, `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1",
+                                       $result = sqlQueryEscaped("SELECT `ext_has_css`, `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1",
                                                array(bigintval($ext_id)), __FILE__, __LINE__);
-                                       list($css, $active) = SQL_FETCHROW($result);
-                                       SQL_FREERESULT($result);
+                                       list($css, $active) = sqlFetchRow($result);
+                                       sqlFreeResult($result);
                                } else {
-                                       $result = SQL_QUERY_ESC("SELECT `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1",
+                                       $result = sqlQueryEscaped("SELECT `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1",
                                                array(bigintval($ext_id)), __FILE__, __LINE__);
-                                       list($active) = SQL_FETCHROW($result);
-                                       SQL_FREERESULT($result);
+                                       list($active) = sqlFetchRow($result);
+                                       sqlFreeResult($result);
                                        $css = 'X';
                                }
 
@@ -273,7 +273,7 @@ if (isGetRequestElementSet('register_ext')) {
 // Shall we display active/inactive extensions?
 $where = '';
 if (isGetRequestElementSet('active')) {
-       $where = sprintf("WHERE `ext_active`='%s'", SQL_ESCAPE(getRequestElement('active')));
+       $where = sprintf("WHERE `ext_active`='%s'", sqlEscapeString(getRequestElement('active')));
 } // END - if
 
 // Case selection
@@ -281,7 +281,7 @@ switch ($do) {
        case 'overview': // List all registered extensions
                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                        // Load extension data with CSS informations
-                       $result = SQL_QUERY('SELECT
+                       $result = sqlQuery('SELECT
        `id` AS `ext_id`,
        `ext_name`,
        `ext_active`,
@@ -294,7 +294,7 @@ ORDER BY
        `ext_name` ASC', __FILE__, __LINE__);
                } else {
                        // Load extension data without CSS informations
-                       $result = SQL_QUERY('SELECT
+                       $result = sqlQuery('SELECT
        `id` AS `ext_id`,
        `ext_name`,
        `ext_active`,
@@ -307,10 +307,10 @@ ORDER BY
                }
 
                // Are there some entries?
-               if (!SQL_HASZERONUMS($result)) {
+               if (!ifSqlHasZeroNums($result)) {
                        // Extensions are registered
                        $OUT = '';
-                       while ($content = SQL_FETCHARRAY($result)) {
+                       while ($content = sqlFetchArray($result)) {
                                // Prepare CSS selection output
                                $cssSelection = '---';
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
@@ -325,7 +325,7 @@ ORDER BY
                        } // END - while
 
                        // Free memory
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
 
                        // Load template
                        loadTemplate('admin_list_extensions', FALSE, $OUT);
@@ -342,12 +342,12 @@ ORDER BY
                // Is the id number valid and the task was found?
                if ((isValidId($taskId)) && ($numTasks > 0)) {
                        // id is valid so begin with registration, we first want to it's real name from task management (subject column)
-                       $result = SQL_QUERY_ESC("SELECT `subject` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1",
+                       $result = sqlQueryEscaped("SELECT `subject` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1",
                                array(bigintval($taskId)), __FILE__, __LINE__);
-                       list($subject) = SQL_FETCHROW($result);
+                       list($subject) = sqlFetchRow($result);
 
                        // Free result
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
 
                        // Disable cache update by default
                        $cache_update = '0';