NavBar & SideBar Works... Kinda. Not Customized Yet.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
global $current_file, $menu_items, $active_profession, $active_profession_title;
|
||||
$current_file = basename($_SERVER['SCRIPT_NAME']); // Extracts File Name ONLY, Not File Path
|
||||
|
||||
/* Navigation Bar Pages, 'fileName' => ['Page Name', 'pageIcon'] */
|
||||
$menu_items = [
|
||||
'index.php' => ['Home', 'logo.png'],
|
||||
'alchemyIngredientPage.php' => ['Alchemy', 'alchemy.png'],
|
||||
'blacksmithing.php' => ['Blacksmithing', 'blacksmithing.png'],
|
||||
'engineering.php' => ['Engineering', 'engineering.png'],
|
||||
'jewelcrafting.php' => ['Jewelcrafting', 'jewelcrafting.png'],
|
||||
'leatherworking.php' => ['Leatherworking', 'leatherworking.png'],
|
||||
'tailoring.php' => ['Tailoring', 'tailoring.png'],
|
||||
];
|
||||
|
||||
$active_profession = ''; // File Name, e.g., 'alchemyIngredientPage' or 'blacksmithing'
|
||||
$active_profession_title = ''; // Page Name, e.g., 'Alchemy' or 'Blacksmithing'
|
||||
|
||||
/* Finds & Sets Active Profession Page */
|
||||
foreach ($menu_items as $file => $info) {
|
||||
$root_file_name = pathinfo($file, PATHINFO_FILENAME); // Extracts File Name ONLY, Not File Path
|
||||
|
||||
if (str_starts_with($current_file, $root_file_name)) {
|
||||
$active_profession = $root_file_name;
|
||||
$active_profession_title = $info[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user