1 | <?php |
||
9 | class AdminRootController extends Controller implements TemplateGlobalProvider { |
||
10 | |||
11 | /** |
||
12 | * Fallback admin URL in case this cannot be infered from Director.rules |
||
13 | * |
||
14 | * @var string |
||
15 | * @config |
||
16 | */ |
||
17 | private static $url_base = 'admin'; |
||
18 | |||
19 | /** |
||
20 | * Convenience function to return the admin route config. |
||
21 | * Looks for the {@link Director::$rules} for the current admin Controller. |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | public static function get_admin_route() { |
||
30 | |||
31 | /** |
||
32 | * Returns the root admin URL for the site with trailing slash |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | public static function admin_url() { |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | * @config |
||
43 | * The LeftAndMain child that will be used as the initial panel to display if none is selected (i.e. if you |
||
44 | * visit /admin) |
||
45 | */ |
||
46 | private static $default_panel = 'SecurityAdmin'; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | * Holds an array of url_pattern => controller k/v pairs, the same as Director::rules. However this is built |
||
51 | * dynamically from introspecting on all the classes that derive from LeftAndMain. |
||
52 | * |
||
53 | * Don't access this directly - always access via the rules() accessor below, which will build this array |
||
54 | * the first time it's accessed |
||
55 | */ |
||
56 | private static $_rules = null; |
||
57 | |||
58 | /** |
||
59 | * Gets a list of url_pattern => controller k/v pairs for each LeftAndMain derived controller |
||
60 | */ |
||
61 | public static function rules() { |
||
71 | |||
72 | /** |
||
73 | * Add the appropriate k/v pair to self::$rules for the given controller. |
||
74 | * |
||
75 | * @param string $controllerClass Name of class |
||
76 | */ |
||
77 | protected static function add_rule_for_controller($controllerClass) { |
||
90 | |||
91 | public function handleRequest(SS_HTTPRequest $request, DataModel $model) { |
||
115 | |||
116 | /** |
||
117 | * @return array Returns an array of strings of the method names of methods on the call that should be exposed |
||
118 | * as global variables in the templates. |
||
119 | */ |
||
120 | public static function get_template_global_variables() { |
||
125 | } |
||
126 |