1 | <?php |
||
8 | class AdminManager extends Collection |
||
9 | { |
||
10 | /** |
||
11 | * Base Class. |
||
12 | * |
||
13 | * The Base Class for Model Admin's |
||
14 | */ |
||
15 | const BASE_CLASS = 'LaravelFlare\Flare\Admin\Admin'; |
||
16 | |||
17 | /** |
||
18 | * Admin Config Key. |
||
19 | * |
||
20 | * Key which defined where in the Flare Admin Config to |
||
21 | * load the Admin classes from. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | const ADMIN_KEY = 'admin'; |
||
26 | |||
27 | /** |
||
28 | * __construct. |
||
29 | */ |
||
30 | public function __construct() |
||
36 | |||
37 | /** |
||
38 | * Gets Admin classes based on the current users permissions |
||
39 | * which have been set. If a Admin class has not had the |
||
40 | * Permissions provided, it will be displayed by default. |
||
41 | * |
||
42 | * @return |
||
43 | */ |
||
44 | public function getAdminClasses() |
||
56 | |||
57 | /** |
||
58 | * Takes an array of classes and returns the |
||
59 | * classes which are available with the |
||
60 | * current permissions/policy set. |
||
61 | * |
||
62 | * @param array $classes |
||
63 | * |
||
64 | * @return array |
||
65 | */ |
||
66 | public function getSubAdminClasses(array $classes) |
||
84 | |||
85 | /** |
||
86 | * Returns an instance of the Admin. |
||
87 | * |
||
88 | * @return Admin |
||
89 | */ |
||
90 | public static function getAdminInstance() |
||
98 | |||
99 | /** |
||
100 | * Register Admin Routes. |
||
101 | * |
||
102 | * Loops through all of the Admin classes in the collection |
||
103 | * and registers their Admin Routes. |
||
104 | */ |
||
105 | public function registerRoutes() |
||
109 | |||
110 | /** |
||
111 | * Loops through an array of classes |
||
112 | * and registers their Route recursively. |
||
113 | * |
||
114 | * @param array $classes |
||
115 | */ |
||
116 | public function registerSubRoutes(array $classes) |
||
130 | |||
131 | /** |
||
132 | * Registers an individual group of Admin routes. |
||
133 | * |
||
134 | * @param string $class |
||
135 | */ |
||
136 | public function registerRoute($class) |
||
140 | |||
141 | /** |
||
142 | * Determines if a class is usable by the currently |
||
143 | * defined user and their permission set. |
||
144 | * |
||
145 | * @param string $class |
||
146 | * |
||
147 | * @return bool |
||
148 | */ |
||
149 | private function usableClass($class) |
||
161 | } |
||
162 |