Page 1 of 1

Help

Posted: 2023-05-23 22:30
by Marcelo Vitoria
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

Re: Help

Posted: 2023-05-24 02:25
by jsetzer
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

Re: Help

Posted: 2023-05-27 23:10
by Marcelo Vitoria
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

Re: Help

Posted: 2023-05-30 09:19
by jsetzer
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.

Re: Help

Posted: 2024-03-21 21:14
by Marcelo Vitoria
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

Re: Help

Posted: 2024-03-23 00:14
by Marcelo Vitoria
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.