Completed
Branch BUG-10381-asset-loading (f91422)
by
unknown
170:16 queued 157:41
created

EventsArchiveIframe   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
dl 0
loc 62
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 8

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 47 2
1
<?php
2
namespace EventEspresso\modules\events_archive;
3
4
use EventEspresso\core\libraries\iframe_display\Iframe;
5
6
if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
7
    exit( 'No direct script access allowed' );
8
}
9
10
11
12
/**
13
 * Class EventsArchiveIframe
14
 *
15
 * @package       Event Espresso
16
 * @author        Brent Christensen
17
 * @since         4.9
18
 */
19
class EventsArchiveIframe extends Iframe
20
{
21
22
23
24
    /**
25
     * EventsArchiveIframe constructor.
26
     *
27
     * @param \EED_Events_Archive $EED_Events_Archive
28
     * @throws \DomainException
29
     */
30
    public function __construct( $EED_Events_Archive )
31
    {
32
        \EE_Registry::instance()->REQ->set_espresso_page( true );
33
        add_filter('FHEE__EED_Events_Archive__event_list_iframe', '__return_true');
34
        $EED_Events_Archive->event_list();
35
        $event_list = new \EES_Espresso_Events();
0 ignored issues
show
Deprecated Code introduced by
The class EES_Espresso_Events has been deprecated with message: 4.9.27

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
36
        parent::__construct(
37
            esc_html__( 'Event List', 'event_espresso' ),
38
            $event_list->process_shortcode()
0 ignored issues
show
Deprecated Code introduced by
The method EES_Espresso_Events::process_shortcode() has been deprecated with message: 4.9.27 @param array $attributes @return string

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
39
        );
40
        $this->addStylesheets(
41
            apply_filters(
42
                'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__css',
43
                array(
44
                    'espresso_default'           => is_readable( EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css' )
45
                        ? EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION
46
                        : EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION,
47
                    $EED_Events_Archive->theme() => get_stylesheet_directory_uri()
48
                                                    . $EED_Events_Archive->theme() . DS
49
                                                    . 'style.css?ver=' . EVENT_ESPRESSO_VERSION,
50
                ),
51
                $this
52
            )
53
        );
54
        $this->addScripts(
55
            apply_filters(
56
                'FHEE__EventEspresso_modules_events_archive_EventsArchiveIframe__display__js',
57
                array(
58
                    'gmap_api' => sprintf(
59
                        'https://maps.googleapis.com/maps/api/js?key=%s',
60
                        apply_filters(
61
                            'FHEE__EEH_Maps__espresso_google_maps_js__api_key',
62
                            \EE_Registry::instance()->CFG->map_settings->google_map_api_key
63
                        )
64
                    ),
65
                    'ee_gmap'  => EE_HELPERS_ASSETS . 'ee_gmap.js?ver=1.0',
66
                ),
67
                $this
68
            )
69
        );
70
        $this->addLocalizedVars(
71
            array(
72
                'ee_gmap' => \EEH_Maps::$gmap_vars,
73
            ),
74
            'ee_gmap_vars'
75
        );
76
    }
77
78
79
80
}
81
// End of file EventsArchiveIframe.php
82
// Location: EventEspresso\modules\events_archive/EventsArchiveIframe.php