X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-memedit.php;h=658f45675cc87a83e3965e671218a315cb4d3d50;hb=22f132c8d6314f76c69dff58ec0dac21f5ca3bf2;hp=0349a74b3563586efb42342571885c8e262c75b0;hpb=cf3765c38cf0a76f396aca291f71858936e92956;p=mailer.git
diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php
index 0349a74b35..658f45675c 100644
--- a/inc/modules/admin/what-memedit.php
+++ b/inc/modules/admin/what-memedit.php
@@ -54,7 +54,7 @@ if (isGetRequestParameterSet('sub')) {
} // END - if
// List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Edit menu entries
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
@@ -76,7 +76,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
);
// Load template
- $OUT .= loadTemplate('admin_mmenu_edit_row', true, $data);
+ $OUT .= loadTemplate('admin_edit_member_menu_row', true, $data);
} else {
// Entry not found?
$data = array(
@@ -95,8 +95,8 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
$content['cnt'] = $cnt;
// Load template
- loadTemplate('admin_mmenu_edit', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+ loadTemplate('admin_edit_member_menu', false, $content);
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
@@ -116,7 +116,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
);
// Load template
- $OUT .= loadTemplate('admin_mmenu_delete_row', true, $content);
+ $OUT .= loadTemplate('admin_del_member_menu_row', true, $content);
} else {
// Entry not found?
$content = array(
@@ -133,8 +133,8 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
$content['cnt'] = $cnt;
// Load template
- loadTemplate('admin_mmenu_delete', false, $content);
-} elseif ((isPostRequestParameterSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+ loadTemplate('admin_del_member_menu', false, $content);
+} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change status (visible / locked)
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
@@ -173,7 +173,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
$content['cnt'] = $cnt;
// Load template
- loadTemplate('admin_mmenu_status', false, $content);
+ loadTemplate('admin_member_menu_status', false, $content);
} elseif ((isFormSent()) && (!isDemoModeActive())) {
// An act is done...
foreach (postRequestParameter('sel') as $sel => $menu) {
@@ -216,29 +216,29 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
// Get ids
if (isGetRequestParameterSet('w')) {
// Sub menus selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('act')), bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('act')), bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
} else {
// Main menu selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
array(bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
}
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('tid')), bigintval($fid)), __FILE__, __LINE__);
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
} // END - -fi
} // END - if
@@ -251,11 +251,8 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
$result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
}
- // Get total menu entries
- $max = SQL_NUMROWS($result);
-
// Some are there?
- if ($max > 0) {
+ if (SQL_NUMROWS($result) > 0) {
// Set sub value
$content['sub'] = $SUB;
@@ -267,7 +264,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
$data['navi'] = '{--LOWER--}';
- } elseif ($cnt == $max) {
+ } elseif ($cnt == SQL_NUMROWS($result)) {
// Is lowest position
$data['navi'] = '{--HIGHER--}';
} elseif ($data['sort'] > 0) {
@@ -294,7 +291,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_mmenu_overview', false, $content);
+ loadTemplate('admin_member_menu_overview', false, $content);
} else {
// Menu entries are missing... (???)
loadTemplate('admin_settings_saved', false, '{--ADMIN_NO_MENUS_FOUND--}');