- array($menu), __FUNCTION__, __LINE__);
-
- // Remember the count for later checks
- setAdminMenuHasEntries($menu, ((!SQL_HASZERONUMS($result_what)) && ($action == $menu)));
-
- // Do we have entries?
- if ((ifAdminMenuHasEntries($menu)) && (!SQL_HASZERONUMS($result_what))) {
- $GLOBALS['menu']['description'] = array();
- $GLOBALS['menu']['title'] = array();
- $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)) {
- // Filename
- $inc = sprintf("inc/modules/admin/what-%s.php", $what_sub);
-
- // Is the file readable?
- $readable = isIncludeReadable($inc);
-
- // Is the current admin allowed to access this 'what' menu?
- if (isAdminAllowedAccessMenu(null, $what_sub)) {
- // Insert compiled title and description
- $GLOBALS['menu']['title'][$what_sub] = $title_what;
- $GLOBALS['menu']['description'][$what_sub] = $desc_what;
- $OUT .= '<li class="admin_menu">
+ array($mainContent['main_action']), __FUNCTION__, __LINE__);
+
+ // Remember the count for later checks
+ setAdminMenuHasEntries($mainContent['main_action'], ((!SQL_HASZERONUMS($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
+
+ // Start li-tag for sub menu content
+ $OUT .= '<li class="admin_menu_sub" id="action_menu_' . $mainContent['main_action'] . '"' . addStyleMenuContent('admin', $mainContent['main_action'], $action) . '>';
+
+ // Do we have entries?
+ if (ifAdminMenuHasEntries($mainContent['main_action'])) {
+ // Sub menu has been called
+ $SUB = true;
+ $OUT .= '<ul class="admin_menu_sub">';
+
+ // Load all entries
+ while ($subContent = SQL_FETCHARRAY($result_what)) {
+ // Filename
+ $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, $subContent['sub_what'])) {
+ // Insert compiled title and description
+ $GLOBALS['menu']['title'][$subContent['sub_what']] = $subContent['sub_title'];
+ $GLOBALS['menu']['description'][$subContent['sub_what']] = $subContent['sub_descr'];
+ $OUT .= '<li class="admin_menu">