}
}
break;
- }
+ } // END - switch
} else {
// Display overview
setGetRequestParameter('sub', 'overview');
initSqls();
switch (getRequestParameter('sub')) {
case 'points':
- updateConfiguration(array('points_register', 'points_ref'), array(postRequestParameter('points_register'), postRequestParameter('points_ref')));
+ adminSaveSettingsFromPostData();
break;
case 'ref':
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':
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':
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) {
runFilterChain('run_sqls');
// Entry saved...
- $message = getMessage('SETTINGS_SAVED');
+ $message = '{--SETTINGS_SAVED--}';
// Destroy config cache file here...
rebuildCache('config', 'config');
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) {
// 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) {