Completed
Branch FET-3467-waitlists (78124b)
by
unknown
141:27 queued 128:30
created

CoreAdmin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 28
rs 10
wmc 3
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A adminUrl() 0 7 3
1
<?php
2
namespace Page;
3
4
/**
5
 * CoreAdmin
6
 * This is a set of page properties and helper methods for any generic EE Admin page stuff.  Typically,
7
 * specific EE Admin Page will extend this for their functionality.
8
 *
9
 * @package Page
10
 * @author  Darren Ethier
11
 * @since   1.0.0
12
 */
13
class CoreAdmin
14
{
15
16
    const URL_PREFIX = 'admin.php?page=';
17
18
19
    const ADMIN_LIST_TABLE_NEXT_PAGE_CLASS = '.next-page';
20
21
22
    /**
23
     * Get the EE admin url for the given properties.
24
     * Note, this is JUST the endpoint for the admin route.  It is expected that the actor/test would be calling this
25
     * with `amOnAdminPage` action.
26
     *
27
     * @param string $page
28
     * @param string $action
29
     * @param string $additional_params
30
     * @return string
31
     */
32
    public static function adminUrl($page = 'espresso_events', $action = 'default', $additional_params = '')
33
    {
34
        $url = self::URL_PREFIX . $page;
35
        $url .= $action ? '&action=' . $action : '';
36
        $url .= $additional_params ? '&' . ltrim('&', ltrim('?', $additional_params)) : '';
37
        return $url;
38
    }
39
40
}