-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize.php
More file actions
47 lines (44 loc) · 1.93 KB
/
initialize.php
File metadata and controls
47 lines (44 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
$menus = [
array("Name" => "EXERCISES", "Path" => "/exercises", "Image" => "calendar"),
"Course"=>array(
"Name" => "COURSES",
"Path" => \_::$Address->CategoryRootUrlPath."Course",
"Image" => "book",
"Items" => []
),
array(
"Name" => "CONTACTS",
"Path" => "/contact",
"Image" => "envelope",
"Items" => array(
array("Name" => "FORUMS", "Path" => "/forums", "Image" => "comments"),
array("Name" => "CONTACTS", "Path" => "/contact", "Image" => "address-book"),
array("Name" => "ABOUT", "Path" => "/about", "Image" => "info")
)
)
];
$courses = [];
foreach(array_slice(compute("category/all", ["Direction"=>"Course"]), 1) as $item)
$courses[] = ["Name"=>$item["Title"], "Path"=>\_::$Address->CategoryRootUrlPath."Course/".$item["Name"]];
$menus["Course"]["Items"] = $courses;
\_::$Front->MainMenus = [...\_::$Front->MainMenus,...$menus];
\_::$Front->SideMenus = [...\_::$Front->SideMenus,...$menus];
\_::$Front->Shortcuts = [
array("Name" => "MENU", "Path" => "viewSideMenu()", "Image" => "bars"),
array("Name" => "COURSES", "Path" => \_::$Address->CategoryRootUrlPath."Course", "Image" => "book"),
array("Name" => "HOME", "Path" => \_::$Front->HomePath, "Image" => "home"),
array("Name" => "EXERCISES", "Path" => "/exercises", "Image" => "calendar"),
array("Name" => "CONTACTS", "Path" => "/contact", "Image" => "envelope")
];
// To unset the default router sat at the bottom layers
\_::$Router->On()->Reset();
/**
* Use your routers by below formats
* \_::$Router->On("A Part Of Path?")->Default("Route Name");
*/
\_::$Router->On("exercises")->Default("exercises");
\_::$Router->On("exercise")->Default("exercise");
\_::$Router->On("$|home")
->if(\_::$User->HasAccess(\_::$User->UserAccess))->Default(fn()=>view("part",["Name"=>"sign/dashboard"]))
->else()->Default(fn()=>view("part", ["Name"=>"sign/in"]));