Save to excel

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Save to excel

Post by jsetzer » 2023-02-08 10:59

I'm not using your AppGiniHelper plug-in
Custom navmenu links have nothing to do with AppGini Helper JavaScript Library.
---

Just have a look at the docs for navlinks, we have given before, and then review your code, especially the line in which you allow access to all ("*") groups. Obviously, this is not what you want.
'groups' => array('*')
You should replace * by the name of your Admins group.

I don't know your actual administrator's group name, wich is customizable. Try with 'Admins' or replace it with yours:

Code: Select all

'groups' => array('Admins'),
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

sblasic
Veteran Member
Posts: 53
Joined: 2021-02-22 15:55

Re: Save to excel

Post by sblasic » 2023-02-10 09:28

Hi guys!

Could anyone help me with this?

So, my question is: what I have to add to the code below to hide this link from non-admin users?

Code: Select all


$navLinks[] = [
		'url' => 'https://www.mysite.com/hooks/export.php', 
		'title' => 'Export to XLS', 
		'groups' => array('*'),
		'icon' => 'resources/table_icons/export.png',
		'table_group' => 0,
	];

Thank you in advance guys!

BR, Sinisa

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Save to excel

Post by jsetzer » 2023-02-10 10:30

I've already written the answer above.

Code: Select all

'groups' => array('Admins'),
Did you try it?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Save to excel

Post by jsetzer » 2023-02-10 11:40

By the way: if you plan yo move your site to a different server some day you should avoid absolute URLs:

Just replace this...

Code: Select all

'url' => 'https://www.mysite.com/hooks/export.php',
...by this:

Code: Select all

'url' => 'hooks/export.php',
Should work.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

sblasic
Veteran Member
Posts: 53
Joined: 2021-02-22 15:55

Re: Save to excel

Post by sblasic » 2023-02-11 09:52

@jsetzer

I'm sorry for not seeing your answer before!

Thank you for the tips and the for solution for showing this link for the admin only!

Regarding the documentation for the "navmenu syntax") - I have checked the link you gave me - but it was the link of your plugin AppGini Helper syntax for the navmenu... and could not find the explanation for the "array" command...

I get that the navmenu syntax is the same - plugin or no plugin - but I could not find what array command means... I have no PHP knowledge - that's obvious

In the regular BIGPROF SUPPORT page - I cannot find the documents which explains the navmenu syntax:

https://bigprof.com/appgini/help/advanced-topics

If you could pinpoint me to the "documents" file so I can study it - I'll highly appreciated that!

Best!

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Save to excel

Post by jsetzer » 2023-02-11 14:07

(1) In this thread @alisson has already mentioned the keyword "links-navmenu.php" a week ago:
(posting.php?mode=reply&f=7&t=4726#pr20850)
If you want to add a shortcut in the navbar use the "links-navmenu.php"
Also, @alisson has already given the sourcecode and some hints to you.

(2) I have also mentioned the keyword a week ago:
(posting.php?mode=reply&f=7&t=4726#pr20838)
For adding custom navbar menu items with AppGini built-in features check out the AppGini documentation for links-navmenu.php.
If your help and tips are not enough, just search the docs or search this forum or Google for "AppGini links-navmenu". You will find many examples.

(3) How to find the file

In your code editor or development environment (IDE), just search for and open the file navmenu.php we have named
Code_XOEOhVO8jj.gif
Code_XOEOhVO8jj.gif (204.69 KiB) Viewed 1334 times

(4) This is the documentation page for custom nav menu items

https://bigprof.com/appgini/help/advanc ... r-contents

Find "links-navmenu.php" there.

(5) This is the documentation right inside the file hooks/links-navmenu.php

From my point of view this is well documented and self-explaining

Code: Select all

/*
* You can add custom links to the navigation menu by appending them here ...
* The format for each link is:
    $navLinks[] = array(
        'url' => 'path/to/link', 
        'title' => 'Link title', 
        'groups' => array('group1', 'group2'), // groups allowed to see this link, use '*' if you want to show the link to all groups
        'icon' => 'path/to/icon',
        'table_group' => 0, // optional index of table group, default is 0
    );
*/
The code comment "groups allowed to see this link" should be self-explanatory.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

sblasic
Veteran Member
Posts: 53
Joined: 2021-02-22 15:55

Re: Save to excel

Post by sblasic » 2023-02-13 09:00

@ jsetzer

As always - thank you for your help!
I really appreciated!
Best!

Post Reply