-global $link;
-$ACTIONs = array();
-// First fix all main menus (what='')...
-$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
-$cnt = 0; $REP = 0;
-while(list($id, $act) = SQL_FETCHROW($result_fix))
-{
- // Store action value for later usage in sorting sub menus
- $ACTIONs[] = $act;
+// First fix all main menus (what = '')...
+$result_fix = SQL_QUERY("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
+$count = '0'; $repairedWeights = '0';
+while ($content = SQL_FETCHARRAY($result_fix)) {
+ // Store act value for later usage in sorting sub menus
+ $actions[] = $content['action'];