Page 1 of 1

Menu Help

Posted: Wed Jul 13, 2022 12:05 am
by nhaas
So I have created a new Tab for a idea that I have. I successfully created a manager tab, but when I select the Manager Tab, the Settings tab stays highlighted.... along with the Manger Tab. What am I missing?
manager tab
manager tab
manager.PNG (4.03 KiB) Viewed 7479 times
Let me know if I should upload the admin.php file.

Thank you

Re: Menu Help

Posted: Wed Jul 13, 2022 6:28 am
by captquirk
At the bottom of admin.php, you need to create a new "case" for the new tab.
Near the top of admin.php, you need a new array for the manager functions. Right after the arrays for different tab functions is a group of "if array key exists" statements. You need to integrate the new tab into that.

Re: Menu Help

Posted: Wed Jul 13, 2022 10:03 pm
by nhaas
TOP (Line 66)
//add manager
$manager_funcs = Array ("manager" => "default");
//end manager

LINE 95 IF Array
/////ADD manager
if (array_key_exists($f, $manager_funcs) ) {
$manager_funcs[$f] = "selected";
} else {
$manager_funcs[$f] = "default";
}
////END Add manager

Line 138 <li><a href='admin.php?f=manager' class='".$manager_funcs[$f]."'>Manager</a></li>

BOTTOM

case 'manager':
include 'manager.php';
break;

Re: Menu Help

Posted: Wed Jul 13, 2022 10:26 pm
by nhaas
I Found my error,--> $settings_funcs = Array ("manager" => "default"); Correct line is: $manager_funcs = Array ("manager" => "default");

Re: Menu Help

Posted: Wed Jul 13, 2022 10:58 pm
by captquirk
Editing admin.php is a real adventure!
:lol: :lol: