You probably know the problems with shifting menu indexes depending on permissions on tables when adding a custom menu item:
I have written a short PHP function for automatically finding the correct menu index:
https://appgini.bizzworxx.de/appgini/cu ... able-name/
With this function, custom menu items will be placed in the right menu even if menus before are not rendered due to permissions.
TL;DR
Code: Select all
function getTableGroupIndexByTableName($tn, $default = null)
{
$i = 0;
foreach (get_table_groups(false) as $tgc => $tns) {
if (in_array($tn, $tns)) return $i;
$i++;
}
return $default;
}