1 | <?php |
||
13 | class CoreAdmin |
||
14 | { |
||
15 | |||
16 | const URL_PREFIX = 'admin.php?page='; |
||
17 | |||
18 | |||
19 | /** |
||
20 | * Absolute url to admin for the testing site. eg. `http://www.example.com/wp-admin |
||
21 | * This should be set by anything using this Page object by calling setAdminPath($admin_path) first. |
||
22 | * @var string |
||
23 | */ |
||
24 | private static $root_admin_url =''; |
||
25 | |||
26 | /** |
||
27 | * Set the root admin url for all admin pages. |
||
28 | * @param $admin_url |
||
29 | */ |
||
30 | public static function setRootAdminUrl($admin_url) |
||
34 | |||
35 | |||
36 | /** |
||
37 | * Get the EE admin url for the given properties. |
||
38 | * @param string $page |
||
39 | * @param string $action |
||
40 | * @param string $additional_params |
||
41 | * @return string |
||
42 | */ |
||
43 | public static function adminUrl($page = 'espresso_events', $action = 'default', $additional_params = '') |
||
50 | |||
51 | |||
52 | /** |
||
53 | * Get what is set for the root_admin_url property. |
||
54 | * @return string |
||
55 | */ |
||
56 | protected static function rootAdminUrl() |
||
60 | |||
61 | |||
62 | /** |
||
63 | * Appends a trailing slash. |
||
64 | * |
||
65 | * Will remove trailing forward and backslashes if it exists already before adding |
||
66 | * a trailing forward slash. This prevents double slashing a string or path. |
||
67 | * |
||
68 | * The primary use of this is for paths and thus should be used for paths. It is |
||
69 | * not restricted to paths and offers no specific path support. |
||
70 | * |
||
71 | * @param string $string What to add the trailing slash to. |
||
72 | * @return string String with trailing slash added. |
||
73 | */ |
||
74 | public static function trailingSlashIt($string) |
||
78 | |||
79 | /** |
||
80 | * Removes trailing forward slashes and backslashes if they exist. |
||
81 | * |
||
82 | * The primary use of this is for paths and thus should be used for paths. It is |
||
83 | * not restricted to paths and offers no specific path support. |
||
84 | * |
||
85 | * @param string $string What to remove the trailing slashes from. |
||
86 | * @return string String without the trailing slashes. |
||
87 | */ |
||
88 | public static function unTrailingSlashit($string) |
||
92 | |||
93 | } |