]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_points.php
Next wave of lesser getMessage()
[mailer.git] / inc / modules / admin / what-config_points.php
index 92845f6c658eb96856cf44f290671b32ef4d223a..06b6f2b76238270b9a0aa517d534dfbf9c8de1d3 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -64,7 +65,7 @@ if (isGetRequestParameterSet('sub')) {
                                }
                        }
                        break;
-       }
+       } // END - switch
 } else {
        // Display overview
        setGetRequestParameter('sub', 'overview');
@@ -74,7 +75,7 @@ if (isFormSent()) {
        initSqls();
        switch (getRequestParameter('sub')) {
                case 'points':
-                       updateConfiguration(array('points_register', 'points_ref'), array(postRequestParameter('points_register'), postRequestParameter('points_ref')));
+                       adminSaveSettingsFromPostData();
                        break;
 
                case 'ref':
@@ -96,7 +97,7 @@ if (isFormSent()) {
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refdepths` SET `level`='%s', `percents`='%s' WHERE `id`=%s LIMIT 1",
                                                array(bigintval($value), postRequestParameter('percents', $id), $id), __FILE__, __LINE__);
                                        }
-                                       $message = getMessage('REF_DEPTHS_SAVED');
+                                       $message = '{--REF_DEPTHS_SAVED--}';
                                        break;
 
                                case 'del':
@@ -104,14 +105,15 @@ if (isFormSent()) {
                                                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
                                                array(bigintval($id)), __FILE__, __LINE__);
                                        }
-                                       $message = getMessage('REF_DEPTHS_DELETED');
+                                       $message = '{--REF_DEPTHS_DELETED--}';
                                        break;
                        }
 
                        // Update cache file
-                       if (getExtensionVersion('cache') >= '0.1.2') {
+                       // @TODO Rewrite this to a filter
+                       if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
                                if ($GLOBALS['cache_instance']->loadCacheFile('refdepths')) $GLOBALS['cache_instance']->removeCacheFile();
-                       }
+                       } // END - if
                        break;
 
                case 'settings':
@@ -131,7 +133,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
                                addSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `locked_points`=0 WHERE `locked_points` > 0");
                        }
                        break;
-       }
+       } // END - if
 
        if ((isSqlsValid()) && (isSqlsValid())) {
                if (strpos($GLOBALS['sqls'][0], 'INSERT') > -1) {
@@ -145,10 +147,10 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
                        runFilterChain('run_sqls');
 
                        // Entry saved...
-                       $message = getMessage('SETTINGS_SAVED');
+                       $message = '{--SETTINGS_SAVED--}';
 
                        // Destroy config cache file here...
-                       rebuildCacheFile('config', 'config');
+                       rebuildCache('config', 'config');
                } else {
                        // Prepare failed-message
                        $message = '<span class="admin_failed">{--SETTINGS_NOT_SAVED--}</span>';
@@ -182,7 +184,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
        loadTemplate('admin_config_point_settings', false, $content);
 } elseif (getRequestParameter('sub') == 'ref') {
        // 12                  3     32    2                  3     32    2               3            4     43    21
-       if ((isPostRequestParameterSet('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+       if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
                // Delete entries
                $OUT = ''; $SW = 2;
                foreach (postRequestParameter('sel') as $id => $value) {
@@ -206,7 +208,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
 
                // Load main template
                loadTemplate('admin_points_del', false, $OUT);
-       } elseif ((isPostRequestParameterSet('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+       } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
                // Edit entries
                $OUT = ''; $SW = 2;
                foreach (postRequestParameter('sel') as $id => $value) {