Completed
Branch yet-another-batch-of-ui-fixes (371f49)
by
unknown
30:27 queued 22:46
created
core/helpers/EEH_Maps.helper.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             ? esc_url_raw($ee_gmaps_opts['ee_static_url'])
52 52
             : false;
53 53
 
54
-        if (! empty($ee_gmaps_opts['ee_map_align'])) {
54
+        if ( ! empty($ee_gmaps_opts['ee_map_align'])) {
55 55
             switch ($ee_gmaps_opts['ee_map_align']) {
56 56
                 case "left":
57 57
                     $map_align = 'ee-gmap-align-left left';
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
         // if so display a Google static iframe map else run V3 api
76 76
         if ($static_url) {
77 77
             $html = '
78
-            <div class="ee-gmap-iframewrap ee-gmap-wrapper ' . $map_align . '">
79
-                <iframe src="' . $static_url . '&output=embed"
80
-                        style="width: ' . $ee_map_width . 'px; height: ' . $ee_map_height . 'px;"
78
+            <div class="ee-gmap-iframewrap ee-gmap-wrapper ' . $map_align.'">
79
+                <iframe src="' . $static_url.'&output=embed"
80
+                        style="width: ' . $ee_map_width.'px; height: '.$ee_map_height.'px;"
81 81
                         frameborder="0" 
82 82
                         scrolling="no"
83 83
                     >
84 84
                 </iframe>
85
-                <a href="' . $static_url . '">' . esc_html__('View Large map', 'event_espresso') . '</a>
85
+                <a href="' . $static_url.'">'.esc_html__('View Large map', 'event_espresso').'</a>
86 86
             </div>
87 87
 ';
88 88
         } else {
89
-            EEH_Maps::$gmap_vars[ $ee_gmaps_opts['map_ID'] ] = [
89
+            EEH_Maps::$gmap_vars[$ee_gmaps_opts['map_ID']] = [
90 90
                 'map_ID'              => $ee_gmaps_opts['map_ID'],
91 91
                 'ee_map_zoom'         => $ee_map_zoom,
92 92
                 'ee_map_nav_display'  => $ee_map_nav_display,
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
                 'location'            => $ee_gmaps_opts['location'],
96 96
             ];
97 97
 
98
-            $style = 'width: ' . $ee_map_width . 'px; height: ' . $ee_map_height . 'px;';
98
+            $style = 'width: '.$ee_map_width.'px; height: '.$ee_map_height.'px;';
99 99
             $html  = '
100
-            <div class="ee-gmap-wrapper ' . esc_attr($map_align) . '">
100
+            <div class="ee-gmap-wrapper ' . esc_attr($map_align).'">
101 101
                 <div class="ee-gmap" 
102
-                     id="map_canvas_' . esc_attr($ee_gmaps_opts['map_ID']) . '"
103
-                     style="' . esc_attr($style) . '"
102
+                     id="map_canvas_' . esc_attr($ee_gmaps_opts['map_ID']).'"
103
+                     style="' . esc_attr($style).'"
104 104
                  ></div>
105 105
             </div>';
106 106
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         );
145 145
         wp_register_script(
146 146
             'ee_gmap',
147
-            plugin_dir_url(__FILE__) . 'assets/ee_gmap.js',
147
+            plugin_dir_url(__FILE__).'assets/ee_gmap.js',
148 148
             ['gmap_api'],
149 149
             '1.0',
150 150
             true
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
         $map_image_class = isset($map_image_class) ? $map_image_class : 'ee_google_map_view';
181 181
 
182 182
         $address_string = ($address != '' ? $address : '')
183
-                          . ($city != '' ? ',' . $city : '')
184
-                          . ($state != '' ? ',' . $state : '')
185
-                          . ($zip != '' ? ',' . $zip : '')
186
-                          . ($country != '' ? ',' . $country : '');
183
+                          . ($city != '' ? ','.$city : '')
184
+                          . ($state != '' ? ','.$state : '')
185
+                          . ($zip != '' ? ','.$zip : '')
186
+                          . ($country != '' ? ','.$country : '');
187 187
 
188
-        $google_map = htmlentities2('https://maps.google.com/maps?q=' . urlencode($address_string));
188
+        $google_map = htmlentities2('https://maps.google.com/maps?q='.urlencode($address_string));
189 189
 
190 190
         switch ($type) {
191 191
             case 'text':
@@ -208,31 +208,31 @@  discard block
 block discarded – undo
208 208
 
209 209
                 return '
210 210
                 <a class="a_map_image_link" 
211
-                   href="' . esc_url_raw($google_map) . '" 
211
+                   href="' . esc_url_raw($google_map).'" 
212 212
                    target="_blank" 
213 213
                    rel="noopener noreferrer"
214 214
                 >
215
-                    <img alt="' . esc_html__('Map and Directions', 'event_espresso') . '"
215
+                    <img alt="' . esc_html__('Map and Directions', 'event_espresso').'"
216 216
                          class="map_image_link" 
217
-                         id="venue_map_' . $id . '" ' . $map_image_class . ' 
217
+                         id="venue_map_' . $id.'" '.$map_image_class.' 
218 218
                          src="'
219 219
                        . htmlentities2(
220 220
                            $scheme
221 221
                            . 'maps.googleapis.com/maps/api/staticmap?center='
222 222
                            . urlencode($address_string)
223 223
                            . '&amp;zoom=14&amp;size='
224
-                           . $map_w . 'x' . $map_h
224
+                           . $map_w.'x'.$map_h
225 225
                            . '&amp;markers=color:green|label:|'
226 226
                            . urlencode($address_string)
227 227
                            . '&amp;sensor=false&amp;key='
228 228
                            . $api_key
229
-                       ) . '"
229
+                       ).'"
230 230
                      />
231 231
                  </a>';
232 232
         }
233 233
 
234 234
         return $type === 'url_only'
235 235
             ? $text
236
-            : '<a href="' . esc_url_raw($google_map) . '" target="_blank" rel="noopener noreferrer">' . $text . '</a>';
236
+            : '<a href="'.esc_url_raw($google_map).'" target="_blank" rel="noopener noreferrer">'.$text.'</a>';
237 237
     }
238 238
 }
Please login to merge, or discard this patch.
Indentation   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -11,69 +11,69 @@  discard block
 block discarded – undo
11 11
  */
12 12
 class EEH_Maps
13 13
 {
14
-    // array of map settings
15
-    public static $gmap_vars = [];
16
-
17
-
18
-    /**
19
-     * google_map - creates a Google Map Link
20
-     *
21
-     * @param array $ee_gmaps_opts array of attributes required for the map link generation
22
-     * @return string (link to map!)
23
-     */
24
-    public static function google_map($ee_gmaps_opts)
25
-    {
26
-
27
-        $ee_map_width = ! empty($ee_gmaps_opts['ee_map_width'])
28
-            ? absint($ee_gmaps_opts['ee_map_width'])
29
-            : 300;
30
-
31
-        $ee_map_height = ! empty($ee_gmaps_opts['ee_map_height'])
32
-            ? absint($ee_gmaps_opts['ee_map_height'])
33
-            : 185;
34
-
35
-        $ee_map_zoom = ! empty($ee_gmaps_opts['ee_map_zoom'])
36
-            ? absint($ee_gmaps_opts['ee_map_zoom'])
37
-            : 12;
38
-
39
-        $ee_map_nav_display = ! empty($ee_gmaps_opts['ee_map_nav_display']) ? 'true' : 'false';
40
-
41
-        $ee_map_nav_size = ! empty($ee_gmaps_opts['ee_map_nav_size'])
42
-            ? sanitize_text_field($ee_gmaps_opts['ee_map_nav_size'])
43
-            : 'default';
44
-
45
-        $ee_map_type_control = ! empty($ee_gmaps_opts['ee_map_type_control'])
46
-            ? sanitize_text_field($ee_gmaps_opts['ee_map_type_control'])
47
-            : 'default';
48
-
49
-        $static_url = ! empty($ee_gmaps_opts['ee_static_url'])
50
-            ? esc_url_raw($ee_gmaps_opts['ee_static_url'])
51
-            : false;
52
-
53
-        if (! empty($ee_gmaps_opts['ee_map_align'])) {
54
-            switch ($ee_gmaps_opts['ee_map_align']) {
55
-                case "left":
56
-                    $map_align = 'ee-gmap-align-left left';
57
-                    break;
58
-                case "right":
59
-                    $map_align = 'ee-gmap-align-right right';
60
-                    break;
61
-                case "center":
62
-                    $map_align = 'ee-gmap-align-center center';
63
-                    break;
64
-                case "none":
65
-                default:
66
-                    $map_align = 'ee-gmap-align-none';
67
-            }
68
-        } else {
69
-            $map_align = 'ee-gmap-align-none';
70
-        }
71
-
72
-
73
-        // Determine whether user has set a hardcoded url to use and
74
-        // if so display a Google static iframe map else run V3 api
75
-        if ($static_url) {
76
-            $html = '
14
+	// array of map settings
15
+	public static $gmap_vars = [];
16
+
17
+
18
+	/**
19
+	 * google_map - creates a Google Map Link
20
+	 *
21
+	 * @param array $ee_gmaps_opts array of attributes required for the map link generation
22
+	 * @return string (link to map!)
23
+	 */
24
+	public static function google_map($ee_gmaps_opts)
25
+	{
26
+
27
+		$ee_map_width = ! empty($ee_gmaps_opts['ee_map_width'])
28
+			? absint($ee_gmaps_opts['ee_map_width'])
29
+			: 300;
30
+
31
+		$ee_map_height = ! empty($ee_gmaps_opts['ee_map_height'])
32
+			? absint($ee_gmaps_opts['ee_map_height'])
33
+			: 185;
34
+
35
+		$ee_map_zoom = ! empty($ee_gmaps_opts['ee_map_zoom'])
36
+			? absint($ee_gmaps_opts['ee_map_zoom'])
37
+			: 12;
38
+
39
+		$ee_map_nav_display = ! empty($ee_gmaps_opts['ee_map_nav_display']) ? 'true' : 'false';
40
+
41
+		$ee_map_nav_size = ! empty($ee_gmaps_opts['ee_map_nav_size'])
42
+			? sanitize_text_field($ee_gmaps_opts['ee_map_nav_size'])
43
+			: 'default';
44
+
45
+		$ee_map_type_control = ! empty($ee_gmaps_opts['ee_map_type_control'])
46
+			? sanitize_text_field($ee_gmaps_opts['ee_map_type_control'])
47
+			: 'default';
48
+
49
+		$static_url = ! empty($ee_gmaps_opts['ee_static_url'])
50
+			? esc_url_raw($ee_gmaps_opts['ee_static_url'])
51
+			: false;
52
+
53
+		if (! empty($ee_gmaps_opts['ee_map_align'])) {
54
+			switch ($ee_gmaps_opts['ee_map_align']) {
55
+				case "left":
56
+					$map_align = 'ee-gmap-align-left left';
57
+					break;
58
+				case "right":
59
+					$map_align = 'ee-gmap-align-right right';
60
+					break;
61
+				case "center":
62
+					$map_align = 'ee-gmap-align-center center';
63
+					break;
64
+				case "none":
65
+				default:
66
+					$map_align = 'ee-gmap-align-none';
67
+			}
68
+		} else {
69
+			$map_align = 'ee-gmap-align-none';
70
+		}
71
+
72
+
73
+		// Determine whether user has set a hardcoded url to use and
74
+		// if so display a Google static iframe map else run V3 api
75
+		if ($static_url) {
76
+			$html = '
77 77
             <div class="ee-gmap-iframewrap ee-gmap-wrapper ' . $map_align . '">
78 78
                 <iframe src="' . $static_url . '&output=embed"
79 79
                         style="width: ' . $ee_map_width . 'px; height: ' . $ee_map_height . 'px;"
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
                 <a href="' . $static_url . '">' . esc_html__('View Large map', 'event_espresso') . '</a>
85 85
             </div>
86 86
 ';
87
-        } else {
88
-            EEH_Maps::$gmap_vars[ $ee_gmaps_opts['map_ID'] ] = [
89
-                'map_ID'              => $ee_gmaps_opts['map_ID'],
90
-                'ee_map_zoom'         => $ee_map_zoom,
91
-                'ee_map_nav_display'  => $ee_map_nav_display,
92
-                'ee_map_nav_size'     => $ee_map_nav_size,
93
-                'ee_map_type_control' => $ee_map_type_control,
94
-                'location'            => $ee_gmaps_opts['location'],
95
-            ];
96
-
97
-            $style = 'width: ' . $ee_map_width . 'px; height: ' . $ee_map_height . 'px;';
98
-            $html  = '
87
+		} else {
88
+			EEH_Maps::$gmap_vars[ $ee_gmaps_opts['map_ID'] ] = [
89
+				'map_ID'              => $ee_gmaps_opts['map_ID'],
90
+				'ee_map_zoom'         => $ee_map_zoom,
91
+				'ee_map_nav_display'  => $ee_map_nav_display,
92
+				'ee_map_nav_size'     => $ee_map_nav_size,
93
+				'ee_map_type_control' => $ee_map_type_control,
94
+				'location'            => $ee_gmaps_opts['location'],
95
+			];
96
+
97
+			$style = 'width: ' . $ee_map_width . 'px; height: ' . $ee_map_height . 'px;';
98
+			$html  = '
99 99
             <div class="ee-gmap-wrapper ' . esc_attr($map_align) . '">
100 100
                 <div class="ee-gmap" 
101 101
                      id="map_canvas_' . esc_attr($ee_gmaps_opts['map_ID']) . '"
@@ -103,109 +103,109 @@  discard block
 block discarded – undo
103 103
                  ></div>
104 104
             </div>';
105 105
 
106
-            wp_enqueue_script('gmap_api');
107
-            wp_enqueue_script('ee_gmap');
108
-            add_action('wp_footer', ['EEH_Maps', 'footer_enqueue_script']);
109
-        }
110
-        return $html; // end auto map or static url map check
111
-    }
112
-
113
-
114
-    /**
115
-     * enqueue_script
116
-     *
117
-     * @return void
118
-     */
119
-    public static function footer_enqueue_script()
120
-    {
121
-        wp_localize_script('ee_gmap', 'ee_gmap_vars', EEH_Maps::$gmap_vars);
122
-    }
123
-
124
-
125
-    /**
126
-     * registers scripts for maps
127
-     */
128
-    public static function espresso_google_map_js()
129
-    {
130
-        $api_url = sprintf(
131
-            "https://maps.googleapis.com/maps/api/js?key=%s",
132
-            apply_filters(
133
-                'FHEE__EEH_Maps__espresso_google_maps_js__api_key',
134
-                EE_Registry::instance()->CFG->map_settings->google_map_api_key
135
-            )
136
-        );
137
-        wp_register_script(
138
-            'gmap_api',
139
-            esc_url_raw($api_url),
140
-            ['jquery'],
141
-            null,
142
-            true
143
-        );
144
-        wp_register_script(
145
-            'ee_gmap',
146
-            plugin_dir_url(__FILE__) . 'assets/ee_gmap.js',
147
-            ['gmap_api'],
148
-            '1.0',
149
-            true
150
-        );
151
-    }
152
-
153
-
154
-    /**
155
-     * creates a Google Map Link
156
-     *
157
-     * @param array $atts array of attributes required for the map link generation
158
-     * @return string (link to map!)
159
-     */
160
-    public static function google_map_link($atts)
161
-    {
162
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
163
-        extract($atts);
164
-        /** @var string $address */
165
-        /** @var string $city */
166
-        /** @var string $state */
167
-        /** @var string $zip */
168
-        /** @var string $country */
169
-        $address         = "{$address}";
170
-        $city            = "{$city}";
171
-        $state           = "{$state}";
172
-        $zip             = "{$zip}";
173
-        $country         = "{$country}";
174
-        $text            = isset($text) ? "{$text}" : "";
175
-        $type            = isset($type) ? "{$type}" : "";
176
-        $map_w           = isset($map_w) ? "{$map_w}" : 400;
177
-        $map_h           = isset($map_h) ? "{$map_h}" : 400;
178
-        $id              = isset($id) ? $id : 'not_set';
179
-        $map_image_class = isset($map_image_class) ? $map_image_class : 'ee_google_map_view';
180
-
181
-        $address_string = ($address != '' ? $address : '')
182
-                          . ($city != '' ? ',' . $city : '')
183
-                          . ($state != '' ? ',' . $state : '')
184
-                          . ($zip != '' ? ',' . $zip : '')
185
-                          . ($country != '' ? ',' . $country : '');
186
-
187
-        $google_map = htmlentities2('https://maps.google.com/maps?q=' . urlencode($address_string));
188
-
189
-        switch ($type) {
190
-            case 'text':
191
-            default:
192
-                $text = $text == '' ? esc_html__('Map and Directions', 'event_espresso') : $text;
193
-                break;
194
-
195
-            case 'url_only':
196
-            case 'url':
197
-                $text = $google_map;
198
-                break;
199
-
200
-            case 'map':
201
-                $scheme = is_ssl() ? 'https://' : 'http://';
202
-
203
-                $api_key = apply_filters(
204
-                    'FHEE__EEH_Maps__espresso_google_maps_link__api_key',
205
-                    EE_Registry::instance()->CFG->map_settings->google_map_api_key
206
-                );
207
-
208
-                return '
106
+			wp_enqueue_script('gmap_api');
107
+			wp_enqueue_script('ee_gmap');
108
+			add_action('wp_footer', ['EEH_Maps', 'footer_enqueue_script']);
109
+		}
110
+		return $html; // end auto map or static url map check
111
+	}
112
+
113
+
114
+	/**
115
+	 * enqueue_script
116
+	 *
117
+	 * @return void
118
+	 */
119
+	public static function footer_enqueue_script()
120
+	{
121
+		wp_localize_script('ee_gmap', 'ee_gmap_vars', EEH_Maps::$gmap_vars);
122
+	}
123
+
124
+
125
+	/**
126
+	 * registers scripts for maps
127
+	 */
128
+	public static function espresso_google_map_js()
129
+	{
130
+		$api_url = sprintf(
131
+			"https://maps.googleapis.com/maps/api/js?key=%s",
132
+			apply_filters(
133
+				'FHEE__EEH_Maps__espresso_google_maps_js__api_key',
134
+				EE_Registry::instance()->CFG->map_settings->google_map_api_key
135
+			)
136
+		);
137
+		wp_register_script(
138
+			'gmap_api',
139
+			esc_url_raw($api_url),
140
+			['jquery'],
141
+			null,
142
+			true
143
+		);
144
+		wp_register_script(
145
+			'ee_gmap',
146
+			plugin_dir_url(__FILE__) . 'assets/ee_gmap.js',
147
+			['gmap_api'],
148
+			'1.0',
149
+			true
150
+		);
151
+	}
152
+
153
+
154
+	/**
155
+	 * creates a Google Map Link
156
+	 *
157
+	 * @param array $atts array of attributes required for the map link generation
158
+	 * @return string (link to map!)
159
+	 */
160
+	public static function google_map_link($atts)
161
+	{
162
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
163
+		extract($atts);
164
+		/** @var string $address */
165
+		/** @var string $city */
166
+		/** @var string $state */
167
+		/** @var string $zip */
168
+		/** @var string $country */
169
+		$address         = "{$address}";
170
+		$city            = "{$city}";
171
+		$state           = "{$state}";
172
+		$zip             = "{$zip}";
173
+		$country         = "{$country}";
174
+		$text            = isset($text) ? "{$text}" : "";
175
+		$type            = isset($type) ? "{$type}" : "";
176
+		$map_w           = isset($map_w) ? "{$map_w}" : 400;
177
+		$map_h           = isset($map_h) ? "{$map_h}" : 400;
178
+		$id              = isset($id) ? $id : 'not_set';
179
+		$map_image_class = isset($map_image_class) ? $map_image_class : 'ee_google_map_view';
180
+
181
+		$address_string = ($address != '' ? $address : '')
182
+						  . ($city != '' ? ',' . $city : '')
183
+						  . ($state != '' ? ',' . $state : '')
184
+						  . ($zip != '' ? ',' . $zip : '')
185
+						  . ($country != '' ? ',' . $country : '');
186
+
187
+		$google_map = htmlentities2('https://maps.google.com/maps?q=' . urlencode($address_string));
188
+
189
+		switch ($type) {
190
+			case 'text':
191
+			default:
192
+				$text = $text == '' ? esc_html__('Map and Directions', 'event_espresso') : $text;
193
+				break;
194
+
195
+			case 'url_only':
196
+			case 'url':
197
+				$text = $google_map;
198
+				break;
199
+
200
+			case 'map':
201
+				$scheme = is_ssl() ? 'https://' : 'http://';
202
+
203
+				$api_key = apply_filters(
204
+					'FHEE__EEH_Maps__espresso_google_maps_link__api_key',
205
+					EE_Registry::instance()->CFG->map_settings->google_map_api_key
206
+				);
207
+
208
+				return '
209 209
                 <a class="a_map_image_link" 
210 210
                    href="' . esc_url_raw($google_map) . '" 
211 211
                    target="_blank" 
@@ -215,23 +215,23 @@  discard block
 block discarded – undo
215 215
                          class="map_image_link" 
216 216
                          id="venue_map_' . $id . '" ' . $map_image_class . ' 
217 217
                          src="'
218
-                       . htmlentities2(
219
-                           $scheme
220
-                           . 'maps.googleapis.com/maps/api/staticmap?center='
221
-                           . urlencode($address_string)
222
-                           . '&amp;zoom=14&amp;size='
223
-                           . $map_w . 'x' . $map_h
224
-                           . '&amp;markers=color:green|label:|'
225
-                           . urlencode($address_string)
226
-                           . '&amp;sensor=false&amp;key='
227
-                           . $api_key
228
-                       ) . '"
218
+					   . htmlentities2(
219
+						   $scheme
220
+						   . 'maps.googleapis.com/maps/api/staticmap?center='
221
+						   . urlencode($address_string)
222
+						   . '&amp;zoom=14&amp;size='
223
+						   . $map_w . 'x' . $map_h
224
+						   . '&amp;markers=color:green|label:|'
225
+						   . urlencode($address_string)
226
+						   . '&amp;sensor=false&amp;key='
227
+						   . $api_key
228
+					   ) . '"
229 229
                      />
230 230
                  </a>';
231
-        }
231
+		}
232 232
 
233
-        return $type === 'url_only'
234
-            ? $text
235
-            : '<a href="' . esc_url_raw($google_map) . '" target="_blank" rel="noopener noreferrer">' . $text . '</a>';
236
-    }
233
+		return $type === 'url_only'
234
+			? $text
235
+			: '<a href="' . esc_url_raw($google_map) . '" target="_blank" rel="noopener noreferrer">' . $text . '</a>';
236
+	}
237 237
 }
Please login to merge, or discard this patch.
core/services/progress_steps/ProgressStep.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     protected function setId($id = '')
123 123
     {
124
-        if (! is_string($id)) {
124
+        if ( ! is_string($id)) {
125 125
             throw new InvalidDataTypeException('$id', $id, 'string');
126 126
         }
127 127
         $this->id = $id;
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     protected function setOrder($order = 0)
146 146
     {
147
-        if (! is_int($order)) {
147
+        if ( ! is_int($order)) {
148 148
             throw new InvalidDataTypeException('$order', $order, 'integer');
149 149
         }
150 150
         $this->order = absint($order);
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
      */
174 174
     protected function setHtmlClass($html_class)
175 175
     {
176
-        if (! is_string($html_class)) {
176
+        if ( ! is_string($html_class)) {
177 177
             throw new InvalidDataTypeException('$html_class', $html_class, 'string');
178 178
         }
179 179
         if (strpos($html_class, 'progress-step-') === false) {
180
-            $html_class = 'progress-step-' . $html_class;
180
+            $html_class = 'progress-step-'.$html_class;
181 181
         }
182 182
         $this->html_class = $html_class;
183 183
     }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      */
200 200
     protected function setText($text)
201 201
     {
202
-        if (! is_string($text)) {
202
+        if ( ! is_string($text)) {
203 203
             throw new InvalidDataTypeException('$text', $text, 'string');
204 204
         }
205 205
         $this->text = sanitize_text_field($text);
Please login to merge, or discard this patch.
Indentation   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -16,190 +16,190 @@
 block discarded – undo
16 16
  */
17 17
 class ProgressStep implements ProgressStepInterface
18 18
 {
19
-    /**
20
-     * @var boolean $current
21
-     */
22
-    private $current = false;
23
-
24
-
25
-    /**
26
-     * @var boolean $completed
27
-     */
28
-    private $completed = false;
29
-
30
-
31
-    /**
32
-     * @var string $html_class
33
-     */
34
-    private $html_class;
35
-
36
-    /**
37
-     * @var string $id
38
-     */
39
-    private $id = '';
40
-
41
-    /**
42
-     * @var int $order
43
-     */
44
-    private $order = 0;
45
-
46
-    /**
47
-     * @var string $text
48
-     */
49
-    private $text = '';
50
-
51
-
52
-    /**
53
-     * ProgressStep constructor
54
-     *
55
-     * @param int    $order
56
-     * @param string $id
57
-     * @param string $html_class
58
-     * @param string $text
59
-     * @throws InvalidDataTypeException
60
-     */
61
-    public function __construct($order, $id, $html_class, $text)
62
-    {
63
-        $this->setOrder($order);
64
-        $this->setId($id);
65
-        $this->setHtmlClass($html_class);
66
-        $this->setText($text);
67
-    }
68
-
69
-
70
-    /**
71
-     * @return boolean
72
-     */
73
-    public function isCurrent()
74
-    {
75
-        return $this->current;
76
-    }
77
-
78
-
79
-    /**
80
-     * @param boolean $current
81
-     */
82
-    public function setIsCurrent($current = true)
83
-    {
84
-        $this->current = filter_var($current, FILTER_VALIDATE_BOOLEAN);
85
-    }
86
-
87
-
88
-    /**
89
-     * @return boolean
90
-     */
91
-    public function isCompleted()
92
-    {
93
-        return $this->completed;
94
-    }
95
-
96
-
97
-    /**
98
-     * @param boolean $completed
99
-     */
100
-    public function setIsCompleted($completed = true)
101
-    {
102
-        $this->completed = filter_var($completed, FILTER_VALIDATE_BOOLEAN);
103
-    }
104
-
105
-
106
-    /**
107
-     * @return string
108
-     */
109
-    public function id()
110
-    {
111
-        return $this->id;
112
-    }
113
-
114
-
115
-    /**
116
-     * @access protected
117
-     * @param string $id
118
-     * @throws InvalidDataTypeException
119
-     */
120
-    protected function setId($id = '')
121
-    {
122
-        if (! is_string($id)) {
123
-            throw new InvalidDataTypeException('$id', $id, 'string');
124
-        }
125
-        $this->id = $id;
126
-    }
127
-
128
-
129
-    /**
130
-     * @return int
131
-     */
132
-    public function order()
133
-    {
134
-        return $this->order;
135
-    }
136
-
137
-
138
-    /**
139
-     * @access protected
140
-     * @param int $order
141
-     * @throws InvalidDataTypeException
142
-     */
143
-    protected function setOrder($order = 0)
144
-    {
145
-        if (! is_int($order)) {
146
-            throw new InvalidDataTypeException('$order', $order, 'integer');
147
-        }
148
-        $this->order = absint($order);
149
-    }
150
-
151
-
152
-    /**
153
-     * @return string
154
-     */
155
-    public function htmlClass()
156
-    {
157
-        $html_class = $this->html_class;
158
-        if ($this->isCurrent()) {
159
-            $html_class .= ' progress-step-active';
160
-        } elseif ($this->isCompleted()) {
161
-            $html_class .= ' progress-step-completed';
162
-        }
163
-        return $html_class;
164
-    }
165
-
166
-
167
-    /**
168
-     * @access protected
169
-     * @param string $html_class
170
-     * @throws InvalidDataTypeException
171
-     */
172
-    protected function setHtmlClass($html_class)
173
-    {
174
-        if (! is_string($html_class)) {
175
-            throw new InvalidDataTypeException('$html_class', $html_class, 'string');
176
-        }
177
-        if (strpos($html_class, 'progress-step-') === false) {
178
-            $html_class = 'progress-step-' . $html_class;
179
-        }
180
-        $this->html_class = $html_class;
181
-    }
182
-
183
-
184
-    /**
185
-     * @return string
186
-     */
187
-    public function text()
188
-    {
189
-        return $this->text;
190
-    }
191
-
192
-
193
-    /**
194
-     * @access protected
195
-     * @param string $text
196
-     * @throws InvalidDataTypeException
197
-     */
198
-    protected function setText($text)
199
-    {
200
-        if (! is_string($text)) {
201
-            throw new InvalidDataTypeException('$text', $text, 'string');
202
-        }
203
-        $this->text = sanitize_text_field($text);
204
-    }
19
+	/**
20
+	 * @var boolean $current
21
+	 */
22
+	private $current = false;
23
+
24
+
25
+	/**
26
+	 * @var boolean $completed
27
+	 */
28
+	private $completed = false;
29
+
30
+
31
+	/**
32
+	 * @var string $html_class
33
+	 */
34
+	private $html_class;
35
+
36
+	/**
37
+	 * @var string $id
38
+	 */
39
+	private $id = '';
40
+
41
+	/**
42
+	 * @var int $order
43
+	 */
44
+	private $order = 0;
45
+
46
+	/**
47
+	 * @var string $text
48
+	 */
49
+	private $text = '';
50
+
51
+
52
+	/**
53
+	 * ProgressStep constructor
54
+	 *
55
+	 * @param int    $order
56
+	 * @param string $id
57
+	 * @param string $html_class
58
+	 * @param string $text
59
+	 * @throws InvalidDataTypeException
60
+	 */
61
+	public function __construct($order, $id, $html_class, $text)
62
+	{
63
+		$this->setOrder($order);
64
+		$this->setId($id);
65
+		$this->setHtmlClass($html_class);
66
+		$this->setText($text);
67
+	}
68
+
69
+
70
+	/**
71
+	 * @return boolean
72
+	 */
73
+	public function isCurrent()
74
+	{
75
+		return $this->current;
76
+	}
77
+
78
+
79
+	/**
80
+	 * @param boolean $current
81
+	 */
82
+	public function setIsCurrent($current = true)
83
+	{
84
+		$this->current = filter_var($current, FILTER_VALIDATE_BOOLEAN);
85
+	}
86
+
87
+
88
+	/**
89
+	 * @return boolean
90
+	 */
91
+	public function isCompleted()
92
+	{
93
+		return $this->completed;
94
+	}
95
+
96
+
97
+	/**
98
+	 * @param boolean $completed
99
+	 */
100
+	public function setIsCompleted($completed = true)
101
+	{
102
+		$this->completed = filter_var($completed, FILTER_VALIDATE_BOOLEAN);
103
+	}
104
+
105
+
106
+	/**
107
+	 * @return string
108
+	 */
109
+	public function id()
110
+	{
111
+		return $this->id;
112
+	}
113
+
114
+
115
+	/**
116
+	 * @access protected
117
+	 * @param string $id
118
+	 * @throws InvalidDataTypeException
119
+	 */
120
+	protected function setId($id = '')
121
+	{
122
+		if (! is_string($id)) {
123
+			throw new InvalidDataTypeException('$id', $id, 'string');
124
+		}
125
+		$this->id = $id;
126
+	}
127
+
128
+
129
+	/**
130
+	 * @return int
131
+	 */
132
+	public function order()
133
+	{
134
+		return $this->order;
135
+	}
136
+
137
+
138
+	/**
139
+	 * @access protected
140
+	 * @param int $order
141
+	 * @throws InvalidDataTypeException
142
+	 */
143
+	protected function setOrder($order = 0)
144
+	{
145
+		if (! is_int($order)) {
146
+			throw new InvalidDataTypeException('$order', $order, 'integer');
147
+		}
148
+		$this->order = absint($order);
149
+	}
150
+
151
+
152
+	/**
153
+	 * @return string
154
+	 */
155
+	public function htmlClass()
156
+	{
157
+		$html_class = $this->html_class;
158
+		if ($this->isCurrent()) {
159
+			$html_class .= ' progress-step-active';
160
+		} elseif ($this->isCompleted()) {
161
+			$html_class .= ' progress-step-completed';
162
+		}
163
+		return $html_class;
164
+	}
165
+
166
+
167
+	/**
168
+	 * @access protected
169
+	 * @param string $html_class
170
+	 * @throws InvalidDataTypeException
171
+	 */
172
+	protected function setHtmlClass($html_class)
173
+	{
174
+		if (! is_string($html_class)) {
175
+			throw new InvalidDataTypeException('$html_class', $html_class, 'string');
176
+		}
177
+		if (strpos($html_class, 'progress-step-') === false) {
178
+			$html_class = 'progress-step-' . $html_class;
179
+		}
180
+		$this->html_class = $html_class;
181
+	}
182
+
183
+
184
+	/**
185
+	 * @return string
186
+	 */
187
+	public function text()
188
+	{
189
+		return $this->text;
190
+	}
191
+
192
+
193
+	/**
194
+	 * @access protected
195
+	 * @param string $text
196
+	 * @throws InvalidDataTypeException
197
+	 */
198
+	protected function setText($text)
199
+	{
200
+		if (! is_string($text)) {
201
+			throw new InvalidDataTypeException('$text', $text, 'string');
202
+		}
203
+		$this->text = sanitize_text_field($text);
204
+	}
205 205
 }
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Shortcodes.lib.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
     public function get_shortcode_helper()
148 148
     {
149
-        if (! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes) {
149
+        if ( ! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes) {
150 150
             $this->_set_shortcode_helper();
151 151
         }
152 152
         return $this->_shortcode_helper;
@@ -170,17 +170,17 @@  discard block
 block discarded – undo
170 170
 
171 171
         // we need to setup any dynamic shortcodes so that they work with the array_key_exists
172 172
         preg_match_all('/(\[[A-Za-z0-9\_]+_\*)/', $shortcode, $matches);
173
-        $sc_to_verify = ! empty($matches[0]) ? $matches[0][0] . ']' : $shortcode;
173
+        $sc_to_verify = ! empty($matches[0]) ? $matches[0][0].']' : $shortcode;
174 174
 
175 175
         // first we want to make sure this is a valid shortcode
176
-        if (! array_key_exists($sc_to_verify, $this->_shortcodes)) {
176
+        if ( ! array_key_exists($sc_to_verify, $this->_shortcodes)) {
177 177
             return false;
178 178
         } //get out, this parser doesn't handle the incoming shortcode.
179 179
         $this->_data = $data;
180 180
         $this->_extra_data = $extra_data;
181 181
         $this->_set_messages_properties();
182 182
         $parsed = apply_filters(
183
-            'FHEE__' . get_class($this) . '__parser_after',
183
+            'FHEE__'.get_class($this).'__parser_after',
184 184
             $this->_parser($shortcode),
185 185
             $shortcode,
186 186
             $data,
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     public function get_shortcodes()
203 203
     {
204
-        $this->_shortcodes = apply_filters('FHEE__' . get_class($this) . '__shortcodes', $this->_shortcodes, $this);
204
+        $this->_shortcodes = apply_filters('FHEE__'.get_class($this).'__shortcodes', $this->_shortcodes, $this);
205 205
 
206 206
         // note the below filter applies to ALL shortcode parsers... be careful!
207 207
         $this->_shortcodes = apply_filters('FHEE__EE_Shortcodes__shortcodes', $this->_shortcodes, $this);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     {
249 249
 
250 250
         // first test to make sure we've got an array!
251
-        if (! is_array($this->_data)) {
251
+        if ( ! is_array($this->_data)) {
252 252
             throw new EE_Error(
253 253
                 sprintf(
254 254
                     esc_html__(
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         }
263 263
 
264 264
         // next test to make sure we've got the required template in the index!
265
-        if (! isset($this->_data['template'])) {
265
+        if ( ! isset($this->_data['template'])) {
266 266
             throw new EE_Error(
267 267
                 sprintf(
268 268
                     esc_html__(
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         }
275 275
 
276 276
         // next test to make sure we've got got a data index in the incoming data array
277
-        if (! isset($this->_data['data'])) {
277
+        if ( ! isset($this->_data['data'])) {
278 278
             throw new EE_Error(
279 279
                 esc_html__(
280 280
                     'The incoming data does not have the required data index in its array',
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
     {
304 304
         // make sure the required wp helper function is present
305 305
         // require the shortcode file if necessary
306
-        if (! function_exists('shortcode_parse_atts')) {
307
-            require_once(ABSPATH . WPINC . '/shortcodes.php');
306
+        if ( ! function_exists('shortcode_parse_atts')) {
307
+            require_once(ABSPATH.WPINC.'/shortcodes.php');
308 308
         }
309 309
 
310 310
         // let's get any attributes that may be present and set the defaults.
@@ -329,15 +329,15 @@  discard block
 block discarded – undo
329 329
     protected function _mutate_conditional_block_in_template($shortcode, $show = true)
330 330
     {
331 331
         // first let's get all the matches in the template for this particular shortcode.
332
-        preg_match_all('~' . $this->_get_conditional_block_regex($shortcode) . '~', $this->_data['template'], $matches);
332
+        preg_match_all('~'.$this->_get_conditional_block_regex($shortcode).'~', $this->_data['template'], $matches);
333 333
 
334 334
         if ($matches && is_array($matches[0]) && ! empty($matches[0])) {
335 335
             // we need to hide all instances of the matches
336 336
             foreach ($matches[0] as $index => $content_to_show_or_hide) {
337 337
                 $content_to_show_or_hide = preg_quote($content_to_show_or_hide);
338
-                $replacement = $show ? $matches[4][ $index ] : '';
338
+                $replacement = $show ? $matches[4][$index] : '';
339 339
                 $this->_data['template'] = preg_replace(
340
-                    '~' . $content_to_show_or_hide . '~',
340
+                    '~'.$content_to_show_or_hide.'~',
341 341
                     $replacement,
342 342
                     $this->_data['template']
343 343
                 );
Please login to merge, or discard this patch.
Indentation   +452 added lines, -452 removed lines patch added patch discarded remove patch
@@ -16,456 +16,456 @@
 block discarded – undo
16 16
  */
17 17
 abstract class EE_Shortcodes extends EE_Base
18 18
 {
19
-    /**
20
-     * holds label for library
21
-     * This is used for referencing the library label
22
-     *
23
-     * @access public
24
-     * @var string
25
-     */
26
-    public $label;
27
-
28
-
29
-    /**
30
-     * This property is used for referencing a short description of the library
31
-     *
32
-     * @access public
33
-     * @var string
34
-     */
35
-    public $description;
36
-
37
-
38
-    /**
39
-     * This will hold an array of shortcodes with the key as the shortcode ([shortcode]) and the value as a
40
-     * label/description for the shortcode.
41
-     *
42
-     * @access protected
43
-     * @var array
44
-     */
45
-    protected $_shortcodes;
46
-
47
-
48
-    /**
49
-     * This will hold the incoming data item sent to the parser method
50
-     *
51
-     * @access protected
52
-     * @var mixed (array|object)
53
-     */
54
-    protected $_data;
55
-
56
-
57
-    /**
58
-     * some shortcodes may require extra data to parse.  This property is provided for that.
59
-     *
60
-     * @var array
61
-     */
62
-    protected $_extra_data;
63
-
64
-
65
-    /**
66
-     * EE_messenger used to generate the template being parsed.
67
-     *
68
-     * @since 4.5.0
69
-     * @var EE_messenger
70
-     */
71
-    protected $_messenger;
72
-
73
-
74
-    /**
75
-     * message type used to generate the template being parsed.
76
-     *
77
-     * @since 4.5.0
78
-     * @var EE_message_type
79
-     */
80
-    protected $_message_type;
81
-
82
-
83
-    /**
84
-     * context used for the template being parsed
85
-     *
86
-     * @since 4.5.0
87
-     * @var string
88
-     */
89
-    protected $_context;
90
-
91
-
92
-    /**
93
-     * Specific Message Template Group ID
94
-     *
95
-     * @since 4.5.0
96
-     * @var int
97
-     */
98
-    protected $_GRP_ID;
99
-
100
-
101
-    /**
102
-     * @since 4.9.0
103
-     * @type EE_Message
104
-     */
105
-    protected $_message;
106
-
107
-
108
-    /**
109
-     * This will hold an instance of the EEH_Parse_Shortcodes helper that will be used when handling list type
110
-     * shortcodes
111
-     *
112
-     * @var EEH_Parse_Shortcodes
113
-     */
114
-    protected $_shortcode_helper;
115
-
116
-
117
-    public function __construct()
118
-    {
119
-        $this->_set_defaults();
120
-        $this->_init_props();
121
-    }
122
-
123
-
124
-    /**
125
-     * This sets the defaults for the properties.  Child classes will override these properties in their _init_props
126
-     * method
127
-     */
128
-    private function _set_defaults()
129
-    {
130
-        $this->name = $this->description = '';
131
-        $this->_shortcodes = array();
132
-        $this->_set_shortcode_helper();
133
-    }
134
-
135
-
136
-    /**
137
-     * loads an instance of the EE_Shortcode_Parser helper when requested
138
-     */
139
-    protected function _set_shortcode_helper()
140
-    {
141
-        // get shortcode_replace instance- set when _get_messages is called in child...
142
-        $this->_shortcode_helper = new EEH_Parse_Shortcodes();
143
-    }
144
-
145
-
146
-    public function get_shortcode_helper()
147
-    {
148
-        if (! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes) {
149
-            $this->_set_shortcode_helper();
150
-        }
151
-        return $this->_shortcode_helper;
152
-    }
153
-
154
-
155
-    /**
156
-     * This is the public method for kicking of the parser included with each child.  It can be overridden by child
157
-     * classes if necessary (see EE_Questions_Answers for example)
158
-     *
159
-     * @param  string $shortcode incoming shortcode to be parsed
160
-     * @param  mixed (object|array) $data       incoming data to be be used for parsing
161
-     * @param  mixed (object|array) $extra_data extra incoming data (usually EE_Messages_Addressee)
162
-     * @return string            parsed shortcode.
163
-     */
164
-    public function parser($shortcode, $data, $extra_data = array())
165
-    {
166
-
167
-        // filter setup shortcodes
168
-        $this->_shortcodes = $this->get_shortcodes();
169
-
170
-        // we need to setup any dynamic shortcodes so that they work with the array_key_exists
171
-        preg_match_all('/(\[[A-Za-z0-9\_]+_\*)/', $shortcode, $matches);
172
-        $sc_to_verify = ! empty($matches[0]) ? $matches[0][0] . ']' : $shortcode;
173
-
174
-        // first we want to make sure this is a valid shortcode
175
-        if (! array_key_exists($sc_to_verify, $this->_shortcodes)) {
176
-            return false;
177
-        } //get out, this parser doesn't handle the incoming shortcode.
178
-        $this->_data = $data;
179
-        $this->_extra_data = $extra_data;
180
-        $this->_set_messages_properties();
181
-        $parsed = apply_filters(
182
-            'FHEE__' . get_class($this) . '__parser_after',
183
-            $this->_parser($shortcode),
184
-            $shortcode,
185
-            $data,
186
-            $extra_data,
187
-            $this
188
-        );
189
-
190
-        // note the below filter applies to ALL shortcode parsers... be careful!
191
-        return apply_filters('FHEE__EE_Shortcodes__parser_after', $parsed, $shortcode, $data, $extra_data, $this);
192
-    }
193
-
194
-
195
-    /**
196
-     * This method just returns the shortcodes in the $_shortcodes array property.
197
-     *
198
-     * @access public
199
-     * @return array array of shortcodes => description pairs
200
-     */
201
-    public function get_shortcodes()
202
-    {
203
-        $this->_shortcodes = apply_filters('FHEE__' . get_class($this) . '__shortcodes', $this->_shortcodes, $this);
204
-
205
-        // note the below filter applies to ALL shortcode parsers... be careful!
206
-        $this->_shortcodes = apply_filters('FHEE__EE_Shortcodes__shortcodes', $this->_shortcodes, $this);
207
-
208
-        return $this->_shortcodes;
209
-    }
210
-
211
-
212
-    /**
213
-     * Child classes use this method to set the $name, $description, and $_shortcodes properties.
214
-     *
215
-     * @abstract
216
-     * @access protected
217
-     * @return void
218
-     */
219
-    abstract protected function _init_props();
220
-
221
-
222
-    /**
223
-     * This method will give parsing instructions for each shortcode defined in the _shortcodes array.  Child methods
224
-     * will have to take care of handling.
225
-     *
226
-     * @abstract
227
-     * @access protected
228
-     * @param string $shortcode    the shortcode to be parsed.
229
-     * @param mixed (object|array) $data      incoming data for the parser.  The data could be either an object or
230
-     *                             array because there are some shortcodes that might be replaced by prepared data that
231
-     *                             has multiple items in a list (i.e. list of attendees in an event and we're showing
232
-     *                             fname/lname for each attendee).  In this case data will be in an array.  Otherwise
233
-     *                             the data shoudl be in a properly formatted object.  The
234
-     *                             EEH_Parse_Shortcodes.helper.php describes the data object we're expecting.
235
-     * @return string parsed shortcode
236
-     */
237
-    abstract protected function _parser($shortcode);
238
-
239
-
240
-    /**
241
-     * This just validates incoming data for list type shortcode parsers (and they call this method) to make sure it
242
-     * meets their requirements
243
-     *
244
-     * @return mixed (void|exception) If validation fails we'll throw an exception.
245
-     */
246
-    protected function _validate_list_requirements()
247
-    {
248
-
249
-        // first test to make sure we've got an array!
250
-        if (! is_array($this->_data)) {
251
-            throw new EE_Error(
252
-                sprintf(
253
-                    esc_html__(
254
-                        'Expecting an array for the data sent to %s. Instead it was %s',
255
-                        'event_espresso'
256
-                    ),
257
-                    get_class($this),
258
-                    gettype($this->_data)
259
-                )
260
-            );
261
-        }
262
-
263
-        // next test to make sure we've got the required template in the index!
264
-        if (! isset($this->_data['template'])) {
265
-            throw new EE_Error(
266
-                sprintf(
267
-                    esc_html__(
268
-                        'The incoming data does not have the required template index in its array',
269
-                        'event_espresso'
270
-                    )
271
-                )
272
-            );
273
-        }
274
-
275
-        // next test to make sure we've got got a data index in the incoming data array
276
-        if (! isset($this->_data['data'])) {
277
-            throw new EE_Error(
278
-                esc_html__(
279
-                    'The incoming data does not have the required data index in its array',
280
-                    'event_espresso'
281
-                )
282
-            );
283
-        }
284
-
285
-        // all is well let's make sure _extra_data always has the values needed.
286
-        // let's make sure that extra_data includes all templates (for later parsing if necessary)
287
-        if (empty($this->_extra_data) || (empty($this->_extra_data['data']) && empty($this->_extra_data['template']))) {
288
-            $this->_extra_data['data'] = $this->_data['data'];
289
-            $this->_extra_data['template'] = $this->_data['template'];
290
-        }
291
-    }
292
-
293
-
294
-    /**
295
-     * This returns any attributes that may be existing on an EE_Shortcode
296
-     *
297
-     * @since 4.5.0
298
-     * @param string $shortcode incoming shortcode
299
-     * @return array An array with the attributes
300
-     */
301
-    protected function _get_shortcode_attrs($shortcode)
302
-    {
303
-        // make sure the required wp helper function is present
304
-        // require the shortcode file if necessary
305
-        if (! function_exists('shortcode_parse_atts')) {
306
-            require_once(ABSPATH . WPINC . '/shortcodes.php');
307
-        }
308
-
309
-        // let's get any attributes that may be present and set the defaults.
310
-        $shortcode_to_parse = str_replace('[', '', str_replace(']', '', $shortcode));
311
-        return shortcode_parse_atts($shortcode_to_parse);
312
-    }
313
-
314
-
315
-    /**
316
-     * Conditional blocks are shortcode patterns with an opening conditional tag `[IF_*]` and a corresponding
317
-     * closing tag (eg `[/IF_*]`).  The content within the tags will be displayed/hidden depending on whatever
318
-     * conditions existed in the opening tag.  This method handles parsing the actual template to show/hide this
319
-     * conditional content.
320
-     *
321
-     * @since 4.9.32
322
-     *
323
-     * @param string $shortcode This should be original shortcode as used in the template and passed to the parser.
324
-     * @param bool   $show      true means the opening and closing tags are removed and the content is left showing,
325
-     *                          false means the opening and closing tags and the contained content are removed.
326
-     * @return string     The template for the shortcode is returned.
327
-     */
328
-    protected function _mutate_conditional_block_in_template($shortcode, $show = true)
329
-    {
330
-        // first let's get all the matches in the template for this particular shortcode.
331
-        preg_match_all('~' . $this->_get_conditional_block_regex($shortcode) . '~', $this->_data['template'], $matches);
332
-
333
-        if ($matches && is_array($matches[0]) && ! empty($matches[0])) {
334
-            // we need to hide all instances of the matches
335
-            foreach ($matches[0] as $index => $content_to_show_or_hide) {
336
-                $content_to_show_or_hide = preg_quote($content_to_show_or_hide);
337
-                $replacement = $show ? $matches[4][ $index ] : '';
338
-                $this->_data['template'] = preg_replace(
339
-                    '~' . $content_to_show_or_hide . '~',
340
-                    $replacement,
341
-                    $this->_data['template']
342
-                );
343
-            }
344
-        }
345
-        // return $template
346
-        return $this->_data['template'];
347
-    }
348
-
349
-
350
-    /**
351
-     * This returns the regex pattern to use for conditional shortcodes parsing.
352
-     *
353
-     * Note: regex comes in part from the WP `get_shortcode_regex` expression in \wp-includes\shortcodes.php
354
-     *
355
-     * @param $shortcode
356
-     * @since 4.9.32
357
-     * @return string
358
-     */
359
-    private function _get_conditional_block_regex($shortcode)
360
-    {
361
-        // get just the shortcode tag for the match
362
-        preg_match('@\[([^<>&/\[\]\x00-\x20=]++)@', $shortcode, $shortcode_tag_matches);
363
-        if (empty($shortcode_tag_matches[1])) {
364
-            return $this->_data['template'];
365
-        }
366
-
367
-        $shortcode_tag = $shortcode_tag_matches[1];
368
-        // get attributes_part_of_tag
369
-        $attributes_part = preg_quote(str_replace(array($shortcode_tag, '[', ']'), '', $shortcode));
370
-        // escape
371
-        $shortcode_tag = preg_quote($shortcode_tag);
372
-
373
-        return
374
-            '\['                                  // Opening Bracket
375
-            . "($shortcode_tag)$attributes_part"    // 1: Shortcode Name
376
-            . '(?![\w-])'                           // Not followed by word character or hyphen
377
-            . '('                                   // 2: Unroll the loop: Inside the opening shortcode tag
378
-            . '[^\]\/]*'                          // Not a closing bracket or forward slash
379
-            . '(?:'
380
-            . '\/(?!\])'                      // A forward slash not followed by a closing bracket
381
-            . '[^\]\/]*'                      // Not a closing bracket or forward slash.
382
-            . ')*?'
383
-            . ')'
384
-            . '(?:'
385
-            . '(\/)'                              // 3. Self closing tag ...
386
-            . '\]'                                // ... and closing bracket
387
-            . '|'
388
-            . '\]'                                // Closing bracket
389
-            . '(?:'
390
-            . '('                             // 4: Unroll the loop: Optionally, anything between the opening and closing brackets
391
-            . '[^\[]*+'                   // Not an opening bracket
392
-            . '(?:'
393
-            . '\[(?!\/\1\])'          // An opening bracket not followed by the closing shortcode tag.
394
-            . '[^\[]*+'               // Not an opening bracket
395
-            . ')*+'
396
-            . ')'
397
-            . '\[\/\1\]'                      // Closing shortcode tag
398
-            . ')?'
399
-            . ')';
400
-    }
401
-
402
-
403
-    /**
404
-     * This sets the properties related to the messages system
405
-     *
406
-     * @since 4.5.0
407
-     * @return void
408
-     */
409
-    protected function _set_messages_properties()
410
-    {
411
-        // should be in _extra_data
412
-        if (isset($this->_extra_data['messenger'])) {
413
-            $this->_messenger = $this->_extra_data['messenger'];
414
-            $this->_message_type = $this->_extra_data['message_type'];
415
-            $this->_context = $this->_extra_data['message'] instanceof EE_Message
416
-                ? $this->_extra_data['message']->context() : '';
417
-            $this->_GRP_ID = $this->_extra_data['message'] instanceof EE_Message
418
-                ? $this->_extra_data['message']->GRP_ID() : 0;
419
-            $this->_message = $this->_extra_data['message'] instanceof EE_Message ? $this->_extra_data['message']
420
-                : null;
421
-        }
422
-    }
423
-
424
-
425
-    /**
426
-     * This returns whatever the set message type object is that was set on this shortcode parser.
427
-     *
428
-     * @since 4.5.0
429
-     * @return EE_message_type
430
-     */
431
-    public function get_set_message_type()
432
-    {
433
-        return $this->_message_type;
434
-    }
435
-
436
-
437
-    /**
438
-     * This returns whatever the set messenger object is that was set on this shortcode parser
439
-     *
440
-     * @since 4.5.0
441
-     * @return EE_messenger
442
-     */
443
-    public function get_set_messenger()
444
-    {
445
-        return $this->_messenger;
446
-    }
447
-
448
-
449
-    /**
450
-     * This returns whatever the set context string is on this shortcode parser.
451
-     *
452
-     * @since 4.5.0
453
-     * @return string
454
-     */
455
-    public function get_set_context()
456
-    {
457
-        return $this->_context;
458
-    }
459
-
460
-
461
-    /**
462
-     * This returns whatever the set EE_Message object is on this shortcode.
463
-     *
464
-     * @since 4.9.0
465
-     * @return EE_Message
466
-     */
467
-    public function get_set_message()
468
-    {
469
-        return $this->_message;
470
-    }
19
+	/**
20
+	 * holds label for library
21
+	 * This is used for referencing the library label
22
+	 *
23
+	 * @access public
24
+	 * @var string
25
+	 */
26
+	public $label;
27
+
28
+
29
+	/**
30
+	 * This property is used for referencing a short description of the library
31
+	 *
32
+	 * @access public
33
+	 * @var string
34
+	 */
35
+	public $description;
36
+
37
+
38
+	/**
39
+	 * This will hold an array of shortcodes with the key as the shortcode ([shortcode]) and the value as a
40
+	 * label/description for the shortcode.
41
+	 *
42
+	 * @access protected
43
+	 * @var array
44
+	 */
45
+	protected $_shortcodes;
46
+
47
+
48
+	/**
49
+	 * This will hold the incoming data item sent to the parser method
50
+	 *
51
+	 * @access protected
52
+	 * @var mixed (array|object)
53
+	 */
54
+	protected $_data;
55
+
56
+
57
+	/**
58
+	 * some shortcodes may require extra data to parse.  This property is provided for that.
59
+	 *
60
+	 * @var array
61
+	 */
62
+	protected $_extra_data;
63
+
64
+
65
+	/**
66
+	 * EE_messenger used to generate the template being parsed.
67
+	 *
68
+	 * @since 4.5.0
69
+	 * @var EE_messenger
70
+	 */
71
+	protected $_messenger;
72
+
73
+
74
+	/**
75
+	 * message type used to generate the template being parsed.
76
+	 *
77
+	 * @since 4.5.0
78
+	 * @var EE_message_type
79
+	 */
80
+	protected $_message_type;
81
+
82
+
83
+	/**
84
+	 * context used for the template being parsed
85
+	 *
86
+	 * @since 4.5.0
87
+	 * @var string
88
+	 */
89
+	protected $_context;
90
+
91
+
92
+	/**
93
+	 * Specific Message Template Group ID
94
+	 *
95
+	 * @since 4.5.0
96
+	 * @var int
97
+	 */
98
+	protected $_GRP_ID;
99
+
100
+
101
+	/**
102
+	 * @since 4.9.0
103
+	 * @type EE_Message
104
+	 */
105
+	protected $_message;
106
+
107
+
108
+	/**
109
+	 * This will hold an instance of the EEH_Parse_Shortcodes helper that will be used when handling list type
110
+	 * shortcodes
111
+	 *
112
+	 * @var EEH_Parse_Shortcodes
113
+	 */
114
+	protected $_shortcode_helper;
115
+
116
+
117
+	public function __construct()
118
+	{
119
+		$this->_set_defaults();
120
+		$this->_init_props();
121
+	}
122
+
123
+
124
+	/**
125
+	 * This sets the defaults for the properties.  Child classes will override these properties in their _init_props
126
+	 * method
127
+	 */
128
+	private function _set_defaults()
129
+	{
130
+		$this->name = $this->description = '';
131
+		$this->_shortcodes = array();
132
+		$this->_set_shortcode_helper();
133
+	}
134
+
135
+
136
+	/**
137
+	 * loads an instance of the EE_Shortcode_Parser helper when requested
138
+	 */
139
+	protected function _set_shortcode_helper()
140
+	{
141
+		// get shortcode_replace instance- set when _get_messages is called in child...
142
+		$this->_shortcode_helper = new EEH_Parse_Shortcodes();
143
+	}
144
+
145
+
146
+	public function get_shortcode_helper()
147
+	{
148
+		if (! $this->_shortcode_helper instanceof EEH_Parse_Shortcodes) {
149
+			$this->_set_shortcode_helper();
150
+		}
151
+		return $this->_shortcode_helper;
152
+	}
153
+
154
+
155
+	/**
156
+	 * This is the public method for kicking of the parser included with each child.  It can be overridden by child
157
+	 * classes if necessary (see EE_Questions_Answers for example)
158
+	 *
159
+	 * @param  string $shortcode incoming shortcode to be parsed
160
+	 * @param  mixed (object|array) $data       incoming data to be be used for parsing
161
+	 * @param  mixed (object|array) $extra_data extra incoming data (usually EE_Messages_Addressee)
162
+	 * @return string            parsed shortcode.
163
+	 */
164
+	public function parser($shortcode, $data, $extra_data = array())
165
+	{
166
+
167
+		// filter setup shortcodes
168
+		$this->_shortcodes = $this->get_shortcodes();
169
+
170
+		// we need to setup any dynamic shortcodes so that they work with the array_key_exists
171
+		preg_match_all('/(\[[A-Za-z0-9\_]+_\*)/', $shortcode, $matches);
172
+		$sc_to_verify = ! empty($matches[0]) ? $matches[0][0] . ']' : $shortcode;
173
+
174
+		// first we want to make sure this is a valid shortcode
175
+		if (! array_key_exists($sc_to_verify, $this->_shortcodes)) {
176
+			return false;
177
+		} //get out, this parser doesn't handle the incoming shortcode.
178
+		$this->_data = $data;
179
+		$this->_extra_data = $extra_data;
180
+		$this->_set_messages_properties();
181
+		$parsed = apply_filters(
182
+			'FHEE__' . get_class($this) . '__parser_after',
183
+			$this->_parser($shortcode),
184
+			$shortcode,
185
+			$data,
186
+			$extra_data,
187
+			$this
188
+		);
189
+
190
+		// note the below filter applies to ALL shortcode parsers... be careful!
191
+		return apply_filters('FHEE__EE_Shortcodes__parser_after', $parsed, $shortcode, $data, $extra_data, $this);
192
+	}
193
+
194
+
195
+	/**
196
+	 * This method just returns the shortcodes in the $_shortcodes array property.
197
+	 *
198
+	 * @access public
199
+	 * @return array array of shortcodes => description pairs
200
+	 */
201
+	public function get_shortcodes()
202
+	{
203
+		$this->_shortcodes = apply_filters('FHEE__' . get_class($this) . '__shortcodes', $this->_shortcodes, $this);
204
+
205
+		// note the below filter applies to ALL shortcode parsers... be careful!
206
+		$this->_shortcodes = apply_filters('FHEE__EE_Shortcodes__shortcodes', $this->_shortcodes, $this);
207
+
208
+		return $this->_shortcodes;
209
+	}
210
+
211
+
212
+	/**
213
+	 * Child classes use this method to set the $name, $description, and $_shortcodes properties.
214
+	 *
215
+	 * @abstract
216
+	 * @access protected
217
+	 * @return void
218
+	 */
219
+	abstract protected function _init_props();
220
+
221
+
222
+	/**
223
+	 * This method will give parsing instructions for each shortcode defined in the _shortcodes array.  Child methods
224
+	 * will have to take care of handling.
225
+	 *
226
+	 * @abstract
227
+	 * @access protected
228
+	 * @param string $shortcode    the shortcode to be parsed.
229
+	 * @param mixed (object|array) $data      incoming data for the parser.  The data could be either an object or
230
+	 *                             array because there are some shortcodes that might be replaced by prepared data that
231
+	 *                             has multiple items in a list (i.e. list of attendees in an event and we're showing
232
+	 *                             fname/lname for each attendee).  In this case data will be in an array.  Otherwise
233
+	 *                             the data shoudl be in a properly formatted object.  The
234
+	 *                             EEH_Parse_Shortcodes.helper.php describes the data object we're expecting.
235
+	 * @return string parsed shortcode
236
+	 */
237
+	abstract protected function _parser($shortcode);
238
+
239
+
240
+	/**
241
+	 * This just validates incoming data for list type shortcode parsers (and they call this method) to make sure it
242
+	 * meets their requirements
243
+	 *
244
+	 * @return mixed (void|exception) If validation fails we'll throw an exception.
245
+	 */
246
+	protected function _validate_list_requirements()
247
+	{
248
+
249
+		// first test to make sure we've got an array!
250
+		if (! is_array($this->_data)) {
251
+			throw new EE_Error(
252
+				sprintf(
253
+					esc_html__(
254
+						'Expecting an array for the data sent to %s. Instead it was %s',
255
+						'event_espresso'
256
+					),
257
+					get_class($this),
258
+					gettype($this->_data)
259
+				)
260
+			);
261
+		}
262
+
263
+		// next test to make sure we've got the required template in the index!
264
+		if (! isset($this->_data['template'])) {
265
+			throw new EE_Error(
266
+				sprintf(
267
+					esc_html__(
268
+						'The incoming data does not have the required template index in its array',
269
+						'event_espresso'
270
+					)
271
+				)
272
+			);
273
+		}
274
+
275
+		// next test to make sure we've got got a data index in the incoming data array
276
+		if (! isset($this->_data['data'])) {
277
+			throw new EE_Error(
278
+				esc_html__(
279
+					'The incoming data does not have the required data index in its array',
280
+					'event_espresso'
281
+				)
282
+			);
283
+		}
284
+
285
+		// all is well let's make sure _extra_data always has the values needed.
286
+		// let's make sure that extra_data includes all templates (for later parsing if necessary)
287
+		if (empty($this->_extra_data) || (empty($this->_extra_data['data']) && empty($this->_extra_data['template']))) {
288
+			$this->_extra_data['data'] = $this->_data['data'];
289
+			$this->_extra_data['template'] = $this->_data['template'];
290
+		}
291
+	}
292
+
293
+
294
+	/**
295
+	 * This returns any attributes that may be existing on an EE_Shortcode
296
+	 *
297
+	 * @since 4.5.0
298
+	 * @param string $shortcode incoming shortcode
299
+	 * @return array An array with the attributes
300
+	 */
301
+	protected function _get_shortcode_attrs($shortcode)
302
+	{
303
+		// make sure the required wp helper function is present
304
+		// require the shortcode file if necessary
305
+		if (! function_exists('shortcode_parse_atts')) {
306
+			require_once(ABSPATH . WPINC . '/shortcodes.php');
307
+		}
308
+
309
+		// let's get any attributes that may be present and set the defaults.
310
+		$shortcode_to_parse = str_replace('[', '', str_replace(']', '', $shortcode));
311
+		return shortcode_parse_atts($shortcode_to_parse);
312
+	}
313
+
314
+
315
+	/**
316
+	 * Conditional blocks are shortcode patterns with an opening conditional tag `[IF_*]` and a corresponding
317
+	 * closing tag (eg `[/IF_*]`).  The content within the tags will be displayed/hidden depending on whatever
318
+	 * conditions existed in the opening tag.  This method handles parsing the actual template to show/hide this
319
+	 * conditional content.
320
+	 *
321
+	 * @since 4.9.32
322
+	 *
323
+	 * @param string $shortcode This should be original shortcode as used in the template and passed to the parser.
324
+	 * @param bool   $show      true means the opening and closing tags are removed and the content is left showing,
325
+	 *                          false means the opening and closing tags and the contained content are removed.
326
+	 * @return string     The template for the shortcode is returned.
327
+	 */
328
+	protected function _mutate_conditional_block_in_template($shortcode, $show = true)
329
+	{
330
+		// first let's get all the matches in the template for this particular shortcode.
331
+		preg_match_all('~' . $this->_get_conditional_block_regex($shortcode) . '~', $this->_data['template'], $matches);
332
+
333
+		if ($matches && is_array($matches[0]) && ! empty($matches[0])) {
334
+			// we need to hide all instances of the matches
335
+			foreach ($matches[0] as $index => $content_to_show_or_hide) {
336
+				$content_to_show_or_hide = preg_quote($content_to_show_or_hide);
337
+				$replacement = $show ? $matches[4][ $index ] : '';
338
+				$this->_data['template'] = preg_replace(
339
+					'~' . $content_to_show_or_hide . '~',
340
+					$replacement,
341
+					$this->_data['template']
342
+				);
343
+			}
344
+		}
345
+		// return $template
346
+		return $this->_data['template'];
347
+	}
348
+
349
+
350
+	/**
351
+	 * This returns the regex pattern to use for conditional shortcodes parsing.
352
+	 *
353
+	 * Note: regex comes in part from the WP `get_shortcode_regex` expression in \wp-includes\shortcodes.php
354
+	 *
355
+	 * @param $shortcode
356
+	 * @since 4.9.32
357
+	 * @return string
358
+	 */
359
+	private function _get_conditional_block_regex($shortcode)
360
+	{
361
+		// get just the shortcode tag for the match
362
+		preg_match('@\[([^<>&/\[\]\x00-\x20=]++)@', $shortcode, $shortcode_tag_matches);
363
+		if (empty($shortcode_tag_matches[1])) {
364
+			return $this->_data['template'];
365
+		}
366
+
367
+		$shortcode_tag = $shortcode_tag_matches[1];
368
+		// get attributes_part_of_tag
369
+		$attributes_part = preg_quote(str_replace(array($shortcode_tag, '[', ']'), '', $shortcode));
370
+		// escape
371
+		$shortcode_tag = preg_quote($shortcode_tag);
372
+
373
+		return
374
+			'\['                                  // Opening Bracket
375
+			. "($shortcode_tag)$attributes_part"    // 1: Shortcode Name
376
+			. '(?![\w-])'                           // Not followed by word character or hyphen
377
+			. '('                                   // 2: Unroll the loop: Inside the opening shortcode tag
378
+			. '[^\]\/]*'                          // Not a closing bracket or forward slash
379
+			. '(?:'
380
+			. '\/(?!\])'                      // A forward slash not followed by a closing bracket
381
+			. '[^\]\/]*'                      // Not a closing bracket or forward slash.
382
+			. ')*?'
383
+			. ')'
384
+			. '(?:'
385
+			. '(\/)'                              // 3. Self closing tag ...
386
+			. '\]'                                // ... and closing bracket
387
+			. '|'
388
+			. '\]'                                // Closing bracket
389
+			. '(?:'
390
+			. '('                             // 4: Unroll the loop: Optionally, anything between the opening and closing brackets
391
+			. '[^\[]*+'                   // Not an opening bracket
392
+			. '(?:'
393
+			. '\[(?!\/\1\])'          // An opening bracket not followed by the closing shortcode tag.
394
+			. '[^\[]*+'               // Not an opening bracket
395
+			. ')*+'
396
+			. ')'
397
+			. '\[\/\1\]'                      // Closing shortcode tag
398
+			. ')?'
399
+			. ')';
400
+	}
401
+
402
+
403
+	/**
404
+	 * This sets the properties related to the messages system
405
+	 *
406
+	 * @since 4.5.0
407
+	 * @return void
408
+	 */
409
+	protected function _set_messages_properties()
410
+	{
411
+		// should be in _extra_data
412
+		if (isset($this->_extra_data['messenger'])) {
413
+			$this->_messenger = $this->_extra_data['messenger'];
414
+			$this->_message_type = $this->_extra_data['message_type'];
415
+			$this->_context = $this->_extra_data['message'] instanceof EE_Message
416
+				? $this->_extra_data['message']->context() : '';
417
+			$this->_GRP_ID = $this->_extra_data['message'] instanceof EE_Message
418
+				? $this->_extra_data['message']->GRP_ID() : 0;
419
+			$this->_message = $this->_extra_data['message'] instanceof EE_Message ? $this->_extra_data['message']
420
+				: null;
421
+		}
422
+	}
423
+
424
+
425
+	/**
426
+	 * This returns whatever the set message type object is that was set on this shortcode parser.
427
+	 *
428
+	 * @since 4.5.0
429
+	 * @return EE_message_type
430
+	 */
431
+	public function get_set_message_type()
432
+	{
433
+		return $this->_message_type;
434
+	}
435
+
436
+
437
+	/**
438
+	 * This returns whatever the set messenger object is that was set on this shortcode parser
439
+	 *
440
+	 * @since 4.5.0
441
+	 * @return EE_messenger
442
+	 */
443
+	public function get_set_messenger()
444
+	{
445
+		return $this->_messenger;
446
+	}
447
+
448
+
449
+	/**
450
+	 * This returns whatever the set context string is on this shortcode parser.
451
+	 *
452
+	 * @since 4.5.0
453
+	 * @return string
454
+	 */
455
+	public function get_set_context()
456
+	{
457
+		return $this->_context;
458
+	}
459
+
460
+
461
+	/**
462
+	 * This returns whatever the set EE_Message object is on this shortcode.
463
+	 *
464
+	 * @since 4.9.0
465
+	 * @return EE_Message
466
+	 */
467
+	public function get_set_message()
468
+	{
469
+		return $this->_message;
470
+	}
471 471
 }
Please login to merge, or discard this patch.
core/libraries/iframe_display/iframe_wrapper.template.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,9 +24,12 @@
 block discarded – undo
24 24
     <title><?php echo wp_strip_all_tags($title); ?></title>
25 25
     <?php if ($enqueue_wp_assets) : ?>
26 26
         <?php wp_head(); ?>
27
-    <?php else : ?>
27
+    <?php else {
28
+	: ?>
28 29
         <?php foreach ($css as $url) :?>
29
-    <link rel="stylesheet" type="text/css" href="<?php echo esc_url_raw($url); ?>">
30
+    <link rel="stylesheet" type="text/css" href="<?php echo esc_url_raw($url);
31
+}
32
+?>">
30 33
         <?php endforeach; ?>
31 34
             <script type="text/javascript">
32 35
                 <?php echo $eei18n; ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                 <?php echo $eei18n; ?>
37 37
             </script>
38 38
         <?php foreach ($header_js as $key => $url) :?>
39
-            <?php $header_attributes = isset($header_js_attributes[ $key ]) ? $header_js_attributes[ $key ] : ''; ?>
39
+            <?php $header_attributes = isset($header_js_attributes[$key]) ? $header_js_attributes[$key] : ''; ?>
40 40
         <script type="text/javascript" src="<?php echo esc_url_raw($url); ?>" <?php echo AttributesSanitizer::clean($header_attributes, AllowedTags::getAllowedTags(), 'script'); ?>></script>
41 41
         <?php endforeach; ?>
42 42
     <?php endif; ?>
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     <?php echo wp_kses($content, AllowedTags::getWithFormTags()); ?>
48 48
 </div>
49 49
 <?php foreach ($footer_js as $key => $url) : ?>
50
-    <?php $footer_attributes = isset($footer_js_attributes[ $key ]) ? $footer_js_attributes[ $key ] : ''; ?>
50
+    <?php $footer_attributes = isset($footer_js_attributes[$key]) ? $footer_js_attributes[$key] : ''; ?>
51 51
     <script type="text/javascript" src="<?php echo esc_url_raw($url); ?>" <?php echo AttributesSanitizer::clean($footer_attributes, AllowedTags::getAllowedTags(), 'script'); ?>></script>
52 52
 <?php endforeach; ?>
53 53
 <?php if ($enqueue_wp_assets) : ?>
Please login to merge, or discard this patch.
libraries/payment_methods/templates/payment_details_content.template.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (! defined('EVENT_ESPRESSO_VERSION')) {
4
-    exit('No direct script access allowed');
4
+	exit('No direct script access allowed');
5 5
 }
6 6
 /**
7 7
  * payment_details_content
@@ -11,5 +11,5 @@  discard block
 block discarded – undo
11 11
  */
12 12
 $gateway_response = $payment->gateway_response();
13 13
 if (! empty($gateway_response)) {
14
-    echo '<span class="error payment-problem">' . esc_html($gateway_response) . '</span>';
14
+	echo '<span class="error payment-problem">' . esc_html($gateway_response) . '</span>';
15 15
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! defined('EVENT_ESPRESSO_VERSION')) {
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4 4
     exit('No direct script access allowed');
5 5
 }
6 6
 /**
@@ -10,6 +10,6 @@  discard block
 block discarded – undo
10 10
  * @var EE_Payment_Method $payment_method
11 11
  */
12 12
 $gateway_response = $payment->gateway_response();
13
-if (! empty($gateway_response)) {
14
-    echo '<span class="error payment-problem">' . esc_html($gateway_response) . '</span>';
13
+if ( ! empty($gateway_response)) {
14
+    echo '<span class="error payment-problem">'.esc_html($gateway_response).'</span>';
15 15
 }
Please login to merge, or discard this patch.
core/libraries/messages/EE_Message_Type_Collection.lib.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
             $this->rewind();
175 175
             while ($this->valid()) {
176 176
                 echo '<h5 style="color:#2EA2CC;">
177
-                    ' . __CLASS__ . ' class : <span style="color:#E76700">' . esc_html($this->getInfo()) . '</span>
177
+                    ' . __CLASS__.' class : <span style="color:#E76700">'.esc_html($this->getInfo()).'</span>
178 178
                     </h5>';
179 179
                 $this->next();
180 180
             }
Please login to merge, or discard this patch.
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -13,170 +13,170 @@
 block discarded – undo
13 13
  */
14 14
 class EE_Message_Type_Collection extends EE_Object_Collection
15 15
 {
16
-    /**
17
-     * EE_Message_Type_Collection constructor.
18
-     */
19
-    public function __construct()
20
-    {
21
-        $this->interface = 'EE_message_type';
22
-    }
23
-
24
-
25
-
26
-    /**
27
-     * add
28
-     *
29
-     * attaches an object to the Collection
30
-     * and sets any supplied data associated with the current iterator entry
31
-     * by calling EE_Object_Collection::set_info()
32
-     *
33
-     * @access public
34
-     * @param object $object
35
-     * @param mixed  $info
36
-     * @return bool
37
-     */
38
-    public function add($object, $info = null)
39
-    {
40
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
41
-        return parent::add($object, $info);
42
-    }
43
-
44
-
45
-
46
-    /**
47
-     * set_info
48
-     *
49
-     * Sets the data associated with an object in the Collection
50
-     * if no $info is supplied, then the spl_object_hash() is used
51
-     *
52
-     * @access public
53
-     * @param object $object
54
-     * @param mixed  $info
55
-     * @return bool
56
-     */
57
-    public function set_info($object, $info = null)
58
-    {
59
-        $info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
60
-        return parent::set_info($object, $info);
61
-    }
62
-
63
-
64
-
65
-    /**
66
-     * get_by_info
67
-     *
68
-     * finds and returns an object in the Collection based on the info that was set using addObject()
69
-     * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
70
-     *
71
-     * @access public
72
-     * @param mixed
73
-     * @return null | object
74
-     */
75
-    public function get_by_info($info)
76
-    {
77
-        return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
78
-    }
79
-
80
-
81
-
82
-    /**
83
-     * has
84
-     *
85
-     * returns TRUE or FALSE depending on whether the supplied object is within the Collection
86
-     *
87
-     * @access public
88
-     * @param object $object
89
-     * @return bool
90
-     */
91
-    public function has($object)
92
-    {
93
-        return parent::has($object);
94
-    }
95
-
96
-
97
-
98
-    /**
99
-     * has_by_name
100
-     *
101
-     * returns TRUE or FALSE depending on whether the supplied message_type classname is within the Collection
102
-     *
103
-     * @access public
104
-     * @param string $message_type_name
105
-     * @return bool
106
-     */
107
-    public function has_by_name($message_type_name)
108
-    {
109
-        return $this->get_by_info($message_type_name) instanceof $this->interface ? true : false;
110
-    }
111
-
112
-
113
-
114
-    /**
115
-     * remove
116
-     *
117
-     * detaches an object from the Collection
118
-     *
119
-     * @access public
120
-     * @param $object
121
-     * @return bool
122
-     */
123
-    public function remove($object)
124
-    {
125
-        return parent::remove($object);
126
-    }
127
-
128
-
129
-
130
-    /**
131
-     * set_current
132
-     *
133
-     * advances pointer to the provided object
134
-     *
135
-     * @access public
136
-     * @param $object
137
-     * @return void
138
-     */
139
-    public function set_current($object)
140
-    {
141
-        parent::set_current($object);
142
-    }
143
-
144
-
145
-
146
-    /**
147
-     * set_current_by_info
148
-     *
149
-     * advances pointer to the object whose info matches that which was provided
150
-     *
151
-     * @access public
152
-     * @param $info
153
-     * @return void
154
-     */
155
-    public function set_current_by_info($info)
156
-    {
157
-        parent::set_current_by_info($info);
158
-    }
159
-
160
-
161
-
162
-    /**
163
-     * show_collection_classes
164
-     *
165
-     * displays list of collection classes if WP_DEBUG is on
166
-     *
167
-     * @access public
168
-     * @return void
169
-     */
170
-    public function show_collection_classes()
171
-    {
172
-        if (WP_DEBUG) {
173
-            $this->rewind();
174
-            while ($this->valid()) {
175
-                echo '<h5 style="color:#2EA2CC;">
16
+	/**
17
+	 * EE_Message_Type_Collection constructor.
18
+	 */
19
+	public function __construct()
20
+	{
21
+		$this->interface = 'EE_message_type';
22
+	}
23
+
24
+
25
+
26
+	/**
27
+	 * add
28
+	 *
29
+	 * attaches an object to the Collection
30
+	 * and sets any supplied data associated with the current iterator entry
31
+	 * by calling EE_Object_Collection::set_info()
32
+	 *
33
+	 * @access public
34
+	 * @param object $object
35
+	 * @param mixed  $info
36
+	 * @return bool
37
+	 */
38
+	public function add($object, $info = null)
39
+	{
40
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
41
+		return parent::add($object, $info);
42
+	}
43
+
44
+
45
+
46
+	/**
47
+	 * set_info
48
+	 *
49
+	 * Sets the data associated with an object in the Collection
50
+	 * if no $info is supplied, then the spl_object_hash() is used
51
+	 *
52
+	 * @access public
53
+	 * @param object $object
54
+	 * @param mixed  $info
55
+	 * @return bool
56
+	 */
57
+	public function set_info($object, $info = null)
58
+	{
59
+		$info = empty($info) && $object instanceof $this->interface ? $object->name : $info;
60
+		return parent::set_info($object, $info);
61
+	}
62
+
63
+
64
+
65
+	/**
66
+	 * get_by_info
67
+	 *
68
+	 * finds and returns an object in the Collection based on the info that was set using addObject()
69
+	 * PLZ NOTE: the pointer is reset to the beginning of the collection before returning
70
+	 *
71
+	 * @access public
72
+	 * @param mixed
73
+	 * @return null | object
74
+	 */
75
+	public function get_by_info($info)
76
+	{
77
+		return parent::get_by_info(str_replace(' ', '_', strtolower($info)));
78
+	}
79
+
80
+
81
+
82
+	/**
83
+	 * has
84
+	 *
85
+	 * returns TRUE or FALSE depending on whether the supplied object is within the Collection
86
+	 *
87
+	 * @access public
88
+	 * @param object $object
89
+	 * @return bool
90
+	 */
91
+	public function has($object)
92
+	{
93
+		return parent::has($object);
94
+	}
95
+
96
+
97
+
98
+	/**
99
+	 * has_by_name
100
+	 *
101
+	 * returns TRUE or FALSE depending on whether the supplied message_type classname is within the Collection
102
+	 *
103
+	 * @access public
104
+	 * @param string $message_type_name
105
+	 * @return bool
106
+	 */
107
+	public function has_by_name($message_type_name)
108
+	{
109
+		return $this->get_by_info($message_type_name) instanceof $this->interface ? true : false;
110
+	}
111
+
112
+
113
+
114
+	/**
115
+	 * remove
116
+	 *
117
+	 * detaches an object from the Collection
118
+	 *
119
+	 * @access public
120
+	 * @param $object
121
+	 * @return bool
122
+	 */
123
+	public function remove($object)
124
+	{
125
+		return parent::remove($object);
126
+	}
127
+
128
+
129
+
130
+	/**
131
+	 * set_current
132
+	 *
133
+	 * advances pointer to the provided object
134
+	 *
135
+	 * @access public
136
+	 * @param $object
137
+	 * @return void
138
+	 */
139
+	public function set_current($object)
140
+	{
141
+		parent::set_current($object);
142
+	}
143
+
144
+
145
+
146
+	/**
147
+	 * set_current_by_info
148
+	 *
149
+	 * advances pointer to the object whose info matches that which was provided
150
+	 *
151
+	 * @access public
152
+	 * @param $info
153
+	 * @return void
154
+	 */
155
+	public function set_current_by_info($info)
156
+	{
157
+		parent::set_current_by_info($info);
158
+	}
159
+
160
+
161
+
162
+	/**
163
+	 * show_collection_classes
164
+	 *
165
+	 * displays list of collection classes if WP_DEBUG is on
166
+	 *
167
+	 * @access public
168
+	 * @return void
169
+	 */
170
+	public function show_collection_classes()
171
+	{
172
+		if (WP_DEBUG) {
173
+			$this->rewind();
174
+			while ($this->valid()) {
175
+				echo '<h5 style="color:#2EA2CC;">
176 176
                     ' . __CLASS__ . ' class : <span style="color:#E76700">' . esc_html($this->getInfo()) . '</span>
177 177
                     </h5>';
178
-                $this->next();
179
-            }
180
-        }
181
-    }
178
+				$this->next();
179
+			}
180
+		}
181
+	}
182 182
 }
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_ticket_list.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
         <div class="ticket-time-and-place-details">
25 25
             <div class="ticket-time-details">
26 26
                 <h4 class="sub-section-title no-bottom-margin">
27
-                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'clock-16x16.png'); ?>">
27
+                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'clock-16x16.png'); ?>">
28 28
                     <?php esc_html_e('Date/Time:', 'event_espresso'); ?>
29 29
                 </h4>
30 30
                 <ul class="event-dates">[DATETIME_LIST]</ul>
31 31
             </div>
32 32
             <div class="ticket-place-details">
33 33
                 <h4 class="sub-section-title no-bottom-margin">
34
-                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'location-pin-16x16.png'); ?>">
34
+                    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'location-pin-16x16.png'); ?>">
35 35
                     <?php esc_html_e('Venue', 'event_espresso'); ?>
36 36
                 </h4>
37 37
                 <ul class="event-venues">
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         </div>
46 46
         <div class="ticket-registrations-area">
47 47
             <h4 class="sub-section-title">
48
-                <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'users-16x16.png'); ?>">
48
+                <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'users-16x16.png'); ?>">
49 49
                 <?php esc_html_e("Registration Details", "event_espresso"); ?>
50 50
                 <span class="small-text link">
51 51
                     ( <a class="print_button noPrint" href="[PRIMARY_REGISTRANT_FRONTEND_EDIT_REG_LINK]">
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_event_list.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 ?>
8 8
 <h3 class="section-title event-name">
9
-    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL . 'calendar_year-24x24.png'); ?>">
9
+    <img class="icon" src="<?php echo esc_url_raw(EE_IMAGES_URL.'calendar_year-24x24.png'); ?>">
10 10
     <?php esc_html_e("Event Name:", "event_espresso") ?>
11 11
     <span class="plain-text">[EVENT_NAME]</span>
12 12
     <span class="small-text link">
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_attendee_list.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 <li class="ticket-registration">
9 9
     <table class="registration-details">
10 10
         <tr class="odd">
11
-            <th><?php	_e('Attendee', 'event_espresso');?></th>
11
+            <th><?php	_e('Attendee', 'event_espresso'); ?></th>
12 12
             <td>[FNAME] [LNAME] ([ATTENDEE_EMAIL])</td>
13 13
         </tr>
14 14
         <tr>
15
-            <th><?php esc_html_e("Registration Code:", "event_espresso");?></th>
15
+            <th><?php esc_html_e("Registration Code:", "event_espresso"); ?></th>
16 16
             <td>[REGISTRATION_CODE] - <span class="[REGISTRATION_STATUS_ID]">[REGISTRATION_STATUS_LABEL]</span></td>
17 17
         </tr>
18 18
     </table>
Please login to merge, or discard this patch.