Page 1 of 1
Missing hooks/links-nav title
Posted: 2019-11-24 10:40
by onoehring
Hi,
AG 5.81.
I notice, that when I add a new item to a menu in hooks/links-navmenu.php like this
Code: Select all
$navLinks[] = array(
'url' => 'hooks/setup_googleauth.php',
'title' => 'Google Authenticator',
'icon' => '/resources/table_icons/googleauthenticator.png',
'groups' => array('*'),
'table_group' => 1
);
but the user has no access permissions to any of the regular tables in that group (group ID 1) there is no headline for the menu ... which is ... confusing

:

- ec-miss.png (6.75 KiB) Viewed 6600 times
A user with permissions to tables in that group sees this like shown here:

- ec-miss2.png (13.07 KiB) Viewed 6599 times
Is there a way to add a completely new menu to the links-section and give that menu a/the title I want? This is a possible workaround, but not a real solution to the problem described I believe.
Olaf
Re: Missing hooks/links-nav title
Posted: 2019-11-24 12:42
by ronwill
Don't you need a comma end of table group line!
i.e.
'table_group' => 1,
Cheers, Ron
Re: Missing hooks/links-nav title
Posted: 2019-11-24 13:10
by onoehring
Hi Ron,
I believe no, as the array ends there... checking ... no, No difference.
php: The comma would not need to be after the last "entry" before the closesing ) - the array ends there, so no comma needed.
Olaf
Re: Missing hooks/links-nav title
Posted: 2019-11-26 00:03
by ronwill
Hi Olaf,
Agree, comma was not needed, I tried your code (changed to point to a file/icon existing in my project and as it worked fine for me (I'm using latest version) I can't re-create the issue.
As a workaround that I've used in the past (for a different reason: To have my added hooks/php file show in main menu area in a position I want, not added to bottom of a menu under a break line as happens when using links-navmenu.php).
I simply create a new table in AppGini with just an id + text field, name this table similar to my created hooks.php file, then select the table group I want it to belong to. I then go to the created hooks file for this dummy table.php file and under the header function I point it to the hooks file i want i.e, for your case:
case 'tableview':
header('Location: hooks/setup_googleauth.php');
This works fine for me and does not get overwritten as a bonus lol. I think it will give you the result you need. I don't know coding so I always look for alternative solutions!
Cheers, Ron
Re: Missing hooks/links-nav title
Posted: 2019-11-26 04:11
by onoehring
Hi Ron,
sounds good. I will try that, but i still think it's a workaround. Does on really need fields in the simply AG table which is used to create the navigation link, or did you try to create a table only without any fields?
I agree that the line between AG tables and added links-files in the menu has it's good, but also it's bad.
Olaf
Re: Missing hooks/links-nav title
Posted: 2019-11-26 17:06
by ronwill
Needs field or it gives error that table has no fields on generating project.
Ron
Re: Missing hooks/links-nav title
Posted: 2019-11-26 17:57
by onoehring
Hi Ron,
thanks for trying and reporting.
Olaf