Help

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
Marcelo Vitoria
Veteran Member
Posts: 60
Joined: 2016-10-11 12:08

Help

Post by Marcelo Vitoria » 2023-05-23 22:30

Hello friends

I have 3 doubts that I would like to see if anyone knows how to solve.

1 - When logging into the application, AppGini displays the group bars (when configured) and the first tab opens by itself. I would like to know if there is a way to disable this automatic opening.

2 - Try to check if the application is running on a cell phone screen or a PC. If it's on a PC, it will automatically go to a listing in a table and if it's on a cell phone, open the group tabs normally

Does anyone know where I can adjust this?

Thanks
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.11 - AdminLTE
https://www.workspaceservices.com.br

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

Re: Help

Post by jsetzer » 2023-05-24 02:25

1 - When logging into the application, AppGini displays the group bars (when configured) and the first tab opens by itself. I would like to know if there is a way to disable this automatic opening.
There is an older thread and a hooks-only solution there:
viewtopic.php?t=4542#p18513
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
Marcelo Vitoria
Veteran Member
Posts: 60
Joined: 2016-10-11 12:08

Re: Help

Post by Marcelo Vitoria » 2023-05-27 23:10

jsetzer wrote:
2023-05-24 02:25
1 - When logging into the application, AppGini displays the group bars (when configured) and the first tab opens by itself. I would like to know if there is a way to disable this automatic opening.
There is an older thread and a hooks-only solution there:
viewtopic.php?t=4542#p18513
I now need to find a way to not display the panels when in use on a computer

Thank you for your help
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.11 - AdminLTE
https://www.workspaceservices.com.br

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

Re: Help

Post by jsetzer » 2023-05-30 09:19

As a starting point:

1) After login direct the logged in user to a custom page, for example to go.php.
2) In go.php detect environment (desktop or mobile) and redirect to index.php (standard dashboard) or to TABLENAME_view.php

(1) can be done in login function of __global.php, I think

(2) should be possible by evaluating the page's HEADER. Redirect can be done by using PHP's header location function.
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
Marcelo Vitoria
Veteran Member
Posts: 60
Joined: 2016-10-11 12:08

Re: Help

Post by Marcelo Vitoria » 2024-03-21 21:14

Hello jsetzer

Sorry to dig up such an old topic, but as I needed help several times and you promptly helped me on several occasions, I thought it was right to respond to this topic and, following your guidelines, I was able to better understand the problem and solved it this way:

To change the home page of an app, detecting which device is opening the app, do this:

Access the \hooks\__global.php file
Look for the login_ok function
Add the code in this function:

Code: Select all

function login_ok($memberInfo, &$args) {
             $iphone  = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
             $ipad    = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
             $android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
             $palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
             $berry   = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
             $ipod    = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
             $symbian = strpos($_SERVER['HTTP_USER_AGENT'],"Symbian");

             if ($iphone || $ipad || $android || $palmpre || $ipod || $berry || $symbian == true) {
		     $tela = "OK";          
             } else {                
		     return 'Agenda_view.php';  //here put the url that needs to redirect
             }
		return '';
	}
I want to apologize for the delayed response and thank my friend jsetzer again for always helping me when necessary.

I'm finishing developing an application that will require the addition of bizzworxx components and we will soon acquire some of them.

Thank you very much and good luck
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.11 - AdminLTE
https://www.workspaceservices.com.br

User avatar
Marcelo Vitoria
Veteran Member
Posts: 60
Joined: 2016-10-11 12:08

Re: Help

Post by Marcelo Vitoria » 2024-03-23 00:14

Now I managed to get a quote! :D :D

Answer above.
jsetzer wrote:
2023-05-30 09:19
As a starting point:

1) After login direct the logged in user to a custom page, for example to go.php.
2) In go.php detect environment (desktop or mobile) and redirect to index.php (standard dashboard) or to TABLENAME_view.php

(1) can be done in login function of __global.php, I think

(2) should be possible by evaluating the page's HEADER. Redirect can be done by using PHP's header location function.
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.11 - AdminLTE
https://www.workspaceservices.com.br

Post Reply