./inc/mails/doubler_mails.php:53:// @TODO Can this be rewritten to a filter?
./inc/module-functions.php:267: // @TODO Nothing helped???
./inc/module-functions.php:308: // @TODO Rewrite this to a filter
-./inc/modules/admin/admin-inc.php:1423: // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
+./inc/modules/admin/admin-inc.php:1426: // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
./inc/modules/admin/admin-inc.php:171: // @TODO This and the next getCurrentAdminId() call might be moved into the templates?
./inc/modules/admin/admin-inc.php:242: // @TODO This can be rewritten into a filter
-./inc/modules/admin/admin-inc.php:274: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:342: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:487:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
+./inc/modules/admin/admin-inc.php:490:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
./inc/modules/admin/overview-inc.php:162: // @TODO Rewrite this to a filter
./inc/modules/admin/overview-inc.php:275: // @TODO Rewrite this to something with include files and/or filter
./inc/modules/admin/overview-inc.php:309: // @TODO This may also be rewritten to include files
./inc/loader/load_cache-revision.php:2:// @DEPRECATED
./inc/loader/load_cache-them.php:2:// @DEPRECATED
./inc/loader/load-extensions.php:2:// @DEPRECATED
-./inc/modules/admin/admin-inc.php:488:// @DEPRECATED
+./inc/modules/admin/admin-inc.php:491:// @DEPRECATED
./inc/modules/admin/what-chk_regs.php:2:// @DEPRECATED
./inc/modules/admin/what-config_admins.php:2:// @DEPRECATED
./inc/modules/admin/what-config_email.php:2:// @DEPRECATED
}
// Adds an admin menu
-function addAdminMenu ($action, $what, $return = false) {
+function addAdminMenu ($action, $what) {
// Init variables
$SUB = false;
$OUT = '';
// Menu descriptions
$GLOBALS['menu']['description'] = array();
- $GLOBALS['menu']['title'] = array();
+ $GLOBALS['menu']['title'] = array();
// Build main menu
$result_main = SQL_QUERY("SELECT
- `action`,`title`,`descr`
+ `action` AS `main_action`,
+ `title` AS `main_title`,
+ `descr` AS `main_descr`
FROM
`{?_MYSQL_PREFIX?}_admin_menu`
WHERE
// Do we have entries?
if (!SQL_HASZERONUMS($result_main)) {
$OUT .= '<ul class="admin_menu_main">';
- // @TODO Rewrite this to $content = SQL_FETCHARRAY()
- while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
+
+ // Load all 'action' menus
+ while ($mainContent = SQL_FETCHARRAY($result_main)) {
// Filename
- $inc = sprintf("inc/modules/admin/action-%s.php", $menu);
+ $inc = sprintf("inc/modules/admin/action-%s.php", $mainContent['main_action']);
// Is the file readable?
$readable = isIncludeReadable($inc);
// Is the current admin allowed to access this 'action' menu?
- if (isAdminAllowedAccessMenu($menu)) {
+ if (isAdminAllowedAccessMenu($mainContent['main_action'])) {
if ($SUB === false) {
// Insert compiled menu title and description
- $GLOBALS['menu']['title'][$menu] = $title;
- $GLOBALS['menu']['description'][$menu] = $descr;
+ $GLOBALS['menu']['title'][$mainContent['main_action']] = $mainContent['main_title'];
+ $GLOBALS['menu']['description'][$mainContent['main_action']] = $mainContent['main_descr'];
} // END - if
$OUT .= '<li class="admin_menu">
<div class="nobr"><strong>·</strong> ';
if ($readable === true) {
- if (($menu == $action) && (empty($what))) {
+ if (($mainContent['main_action'] == $action) && (empty($what))) {
$OUT .= '<strong>';
} else {
- $OUT .= '[<a href="{%url=modules.php?module=admin&action=' . $menu . '%}">';
+ $OUT .= '[<a href="{%url=modules.php?module=admin&action=' . $mainContent['main_action'] . '%}">';
}
} else {
- $OUT .= '<span class="bad" style="cursor:help" title="{%message,ADMIN_MENU_ACTION_404_TITLE=' . $menu . '%}">';
+ $OUT .= '<span class="bad" style="cursor:help" title="{%message,ADMIN_MENU_ACTION_404_TITLE=' . $mainContent['main_action'] . '%}">';
}
- $OUT .= $title;
+ $OUT .= $mainContent['main_title'];
if ($readable === true) {
- if (($menu == $action) && (empty($what))) {
+ if (($mainContent['main_action'] == $action) && (empty($what))) {
$OUT .= '</strong>';
} else {
$OUT .= '</a>]';
// Check for menu entries
$result_what = SQL_QUERY_ESC("SELECT
- `what`,
- `title`,
- `descr`
+ `what` AS `sub_what`,
+ `title` AS `sub_title`,
+ `descr` AS `sub_descr`
FROM
`{?_MYSQL_PREFIX?}_admin_menu`
WHERE
ORDER BY
`sort` ASC,
`id` DESC",
- array($menu), __FUNCTION__, __LINE__);
+ array($mainContent['main_action']), __FUNCTION__, __LINE__);
// Remember the count for later checks
- setAdminMenuHasEntries($menu, ((!SQL_HASZERONUMS($result_what)) && ($action == $menu)));
+ setAdminMenuHasEntries($mainContent['main_action'], ((!SQL_HASZERONUMS($result_what)) && ($action == $mainContent['main_action'])));
+
+ // Start li-tag for sub menu content
+ $OUT .= '<li class="admin_menu_sub" id="action_menu_' . $mainContent['main_action'] . '">';
// Do we have entries?
- if ((ifAdminMenuHasEntries($menu)) && (!SQL_HASZERONUMS($result_what))) {
- $GLOBALS['menu']['description'] = array();
- $GLOBALS['menu']['title'] = array();
+ if (ifAdminMenuHasEntries($mainContent['main_action'])) {
+ // Sub menu has been called
$SUB = true;
- $OUT .= '<li class="admin_menu_sub"><ul class="admin_menu_sub">';
- // @TODO Rewrite this to $content = SQL_FETCHARRAY()
- while (list($what_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
+ $OUT .= '<ul class="admin_menu_sub">';
+
+ // Load all entries
+ while ($subContent = SQL_FETCHARRAY($result_what)) {
// Filename
- $inc = sprintf("inc/modules/admin/what-%s.php", $what_sub);
+ $inc = sprintf("inc/modules/admin/what-%s.php", $subContent['sub_what']);
// Is the file readable?
$readable = isIncludeReadable($inc);
// Is the current admin allowed to access this 'what' menu?
- if (isAdminAllowedAccessMenu(null, $what_sub)) {
+ if (isAdminAllowedAccessMenu(NULL, $subContent['sub_what'])) {
// Insert compiled title and description
- $GLOBALS['menu']['title'][$what_sub] = $title_what;
- $GLOBALS['menu']['description'][$what_sub] = $desc_what;
+ $GLOBALS['menu']['title'][$subContent['sub_what']] = $subContent['sub_title'];
+ $GLOBALS['menu']['description'][$subContent['sub_what']] = $subContent['sub_descr'];
$OUT .= '<li class="admin_menu">
<div class="nobr"><strong>--></strong> ';
if ($readable === true) {
- if ($what == $what_sub) {
+ if ($what == $subContent['sub_what']) {
$OUT .= '<strong>';
} else {
- $OUT .= '[<a href="{%url=modules.php?module=admin&what=' . $what_sub . '%}">';
+ $OUT .= '[<a href="{%url=modules.php?module=admin&what=' . $subContent['sub_what'] . '%}">';
}
} else {
- $OUT .= '<span class="bad" style="cursor:help" title="{%message,ADMIN_MENU_WHAT_404_TITLE=' . $what_sub . '%}">';
+ $OUT .= '<span class="bad" style="cursor:help" title="{%message,ADMIN_MENU_WHAT_404_TITLE=' . $subContent['sub_what'] . '%}">';
}
- $OUT .= $title_what;
+ $OUT .= $subContent['sub_title'];
if ($readable === true) {
- if ($what == $what_sub) {
+ if ($what == $subContent['sub_what']) {
$OUT .= '</strong>';
} else {
$OUT .= '</a>]';
// Free memory
SQL_FREERESULT($result_what);
- $OUT .= '</ul>
-</li>';
+ $OUT .= '</ul>';
} // END - if
+
+ // Close li-tag
+ $OUT .= '</li>';
} // END - if
} // END - while
$OUT .= '</ul>';
} // END - if
- // Is there a cache instance again?
- // Return or output content?
- if ($return === true) {
- return $OUT;
- } else {
- outputHtml($OUT);
- }
+ // Return content
+ return $OUT;
}
// Create an admin selection box form