Completed
Branch FET/10339/exit-modal-for-ee-de... (47597b)
by
unknown
73:42 queued 59:58
created

ExitModal   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A modalContainer() 0 4 1
A enqueues() 0 5 1
1
<?php
2
namespace EventEspresso\core\domain\services\admin;
3
4
/**
5
 * ExitModal
6
 * Sets up server side logic etc for the exit modal survey triggered when deactivating EE core.
7
 *
8
 * DEVELOPERS: this is a in progress api, do not use this class or rely on its api to remain consistent.
9
 *
10
 * @package EventEspresso\core\domain\services\admin
11
 * @author  Darren Ethier
12
 * @since   $VID:$
13
 */
14
class ExitModal
15
{
16
    /**
17
     * ExitModal constructor.
18
     */
19
    public function __construct()
20
    {
21
        add_action('in_admin_footer', array($this, 'modalContainer'));
22
        add_action('admin_enqueue_scripts', array($this, 'enqueues'));
23
    }
24
25
26
    /**
27
     * Callback on in_admin_footer that is used to output the exit modal container.
28
     */
29
    public function modalContainer()
30
    {
31
        echo '<div id="ee-exit-survey-modal"></div>';
32
    }
33
34
35
    /**
36
     * Callback for `admin_enqueue_scripts` to take care of enqueueing scripts and styles specific to the modal.
37
     */
38
    public function enqueues()
39
    {
40
        wp_enqueue_script('ee-exit-modal-survey');
41
        wp_enqueue_style('ee-exit-modal-survey');
42
    }
43
}