./inc/functions.php:1593: // @TODO Are these convertions still required?
./inc/functions.php:1611:// @TODO Rewrite this function to use readFromFile() and writeToFile()
./inc/functions.php:181:// @TODO Rewrite this to an extension 'smtp'
-./inc/functions.php:2277: // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2271: // @TODO This is still very static, rewrite it somehow
./inc/gen_sql_patches.php:94:// @TODO Rewrite this to a filter
./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
./inc/language/de.php:1091:// @TODO Rewrite these two constants
./inc/language/de.php:1106:// @TODO Rewrite these three constants
./inc/language/de.php:286: // @TODO Following two are unused?
-./inc/language/de.php:789:// @TODO Are these constants longer used?
+./inc/language/de.php:790:// @TODO Are these constants longer used?
./inc/language-functions.php:243: // @TODO These are all valid languages, again hard-coded
./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no *
// Remove both for extension name
$extName = substr($baseFile, strlen($prefix), -4);
- // Is the extension valid and active?
- if (isExtensionNameValid($extName)) {
- // Then add this file
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension entry ' . $baseFile . ' added.');
+ // Add file with or without base path
+ if ($addBaseDir === true) {
+ // With base path
$files[] = $fileName;
} else {
- // Add non-extension files as well
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Regular entry ' . $baseFile . ' added.');
- if ($addBaseDir === true) {
- $files[] = $fileName;
- } else {
- $files[] = $baseFile;
- }
+ // No base path
+ $files[] = $baseFile;
}
} else {
// We found .php file but should not search for them, why?
'GUEST_STATS_YREGISTER' => "Gestrige Anmeldungen",
'GUEST_STATS_INACTIVE' => "Mitgliederstatistik deaktiviert",
'ADMIN_CHANGE_MENUS' => "Ändern",
- 'ADMIN_CHANGE_MEMBER_MENU' => "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmenüs",
+ 'ADMIN_CHANGE_MEMBER_MENU_TITLE' => "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmenüs",
+ 'ADMIN_CHANGE_GUEST_MENU_TITLE' => "Verdecken, anzeigen, deaktivieren, aktivieren des Gastmenüs",
'ADMIN_CHANGE_MENU' => "Ändern von <span class=\"data\">%s</span> Menüeinträgen",
'ADMIN_IS_VISIBLE' => "Wird angezeigt",
'ADMIN_IS_ACTIVE' => "Aktiviert",
'CLICK_NOW' => "Hier bestätigen",
'MAILID_LINK' => "Best.-Link",
'UNKNOWN_MAILID_CODE' => "Unbekannter Fehler-Code <span class=\"data\">%s</span> erkannt.",
- 'ADMIN_CHANGE_GUEST_MENU_TITLE' => "Verdecken, anzeigen, deaktivieren, aktivieren des Gastmenüs",
'ADMIN_MENU_IS_LOCKED' => "Ist gesperrt",
'ADMIN_REMOVE_STATS_ENTRY' => "Hier klicken, um Mitgliederstatistik zu entfernen.",
'ADMIN_USER_STATS_REMOVED' => "Mitgliederstatistiken entfernt.",
// Generate a selection box
function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
// Open the requested menu directory
- $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), '', false, false);
+ $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), $type . '-', false, false);
// Init the selection box
$OUT = '<select name="' . $name . '" class="form_select" size="1"><option value="">{--ADMIN_IS_TOP_MENU--}</option>';
}
}
+// Process menu editing form
+function adminProcessMenuEditForm ($type, $subMenu) {
+ // An action is done...
+ foreach (postRequestParameter('sel') as $sel => $menu) {
+ $AND = "(`what` = '' OR `what` IS NULL)";
+
+ $sel = bigintval($sel);
+
+ if (!empty($subMenu)) {
+ $AND = "`action`='" . $subMenu . "'";
+ } // END - if
+
+ switch (postRequestParameter('ok')) {
+ case 'edit': // Edit menu
+ if (postRequestParameter('sel_what', $sel) == '') {
+ // Update with 'what'=null
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s', `action`='%s', `what`=NULL WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(
+ $type,
+ $menu,
+ postRequestParameter('sel_action', $sel),
+ $sel
+ ), __FILE__, __LINE__);
+ } else {
+ // Update with selected 'what'
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(
+ $type,
+ $menu,
+ postRequestParameter('sel_action', $sel),
+ postRequestParameter('sel_what', $sel),
+ $sel
+ ), __FILE__, __LINE__);
+ }
+ break;
+
+ case 'delete': // Delete menu
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array($type, $sel), __FILE__, __LINE__);
+ break;
+
+ case 'status': // Change status of menus
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array($type, postRequestParameter('visible', $sel), postRequestParameter('locked', $sel), $sel), __FILE__, __LINE__);
+ break;
+
+ default: // Unexpected action
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestParameter('ok')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
+ break;
+ } // END - switch
+ } // END - foreach
+
+ // Load template
+ loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}');
+}
+
+// Handle weightning
+function doAdminProcessMenuWeightning ($type) {
+ // Are there all required (generalized) GET parameter?
+ if ((isGetRequestParameterSet('act')) && (isGetRequestParameterSet('tid')) && (isGetRequestParameterSet('fid'))) {
+ // Init variables
+ $tid = ''; $fid = '';
+
+ // Get ids
+ if (isGetRequestParameterSet('w')) {
+ // Sub menus selected
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
+ array(
+ $type,
+ getRequestParameter('act'),
+ bigintval(getRequestParameter('tid'))
+ ), __FILE__, __LINE__);
+ list($tid) = SQL_FETCHROW($result);
+ SQL_FREERESULT($result);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
+ array(
+ $type,
+ 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?}_%s_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
+ array(
+ $type,
+ bigintval(getRequestParameter('tid'))
+ ), __FILE__, __LINE__);
+ list($tid) = SQL_FETCHROW($result);
+ SQL_FREERESULT($result);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
+ array(
+ $type,
+ bigintval(getRequestParameter('fid'))
+ ), __FILE__, __LINE__);
+ list($fid) = SQL_FETCHROW($result);
+ SQL_FREERESULT($result);
+ }
+
+ if ((!empty($tid)) && (!empty($fid))) {
+ // Sort menu
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(
+ $type,
+ bigintval(getRequestParameter('tid')),
+ bigintval($fid)
+ ), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(
+ $type,
+ bigintval(getRequestParameter('fid')),
+ bigintval($tid)
+ ), __FILE__, __LINE__);
+ } // END - if
+ } // END - if
+}
+
// [EOF]
?>
break;
}
} else {
- if ((isGetRequestParameterSet('act')) && (isGetRequestParameterSet('tid')) && (isGetRequestParameterSet('fid'))) {
- // Get ids
- if (isGetRequestParameterSet('w')) {
- // Sub menus selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `what` != '%s' AND `sort`=%s LIMIT 1",
- array(
- getRequestParameter('w'),
- bigintval(getRequestParameter('tid'))
- ), __FILE__, __LINE__);
- list($tid) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `what`='%s' AND `sort`=%s LIMIT 1",
- array(
- getRequestParameter('w'),
- 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?}_admin_menu` WHERE `action` != %s AND ".$AND." AND `sort`=%s LIMIT 1",
- array(
- getRequestParameter('act'),
- bigintval(getRequestParameter('tid'))
- ), __FILE__, __LINE__);
- list($tid) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`=%s AND ".$AND." AND `sort`=%s LIMIT 1",
- array(
- getRequestParameter('act'),
- bigintval(getRequestParameter('fid'))
- ), __FILE__, __LINE__);
- list($fid) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- }
-
- // Do we have entries found?
- if ((!empty($tid)) && (!empty($fid))) {
- // Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_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?}_admin_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(
- bigintval(getRequestParameter('fid')),
- bigintval($tid)
- ), __FILE__, __LINE__);
- } // END - if
- } // END - if
+ // Handle weightning
+ doAdminProcessMenuWeightning('guest');
// Run SQL
$result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
addMenuDescription('admin', __FILE__);
// Do we edit/delete/change main menus or sub menus?
-$AND = "(`what` = '' OR `what` IS NULL)"; $SUB = '';
+$AND = "(`what` = '' OR `what` IS NULL)"; $subMenu = '';
if (isGetRequestParameterSet('sub')) {
$AND = sprintf("`action`='%s' AND `what` IS NOT NULL", getRequestParameter('sub'));
- $SUB = getRequestParameter('sub');
+ $subMenu = getRequestParameter('sub');
} // END - if
// List all menu points and make them editable
if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Edit menu entries
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
$content['chk'] = countPostSelection();
$cnt = '0'; $OUT = '';
loadTemplate('admin_edit_guest_menu_form', false, $content);
} elseif ((isFormSent('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
$content['chk'] = countPostSelection();
$cnt = '0';
// Load template
loadTemplate('admin_delete_guest_menu', false, $content);
-} elseif ((isFormSent()) && (!isDemoModeActive())) {
- // An action is done...
- switch (postRequestParameter('ok')) {
- case 'edit': // Edit menu
- foreach (postRequestParameter('sel') as $sel => $menu) {
- // Secure selector
- $sel = bigintval($sel);
-
- // Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array($menu, postRequestParameter('sel_action', $sel), postRequestParameter('sel_what', $sel), $sel),__FILE__, __LINE__);
- } // END - foreach
- loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}');
- break;
-
- case 'delete': // Delete menu
- foreach (postRequestParameter('sel') as $sel => $menu) {
- // Delete enty
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- } // END - foreach
- loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}');
- break;
-
- case 'status': // Change access levels
- foreach (postRequestParameter('sel') as $sel => $menu) {
- // Secure selector
- $sel = bigintval($sel);
-
- // Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(postRequestParameter('visible', $sel), postRequestParameter('locked', $sel), $sel), __FILE__, __LINE__);
- } // END - foreach
- loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}');
- break;
-
- default: // Unexpected action
- logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestParameter('ok')));
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
- break;
- } // END - switch
} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change status (visible / locked)
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
$content['chk'] = countPostSelection();
// Load template
// Load template
loadTemplate('admin_guest_menu_status', false, $content);
+} elseif ((isFormSent()) && (!isDemoModeActive())) {
+ // An action is done...
+ adminProcessMenuEditForm('guest', $subMenu);
} else {
- if ((isGetRequestParameterSet('act')) && (isGetRequestParameterSet('tid')) && (isGetRequestParameterSet('fid'))) {
- // Get ids
- if (isGetRequestParameterSet('w')) {
- // Sub menus selected
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
- array(getRequestParameter('act'), bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
- list($tid) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
- array(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?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
- array(bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
- list($tid) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
- array(bigintval(getRequestParameter('fid'))), __FILE__, __LINE__);
- list($fid) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- }
-
- if ((!empty($tid)) && (!empty($fid))) {
- // Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_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?}_guest_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
- } // END - if
- } // END - if
+ // Handle weightning
+ doAdminProcessMenuWeightning('guest');
// By default list menus
- if (empty($SUB)) {
+ if (empty($subMenu)) {
// List only main menus
$result = SQL_QUERY("SELECT `id`,`action`,`what`,`title`,`sort` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
} else {
// List sub menus
$result = SQL_QUERY_ESC("SELECT `id`,`action`,`what`,`title`,`sort` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
- array($SUB), __FILE__, __LINE__);
+ array($subMenu), __FILE__, __LINE__);
}
// Do we have entries?
if (SQL_NUMROWS($result) > 0) {
// Set sub value
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
// Init variables
$cnt = '0';
// Process all menu entries
while ($data = SQL_FETCHARRAY($result)) {
$cnt++;
- if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
+ if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($subMenu)))) {
// Is highest position
$NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
} elseif ($cnt == SQL_NUMROWS($result)) {
addMenuDescription('admin', __FILE__);
// Do we edit/delete/change main menus or sub menus?
-$AND = "(`what` = '' OR `what` IS NULL)"; $SUB = '';
+$AND = "(`what` = '' OR `what` IS NULL)"; $subMenu = '';
if (isGetRequestParameterSet('sub')) {
$AND = sprintf("`action`='%s' AND `what` IS NOT NULL", getRequestParameter('sub'));
- $SUB = getRequestParameter('sub');
+ $subMenu = getRequestParameter('sub');
} // END - if
// List all menu points and make them editable
if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Edit menu entries
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
$content['chk'] = countPostSelection();
$cnt = '0'; $OUT = '';
foreach (postRequestParameter('sel') as $sel => $confirm) {
'cnt' => $cnt,
'sel' => $sel,
'menu' => $data['title'],
- 'act' => adminAddMenuSelectionBox('member', 'act' , 'sel_act[' . $sel . ']', $data['action']),
- 'what' => adminAddMenuSelectionBox('member', 'what', 'sel_what[' . $sel . ']', $data['what']),
+ 'action' => adminAddMenuSelectionBox('member', 'action', 'sel_action[' . $sel . ']', $data['action']),
+ 'what' => adminAddMenuSelectionBox('member', 'what' , 'sel_what[' . $sel . ']', $data['what']),
);
// Load template
loadTemplate('admin_edit_member_menu', false, $content);
} elseif ((isFormSent('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
$content['chk'] = countPostSelection();
$cnt = '0'; $OUT = '';
foreach (postRequestParameter('sel') as $sel => $confirm) {
loadTemplate('admin_delete_member_menu', false, $content);
} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change status (visible / locked)
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
$content['chk'] = countPostSelection();
$cnt = '0'; $OUT = '';
foreach (postRequestParameter('sel') as $sel => $confirm) {
// Load template
loadTemplate('admin_member_menu_status', false, $content);
} elseif ((isFormSent()) && (!isDemoModeActive())) {
- // An act is done...
- foreach (postRequestParameter('sel') as $sel => $menu) {
- $AND = "(`what` = '' OR `what` IS NULL)";
-
- $sel = bigintval($sel);
-
- if (!empty($SUB)) $AND = "`action`='" . $SUB . "'";
-
- switch (postRequestParameter('ok')) {
- case 'edit': // Edit menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array($menu, postRequestParameter('sel_act', $sel), postRequestParameter('sel_what', $sel), $sel), __FILE__, __LINE__);
- break;
-
- case 'delete': // Delete menu
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
- array($sel), __FILE__, __LINE__);
- break;
-
- case 'status': // Change status of menus
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(postRequestParameter('visible', $sel), postRequestParameter('locked', $sel), $sel), __FILE__, __LINE__);
- break;
-
- default: // Unexpected action
- logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestParameter('ok')));
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
- break;
- } // END - switch
- } // END - foreach
-
- // Load template
- loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}');
+ // Process menu editing form
+ adminProcessMenuEditForm('member', $subMenu);
} else {
- if ((isGetRequestParameterSet('act')) && (isGetRequestParameterSet('tid')) && (isGetRequestParameterSet('fid'))) {
- // Init
- $tid = ''; $fid = '';
-
- // 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
- } // END - -fi
- } // END - if
+ // Handle weightning
+ doAdminProcessMenuWeightning('guest');
- if (!empty($SUB)) {
+ if (!empty($subMenu)) {
// Edit sub menus
$result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", __FILE__, __LINE__);
} else {
// Some are there?
if (SQL_NUMROWS($result) > 0) {
// Set sub value
- $content['sub'] = $SUB;
+ $content['sub'] = $subMenu;
$cnt = '0'; $OUT = '';
while ($data = SQL_FETCHARRAY($result)) {
// Init navigation
$data['navi'] = '';
$cnt++;
- if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
+ if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($subMenu)))) {
// Is highest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
} elseif ($cnt == SQL_NUMROWS($result)) {