Get your custom links BEFORE all the other links in dashboard

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Get your custom links BEFORE all the other links in dashboard

Post by AhmedBR » 2022-07-27 18:35

I need to have some links before all the other links in dashboard!
I do not want to edit any files that can be overwritten, and as my style goes: "keep it as simple as possible!"

Here is how I do it:
First create a table (fake one) with just one field id (not hidden), no need to add anything else to this table.
I call it `goto` table since I am using it to redirect.

Make a group for the dashboard and place it in the first place.
Add just this table to it.

Go to `goto` hook file function goto_init and add this line:

Code: Select all

header("location: your_custom_link.php"); 
This will redirect to whatever page or link you need.

Now, go to links-home.php (hooks folder)

add all your custom links, if you are stuck, there are a lot of examples here on the forum.

final step add this link to footer-extras.php (again hooks folder)

Code: Select all

<script>
$j(function() {
$j('.custom_links').prev().first().append($j('.custom_links div:first'));
})
</script>
the above code from here at the forum but with one word changed from last to first, thanks for the poster (cannot remember who posted it, thanks to him)

This way all your custom links will be FIRST thing and noting will be overwritten when regenerating!
If you have a simpler way, please let me know.

Happy coding
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Get your custom links BEFORE all the other links in dashboard

Post by AhmedBR » 2022-07-28 00:01

I decided to go for only fake tables (the maximum I needed was 3), this way I do not need to reedit the links to add group permission every time there is a new group.

This way all permission is done through Appgini admin.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Get your custom links BEFORE all the other links in dashboard

Post by AhmedBR » 2022-07-28 00:03

Mixing with the color from this link:
viewtopic.php?f=7&p=19839#p19839

You get a colorful dashboard home page.
Some apps need to be colorful :D
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

Post Reply