@@ -15,107 +15,107 @@ |
||
15 | 15 | class Critical_Pages_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Critical Pages Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'critical-pages-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Critical Pages Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'critical-pages-joyride'; |
|
22 | + } |
|
23 | 23 | |
24 | - protected function _set_tour_stops() |
|
25 | - { |
|
26 | - $this->_stops = array( |
|
27 | - 10 => array( |
|
28 | - 'content' => $this->_start(), |
|
29 | - ), |
|
30 | - 20 => array( |
|
31 | - 'id' => 'reg_page_id', |
|
32 | - 'content' => $this->_reg_page_id_stop(), |
|
33 | - 'options' => array( |
|
34 | - 'tipLocation' => 'right', |
|
35 | - 'tipAdjustmentY' => -50, |
|
36 | - 'tipAdjustmentX' => 15, |
|
37 | - ), |
|
38 | - ), |
|
39 | - 30 => array( |
|
40 | - 'id' => 'txn_page_id', |
|
41 | - 'content' => $this->_txn_page_id_stop(), |
|
42 | - 'options' => array( |
|
43 | - 'tipLocation' => 'right', |
|
44 | - 'tipAdjustmentY' => -50, |
|
45 | - 'tipAdjustmentX' => 15, |
|
46 | - ), |
|
47 | - ), |
|
48 | - 40 => array( |
|
49 | - 'id' => 'thank_you_page_id', |
|
50 | - 'content' => $this->_thank_you_page_id_stop(), |
|
51 | - 'options' => array( |
|
52 | - 'tipLocation' => 'right', |
|
53 | - 'tipAdjustmentY' => -50, |
|
54 | - 'tipAdjustmentX' => 15, |
|
55 | - ), |
|
56 | - ), |
|
57 | - 50 => array( |
|
58 | - 'id' => 'cancel_page_id', |
|
59 | - 'content' => $this->_cancel_page_id_stop(), |
|
60 | - 'options' => array( |
|
61 | - 'tipLocation' => 'right', |
|
62 | - 'tipAdjustmentY' => -50, |
|
63 | - 'tipAdjustmentX' => 15, |
|
64 | - ), |
|
65 | - ), |
|
66 | - ); |
|
67 | - } |
|
24 | + protected function _set_tour_stops() |
|
25 | + { |
|
26 | + $this->_stops = array( |
|
27 | + 10 => array( |
|
28 | + 'content' => $this->_start(), |
|
29 | + ), |
|
30 | + 20 => array( |
|
31 | + 'id' => 'reg_page_id', |
|
32 | + 'content' => $this->_reg_page_id_stop(), |
|
33 | + 'options' => array( |
|
34 | + 'tipLocation' => 'right', |
|
35 | + 'tipAdjustmentY' => -50, |
|
36 | + 'tipAdjustmentX' => 15, |
|
37 | + ), |
|
38 | + ), |
|
39 | + 30 => array( |
|
40 | + 'id' => 'txn_page_id', |
|
41 | + 'content' => $this->_txn_page_id_stop(), |
|
42 | + 'options' => array( |
|
43 | + 'tipLocation' => 'right', |
|
44 | + 'tipAdjustmentY' => -50, |
|
45 | + 'tipAdjustmentX' => 15, |
|
46 | + ), |
|
47 | + ), |
|
48 | + 40 => array( |
|
49 | + 'id' => 'thank_you_page_id', |
|
50 | + 'content' => $this->_thank_you_page_id_stop(), |
|
51 | + 'options' => array( |
|
52 | + 'tipLocation' => 'right', |
|
53 | + 'tipAdjustmentY' => -50, |
|
54 | + 'tipAdjustmentX' => 15, |
|
55 | + ), |
|
56 | + ), |
|
57 | + 50 => array( |
|
58 | + 'id' => 'cancel_page_id', |
|
59 | + 'content' => $this->_cancel_page_id_stop(), |
|
60 | + 'options' => array( |
|
61 | + 'tipLocation' => 'right', |
|
62 | + 'tipAdjustmentY' => -50, |
|
63 | + 'tipAdjustmentX' => 15, |
|
64 | + ), |
|
65 | + ), |
|
66 | + ); |
|
67 | + } |
|
68 | 68 | |
69 | 69 | |
70 | - protected function _start() |
|
71 | - { |
|
72 | - $content = '<h3>' . __('Critical Pages', 'event_espresso') . '</h3>'; |
|
73 | - $content .= '<p>' |
|
74 | - . __( |
|
75 | - 'This section lists the pages that Event Espresso needs in order to function. Should you wish to change a page that is used you will need to move the shortcode to the new page and then allocate it here. Otherwise your registrations will not work correctly.', |
|
76 | - 'event_espresso' |
|
77 | - ) . '</p>'; |
|
78 | - $content .= '<p>' |
|
79 | - . __( |
|
80 | - 'This section also provides a status of the page to show you at a glance if something is not right.', |
|
81 | - 'event_espresso' |
|
82 | - ) . '</p>'; |
|
83 | - return $content; |
|
84 | - } |
|
70 | + protected function _start() |
|
71 | + { |
|
72 | + $content = '<h3>' . __('Critical Pages', 'event_espresso') . '</h3>'; |
|
73 | + $content .= '<p>' |
|
74 | + . __( |
|
75 | + 'This section lists the pages that Event Espresso needs in order to function. Should you wish to change a page that is used you will need to move the shortcode to the new page and then allocate it here. Otherwise your registrations will not work correctly.', |
|
76 | + 'event_espresso' |
|
77 | + ) . '</p>'; |
|
78 | + $content .= '<p>' |
|
79 | + . __( |
|
80 | + 'This section also provides a status of the page to show you at a glance if something is not right.', |
|
81 | + 'event_espresso' |
|
82 | + ) . '</p>'; |
|
83 | + return $content; |
|
84 | + } |
|
85 | 85 | |
86 | - protected function _reg_page_id_stop() |
|
87 | - { |
|
88 | - return '<p>' |
|
89 | - . __( |
|
90 | - 'This page processes the registrations and is required, even if it is not visible in your menus. ', |
|
91 | - 'event_espresso' |
|
92 | - ) . '</p>'; |
|
93 | - } |
|
86 | + protected function _reg_page_id_stop() |
|
87 | + { |
|
88 | + return '<p>' |
|
89 | + . __( |
|
90 | + 'This page processes the registrations and is required, even if it is not visible in your menus. ', |
|
91 | + 'event_espresso' |
|
92 | + ) . '</p>'; |
|
93 | + } |
|
94 | 94 | |
95 | - protected function _txn_page_id_stop() |
|
96 | - { |
|
97 | - return '<p>' |
|
98 | - . __( |
|
99 | - 'This page processes payments. It should not be visible on your menus, and the page should not contain anything other than the shortcode.', |
|
100 | - 'event_espresso' |
|
101 | - ) . '</p>'; |
|
102 | - } |
|
95 | + protected function _txn_page_id_stop() |
|
96 | + { |
|
97 | + return '<p>' |
|
98 | + . __( |
|
99 | + 'This page processes payments. It should not be visible on your menus, and the page should not contain anything other than the shortcode.', |
|
100 | + 'event_espresso' |
|
101 | + ) . '</p>'; |
|
102 | + } |
|
103 | 103 | |
104 | - protected function _thank_you_page_id_stop() |
|
105 | - { |
|
106 | - return '<p>' |
|
107 | - . __( |
|
108 | - 'This page is displayed after a successful transaction. Feel free to add extra content to this page to personalise it!', |
|
109 | - 'event_espresso' |
|
110 | - ) . '</p>'; |
|
111 | - } |
|
104 | + protected function _thank_you_page_id_stop() |
|
105 | + { |
|
106 | + return '<p>' |
|
107 | + . __( |
|
108 | + 'This page is displayed after a successful transaction. Feel free to add extra content to this page to personalise it!', |
|
109 | + 'event_espresso' |
|
110 | + ) . '</p>'; |
|
111 | + } |
|
112 | 112 | |
113 | - protected function _cancel_page_id_stop() |
|
114 | - { |
|
115 | - return '<p>' |
|
116 | - . __( |
|
117 | - 'This page is displayed after an unsuccessful transaction. Feel free to add extra content to this page to personalise it!', |
|
118 | - 'event_espresso' |
|
119 | - ) . '</p>'; |
|
120 | - } |
|
113 | + protected function _cancel_page_id_stop() |
|
114 | + { |
|
115 | + return '<p>' |
|
116 | + . __( |
|
117 | + 'This page is displayed after an unsuccessful transaction. Feel free to add extra content to this page to personalise it!', |
|
118 | + 'event_espresso' |
|
119 | + ) . '</p>'; |
|
120 | + } |
|
121 | 121 | } |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | |
70 | 70 | protected function _start() |
71 | 71 | { |
72 | - $content = '<h3>' . __('Critical Pages', 'event_espresso') . '</h3>'; |
|
72 | + $content = '<h3>'.__('Critical Pages', 'event_espresso').'</h3>'; |
|
73 | 73 | $content .= '<p>' |
74 | 74 | . __( |
75 | 75 | 'This section lists the pages that Event Espresso needs in order to function. Should you wish to change a page that is used you will need to move the shortcode to the new page and then allocate it here. Otherwise your registrations will not work correctly.', |
76 | 76 | 'event_espresso' |
77 | - ) . '</p>'; |
|
77 | + ).'</p>'; |
|
78 | 78 | $content .= '<p>' |
79 | 79 | . __( |
80 | 80 | 'This section also provides a status of the page to show you at a glance if something is not right.', |
81 | 81 | 'event_espresso' |
82 | - ) . '</p>'; |
|
82 | + ).'</p>'; |
|
83 | 83 | return $content; |
84 | 84 | } |
85 | 85 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | . __( |
90 | 90 | 'This page processes the registrations and is required, even if it is not visible in your menus. ', |
91 | 91 | 'event_espresso' |
92 | - ) . '</p>'; |
|
92 | + ).'</p>'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | protected function _txn_page_id_stop() |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | . __( |
99 | 99 | 'This page processes payments. It should not be visible on your menus, and the page should not contain anything other than the shortcode.', |
100 | 100 | 'event_espresso' |
101 | - ) . '</p>'; |
|
101 | + ).'</p>'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | protected function _thank_you_page_id_stop() |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | . __( |
108 | 108 | 'This page is displayed after a successful transaction. Feel free to add extra content to this page to personalise it!', |
109 | 109 | 'event_espresso' |
110 | - ) . '</p>'; |
|
110 | + ).'</p>'; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | protected function _cancel_page_id_stop() |
@@ -116,6 +116,6 @@ discard block |
||
116 | 116 | . __( |
117 | 117 | 'This page is displayed after an unsuccessful transaction. Feel free to add extra content to this page to personalise it!', |
118 | 118 | 'event_espresso' |
119 | - ) . '</p>'; |
|
119 | + ).'</p>'; |
|
120 | 120 | } |
121 | 121 | } |
@@ -15,136 +15,136 @@ |
||
15 | 15 | class Your_Organization_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Your Organization Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'your-organization-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Your Organization Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'your-organization-joyride'; |
|
22 | + } |
|
23 | 23 | |
24 | 24 | |
25 | - protected function _set_tour_stops() |
|
26 | - { |
|
27 | - $this->_stops = array( |
|
28 | - 10 => array( |
|
29 | - 'content' => $this->_start(), |
|
30 | - ), |
|
31 | - 30 => array( |
|
32 | - 'id' => 'contact_info_h4', |
|
33 | - 'content' => $this->_contact_information_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'left', |
|
36 | - 'tipAdjustmentY' => -50, |
|
37 | - 'tipAdjustmentX' => 15, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 40 => array( |
|
41 | - 'id' => 'upload_image', |
|
42 | - 'content' => $this->_upload_image_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'right', |
|
45 | - 'tipAdjustmentY' => -50, |
|
46 | - 'tipAdjustmentX' => 15, |
|
47 | - ), |
|
48 | - ), |
|
49 | - 50 => array( |
|
50 | - 'id' => 'organization_facebook', |
|
51 | - 'content' => $this->_organization_facebook_stop(), |
|
52 | - 'options' => array( |
|
53 | - 'tipLocation' => 'right', |
|
54 | - 'tipAdjustmentY' => -50, |
|
55 | - 'tipAdjustmentX' => 15, |
|
56 | - ), |
|
57 | - ), |
|
58 | - 60 => array( |
|
59 | - 'id' => 'ueip_optin', |
|
60 | - 'content' => $this->_ueip_option_stop(), |
|
61 | - 'options' => array( |
|
62 | - 'tipLocation' => 'right', |
|
63 | - 'tipAdjustmentY' => -50, |
|
64 | - 'tipAdjustmentX' => 15, |
|
65 | - ), |
|
66 | - ), |
|
67 | - 70 => array( |
|
68 | - 'id' => 'espresso_major_buttons_wrapper', |
|
69 | - 'content' => $this->_end_tour_stop(), |
|
70 | - 'options' => array( |
|
71 | - 'tipLocation' => 'right', |
|
72 | - 'tipAdjustmentY' => -50, |
|
73 | - 'tipAdjustmentX' => 185, |
|
74 | - ), |
|
75 | - ), |
|
76 | - ); |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 30 => array( |
|
32 | + 'id' => 'contact_info_h4', |
|
33 | + 'content' => $this->_contact_information_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'left', |
|
36 | + 'tipAdjustmentY' => -50, |
|
37 | + 'tipAdjustmentX' => 15, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 40 => array( |
|
41 | + 'id' => 'upload_image', |
|
42 | + 'content' => $this->_upload_image_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'right', |
|
45 | + 'tipAdjustmentY' => -50, |
|
46 | + 'tipAdjustmentX' => 15, |
|
47 | + ), |
|
48 | + ), |
|
49 | + 50 => array( |
|
50 | + 'id' => 'organization_facebook', |
|
51 | + 'content' => $this->_organization_facebook_stop(), |
|
52 | + 'options' => array( |
|
53 | + 'tipLocation' => 'right', |
|
54 | + 'tipAdjustmentY' => -50, |
|
55 | + 'tipAdjustmentX' => 15, |
|
56 | + ), |
|
57 | + ), |
|
58 | + 60 => array( |
|
59 | + 'id' => 'ueip_optin', |
|
60 | + 'content' => $this->_ueip_option_stop(), |
|
61 | + 'options' => array( |
|
62 | + 'tipLocation' => 'right', |
|
63 | + 'tipAdjustmentY' => -50, |
|
64 | + 'tipAdjustmentX' => 15, |
|
65 | + ), |
|
66 | + ), |
|
67 | + 70 => array( |
|
68 | + 'id' => 'espresso_major_buttons_wrapper', |
|
69 | + 'content' => $this->_end_tour_stop(), |
|
70 | + 'options' => array( |
|
71 | + 'tipLocation' => 'right', |
|
72 | + 'tipAdjustmentY' => -50, |
|
73 | + 'tipAdjustmentX' => 185, |
|
74 | + ), |
|
75 | + ), |
|
76 | + ); |
|
77 | 77 | |
78 | - if (is_main_site()) { |
|
79 | - $this->_stops[20] = array( |
|
80 | - 'id' => 'site_license_key', |
|
81 | - 'content' => $this->_site_license_key_stop(), |
|
82 | - 'options' => array( |
|
83 | - 'tipLocation' => 'right', |
|
84 | - 'tipAdjustmentY' => -50, |
|
85 | - 'tipAdjustmentX' => 15, |
|
86 | - ), |
|
87 | - ); |
|
88 | - } |
|
89 | - ksort($this->_stops); |
|
90 | - } |
|
78 | + if (is_main_site()) { |
|
79 | + $this->_stops[20] = array( |
|
80 | + 'id' => 'site_license_key', |
|
81 | + 'content' => $this->_site_license_key_stop(), |
|
82 | + 'options' => array( |
|
83 | + 'tipLocation' => 'right', |
|
84 | + 'tipAdjustmentY' => -50, |
|
85 | + 'tipAdjustmentX' => 15, |
|
86 | + ), |
|
87 | + ); |
|
88 | + } |
|
89 | + ksort($this->_stops); |
|
90 | + } |
|
91 | 91 | |
92 | 92 | |
93 | - protected function _start() |
|
94 | - { |
|
95 | - $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
96 | - $content .= '<p>' |
|
97 | - . __( |
|
98 | - 'This tour of the Your Organization page will go over different areas of the screen to help you understand what they are used for.', |
|
99 | - 'event_espresso' |
|
100 | - ) . '</p>'; |
|
93 | + protected function _start() |
|
94 | + { |
|
95 | + $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
96 | + $content .= '<p>' |
|
97 | + . __( |
|
98 | + 'This tour of the Your Organization page will go over different areas of the screen to help you understand what they are used for.', |
|
99 | + 'event_espresso' |
|
100 | + ) . '</p>'; |
|
101 | 101 | |
102 | - return $content; |
|
103 | - } |
|
102 | + return $content; |
|
103 | + } |
|
104 | 104 | |
105 | - protected function _site_license_key_stop() |
|
106 | - { |
|
107 | - return '<p>' |
|
108 | - . __( |
|
109 | - 'Enter your support license key here to enable one-click updates.', |
|
110 | - 'event_espresso' |
|
111 | - ) . '</p>'; |
|
112 | - } |
|
105 | + protected function _site_license_key_stop() |
|
106 | + { |
|
107 | + return '<p>' |
|
108 | + . __( |
|
109 | + 'Enter your support license key here to enable one-click updates.', |
|
110 | + 'event_espresso' |
|
111 | + ) . '</p>'; |
|
112 | + } |
|
113 | 113 | |
114 | - protected function _contact_information_stop() |
|
115 | - { |
|
116 | - return '<p>' |
|
117 | - . __( |
|
118 | - 'You can change your business / organization information below. Be sure to keep this information updated as it is used in other areas of the site. Adjusting the country option here will update your currency settings. More options are available in the Countries tab.', |
|
119 | - 'event_espresso' |
|
120 | - ) . '</p>'; |
|
121 | - } |
|
114 | + protected function _contact_information_stop() |
|
115 | + { |
|
116 | + return '<p>' |
|
117 | + . __( |
|
118 | + 'You can change your business / organization information below. Be sure to keep this information updated as it is used in other areas of the site. Adjusting the country option here will update your currency settings. More options are available in the Countries tab.', |
|
119 | + 'event_espresso' |
|
120 | + ) . '</p>'; |
|
121 | + } |
|
122 | 122 | |
123 | - protected function _upload_image_stop() |
|
124 | - { |
|
125 | - return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
126 | - } |
|
123 | + protected function _upload_image_stop() |
|
124 | + { |
|
125 | + return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
126 | + } |
|
127 | 127 | |
128 | - protected function _organization_facebook_stop() |
|
129 | - { |
|
130 | - return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
131 | - } |
|
128 | + protected function _organization_facebook_stop() |
|
129 | + { |
|
130 | + return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
131 | + } |
|
132 | 132 | |
133 | - protected function _ueip_option_stop() |
|
134 | - { |
|
135 | - return '<p>' |
|
136 | - . __( |
|
137 | - 'Help us to help you! Sign up to the User eXperience Improvement Program and send us anonymous data that will help us improve Event Espresso.', |
|
138 | - 'event_espresso' |
|
139 | - ) . '</p>'; |
|
140 | - } |
|
133 | + protected function _ueip_option_stop() |
|
134 | + { |
|
135 | + return '<p>' |
|
136 | + . __( |
|
137 | + 'Help us to help you! Sign up to the User eXperience Improvement Program and send us anonymous data that will help us improve Event Espresso.', |
|
138 | + 'event_espresso' |
|
139 | + ) . '</p>'; |
|
140 | + } |
|
141 | 141 | |
142 | - protected function _end_tour_stop() |
|
143 | - { |
|
144 | - return '<p>' |
|
145 | - . __( |
|
146 | - 'You are almost done updating Your Organization information. Click on the Save button to save changes and then go to the Payment Methods screen so you can setup a payment gateway.', |
|
147 | - 'event_espresso' |
|
148 | - ) . '</p>'; |
|
149 | - } |
|
142 | + protected function _end_tour_stop() |
|
143 | + { |
|
144 | + return '<p>' |
|
145 | + . __( |
|
146 | + 'You are almost done updating Your Organization information. Click on the Save button to save changes and then go to the Payment Methods screen so you can setup a payment gateway.', |
|
147 | + 'event_espresso' |
|
148 | + ) . '</p>'; |
|
149 | + } |
|
150 | 150 | } |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | |
93 | 93 | protected function _start() |
94 | 94 | { |
95 | - $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
95 | + $content = '<h3>'.__('Organization Settings', 'event_espresso').'</h3>'; |
|
96 | 96 | $content .= '<p>' |
97 | 97 | . __( |
98 | 98 | 'This tour of the Your Organization page will go over different areas of the screen to help you understand what they are used for.', |
99 | 99 | 'event_espresso' |
100 | - ) . '</p>'; |
|
100 | + ).'</p>'; |
|
101 | 101 | |
102 | 102 | return $content; |
103 | 103 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | . __( |
109 | 109 | 'Enter your support license key here to enable one-click updates.', |
110 | 110 | 'event_espresso' |
111 | - ) . '</p>'; |
|
111 | + ).'</p>'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | protected function _contact_information_stop() |
@@ -117,17 +117,17 @@ discard block |
||
117 | 117 | . __( |
118 | 118 | 'You can change your business / organization information below. Be sure to keep this information updated as it is used in other areas of the site. Adjusting the country option here will update your currency settings. More options are available in the Countries tab.', |
119 | 119 | 'event_espresso' |
120 | - ) . '</p>'; |
|
120 | + ).'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _upload_image_stop() |
124 | 124 | { |
125 | - return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
125 | + return '<p>'.__('Add a logo. This can be used for invoices and tickets.', 'event_espresso').'</p>'; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | protected function _organization_facebook_stop() |
129 | 129 | { |
130 | - return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
130 | + return '<p>'.__('Add links to various social media networks.', 'event_espresso').'</p>'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | protected function _ueip_option_stop() |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | . __( |
137 | 137 | 'Help us to help you! Sign up to the User eXperience Improvement Program and send us anonymous data that will help us improve Event Espresso.', |
138 | 138 | 'event_espresso' |
139 | - ) . '</p>'; |
|
139 | + ).'</p>'; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | protected function _end_tour_stop() |
@@ -145,6 +145,6 @@ discard block |
||
145 | 145 | . __( |
146 | 146 | 'You are almost done updating Your Organization information. Click on the Save button to save changes and then go to the Payment Methods screen so you can setup a payment gateway.', |
147 | 147 | 'event_espresso' |
148 | - ) . '</p>'; |
|
148 | + ).'</p>'; |
|
149 | 149 | } |
150 | 150 | } |
@@ -15,137 +15,137 @@ |
||
15 | 15 | class Message_Templates_Edit_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Message Template Editor Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'messages-templates-edit-joyride'; |
|
22 | - } |
|
23 | - |
|
24 | - |
|
25 | - protected function _set_tour_stops() |
|
26 | - { |
|
27 | - $this->_stops = array( |
|
28 | - 10 => array( |
|
29 | - 'content' => $this->_start(), |
|
30 | - ), |
|
31 | - 20 => array( |
|
32 | - 'id' => 'submit-msg-context-switcher-sbmt', |
|
33 | - 'content' => $this->_context_switcher_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'bottom', |
|
36 | - 'tipAdjustmentY' => -30, |
|
37 | - 'tipAdjustmentX' => -60, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'class' => 'messages-preview-button"', |
|
42 | - 'content' => $this->_preview_button_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'bottom', |
|
45 | - 'tipAdjustmentY' => -30, |
|
46 | - ), |
|
47 | - ), |
|
48 | - 40 => array( |
|
49 | - 'content' => $this->_template_area_stop(), |
|
50 | - 'options' => array( |
|
51 | - 'tipAdjustmentY' => -100, |
|
52 | - 'tipAdjustmentX' => -60, |
|
53 | - ), |
|
54 | - ), |
|
55 | - 50 => array( |
|
56 | - 'id' => 'mtp_valid_shortcodes', |
|
57 | - 'content' => $this->_mtp_valid_shortcodes_stop(), |
|
58 | - 'options' => array( |
|
59 | - 'tipLocation' => 'left', |
|
60 | - 'tipAdjustmentY' => -50, |
|
61 | - 'tipAdjustmentX' => -15, |
|
62 | - ), |
|
63 | - ), |
|
64 | - 60 => array( |
|
65 | - 'id' => 'mtp_extra_actions', |
|
66 | - 'content' => $this->_mtp_extra_actions_stop(), |
|
67 | - 'options' => array( |
|
68 | - 'tipLocation' => 'left', |
|
69 | - 'tipAdjustmentY' => -50, |
|
70 | - 'tipAdjustmentX' => -15, |
|
71 | - ), |
|
72 | - ), |
|
73 | - 70 => array( |
|
74 | - 'id' => 'espresso_espresso_messages_editor_overview', |
|
75 | - 'content' => $this->_update_metabox_stop(), |
|
76 | - 'options' => array( |
|
77 | - 'tipLocation' => 'left', |
|
78 | - 'tipAdjustmentY' => -50, |
|
79 | - 'tipAdjustmentX' => -15, |
|
80 | - ), |
|
81 | - ), |
|
82 | - ); |
|
83 | - } |
|
84 | - |
|
85 | - |
|
86 | - protected function _start() |
|
87 | - { |
|
88 | - $content = '<h3>' . __('Message Template Editor', 'event_espresso') . '</h3>'; |
|
89 | - $content .= '<p>' |
|
90 | - . __( |
|
91 | - 'This tour of the Message Template Editor page will go over different areas of the screen to help you understand what they are used for.', |
|
92 | - 'event_espresso' |
|
93 | - ) . '</p>'; |
|
94 | - return $content; |
|
95 | - } |
|
96 | - |
|
97 | - |
|
98 | - protected function _context_switcher_stop() |
|
99 | - { |
|
100 | - return '<p>' |
|
101 | - . __( |
|
102 | - 'This dropdown allows you to swap between the different recipients templates that are available in this message type. Be sure to save changes befor switching to a different context.', |
|
103 | - 'event_espresso' |
|
104 | - ) . '</p>'; |
|
105 | - } |
|
106 | - |
|
107 | - |
|
108 | - protected function _preview_button_stop() |
|
109 | - { |
|
110 | - return '<p>' |
|
111 | - . __( |
|
112 | - 'Clicking this button will show you a preview of how your message will look.', |
|
113 | - 'event_espresso' |
|
114 | - ) . '</p>'; |
|
115 | - } |
|
116 | - |
|
117 | - |
|
118 | - protected function _template_area_stop() |
|
119 | - { |
|
120 | - return '<p>' |
|
121 | - . __( |
|
122 | - 'Depending on the messenger (recipient) and the message type, the main screen can show different boxes. Overall the screen allows you to confirm who the messages go to and who from, and the actual content of the message.', |
|
123 | - 'event_espresso' |
|
124 | - ) . '</p>'; |
|
125 | - } |
|
126 | - |
|
127 | - protected function _mtp_valid_shortcodes_stop() |
|
128 | - { |
|
129 | - return '<p>' |
|
130 | - . __( |
|
131 | - 'These shortcodes allow you to quickly add data into your messages, without touching code. From emails, to ticket details, to your company logo, building messages with shortcodes is easy and fast.', |
|
132 | - 'event_espresso' |
|
133 | - ) . '</p>'; |
|
134 | - } |
|
135 | - |
|
136 | - |
|
137 | - protected function _mtp_extra_actions_stop() |
|
138 | - { |
|
139 | - return '<p>' |
|
140 | - . __( |
|
141 | - 'Here you will find miscellaneous options to assist you, including a test send button and a reset button.', |
|
142 | - 'event_espresso' |
|
143 | - ) . '</p>'; |
|
144 | - } |
|
145 | - |
|
146 | - |
|
147 | - protected function _update_metabox_stop() |
|
148 | - { |
|
149 | - return '<p>' . __('When done creating your message, click here to save it.', 'event_espresso') . '</p>'; |
|
150 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Message Template Editor Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'messages-templates-edit-joyride'; |
|
22 | + } |
|
23 | + |
|
24 | + |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'id' => 'submit-msg-context-switcher-sbmt', |
|
33 | + 'content' => $this->_context_switcher_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'bottom', |
|
36 | + 'tipAdjustmentY' => -30, |
|
37 | + 'tipAdjustmentX' => -60, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'class' => 'messages-preview-button"', |
|
42 | + 'content' => $this->_preview_button_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'bottom', |
|
45 | + 'tipAdjustmentY' => -30, |
|
46 | + ), |
|
47 | + ), |
|
48 | + 40 => array( |
|
49 | + 'content' => $this->_template_area_stop(), |
|
50 | + 'options' => array( |
|
51 | + 'tipAdjustmentY' => -100, |
|
52 | + 'tipAdjustmentX' => -60, |
|
53 | + ), |
|
54 | + ), |
|
55 | + 50 => array( |
|
56 | + 'id' => 'mtp_valid_shortcodes', |
|
57 | + 'content' => $this->_mtp_valid_shortcodes_stop(), |
|
58 | + 'options' => array( |
|
59 | + 'tipLocation' => 'left', |
|
60 | + 'tipAdjustmentY' => -50, |
|
61 | + 'tipAdjustmentX' => -15, |
|
62 | + ), |
|
63 | + ), |
|
64 | + 60 => array( |
|
65 | + 'id' => 'mtp_extra_actions', |
|
66 | + 'content' => $this->_mtp_extra_actions_stop(), |
|
67 | + 'options' => array( |
|
68 | + 'tipLocation' => 'left', |
|
69 | + 'tipAdjustmentY' => -50, |
|
70 | + 'tipAdjustmentX' => -15, |
|
71 | + ), |
|
72 | + ), |
|
73 | + 70 => array( |
|
74 | + 'id' => 'espresso_espresso_messages_editor_overview', |
|
75 | + 'content' => $this->_update_metabox_stop(), |
|
76 | + 'options' => array( |
|
77 | + 'tipLocation' => 'left', |
|
78 | + 'tipAdjustmentY' => -50, |
|
79 | + 'tipAdjustmentX' => -15, |
|
80 | + ), |
|
81 | + ), |
|
82 | + ); |
|
83 | + } |
|
84 | + |
|
85 | + |
|
86 | + protected function _start() |
|
87 | + { |
|
88 | + $content = '<h3>' . __('Message Template Editor', 'event_espresso') . '</h3>'; |
|
89 | + $content .= '<p>' |
|
90 | + . __( |
|
91 | + 'This tour of the Message Template Editor page will go over different areas of the screen to help you understand what they are used for.', |
|
92 | + 'event_espresso' |
|
93 | + ) . '</p>'; |
|
94 | + return $content; |
|
95 | + } |
|
96 | + |
|
97 | + |
|
98 | + protected function _context_switcher_stop() |
|
99 | + { |
|
100 | + return '<p>' |
|
101 | + . __( |
|
102 | + 'This dropdown allows you to swap between the different recipients templates that are available in this message type. Be sure to save changes befor switching to a different context.', |
|
103 | + 'event_espresso' |
|
104 | + ) . '</p>'; |
|
105 | + } |
|
106 | + |
|
107 | + |
|
108 | + protected function _preview_button_stop() |
|
109 | + { |
|
110 | + return '<p>' |
|
111 | + . __( |
|
112 | + 'Clicking this button will show you a preview of how your message will look.', |
|
113 | + 'event_espresso' |
|
114 | + ) . '</p>'; |
|
115 | + } |
|
116 | + |
|
117 | + |
|
118 | + protected function _template_area_stop() |
|
119 | + { |
|
120 | + return '<p>' |
|
121 | + . __( |
|
122 | + 'Depending on the messenger (recipient) and the message type, the main screen can show different boxes. Overall the screen allows you to confirm who the messages go to and who from, and the actual content of the message.', |
|
123 | + 'event_espresso' |
|
124 | + ) . '</p>'; |
|
125 | + } |
|
126 | + |
|
127 | + protected function _mtp_valid_shortcodes_stop() |
|
128 | + { |
|
129 | + return '<p>' |
|
130 | + . __( |
|
131 | + 'These shortcodes allow you to quickly add data into your messages, without touching code. From emails, to ticket details, to your company logo, building messages with shortcodes is easy and fast.', |
|
132 | + 'event_espresso' |
|
133 | + ) . '</p>'; |
|
134 | + } |
|
135 | + |
|
136 | + |
|
137 | + protected function _mtp_extra_actions_stop() |
|
138 | + { |
|
139 | + return '<p>' |
|
140 | + . __( |
|
141 | + 'Here you will find miscellaneous options to assist you, including a test send button and a reset button.', |
|
142 | + 'event_espresso' |
|
143 | + ) . '</p>'; |
|
144 | + } |
|
145 | + |
|
146 | + |
|
147 | + protected function _update_metabox_stop() |
|
148 | + { |
|
149 | + return '<p>' . __('When done creating your message, click here to save it.', 'event_espresso') . '</p>'; |
|
150 | + } |
|
151 | 151 | } |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | |
86 | 86 | protected function _start() |
87 | 87 | { |
88 | - $content = '<h3>' . __('Message Template Editor', 'event_espresso') . '</h3>'; |
|
88 | + $content = '<h3>'.__('Message Template Editor', 'event_espresso').'</h3>'; |
|
89 | 89 | $content .= '<p>' |
90 | 90 | . __( |
91 | 91 | 'This tour of the Message Template Editor page will go over different areas of the screen to help you understand what they are used for.', |
92 | 92 | 'event_espresso' |
93 | - ) . '</p>'; |
|
93 | + ).'</p>'; |
|
94 | 94 | return $content; |
95 | 95 | } |
96 | 96 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | . __( |
102 | 102 | 'This dropdown allows you to swap between the different recipients templates that are available in this message type. Be sure to save changes befor switching to a different context.', |
103 | 103 | 'event_espresso' |
104 | - ) . '</p>'; |
|
104 | + ).'</p>'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | . __( |
112 | 112 | 'Clicking this button will show you a preview of how your message will look.', |
113 | 113 | 'event_espresso' |
114 | - ) . '</p>'; |
|
114 | + ).'</p>'; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | . __( |
122 | 122 | 'Depending on the messenger (recipient) and the message type, the main screen can show different boxes. Overall the screen allows you to confirm who the messages go to and who from, and the actual content of the message.', |
123 | 123 | 'event_espresso' |
124 | - ) . '</p>'; |
|
124 | + ).'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _mtp_valid_shortcodes_stop() |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | . __( |
131 | 131 | 'These shortcodes allow you to quickly add data into your messages, without touching code. From emails, to ticket details, to your company logo, building messages with shortcodes is easy and fast.', |
132 | 132 | 'event_espresso' |
133 | - ) . '</p>'; |
|
133 | + ).'</p>'; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | |
@@ -140,12 +140,12 @@ discard block |
||
140 | 140 | . __( |
141 | 141 | 'Here you will find miscellaneous options to assist you, including a test send button and a reset button.', |
142 | 142 | 'event_espresso' |
143 | - ) . '</p>'; |
|
143 | + ).'</p>'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
147 | 147 | protected function _update_metabox_stop() |
148 | 148 | { |
149 | - return '<p>' . __('When done creating your message, click here to save it.', 'event_espresso') . '</p>'; |
|
149 | + return '<p>'.__('When done creating your message, click here to save it.', 'event_espresso').'</p>'; |
|
150 | 150 | } |
151 | 151 | } |
@@ -15,112 +15,112 @@ |
||
15 | 15 | class Messages_Settings_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Messages Settings Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'messages-settings-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Messages Settings Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'messages-settings-joyride'; |
|
22 | + } |
|
23 | 23 | |
24 | 24 | |
25 | - protected function _set_tour_stops() |
|
26 | - { |
|
27 | - $this->_stops = array( |
|
28 | - 10 => array( |
|
29 | - 'content' => $this->_start(), |
|
30 | - ), |
|
31 | - 20 => array( |
|
32 | - 'class' => 'messenger_links', |
|
33 | - 'content' => $this->_messenger_links_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'bottom', |
|
36 | - 'tipAdjustmentX' => -5, |
|
37 | - 'tipAdjustmentY' => -25, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'espresso_email_settings', |
|
42 | - 'content' => $this->_email_settings_metabox_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentX' => 20, |
|
46 | - 'tipAdjustmentY' => -30, |
|
47 | - ), |
|
48 | - ), |
|
49 | - 40 => array( |
|
50 | - 'id' => 'on-off-email', |
|
51 | - 'content' => $this->_on_off_toggle_stop(), |
|
52 | - 'options' => array( |
|
53 | - 'tipLocation' => 'left', |
|
54 | - 'tipAdjustmentY' => -50, |
|
55 | - 'tipAdjustmentX' => -15, |
|
56 | - ), |
|
57 | - ), |
|
58 | - 50 => array( |
|
59 | - 'id' => 'active-message-types', |
|
60 | - 'content' => $this->_active_mts_container_stop(), |
|
61 | - 'options' => array( |
|
62 | - 'tipLocation' => 'top', |
|
63 | - 'tipAdjustmentY' => -30, |
|
64 | - ), |
|
65 | - ), |
|
66 | - 60 => array( |
|
67 | - 'id' => 'inactive-message-types', |
|
68 | - 'content' => $this->_inactive_mts_container_stop(), |
|
69 | - 'options' => array( |
|
70 | - 'tipLocation' => 'left', |
|
71 | - 'tipAdjustmentY' => -50, |
|
72 | - 'tipAdjustmentX' => -15, |
|
73 | - ), |
|
74 | - ), |
|
75 | - ); |
|
76 | - } |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'class' => 'messenger_links', |
|
33 | + 'content' => $this->_messenger_links_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'bottom', |
|
36 | + 'tipAdjustmentX' => -5, |
|
37 | + 'tipAdjustmentY' => -25, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'espresso_email_settings', |
|
42 | + 'content' => $this->_email_settings_metabox_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentX' => 20, |
|
46 | + 'tipAdjustmentY' => -30, |
|
47 | + ), |
|
48 | + ), |
|
49 | + 40 => array( |
|
50 | + 'id' => 'on-off-email', |
|
51 | + 'content' => $this->_on_off_toggle_stop(), |
|
52 | + 'options' => array( |
|
53 | + 'tipLocation' => 'left', |
|
54 | + 'tipAdjustmentY' => -50, |
|
55 | + 'tipAdjustmentX' => -15, |
|
56 | + ), |
|
57 | + ), |
|
58 | + 50 => array( |
|
59 | + 'id' => 'active-message-types', |
|
60 | + 'content' => $this->_active_mts_container_stop(), |
|
61 | + 'options' => array( |
|
62 | + 'tipLocation' => 'top', |
|
63 | + 'tipAdjustmentY' => -30, |
|
64 | + ), |
|
65 | + ), |
|
66 | + 60 => array( |
|
67 | + 'id' => 'inactive-message-types', |
|
68 | + 'content' => $this->_inactive_mts_container_stop(), |
|
69 | + 'options' => array( |
|
70 | + 'tipLocation' => 'left', |
|
71 | + 'tipAdjustmentY' => -50, |
|
72 | + 'tipAdjustmentX' => -15, |
|
73 | + ), |
|
74 | + ), |
|
75 | + ); |
|
76 | + } |
|
77 | 77 | |
78 | 78 | |
79 | - protected function _start() |
|
80 | - { |
|
81 | - $content = '<h3>' . __('Messages Settings', 'event_espresso') . '</h3>'; |
|
82 | - $content .= '<p>' |
|
83 | - . __( |
|
84 | - 'This tour of the Messages Settings page will go over different areas of the screen to help you understand what they are used for.', |
|
85 | - 'event_espresso' |
|
86 | - ) . '</p>'; |
|
87 | - return $content; |
|
88 | - } |
|
79 | + protected function _start() |
|
80 | + { |
|
81 | + $content = '<h3>' . __('Messages Settings', 'event_espresso') . '</h3>'; |
|
82 | + $content .= '<p>' |
|
83 | + . __( |
|
84 | + 'This tour of the Messages Settings page will go over different areas of the screen to help you understand what they are used for.', |
|
85 | + 'event_espresso' |
|
86 | + ) . '</p>'; |
|
87 | + return $content; |
|
88 | + } |
|
89 | 89 | |
90 | - protected function _messenger_links_stop() |
|
91 | - { |
|
92 | - return '<p>' . __('Available messengers are shown above.', 'event_espresso') . '</p>'; |
|
93 | - } |
|
90 | + protected function _messenger_links_stop() |
|
91 | + { |
|
92 | + return '<p>' . __('Available messengers are shown above.', 'event_espresso') . '</p>'; |
|
93 | + } |
|
94 | 94 | |
95 | - protected function _email_settings_metabox_stop() |
|
96 | - { |
|
97 | - return '<p>' . __('View the different message types that are currently active.', 'event_espresso') . '</p>'; |
|
98 | - } |
|
95 | + protected function _email_settings_metabox_stop() |
|
96 | + { |
|
97 | + return '<p>' . __('View the different message types that are currently active.', 'event_espresso') . '</p>'; |
|
98 | + } |
|
99 | 99 | |
100 | - protected function _on_off_toggle_stop() |
|
101 | - { |
|
102 | - return '<p>' |
|
103 | - . __( |
|
104 | - 'This toggle will turn all messages on or off for this message type.', |
|
105 | - 'event_espresso' |
|
106 | - ) . '</p>'; |
|
107 | - } |
|
100 | + protected function _on_off_toggle_stop() |
|
101 | + { |
|
102 | + return '<p>' |
|
103 | + . __( |
|
104 | + 'This toggle will turn all messages on or off for this message type.', |
|
105 | + 'event_espresso' |
|
106 | + ) . '</p>'; |
|
107 | + } |
|
108 | 108 | |
109 | - protected function _active_mts_container_stop() |
|
110 | - { |
|
111 | - return '<p>' |
|
112 | - . __( |
|
113 | - 'These are your active message types. Click them to see a description and settings for each one.', |
|
114 | - 'event_espresso' |
|
115 | - ) . '</p>'; |
|
116 | - } |
|
109 | + protected function _active_mts_container_stop() |
|
110 | + { |
|
111 | + return '<p>' |
|
112 | + . __( |
|
113 | + 'These are your active message types. Click them to see a description and settings for each one.', |
|
114 | + 'event_espresso' |
|
115 | + ) . '</p>'; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _inactive_mts_container_stop() |
|
119 | - { |
|
120 | - return '<p>' |
|
121 | - . __( |
|
122 | - 'Drag message types here to deactivate them. Drag them from here to the active box to reactivate them.', |
|
123 | - 'event_espresso' |
|
124 | - ) . '</p>'; |
|
125 | - } |
|
118 | + protected function _inactive_mts_container_stop() |
|
119 | + { |
|
120 | + return '<p>' |
|
121 | + . __( |
|
122 | + 'Drag message types here to deactivate them. Drag them from here to the active box to reactivate them.', |
|
123 | + 'event_espresso' |
|
124 | + ) . '</p>'; |
|
125 | + } |
|
126 | 126 | } |
@@ -78,23 +78,23 @@ discard block |
||
78 | 78 | |
79 | 79 | protected function _start() |
80 | 80 | { |
81 | - $content = '<h3>' . __('Messages Settings', 'event_espresso') . '</h3>'; |
|
81 | + $content = '<h3>'.__('Messages Settings', 'event_espresso').'</h3>'; |
|
82 | 82 | $content .= '<p>' |
83 | 83 | . __( |
84 | 84 | 'This tour of the Messages Settings page will go over different areas of the screen to help you understand what they are used for.', |
85 | 85 | 'event_espresso' |
86 | - ) . '</p>'; |
|
86 | + ).'</p>'; |
|
87 | 87 | return $content; |
88 | 88 | } |
89 | 89 | |
90 | 90 | protected function _messenger_links_stop() |
91 | 91 | { |
92 | - return '<p>' . __('Available messengers are shown above.', 'event_espresso') . '</p>'; |
|
92 | + return '<p>'.__('Available messengers are shown above.', 'event_espresso').'</p>'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | protected function _email_settings_metabox_stop() |
96 | 96 | { |
97 | - return '<p>' . __('View the different message types that are currently active.', 'event_espresso') . '</p>'; |
|
97 | + return '<p>'.__('View the different message types that are currently active.', 'event_espresso').'</p>'; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | protected function _on_off_toggle_stop() |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | . __( |
104 | 104 | 'This toggle will turn all messages on or off for this message type.', |
105 | 105 | 'event_espresso' |
106 | - ) . '</p>'; |
|
106 | + ).'</p>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function _active_mts_container_stop() |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | . __( |
113 | 113 | 'These are your active message types. Click them to see a description and settings for each one.', |
114 | 114 | 'event_espresso' |
115 | - ) . '</p>'; |
|
115 | + ).'</p>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | protected function _inactive_mts_container_stop() |
@@ -121,6 +121,6 @@ discard block |
||
121 | 121 | . __( |
122 | 122 | 'Drag message types here to deactivate them. Drag them from here to the active box to reactivate them.', |
123 | 123 | 'event_espresso' |
124 | - ) . '</p>'; |
|
124 | + ).'</p>'; |
|
125 | 125 | } |
126 | 126 | } |
@@ -15,131 +15,131 @@ |
||
15 | 15 | class Messages_Overview_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Messages Overview Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'messages-overview-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Messages Overview Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'messages-overview-joyride'; |
|
22 | + } |
|
23 | 23 | |
24 | 24 | |
25 | - protected function _set_tour_stops() |
|
26 | - { |
|
27 | - $this->_stops = array( |
|
28 | - 10 => array( |
|
29 | - 'content' => $this->_start(), |
|
30 | - ), |
|
31 | - 20 => array( |
|
32 | - 'id' => 'event', |
|
33 | - 'content' => $this->event_column_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'top', |
|
36 | - 'tipAdjustmentX' => -5, |
|
37 | - 'tipAdjustmentY' => -30, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'message_type', |
|
42 | - 'content' => $this->_message_type_column_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentX' => 20, |
|
46 | - 'tipAdjustmentY' => -30, |
|
47 | - ), |
|
48 | - ), |
|
49 | - 40 => array( |
|
50 | - 'id' => 'messenger', |
|
51 | - 'content' => $this->_messenger_column_stop(), |
|
52 | - 'options' => array( |
|
53 | - 'tipLocation' => 'top', |
|
54 | - 'tipAdjustmentX' => 5, |
|
55 | - 'tipAdjustmentY' => -30, |
|
56 | - ), |
|
57 | - ), |
|
58 | - 50 => array( |
|
59 | - 'id' => 'description', |
|
60 | - 'content' => $this->_description_column_stop(), |
|
61 | - 'options' => array( |
|
62 | - 'tipLocation' => 'top', |
|
63 | - 'tipAdjustmentX' => 5, |
|
64 | - 'tipAdjustmentY' => -30, |
|
65 | - ), |
|
66 | - ), |
|
67 | - 60 => array( |
|
68 | - 'class' => 'bulkactions', |
|
69 | - 'content' => $this->_bulk_actions_stop(), |
|
70 | - 'options' => array( |
|
71 | - 'tipLocation' => 'top', |
|
72 | - 'tipAdjustmentX' => 25, |
|
73 | - 'tipAdjustmentY' => -35, |
|
74 | - ), |
|
75 | - ), |
|
76 | - 70 => array( |
|
77 | - 'id' => 'ee_messenger_filter_by', |
|
78 | - 'content' => $this->_filters_stop(), |
|
79 | - 'options' => array( |
|
80 | - 'tipLocation' => 'top', |
|
81 | - 'tipAdjustmentX' => 25, |
|
82 | - 'tipAdjustmentY' => -30, |
|
83 | - ), |
|
84 | - ), |
|
85 | - ); |
|
86 | - } |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'id' => 'event', |
|
33 | + 'content' => $this->event_column_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'top', |
|
36 | + 'tipAdjustmentX' => -5, |
|
37 | + 'tipAdjustmentY' => -30, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'message_type', |
|
42 | + 'content' => $this->_message_type_column_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentX' => 20, |
|
46 | + 'tipAdjustmentY' => -30, |
|
47 | + ), |
|
48 | + ), |
|
49 | + 40 => array( |
|
50 | + 'id' => 'messenger', |
|
51 | + 'content' => $this->_messenger_column_stop(), |
|
52 | + 'options' => array( |
|
53 | + 'tipLocation' => 'top', |
|
54 | + 'tipAdjustmentX' => 5, |
|
55 | + 'tipAdjustmentY' => -30, |
|
56 | + ), |
|
57 | + ), |
|
58 | + 50 => array( |
|
59 | + 'id' => 'description', |
|
60 | + 'content' => $this->_description_column_stop(), |
|
61 | + 'options' => array( |
|
62 | + 'tipLocation' => 'top', |
|
63 | + 'tipAdjustmentX' => 5, |
|
64 | + 'tipAdjustmentY' => -30, |
|
65 | + ), |
|
66 | + ), |
|
67 | + 60 => array( |
|
68 | + 'class' => 'bulkactions', |
|
69 | + 'content' => $this->_bulk_actions_stop(), |
|
70 | + 'options' => array( |
|
71 | + 'tipLocation' => 'top', |
|
72 | + 'tipAdjustmentX' => 25, |
|
73 | + 'tipAdjustmentY' => -35, |
|
74 | + ), |
|
75 | + ), |
|
76 | + 70 => array( |
|
77 | + 'id' => 'ee_messenger_filter_by', |
|
78 | + 'content' => $this->_filters_stop(), |
|
79 | + 'options' => array( |
|
80 | + 'tipLocation' => 'top', |
|
81 | + 'tipAdjustmentX' => 25, |
|
82 | + 'tipAdjustmentY' => -30, |
|
83 | + ), |
|
84 | + ), |
|
85 | + ); |
|
86 | + } |
|
87 | 87 | |
88 | 88 | |
89 | - protected function _start() |
|
90 | - { |
|
91 | - $content = '<h3>' . __('Messages Overview', 'event_espresso') . '</h3>'; |
|
92 | - $content .= '<p>' |
|
93 | - . __( |
|
94 | - 'This tour of the Messages Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
95 | - 'event_espresso' |
|
96 | - ) . '</p>'; |
|
97 | - return $content; |
|
98 | - } |
|
89 | + protected function _start() |
|
90 | + { |
|
91 | + $content = '<h3>' . __('Messages Overview', 'event_espresso') . '</h3>'; |
|
92 | + $content .= '<p>' |
|
93 | + . __( |
|
94 | + 'This tour of the Messages Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
95 | + 'event_espresso' |
|
96 | + ) . '</p>'; |
|
97 | + return $content; |
|
98 | + } |
|
99 | 99 | |
100 | - protected function event_column_stop() |
|
101 | - { |
|
102 | - return '<p>' |
|
103 | - . __( |
|
104 | - 'View if a message is associated with one event or multiple events. Can be sorted in ascending and descending order.', |
|
105 | - 'event_espresso' |
|
106 | - ) . '</p>'; |
|
107 | - } |
|
100 | + protected function event_column_stop() |
|
101 | + { |
|
102 | + return '<p>' |
|
103 | + . __( |
|
104 | + 'View if a message is associated with one event or multiple events. Can be sorted in ascending and descending order.', |
|
105 | + 'event_espresso' |
|
106 | + ) . '</p>'; |
|
107 | + } |
|
108 | 108 | |
109 | - protected function _message_type_column_stop() |
|
110 | - { |
|
111 | - return '<p>' |
|
112 | - . __( |
|
113 | - 'View the type of message. Can be sorted in ascending or descending order.', |
|
114 | - 'event_espresso' |
|
115 | - ) . '</p>'; |
|
116 | - } |
|
109 | + protected function _message_type_column_stop() |
|
110 | + { |
|
111 | + return '<p>' |
|
112 | + . __( |
|
113 | + 'View the type of message. Can be sorted in ascending or descending order.', |
|
114 | + 'event_espresso' |
|
115 | + ) . '</p>'; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _messenger_column_stop() |
|
119 | - { |
|
120 | - return '<p>' |
|
121 | - . __( |
|
122 | - 'View who messages will be sent to. Can be sorted in ascending or descending order.', |
|
123 | - 'event_espresso' |
|
124 | - ) . '</p>'; |
|
125 | - } |
|
118 | + protected function _messenger_column_stop() |
|
119 | + { |
|
120 | + return '<p>' |
|
121 | + . __( |
|
122 | + 'View who messages will be sent to. Can be sorted in ascending or descending order.', |
|
123 | + 'event_espresso' |
|
124 | + ) . '</p>'; |
|
125 | + } |
|
126 | 126 | |
127 | - protected function _description_column_stop() |
|
128 | - { |
|
129 | - return '<p>' . __('View the description for each message type.', 'event_espresso') . '</p>'; |
|
130 | - } |
|
127 | + protected function _description_column_stop() |
|
128 | + { |
|
129 | + return '<p>' . __('View the description for each message type.', 'event_espresso') . '</p>'; |
|
130 | + } |
|
131 | 131 | |
132 | - protected function _bulk_actions_stop() |
|
133 | - { |
|
134 | - return '<p>' . __('Perform bulk actions to multiple message types.', 'event_espresso') . '</p>'; |
|
135 | - } |
|
132 | + protected function _bulk_actions_stop() |
|
133 | + { |
|
134 | + return '<p>' . __('Perform bulk actions to multiple message types.', 'event_espresso') . '</p>'; |
|
135 | + } |
|
136 | 136 | |
137 | - protected function _filters_stop() |
|
138 | - { |
|
139 | - return '<p>' |
|
140 | - . __( |
|
141 | - 'You can filter by different notifications by making a selection below and clicking on the filter button. To reset your selection, just click on the reset filters button.', |
|
142 | - 'event_espresso' |
|
143 | - ) . '</p>'; |
|
144 | - } |
|
137 | + protected function _filters_stop() |
|
138 | + { |
|
139 | + return '<p>' |
|
140 | + . __( |
|
141 | + 'You can filter by different notifications by making a selection below and clicking on the filter button. To reset your selection, just click on the reset filters button.', |
|
142 | + 'event_espresso' |
|
143 | + ) . '</p>'; |
|
144 | + } |
|
145 | 145 | } |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function _start() |
90 | 90 | { |
91 | - $content = '<h3>' . __('Messages Overview', 'event_espresso') . '</h3>'; |
|
91 | + $content = '<h3>'.__('Messages Overview', 'event_espresso').'</h3>'; |
|
92 | 92 | $content .= '<p>' |
93 | 93 | . __( |
94 | 94 | 'This tour of the Messages Overview page will go over different areas of the screen to help you understand what they are used for.', |
95 | 95 | 'event_espresso' |
96 | - ) . '</p>'; |
|
96 | + ).'</p>'; |
|
97 | 97 | return $content; |
98 | 98 | } |
99 | 99 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | . __( |
104 | 104 | 'View if a message is associated with one event or multiple events. Can be sorted in ascending and descending order.', |
105 | 105 | 'event_espresso' |
106 | - ) . '</p>'; |
|
106 | + ).'</p>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function _message_type_column_stop() |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | . __( |
113 | 113 | 'View the type of message. Can be sorted in ascending or descending order.', |
114 | 114 | 'event_espresso' |
115 | - ) . '</p>'; |
|
115 | + ).'</p>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | protected function _messenger_column_stop() |
@@ -121,17 +121,17 @@ discard block |
||
121 | 121 | . __( |
122 | 122 | 'View who messages will be sent to. Can be sorted in ascending or descending order.', |
123 | 123 | 'event_espresso' |
124 | - ) . '</p>'; |
|
124 | + ).'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _description_column_stop() |
128 | 128 | { |
129 | - return '<p>' . __('View the description for each message type.', 'event_espresso') . '</p>'; |
|
129 | + return '<p>'.__('View the description for each message type.', 'event_espresso').'</p>'; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | protected function _bulk_actions_stop() |
133 | 133 | { |
134 | - return '<p>' . __('Perform bulk actions to multiple message types.', 'event_espresso') . '</p>'; |
|
134 | + return '<p>'.__('Perform bulk actions to multiple message types.', 'event_espresso').'</p>'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | protected function _filters_stop() |
@@ -140,6 +140,6 @@ discard block |
||
140 | 140 | . __( |
141 | 141 | 'You can filter by different notifications by making a selection below and clicking on the filter button. To reset your selection, just click on the reset filters button.', |
142 | 142 | 'event_espresso' |
143 | - ) . '</p>'; |
|
143 | + ).'</p>'; |
|
144 | 144 | } |
145 | 145 | } |
@@ -13,379 +13,379 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | |
16 | - /** |
|
17 | - * @return Messages_Admin_Page |
|
18 | - */ |
|
19 | - public function get_admin_page() |
|
20 | - { |
|
21 | - return $this->_admin_page; |
|
22 | - } |
|
23 | - |
|
24 | - |
|
25 | - /** |
|
26 | - * Setup data object |
|
27 | - */ |
|
28 | - protected function _setup_data() |
|
29 | - { |
|
30 | - $this->_data = $this->get_admin_page()->get_message_templates( |
|
31 | - $this->_per_page, |
|
32 | - $this->_view, |
|
33 | - false |
|
34 | - ); |
|
35 | - $this->_all_data_count = $this->get_admin_page()->get_message_templates( |
|
36 | - $this->_per_page, |
|
37 | - $this->_view, |
|
38 | - true, |
|
39 | - true |
|
40 | - ); |
|
41 | - } |
|
42 | - |
|
43 | - |
|
44 | - /** |
|
45 | - * Set internal properties |
|
46 | - */ |
|
47 | - protected function _set_properties() |
|
48 | - { |
|
49 | - $this->_wp_list_args = array( |
|
50 | - 'singular' => esc_html__('Message Template Group', 'event_espresso'), |
|
51 | - 'plural' => esc_html__('Message Template', 'event_espresso'), |
|
52 | - 'ajax' => true, // for now, |
|
53 | - 'screen' => $this->get_admin_page()->get_current_screen()->id, |
|
54 | - ); |
|
55 | - $this->_columns = array( |
|
56 | - // 'cb' => '<input type="checkbox" />', //no deleting default (global) templates! |
|
57 | - 'message_type' => esc_html__('Message Type', 'event_espresso'), |
|
58 | - 'messenger' => esc_html__('Messenger', 'event_espresso'), |
|
59 | - 'description' => esc_html__('Description', 'event_espresso'), |
|
60 | - ); |
|
61 | - |
|
62 | - $this->_sortable_columns = array( |
|
63 | - 'messenger' => array('MTP_messenger' => true), |
|
64 | - ); |
|
65 | - |
|
66 | - $this->_hidden_columns = array(); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * Overriding the single_row method from parent to verify whether the $item has an accessible |
|
72 | - * message_type or messenger object before generating the row. |
|
73 | - * |
|
74 | - * @param EE_Message_Template_Group $item |
|
75 | - * @return string |
|
76 | - * @throws EE_Error |
|
77 | - */ |
|
78 | - public function single_row($item) |
|
79 | - { |
|
80 | - $message_type = $item->message_type_obj(); |
|
81 | - $messenger = $item->messenger_obj(); |
|
82 | - |
|
83 | - if (! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) { |
|
84 | - echo ''; |
|
85 | - return; |
|
86 | - } |
|
87 | - |
|
88 | - parent::single_row($item); |
|
89 | - } |
|
90 | - |
|
91 | - |
|
92 | - /** |
|
93 | - * @return array |
|
94 | - * @throws EE_Error |
|
95 | - */ |
|
96 | - protected function _get_table_filters() |
|
97 | - { |
|
98 | - $filters = array(); |
|
99 | - |
|
100 | - // get select inputs |
|
101 | - $select_inputs = array( |
|
102 | - $this->_get_messengers_dropdown_filter(), |
|
103 | - $this->_get_message_types_dropdown_filter(), |
|
104 | - ); |
|
105 | - |
|
106 | - // set filters to select inputs if they aren't empty |
|
107 | - foreach ($select_inputs as $select_input) { |
|
108 | - if ($select_input) { |
|
109 | - $filters[] = $select_input; |
|
110 | - } |
|
111 | - } |
|
112 | - return $filters; |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * We're just removing the search box for message templates, not needed. |
|
117 | - * |
|
118 | - * @param string $text |
|
119 | - * @param string $input_id |
|
120 | - * @return string ; |
|
121 | - */ |
|
122 | - public function search_box($text, $input_id) |
|
123 | - { |
|
124 | - return ''; |
|
125 | - } |
|
126 | - |
|
127 | - |
|
128 | - /** |
|
129 | - * Add counts to the _views property |
|
130 | - */ |
|
131 | - protected function _add_view_counts() |
|
132 | - { |
|
133 | - foreach ($this->_views as $view => $args) { |
|
134 | - $this->_views[ $view ]['count'] = $this->get_admin_page()->get_message_templates( |
|
135 | - $this->_per_page, |
|
136 | - $view, |
|
137 | - true, |
|
138 | - true |
|
139 | - ); |
|
140 | - } |
|
141 | - } |
|
142 | - |
|
143 | - |
|
144 | - /** |
|
145 | - * @param EE_Message_Template_Group $item |
|
146 | - * @return string |
|
147 | - */ |
|
148 | - public function column_cb($item) |
|
149 | - { |
|
150 | - return ''; |
|
151 | - } |
|
152 | - |
|
153 | - |
|
154 | - /** |
|
155 | - * @param EE_Message_Template_Group $item |
|
156 | - * @return string |
|
157 | - * @throws EE_Error |
|
158 | - */ |
|
159 | - public function column_description($item) |
|
160 | - { |
|
161 | - return '<p>' . $item->message_type_obj()->description . '</p>'; |
|
162 | - } |
|
163 | - |
|
164 | - |
|
165 | - /** |
|
166 | - * @param EE_Message_Template_Group $item |
|
167 | - * @return string |
|
168 | - * @throws EE_Error |
|
169 | - */ |
|
170 | - public function column_messenger($item) |
|
171 | - { |
|
172 | - // Return the name contents |
|
173 | - return sprintf( |
|
174 | - '%1$s <span style="color:silver">(id:%2$s)</span><br />%3$s%4$s', |
|
175 | - /* $1%s */ |
|
176 | - $this->_get_name_link_for_messenger($item), |
|
177 | - /* $2%s */ |
|
178 | - $item->GRP_ID(), |
|
179 | - /* %4$s */ |
|
180 | - $this->_get_context_links($item), |
|
181 | - /* $3%s */ |
|
182 | - $this->row_actions($this->_get_actions_for_messenger_column($item)) |
|
183 | - ); |
|
184 | - } |
|
185 | - |
|
186 | - /** |
|
187 | - * column_message_type |
|
188 | - * |
|
189 | - * @param EE_Message_Template_Group $item message info for the row |
|
190 | - * @return string message_type name |
|
191 | - * @throws EE_Error |
|
192 | - */ |
|
193 | - public function column_message_type($item) |
|
194 | - { |
|
195 | - return ucwords($item->message_type_obj()->label['singular']); |
|
196 | - } |
|
197 | - |
|
198 | - |
|
199 | - /** |
|
200 | - * Generate dropdown filter select input for messengers |
|
201 | - * |
|
202 | - * @param bool $global |
|
203 | - * @return string |
|
204 | - * @throws EE_Error |
|
205 | - */ |
|
206 | - protected function _get_messengers_dropdown_filter($global = true) |
|
207 | - { |
|
208 | - $messenger_options = array(); |
|
209 | - $active_message_template_groups_grouped_by_messenger = EEM_Message_Template_Group::instance()->get_all( |
|
210 | - array( |
|
211 | - array( |
|
212 | - 'MTP_is_active' => true, |
|
213 | - 'MTP_is_global' => $global, |
|
214 | - ), |
|
215 | - 'group_by' => 'MTP_messenger', |
|
216 | - ) |
|
217 | - ); |
|
218 | - |
|
219 | - foreach ($active_message_template_groups_grouped_by_messenger as $active_message_template_group) { |
|
220 | - if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
221 | - $messenger = $active_message_template_group->messenger_obj(); |
|
222 | - $messenger_label = $messenger instanceof EE_messenger |
|
223 | - ? $messenger->label['singular'] |
|
224 | - : $active_message_template_group->messenger(); |
|
225 | - $messenger_options[ $active_message_template_group->messenger() ] = ucwords($messenger_label); |
|
226 | - } |
|
227 | - } |
|
228 | - return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
229 | - } |
|
230 | - |
|
231 | - |
|
232 | - /** |
|
233 | - * Generate dropdown filter select input for message types |
|
234 | - * |
|
235 | - * @param bool $global |
|
236 | - * @return string |
|
237 | - * @throws EE_Error |
|
238 | - */ |
|
239 | - protected function _get_message_types_dropdown_filter($global = true) |
|
240 | - { |
|
241 | - $message_type_options = array(); |
|
242 | - $active_message_template_groups_grouped_by_message_type = EEM_Message_Template_Group::instance()->get_all( |
|
243 | - array( |
|
244 | - array( |
|
245 | - 'MTP_is_active' => true, |
|
246 | - 'MTP_is_global' => true, |
|
247 | - ), |
|
248 | - 'group_by' => 'MTP_message_type', |
|
249 | - ) |
|
250 | - ); |
|
251 | - |
|
252 | - foreach ($active_message_template_groups_grouped_by_message_type as $active_message_template_group) { |
|
253 | - if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
254 | - $message_type = $active_message_template_group->message_type_obj(); |
|
255 | - $message_type_label = $message_type instanceof EE_message_type |
|
256 | - ? $message_type->label['singular'] |
|
257 | - : $active_message_template_group->message_type(); |
|
258 | - $message_type_options[ $active_message_template_group->message_type() ] = ucwords($message_type_label); |
|
259 | - } |
|
260 | - } |
|
261 | - return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
262 | - } |
|
263 | - |
|
264 | - |
|
265 | - /** |
|
266 | - * Return the edit url for the message template group. |
|
267 | - * |
|
268 | - * @param EE_Message_Template_Group $item |
|
269 | - * @return string |
|
270 | - * @throws EE_Error |
|
271 | - */ |
|
272 | - protected function _get_edit_url(EE_Message_Template_Group $item) |
|
273 | - { |
|
274 | - $edit_url = ''; |
|
275 | - // edit link but only if item isn't trashed. |
|
276 | - if (! $item->get('MTP_deleted') |
|
277 | - && EE_Registry::instance()->CAP->current_user_can( |
|
278 | - 'ee_edit_message', |
|
279 | - 'espresso_messages_edit_message_template', |
|
280 | - $item->ID() |
|
281 | - )) { |
|
282 | - $edit_url = EE_Admin_Page::add_query_args_and_nonce( |
|
283 | - array( |
|
284 | - 'action' => 'edit_message_template', |
|
285 | - 'id' => $item->GRP_ID(), |
|
286 | - ), |
|
287 | - EE_MSG_ADMIN_URL |
|
288 | - ); |
|
289 | - } |
|
290 | - return $edit_url; |
|
291 | - } |
|
292 | - |
|
293 | - |
|
294 | - /** |
|
295 | - * Get the context link string for the messenger column. |
|
296 | - * |
|
297 | - * @param EE_Message_Template_Group $item |
|
298 | - * @return string |
|
299 | - * @throws EE_Error |
|
300 | - */ |
|
301 | - protected function _get_context_links(EE_Message_Template_Group $item) |
|
302 | - { |
|
303 | - // first check if we even show the context links or not. |
|
304 | - if (! EE_Registry::instance()->CAP->current_user_can( |
|
305 | - 'ee_edit_message', |
|
306 | - 'espresso_messages_edit_message_template', |
|
307 | - $item->ID() |
|
308 | - ) |
|
309 | - || $item->get('MTP_deleted') |
|
310 | - ) { |
|
311 | - return ''; |
|
312 | - } |
|
313 | - // we want to display the contexts in here so we need to set them up |
|
314 | - $c_label = $item->context_label(); |
|
315 | - $c_configs = $item->contexts_config(); |
|
316 | - $ctxt = array(); |
|
317 | - $context_templates = $item->context_templates(); |
|
318 | - foreach ($context_templates as $context => $template_fields) { |
|
319 | - $mtp_to = ! empty($context_templates[ $context ]['to']) |
|
320 | - && $context_templates[ $context ]['to'] instanceof EE_Message_Template |
|
321 | - ? $context_templates[ $context ]['to']->get('MTP_content') |
|
322 | - : null; |
|
323 | - $inactive_class = ( |
|
324 | - empty($mtp_to) |
|
325 | - && ! empty($context_templates[ $context ]['to']) |
|
326 | - ) |
|
327 | - || ! $item->is_context_active($context) |
|
328 | - ? ' mtp-inactive' |
|
329 | - : ''; |
|
330 | - $context_title = ucwords($c_configs[ $context ]['label']); |
|
331 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( |
|
332 | - array( |
|
333 | - 'action' => 'edit_message_template', |
|
334 | - 'id' => $item->GRP_ID(), |
|
335 | - 'context' => $context, |
|
336 | - ), |
|
337 | - EE_MSG_ADMIN_URL |
|
338 | - ); |
|
339 | - $ctxt[] = '<a' |
|
340 | - . ' href="' . $edit_link . '"' |
|
341 | - . ' class="' . $item->message_type() . '-' . $context . '-edit-link' . $inactive_class . '"' |
|
342 | - . ' title="' . esc_attr__('Edit Context', 'event_espresso') . '">' |
|
343 | - . $context_title |
|
344 | - . '</a>'; |
|
345 | - } |
|
346 | - |
|
347 | - return sprintf('<strong>%s:</strong> ', ucwords($c_label['plural'])) . implode(' | ', $ctxt); |
|
348 | - } |
|
349 | - |
|
350 | - |
|
351 | - /** |
|
352 | - * Get the Name string from the messenger column (linked to edit if the context allows for that). |
|
353 | - * |
|
354 | - * @param EE_Message_Template_Group $item |
|
355 | - * @return string |
|
356 | - * @throws EE_Error |
|
357 | - */ |
|
358 | - protected function _get_name_link_for_messenger(EE_Message_Template_Group $item) |
|
359 | - { |
|
360 | - $edit_url = $this->_get_edit_url($item); |
|
361 | - return $edit_url |
|
362 | - ? '<a href="' . $edit_url . '"' |
|
363 | - . ' title="' . esc_attr__('Edit Template Group', 'event_espresso') . '">' |
|
364 | - . ucwords($item->messenger_obj()->label['singular']) |
|
365 | - . '</a>' |
|
366 | - : ucwords($item->messenger_obj()->label['singular']); |
|
367 | - } |
|
368 | - |
|
369 | - |
|
370 | - /** |
|
371 | - * Return the actions array for the messenger column. |
|
372 | - * |
|
373 | - * @param EE_Message_Template_Group $item |
|
374 | - * @return array |
|
375 | - * @throws EE_Error |
|
376 | - */ |
|
377 | - protected function _get_actions_for_messenger_column(EE_Message_Template_Group $item) |
|
378 | - { |
|
379 | - $actions = array(); |
|
380 | - if ($edit_url = $this->_get_edit_url($item)) { |
|
381 | - $actions = array( |
|
382 | - 'edit' => '<a href="' . $edit_url . '"' |
|
383 | - . ' class="' . $item->message_type() . '-edit-link"' |
|
384 | - . ' title="' . esc_attr__('Edit Template Group', 'event_espresso') . '">' |
|
385 | - . esc_html__('Edit', 'event_espresso') |
|
386 | - . '</a>', |
|
387 | - ); |
|
388 | - } |
|
389 | - return $actions; |
|
390 | - } |
|
16 | + /** |
|
17 | + * @return Messages_Admin_Page |
|
18 | + */ |
|
19 | + public function get_admin_page() |
|
20 | + { |
|
21 | + return $this->_admin_page; |
|
22 | + } |
|
23 | + |
|
24 | + |
|
25 | + /** |
|
26 | + * Setup data object |
|
27 | + */ |
|
28 | + protected function _setup_data() |
|
29 | + { |
|
30 | + $this->_data = $this->get_admin_page()->get_message_templates( |
|
31 | + $this->_per_page, |
|
32 | + $this->_view, |
|
33 | + false |
|
34 | + ); |
|
35 | + $this->_all_data_count = $this->get_admin_page()->get_message_templates( |
|
36 | + $this->_per_page, |
|
37 | + $this->_view, |
|
38 | + true, |
|
39 | + true |
|
40 | + ); |
|
41 | + } |
|
42 | + |
|
43 | + |
|
44 | + /** |
|
45 | + * Set internal properties |
|
46 | + */ |
|
47 | + protected function _set_properties() |
|
48 | + { |
|
49 | + $this->_wp_list_args = array( |
|
50 | + 'singular' => esc_html__('Message Template Group', 'event_espresso'), |
|
51 | + 'plural' => esc_html__('Message Template', 'event_espresso'), |
|
52 | + 'ajax' => true, // for now, |
|
53 | + 'screen' => $this->get_admin_page()->get_current_screen()->id, |
|
54 | + ); |
|
55 | + $this->_columns = array( |
|
56 | + // 'cb' => '<input type="checkbox" />', //no deleting default (global) templates! |
|
57 | + 'message_type' => esc_html__('Message Type', 'event_espresso'), |
|
58 | + 'messenger' => esc_html__('Messenger', 'event_espresso'), |
|
59 | + 'description' => esc_html__('Description', 'event_espresso'), |
|
60 | + ); |
|
61 | + |
|
62 | + $this->_sortable_columns = array( |
|
63 | + 'messenger' => array('MTP_messenger' => true), |
|
64 | + ); |
|
65 | + |
|
66 | + $this->_hidden_columns = array(); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * Overriding the single_row method from parent to verify whether the $item has an accessible |
|
72 | + * message_type or messenger object before generating the row. |
|
73 | + * |
|
74 | + * @param EE_Message_Template_Group $item |
|
75 | + * @return string |
|
76 | + * @throws EE_Error |
|
77 | + */ |
|
78 | + public function single_row($item) |
|
79 | + { |
|
80 | + $message_type = $item->message_type_obj(); |
|
81 | + $messenger = $item->messenger_obj(); |
|
82 | + |
|
83 | + if (! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) { |
|
84 | + echo ''; |
|
85 | + return; |
|
86 | + } |
|
87 | + |
|
88 | + parent::single_row($item); |
|
89 | + } |
|
90 | + |
|
91 | + |
|
92 | + /** |
|
93 | + * @return array |
|
94 | + * @throws EE_Error |
|
95 | + */ |
|
96 | + protected function _get_table_filters() |
|
97 | + { |
|
98 | + $filters = array(); |
|
99 | + |
|
100 | + // get select inputs |
|
101 | + $select_inputs = array( |
|
102 | + $this->_get_messengers_dropdown_filter(), |
|
103 | + $this->_get_message_types_dropdown_filter(), |
|
104 | + ); |
|
105 | + |
|
106 | + // set filters to select inputs if they aren't empty |
|
107 | + foreach ($select_inputs as $select_input) { |
|
108 | + if ($select_input) { |
|
109 | + $filters[] = $select_input; |
|
110 | + } |
|
111 | + } |
|
112 | + return $filters; |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * We're just removing the search box for message templates, not needed. |
|
117 | + * |
|
118 | + * @param string $text |
|
119 | + * @param string $input_id |
|
120 | + * @return string ; |
|
121 | + */ |
|
122 | + public function search_box($text, $input_id) |
|
123 | + { |
|
124 | + return ''; |
|
125 | + } |
|
126 | + |
|
127 | + |
|
128 | + /** |
|
129 | + * Add counts to the _views property |
|
130 | + */ |
|
131 | + protected function _add_view_counts() |
|
132 | + { |
|
133 | + foreach ($this->_views as $view => $args) { |
|
134 | + $this->_views[ $view ]['count'] = $this->get_admin_page()->get_message_templates( |
|
135 | + $this->_per_page, |
|
136 | + $view, |
|
137 | + true, |
|
138 | + true |
|
139 | + ); |
|
140 | + } |
|
141 | + } |
|
142 | + |
|
143 | + |
|
144 | + /** |
|
145 | + * @param EE_Message_Template_Group $item |
|
146 | + * @return string |
|
147 | + */ |
|
148 | + public function column_cb($item) |
|
149 | + { |
|
150 | + return ''; |
|
151 | + } |
|
152 | + |
|
153 | + |
|
154 | + /** |
|
155 | + * @param EE_Message_Template_Group $item |
|
156 | + * @return string |
|
157 | + * @throws EE_Error |
|
158 | + */ |
|
159 | + public function column_description($item) |
|
160 | + { |
|
161 | + return '<p>' . $item->message_type_obj()->description . '</p>'; |
|
162 | + } |
|
163 | + |
|
164 | + |
|
165 | + /** |
|
166 | + * @param EE_Message_Template_Group $item |
|
167 | + * @return string |
|
168 | + * @throws EE_Error |
|
169 | + */ |
|
170 | + public function column_messenger($item) |
|
171 | + { |
|
172 | + // Return the name contents |
|
173 | + return sprintf( |
|
174 | + '%1$s <span style="color:silver">(id:%2$s)</span><br />%3$s%4$s', |
|
175 | + /* $1%s */ |
|
176 | + $this->_get_name_link_for_messenger($item), |
|
177 | + /* $2%s */ |
|
178 | + $item->GRP_ID(), |
|
179 | + /* %4$s */ |
|
180 | + $this->_get_context_links($item), |
|
181 | + /* $3%s */ |
|
182 | + $this->row_actions($this->_get_actions_for_messenger_column($item)) |
|
183 | + ); |
|
184 | + } |
|
185 | + |
|
186 | + /** |
|
187 | + * column_message_type |
|
188 | + * |
|
189 | + * @param EE_Message_Template_Group $item message info for the row |
|
190 | + * @return string message_type name |
|
191 | + * @throws EE_Error |
|
192 | + */ |
|
193 | + public function column_message_type($item) |
|
194 | + { |
|
195 | + return ucwords($item->message_type_obj()->label['singular']); |
|
196 | + } |
|
197 | + |
|
198 | + |
|
199 | + /** |
|
200 | + * Generate dropdown filter select input for messengers |
|
201 | + * |
|
202 | + * @param bool $global |
|
203 | + * @return string |
|
204 | + * @throws EE_Error |
|
205 | + */ |
|
206 | + protected function _get_messengers_dropdown_filter($global = true) |
|
207 | + { |
|
208 | + $messenger_options = array(); |
|
209 | + $active_message_template_groups_grouped_by_messenger = EEM_Message_Template_Group::instance()->get_all( |
|
210 | + array( |
|
211 | + array( |
|
212 | + 'MTP_is_active' => true, |
|
213 | + 'MTP_is_global' => $global, |
|
214 | + ), |
|
215 | + 'group_by' => 'MTP_messenger', |
|
216 | + ) |
|
217 | + ); |
|
218 | + |
|
219 | + foreach ($active_message_template_groups_grouped_by_messenger as $active_message_template_group) { |
|
220 | + if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
221 | + $messenger = $active_message_template_group->messenger_obj(); |
|
222 | + $messenger_label = $messenger instanceof EE_messenger |
|
223 | + ? $messenger->label['singular'] |
|
224 | + : $active_message_template_group->messenger(); |
|
225 | + $messenger_options[ $active_message_template_group->messenger() ] = ucwords($messenger_label); |
|
226 | + } |
|
227 | + } |
|
228 | + return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
229 | + } |
|
230 | + |
|
231 | + |
|
232 | + /** |
|
233 | + * Generate dropdown filter select input for message types |
|
234 | + * |
|
235 | + * @param bool $global |
|
236 | + * @return string |
|
237 | + * @throws EE_Error |
|
238 | + */ |
|
239 | + protected function _get_message_types_dropdown_filter($global = true) |
|
240 | + { |
|
241 | + $message_type_options = array(); |
|
242 | + $active_message_template_groups_grouped_by_message_type = EEM_Message_Template_Group::instance()->get_all( |
|
243 | + array( |
|
244 | + array( |
|
245 | + 'MTP_is_active' => true, |
|
246 | + 'MTP_is_global' => true, |
|
247 | + ), |
|
248 | + 'group_by' => 'MTP_message_type', |
|
249 | + ) |
|
250 | + ); |
|
251 | + |
|
252 | + foreach ($active_message_template_groups_grouped_by_message_type as $active_message_template_group) { |
|
253 | + if ($active_message_template_group instanceof EE_Message_Template_Group) { |
|
254 | + $message_type = $active_message_template_group->message_type_obj(); |
|
255 | + $message_type_label = $message_type instanceof EE_message_type |
|
256 | + ? $message_type->label['singular'] |
|
257 | + : $active_message_template_group->message_type(); |
|
258 | + $message_type_options[ $active_message_template_group->message_type() ] = ucwords($message_type_label); |
|
259 | + } |
|
260 | + } |
|
261 | + return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
262 | + } |
|
263 | + |
|
264 | + |
|
265 | + /** |
|
266 | + * Return the edit url for the message template group. |
|
267 | + * |
|
268 | + * @param EE_Message_Template_Group $item |
|
269 | + * @return string |
|
270 | + * @throws EE_Error |
|
271 | + */ |
|
272 | + protected function _get_edit_url(EE_Message_Template_Group $item) |
|
273 | + { |
|
274 | + $edit_url = ''; |
|
275 | + // edit link but only if item isn't trashed. |
|
276 | + if (! $item->get('MTP_deleted') |
|
277 | + && EE_Registry::instance()->CAP->current_user_can( |
|
278 | + 'ee_edit_message', |
|
279 | + 'espresso_messages_edit_message_template', |
|
280 | + $item->ID() |
|
281 | + )) { |
|
282 | + $edit_url = EE_Admin_Page::add_query_args_and_nonce( |
|
283 | + array( |
|
284 | + 'action' => 'edit_message_template', |
|
285 | + 'id' => $item->GRP_ID(), |
|
286 | + ), |
|
287 | + EE_MSG_ADMIN_URL |
|
288 | + ); |
|
289 | + } |
|
290 | + return $edit_url; |
|
291 | + } |
|
292 | + |
|
293 | + |
|
294 | + /** |
|
295 | + * Get the context link string for the messenger column. |
|
296 | + * |
|
297 | + * @param EE_Message_Template_Group $item |
|
298 | + * @return string |
|
299 | + * @throws EE_Error |
|
300 | + */ |
|
301 | + protected function _get_context_links(EE_Message_Template_Group $item) |
|
302 | + { |
|
303 | + // first check if we even show the context links or not. |
|
304 | + if (! EE_Registry::instance()->CAP->current_user_can( |
|
305 | + 'ee_edit_message', |
|
306 | + 'espresso_messages_edit_message_template', |
|
307 | + $item->ID() |
|
308 | + ) |
|
309 | + || $item->get('MTP_deleted') |
|
310 | + ) { |
|
311 | + return ''; |
|
312 | + } |
|
313 | + // we want to display the contexts in here so we need to set them up |
|
314 | + $c_label = $item->context_label(); |
|
315 | + $c_configs = $item->contexts_config(); |
|
316 | + $ctxt = array(); |
|
317 | + $context_templates = $item->context_templates(); |
|
318 | + foreach ($context_templates as $context => $template_fields) { |
|
319 | + $mtp_to = ! empty($context_templates[ $context ]['to']) |
|
320 | + && $context_templates[ $context ]['to'] instanceof EE_Message_Template |
|
321 | + ? $context_templates[ $context ]['to']->get('MTP_content') |
|
322 | + : null; |
|
323 | + $inactive_class = ( |
|
324 | + empty($mtp_to) |
|
325 | + && ! empty($context_templates[ $context ]['to']) |
|
326 | + ) |
|
327 | + || ! $item->is_context_active($context) |
|
328 | + ? ' mtp-inactive' |
|
329 | + : ''; |
|
330 | + $context_title = ucwords($c_configs[ $context ]['label']); |
|
331 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce( |
|
332 | + array( |
|
333 | + 'action' => 'edit_message_template', |
|
334 | + 'id' => $item->GRP_ID(), |
|
335 | + 'context' => $context, |
|
336 | + ), |
|
337 | + EE_MSG_ADMIN_URL |
|
338 | + ); |
|
339 | + $ctxt[] = '<a' |
|
340 | + . ' href="' . $edit_link . '"' |
|
341 | + . ' class="' . $item->message_type() . '-' . $context . '-edit-link' . $inactive_class . '"' |
|
342 | + . ' title="' . esc_attr__('Edit Context', 'event_espresso') . '">' |
|
343 | + . $context_title |
|
344 | + . '</a>'; |
|
345 | + } |
|
346 | + |
|
347 | + return sprintf('<strong>%s:</strong> ', ucwords($c_label['plural'])) . implode(' | ', $ctxt); |
|
348 | + } |
|
349 | + |
|
350 | + |
|
351 | + /** |
|
352 | + * Get the Name string from the messenger column (linked to edit if the context allows for that). |
|
353 | + * |
|
354 | + * @param EE_Message_Template_Group $item |
|
355 | + * @return string |
|
356 | + * @throws EE_Error |
|
357 | + */ |
|
358 | + protected function _get_name_link_for_messenger(EE_Message_Template_Group $item) |
|
359 | + { |
|
360 | + $edit_url = $this->_get_edit_url($item); |
|
361 | + return $edit_url |
|
362 | + ? '<a href="' . $edit_url . '"' |
|
363 | + . ' title="' . esc_attr__('Edit Template Group', 'event_espresso') . '">' |
|
364 | + . ucwords($item->messenger_obj()->label['singular']) |
|
365 | + . '</a>' |
|
366 | + : ucwords($item->messenger_obj()->label['singular']); |
|
367 | + } |
|
368 | + |
|
369 | + |
|
370 | + /** |
|
371 | + * Return the actions array for the messenger column. |
|
372 | + * |
|
373 | + * @param EE_Message_Template_Group $item |
|
374 | + * @return array |
|
375 | + * @throws EE_Error |
|
376 | + */ |
|
377 | + protected function _get_actions_for_messenger_column(EE_Message_Template_Group $item) |
|
378 | + { |
|
379 | + $actions = array(); |
|
380 | + if ($edit_url = $this->_get_edit_url($item)) { |
|
381 | + $actions = array( |
|
382 | + 'edit' => '<a href="' . $edit_url . '"' |
|
383 | + . ' class="' . $item->message_type() . '-edit-link"' |
|
384 | + . ' title="' . esc_attr__('Edit Template Group', 'event_espresso') . '">' |
|
385 | + . esc_html__('Edit', 'event_espresso') |
|
386 | + . '</a>', |
|
387 | + ); |
|
388 | + } |
|
389 | + return $actions; |
|
390 | + } |
|
391 | 391 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $message_type = $item->message_type_obj(); |
81 | 81 | $messenger = $item->messenger_obj(); |
82 | 82 | |
83 | - if (! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) { |
|
83 | + if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) { |
|
84 | 84 | echo ''; |
85 | 85 | return; |
86 | 86 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | protected function _add_view_counts() |
132 | 132 | { |
133 | 133 | foreach ($this->_views as $view => $args) { |
134 | - $this->_views[ $view ]['count'] = $this->get_admin_page()->get_message_templates( |
|
134 | + $this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates( |
|
135 | 135 | $this->_per_page, |
136 | 136 | $view, |
137 | 137 | true, |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function column_description($item) |
160 | 160 | { |
161 | - return '<p>' . $item->message_type_obj()->description . '</p>'; |
|
161 | + return '<p>'.$item->message_type_obj()->description.'</p>'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $messenger_label = $messenger instanceof EE_messenger |
223 | 223 | ? $messenger->label['singular'] |
224 | 224 | : $active_message_template_group->messenger(); |
225 | - $messenger_options[ $active_message_template_group->messenger() ] = ucwords($messenger_label); |
|
225 | + $messenger_options[$active_message_template_group->messenger()] = ucwords($messenger_label); |
|
226 | 226 | } |
227 | 227 | } |
228 | 228 | return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $message_type_label = $message_type instanceof EE_message_type |
256 | 256 | ? $message_type->label['singular'] |
257 | 257 | : $active_message_template_group->message_type(); |
258 | - $message_type_options[ $active_message_template_group->message_type() ] = ucwords($message_type_label); |
|
258 | + $message_type_options[$active_message_template_group->message_type()] = ucwords($message_type_label); |
|
259 | 259 | } |
260 | 260 | } |
261 | 261 | return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | { |
274 | 274 | $edit_url = ''; |
275 | 275 | // edit link but only if item isn't trashed. |
276 | - if (! $item->get('MTP_deleted') |
|
276 | + if ( ! $item->get('MTP_deleted') |
|
277 | 277 | && EE_Registry::instance()->CAP->current_user_can( |
278 | 278 | 'ee_edit_message', |
279 | 279 | 'espresso_messages_edit_message_template', |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | protected function _get_context_links(EE_Message_Template_Group $item) |
302 | 302 | { |
303 | 303 | // first check if we even show the context links or not. |
304 | - if (! EE_Registry::instance()->CAP->current_user_can( |
|
304 | + if ( ! EE_Registry::instance()->CAP->current_user_can( |
|
305 | 305 | 'ee_edit_message', |
306 | 306 | 'espresso_messages_edit_message_template', |
307 | 307 | $item->ID() |
@@ -316,18 +316,18 @@ discard block |
||
316 | 316 | $ctxt = array(); |
317 | 317 | $context_templates = $item->context_templates(); |
318 | 318 | foreach ($context_templates as $context => $template_fields) { |
319 | - $mtp_to = ! empty($context_templates[ $context ]['to']) |
|
320 | - && $context_templates[ $context ]['to'] instanceof EE_Message_Template |
|
321 | - ? $context_templates[ $context ]['to']->get('MTP_content') |
|
319 | + $mtp_to = ! empty($context_templates[$context]['to']) |
|
320 | + && $context_templates[$context]['to'] instanceof EE_Message_Template |
|
321 | + ? $context_templates[$context]['to']->get('MTP_content') |
|
322 | 322 | : null; |
323 | 323 | $inactive_class = ( |
324 | 324 | empty($mtp_to) |
325 | - && ! empty($context_templates[ $context ]['to']) |
|
325 | + && ! empty($context_templates[$context]['to']) |
|
326 | 326 | ) |
327 | 327 | || ! $item->is_context_active($context) |
328 | 328 | ? ' mtp-inactive' |
329 | 329 | : ''; |
330 | - $context_title = ucwords($c_configs[ $context ]['label']); |
|
330 | + $context_title = ucwords($c_configs[$context]['label']); |
|
331 | 331 | $edit_link = EE_Admin_Page::add_query_args_and_nonce( |
332 | 332 | array( |
333 | 333 | 'action' => 'edit_message_template', |
@@ -337,14 +337,14 @@ discard block |
||
337 | 337 | EE_MSG_ADMIN_URL |
338 | 338 | ); |
339 | 339 | $ctxt[] = '<a' |
340 | - . ' href="' . $edit_link . '"' |
|
341 | - . ' class="' . $item->message_type() . '-' . $context . '-edit-link' . $inactive_class . '"' |
|
342 | - . ' title="' . esc_attr__('Edit Context', 'event_espresso') . '">' |
|
340 | + . ' href="'.$edit_link.'"' |
|
341 | + . ' class="'.$item->message_type().'-'.$context.'-edit-link'.$inactive_class.'"' |
|
342 | + . ' title="'.esc_attr__('Edit Context', 'event_espresso').'">' |
|
343 | 343 | . $context_title |
344 | 344 | . '</a>'; |
345 | 345 | } |
346 | 346 | |
347 | - return sprintf('<strong>%s:</strong> ', ucwords($c_label['plural'])) . implode(' | ', $ctxt); |
|
347 | + return sprintf('<strong>%s:</strong> ', ucwords($c_label['plural'])).implode(' | ', $ctxt); |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | |
@@ -359,8 +359,8 @@ discard block |
||
359 | 359 | { |
360 | 360 | $edit_url = $this->_get_edit_url($item); |
361 | 361 | return $edit_url |
362 | - ? '<a href="' . $edit_url . '"' |
|
363 | - . ' title="' . esc_attr__('Edit Template Group', 'event_espresso') . '">' |
|
362 | + ? '<a href="'.$edit_url.'"' |
|
363 | + . ' title="'.esc_attr__('Edit Template Group', 'event_espresso').'">' |
|
364 | 364 | . ucwords($item->messenger_obj()->label['singular']) |
365 | 365 | . '</a>' |
366 | 366 | : ucwords($item->messenger_obj()->label['singular']); |
@@ -379,9 +379,9 @@ discard block |
||
379 | 379 | $actions = array(); |
380 | 380 | if ($edit_url = $this->_get_edit_url($item)) { |
381 | 381 | $actions = array( |
382 | - 'edit' => '<a href="' . $edit_url . '"' |
|
383 | - . ' class="' . $item->message_type() . '-edit-link"' |
|
384 | - . ' title="' . esc_attr__('Edit Template Group', 'event_espresso') . '">' |
|
382 | + 'edit' => '<a href="'.$edit_url.'"' |
|
383 | + . ' class="'.$item->message_type().'-edit-link"' |
|
384 | + . ' title="'.esc_attr__('Edit Template Group', 'event_espresso').'">' |
|
385 | 385 | . esc_html__('Edit', 'event_espresso') |
386 | 386 | . '</a>', |
387 | 387 | ); |
@@ -12,434 +12,434 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * @return Messages_Admin_Page |
|
17 | - */ |
|
18 | - public function get_admin_page() |
|
19 | - { |
|
20 | - return $this->_admin_page; |
|
21 | - } |
|
22 | - |
|
23 | - |
|
24 | - protected function _setup_data() |
|
25 | - { |
|
26 | - $this->_data = $this->_get_messages($this->_per_page, $this->_view); |
|
27 | - $this->_all_data_count = $this->_get_messages($this->_per_page, $this->_view, true); |
|
28 | - } |
|
29 | - |
|
30 | - |
|
31 | - protected function _set_properties() |
|
32 | - { |
|
33 | - $this->_wp_list_args = array( |
|
34 | - 'singular' => __('Message', 'event_espresso'), |
|
35 | - 'plural' => __('Messages', 'event_espresso'), |
|
36 | - 'ajax' => true, |
|
37 | - 'screen' => $this->get_admin_page()->get_current_screen()->id, |
|
38 | - ); |
|
39 | - |
|
40 | - $this->_columns = array( |
|
41 | - 'cb' => '<input type="checkbox" />', |
|
42 | - 'to' => __('To', 'event_espresso'), |
|
43 | - 'from' => __('From', 'event_espresso'), |
|
44 | - 'messenger' => __('Messenger', 'event_espresso'), |
|
45 | - 'message_type' => __('Message Type', 'event_espresso'), |
|
46 | - 'context' => __('Context', 'event_espresso'), |
|
47 | - 'modified' => __('Modified', 'event_espresso'), |
|
48 | - 'action' => __('Actions', 'event_espresso'), |
|
49 | - 'msg_id' => __('ID', 'event_espresso'), |
|
50 | - ); |
|
51 | - |
|
52 | - $this->_sortable_columns = array( |
|
53 | - 'modified' => array('MSG_modified' => true), |
|
54 | - 'message_type' => array('MSG_message_type' => false), |
|
55 | - 'messenger' => array('MSG_messenger' => false), |
|
56 | - 'to' => array('MSG_to' => false), |
|
57 | - 'from' => array('MSG_from' => false), |
|
58 | - 'context' => array('MSG_context' => false), |
|
59 | - 'msg_id' => array('MSG_ID', false), |
|
60 | - ); |
|
61 | - |
|
62 | - $this->_primary_column = 'to'; |
|
63 | - |
|
64 | - $this->_hidden_columns = array( |
|
65 | - 'msg_id', |
|
66 | - ); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * This simply sets up the row class for the table rows. |
|
72 | - * Allows for easier overriding of child methods for setting up sorting. |
|
73 | - * |
|
74 | - * @param object $item the current item |
|
75 | - * @return string |
|
76 | - */ |
|
77 | - protected function _get_row_class($item) |
|
78 | - { |
|
79 | - $class = parent::_get_row_class($item); |
|
80 | - // add status class |
|
81 | - $class .= ' ee-status-strip msg-status-' . $item->STS_ID(); |
|
82 | - if ($this->_has_checkbox_column) { |
|
83 | - $class .= ' has-checkbox-column'; |
|
84 | - } |
|
85 | - return $class; |
|
86 | - } |
|
87 | - |
|
88 | - |
|
89 | - /** |
|
90 | - * _get_table_filters |
|
91 | - * We use this to assemble and return any filters that are associated with this table that help further refine what |
|
92 | - * get's shown in the table. |
|
93 | - * |
|
94 | - * @abstract |
|
95 | - * @access protected |
|
96 | - * @return string |
|
97 | - * @throws \EE_Error |
|
98 | - */ |
|
99 | - protected function _get_table_filters() |
|
100 | - { |
|
101 | - $filters = array(); |
|
102 | - |
|
103 | - // get select_inputs |
|
104 | - $select_inputs = array( |
|
105 | - $this->_get_messengers_dropdown_filter(), |
|
106 | - $this->_get_message_types_dropdown_filter(), |
|
107 | - $this->_get_contexts_for_message_types_dropdown_filter(), |
|
108 | - ); |
|
109 | - |
|
110 | - // set filters to select inputs if they aren't empty |
|
111 | - foreach ($select_inputs as $select_input) { |
|
112 | - if ($select_input) { |
|
113 | - $filters[] = $select_input; |
|
114 | - } |
|
115 | - } |
|
116 | - return $filters; |
|
117 | - } |
|
118 | - |
|
119 | - |
|
120 | - protected function _add_view_counts() |
|
121 | - { |
|
122 | - foreach ($this->_views as $view => $args) { |
|
123 | - $this->_views[ $view ]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
124 | - } |
|
125 | - } |
|
126 | - |
|
127 | - |
|
128 | - /** |
|
129 | - * @param EE_Message $message |
|
130 | - * @return string checkbox |
|
131 | - * @throws \EE_Error |
|
132 | - */ |
|
133 | - public function column_cb($message) |
|
134 | - { |
|
135 | - return sprintf('<input type="checkbox" name="MSG_ID[%s]" value="1" />', $message->ID()); |
|
136 | - } |
|
137 | - |
|
138 | - |
|
139 | - /** |
|
140 | - * @param EE_Message $message |
|
141 | - * @return string |
|
142 | - * @throws \EE_Error |
|
143 | - */ |
|
144 | - public function column_msg_id(EE_Message $message) |
|
145 | - { |
|
146 | - return $message->ID(); |
|
147 | - } |
|
148 | - |
|
149 | - |
|
150 | - /** |
|
151 | - * @param EE_Message $message |
|
152 | - * @return string The recipient of the message |
|
153 | - * @throws \EE_Error |
|
154 | - */ |
|
155 | - public function column_to(EE_Message $message) |
|
156 | - { |
|
157 | - EE_Registry::instance()->load_helper('URL'); |
|
158 | - $actions = array(); |
|
159 | - $actions['delete'] = '<a href="' |
|
160 | - . EEH_URL::add_query_args_and_nonce( |
|
161 | - array( |
|
162 | - 'page' => 'espresso_messages', |
|
163 | - 'action' => 'delete_ee_message', |
|
164 | - 'MSG_ID' => $message->ID(), |
|
165 | - ), |
|
166 | - admin_url('admin.php') |
|
167 | - ) |
|
168 | - . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
169 | - return esc_html($message->to()) . $this->row_actions($actions); |
|
170 | - } |
|
171 | - |
|
172 | - |
|
173 | - /** |
|
174 | - * @param EE_Message $message |
|
175 | - * @return string The sender of the message |
|
176 | - */ |
|
177 | - public function column_from(EE_Message $message) |
|
178 | - { |
|
179 | - return esc_html($message->from()); |
|
180 | - } |
|
181 | - |
|
182 | - |
|
183 | - /** |
|
184 | - * @param EE_Message $message |
|
185 | - * @return string The messenger used to send the message. |
|
186 | - */ |
|
187 | - public function column_messenger(EE_Message $message) |
|
188 | - { |
|
189 | - return ucwords($message->messenger_label()); |
|
190 | - } |
|
191 | - |
|
192 | - |
|
193 | - /** |
|
194 | - * @param EE_Message $message |
|
195 | - * @return string The message type used to generate the message. |
|
196 | - */ |
|
197 | - public function column_message_type(EE_Message $message) |
|
198 | - { |
|
199 | - return ucwords($message->message_type_label()); |
|
200 | - } |
|
201 | - |
|
202 | - |
|
203 | - /** |
|
204 | - * @param EE_Message $message |
|
205 | - * @return string The context the message was generated for. |
|
206 | - */ |
|
207 | - public function column_context(EE_Message $message) |
|
208 | - { |
|
209 | - return $message->context_label(); |
|
210 | - } |
|
211 | - |
|
212 | - |
|
213 | - /** |
|
214 | - * @param EE_Message $message |
|
215 | - * @return string The timestamp when this message was last modified. |
|
216 | - */ |
|
217 | - public function column_modified(EE_Message $message) |
|
218 | - { |
|
219 | - return $message->modified(); |
|
220 | - } |
|
221 | - |
|
222 | - |
|
223 | - /** |
|
224 | - * @param EE_Message $message |
|
225 | - * @return string Actions that can be done on the current message. |
|
226 | - */ |
|
227 | - public function column_action(EE_Message $message) |
|
228 | - { |
|
229 | - EE_Registry::instance()->load_helper('MSG_Template'); |
|
230 | - $action_links = array( |
|
231 | - 'view' => EEH_MSG_Template::get_message_action_link('view', $message), |
|
232 | - 'error' => EEH_MSG_Template::get_message_action_link('error', $message), |
|
233 | - 'generate_now' => EEH_MSG_Template::get_message_action_link('generate_now', $message), |
|
234 | - 'send_now' => EEH_MSG_Template::get_message_action_link('send_now', $message), |
|
235 | - 'queue_for_resending' => EEH_MSG_Template::get_message_action_link('queue_for_resending', $message), |
|
236 | - 'view_transaction' => EEH_MSG_Template::get_message_action_link('view_transaction', $message), |
|
237 | - ); |
|
238 | - $content = ''; |
|
239 | - switch ($message->STS_ID()) { |
|
240 | - case EEM_Message::status_sent: |
|
241 | - $content = $action_links['view'] . $action_links['queue_for_resending'] . $action_links['view_transaction']; |
|
242 | - break; |
|
243 | - case EEM_Message::status_resend: |
|
244 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
245 | - break; |
|
246 | - case EEM_Message::status_retry: |
|
247 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['error'] . $action_links['view_transaction']; |
|
248 | - break; |
|
249 | - case EEM_Message::status_failed: |
|
250 | - case EEM_Message::status_debug_only: |
|
251 | - $content = $action_links['error'] . $action_links['view_transaction']; |
|
252 | - break; |
|
253 | - case EEM_Message::status_idle: |
|
254 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
255 | - break; |
|
256 | - case EEM_Message::status_incomplete: |
|
257 | - $content = $action_links['generate_now'] . $action_links['view_transaction']; |
|
258 | - break; |
|
259 | - } |
|
260 | - return $content; |
|
261 | - } |
|
262 | - |
|
263 | - |
|
264 | - /** |
|
265 | - * Retrieve the EE_Message objects for the list table. |
|
266 | - * |
|
267 | - * @param int $perpage The number of items per page |
|
268 | - * @param string $view The view items are being retrieved for |
|
269 | - * @param bool $count Whether to just return a count or not. |
|
270 | - * @param bool $all Disregard any paging info (no limit on data returned). |
|
271 | - * @return int|EE_Message[] |
|
272 | - * @throws \EE_Error |
|
273 | - */ |
|
274 | - protected function _get_messages($perpage = 10, $view = 'all', $count = false, $all = false) |
|
275 | - { |
|
276 | - |
|
277 | - $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) |
|
278 | - ? $this->_req_data['paged'] |
|
279 | - : 1; |
|
280 | - |
|
281 | - $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) |
|
282 | - ? $this->_req_data['perpage'] |
|
283 | - : $perpage; |
|
284 | - |
|
285 | - $offset = ($current_page - 1) * $per_page; |
|
286 | - $limit = $all || $count ? null : array($offset, $per_page); |
|
287 | - $query_params = array( |
|
288 | - 'order_by' => empty($this->_req_data['orderby']) ? 'MSG_modified' : $this->_req_data['orderby'], |
|
289 | - 'order' => empty($this->_req_data['order']) ? 'DESC' : $this->_req_data['order'], |
|
290 | - 'limit' => $limit, |
|
291 | - ); |
|
292 | - |
|
293 | - /** |
|
294 | - * Any filters coming in from other routes? |
|
295 | - */ |
|
296 | - if (isset($this->_req_data['filterby'])) { |
|
297 | - $query_params = array_merge($query_params, EEM_Message::instance()->filter_by_query_params()); |
|
298 | - if (! $count) { |
|
299 | - $query_params['group_by'] = 'MSG_ID'; |
|
300 | - } |
|
301 | - } |
|
302 | - |
|
303 | - // view conditionals |
|
304 | - if ($view !== 'all' && $count && $all) { |
|
305 | - $query_params[0]['AND*view_conditional'] = array( |
|
306 | - 'STS_ID' => strtoupper($view), |
|
307 | - ); |
|
308 | - } |
|
309 | - |
|
310 | - if (! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
311 | - $query_params[0]['AND*view_conditional'] = $this->_req_data === EEM_Message::status_failed |
|
312 | - ? array( |
|
313 | - 'STS_ID' => array( |
|
314 | - 'IN', |
|
315 | - array(EEM_Message::status_failed, EEM_Message::status_messenger_executing), |
|
316 | - ), |
|
317 | - ) |
|
318 | - : array('STS_ID' => strtoupper($this->_req_data['status'])); |
|
319 | - } |
|
320 | - |
|
321 | - if (! $all && ! empty($this->_req_data['s'])) { |
|
322 | - $search_string = '%' . $this->_req_data['s'] . '%'; |
|
323 | - $query_params[0]['OR'] = array( |
|
324 | - 'MSG_to' => array('LIKE', $search_string), |
|
325 | - 'MSG_from' => array('LIKE', $search_string), |
|
326 | - 'MSG_subject' => array('LIKE', $search_string), |
|
327 | - 'MSG_content' => array('LIKE', $search_string), |
|
328 | - ); |
|
329 | - } |
|
330 | - |
|
331 | - // account for debug only status. We don't show Messages with the EEM_Message::status_debug_only to clients when |
|
332 | - // the messages system is in debug mode. |
|
333 | - // Note: for backward compat with previous iterations, this is necessary because there may be EEM_Message::status_debug_only |
|
334 | - // messages in the database. |
|
335 | - if (! EEM_Message::debug()) { |
|
336 | - $query_params[0]['AND*debug_only_conditional'] = array( |
|
337 | - 'STS_ID' => array('!=', EEM_Message::status_debug_only), |
|
338 | - ); |
|
339 | - } |
|
340 | - |
|
341 | - // account for filters |
|
342 | - if (! $all |
|
343 | - && isset($this->_req_data['ee_messenger_filter_by']) |
|
344 | - && $this->_req_data['ee_messenger_filter_by'] !== 'none_selected' |
|
345 | - ) { |
|
346 | - $query_params[0]['AND*messenger_filter'] = array( |
|
347 | - 'MSG_messenger' => $this->_req_data['ee_messenger_filter_by'], |
|
348 | - ); |
|
349 | - } |
|
350 | - if (! $all |
|
351 | - && ! empty($this->_req_data['ee_message_type_filter_by']) |
|
352 | - && $this->_req_data['ee_message_type_filter_by'] !== 'none_selected' |
|
353 | - ) { |
|
354 | - $query_params[0]['AND*message_type_filter'] = array( |
|
355 | - 'MSG_message_type' => $this->_req_data['ee_message_type_filter_by'], |
|
356 | - ); |
|
357 | - } |
|
358 | - |
|
359 | - if (! $all |
|
360 | - && ! empty($this->_req_data['ee_context_filter_by']) |
|
361 | - && $this->_req_data['ee_context_filter_by'] !== 'none_selected' |
|
362 | - ) { |
|
363 | - $query_params[0]['AND*context_filter'] = array( |
|
364 | - 'MSG_context' => array('IN', explode(',', $this->_req_data['ee_context_filter_by'])), |
|
365 | - ); |
|
366 | - } |
|
367 | - |
|
368 | - return $count |
|
369 | - /** @type int */ |
|
370 | - ? EEM_Message::instance()->count($query_params, null, true) |
|
371 | - /** @type EE_Message[] */ |
|
372 | - : EEM_Message::instance()->get_all($query_params); |
|
373 | - } |
|
374 | - |
|
375 | - |
|
376 | - /** |
|
377 | - * Generate dropdown filter select input for messengers. |
|
378 | - * |
|
379 | - * @return string |
|
380 | - */ |
|
381 | - protected function _get_messengers_dropdown_filter() |
|
382 | - { |
|
383 | - $messenger_options = array(); |
|
384 | - $active_messages_grouped_by_messenger = EEM_Message::instance()->get_all(array('group_by' => 'MSG_messenger')); |
|
385 | - |
|
386 | - // setup array of messenger options |
|
387 | - foreach ($active_messages_grouped_by_messenger as $active_message) { |
|
388 | - if ($active_message instanceof EE_Message) { |
|
389 | - $messenger_options[ $active_message->messenger() ] = ucwords($active_message->messenger_label()); |
|
390 | - } |
|
391 | - } |
|
392 | - return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
393 | - } |
|
394 | - |
|
395 | - |
|
396 | - /** |
|
397 | - * Generate dropdown filter select input for message types |
|
398 | - * |
|
399 | - * @return string |
|
400 | - */ |
|
401 | - protected function _get_message_types_dropdown_filter() |
|
402 | - { |
|
403 | - $message_type_options = array(); |
|
404 | - $active_messages_grouped_by_message_type = EEM_Message::instance()->get_all( |
|
405 | - array('group_by' => 'MSG_message_type') |
|
406 | - ); |
|
407 | - |
|
408 | - // setup array of message type options |
|
409 | - foreach ($active_messages_grouped_by_message_type as $active_message) { |
|
410 | - if ($active_message instanceof EE_Message) { |
|
411 | - $message_type_options[ $active_message->message_type() ] = ucwords( |
|
412 | - $active_message->message_type_label() |
|
413 | - ); |
|
414 | - } |
|
415 | - } |
|
416 | - return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
417 | - } |
|
418 | - |
|
419 | - |
|
420 | - /** |
|
421 | - * Generate dropdown filter select input for message type contexts |
|
422 | - * |
|
423 | - * @return string |
|
424 | - */ |
|
425 | - protected function _get_contexts_for_message_types_dropdown_filter() |
|
426 | - { |
|
427 | - $context_options = array(); |
|
428 | - $active_messages_grouped_by_context = EEM_Message::instance()->get_all(array('group_by' => 'MSG_context')); |
|
429 | - |
|
430 | - // setup array of context options |
|
431 | - foreach ($active_messages_grouped_by_context as $active_message) { |
|
432 | - if ($active_message instanceof EE_Message) { |
|
433 | - $message_type = $active_message->message_type_object(); |
|
434 | - if ($message_type instanceof EE_message_type) { |
|
435 | - foreach ($message_type->get_contexts() as $context => $context_details) { |
|
436 | - if (isset($context_details['label'])) { |
|
437 | - $context_options[ $context ] = $context_details['label']; |
|
438 | - } |
|
439 | - } |
|
440 | - } |
|
441 | - } |
|
442 | - } |
|
443 | - return $this->get_admin_page()->get_contexts_for_message_types_select_input($context_options); |
|
444 | - } |
|
15 | + /** |
|
16 | + * @return Messages_Admin_Page |
|
17 | + */ |
|
18 | + public function get_admin_page() |
|
19 | + { |
|
20 | + return $this->_admin_page; |
|
21 | + } |
|
22 | + |
|
23 | + |
|
24 | + protected function _setup_data() |
|
25 | + { |
|
26 | + $this->_data = $this->_get_messages($this->_per_page, $this->_view); |
|
27 | + $this->_all_data_count = $this->_get_messages($this->_per_page, $this->_view, true); |
|
28 | + } |
|
29 | + |
|
30 | + |
|
31 | + protected function _set_properties() |
|
32 | + { |
|
33 | + $this->_wp_list_args = array( |
|
34 | + 'singular' => __('Message', 'event_espresso'), |
|
35 | + 'plural' => __('Messages', 'event_espresso'), |
|
36 | + 'ajax' => true, |
|
37 | + 'screen' => $this->get_admin_page()->get_current_screen()->id, |
|
38 | + ); |
|
39 | + |
|
40 | + $this->_columns = array( |
|
41 | + 'cb' => '<input type="checkbox" />', |
|
42 | + 'to' => __('To', 'event_espresso'), |
|
43 | + 'from' => __('From', 'event_espresso'), |
|
44 | + 'messenger' => __('Messenger', 'event_espresso'), |
|
45 | + 'message_type' => __('Message Type', 'event_espresso'), |
|
46 | + 'context' => __('Context', 'event_espresso'), |
|
47 | + 'modified' => __('Modified', 'event_espresso'), |
|
48 | + 'action' => __('Actions', 'event_espresso'), |
|
49 | + 'msg_id' => __('ID', 'event_espresso'), |
|
50 | + ); |
|
51 | + |
|
52 | + $this->_sortable_columns = array( |
|
53 | + 'modified' => array('MSG_modified' => true), |
|
54 | + 'message_type' => array('MSG_message_type' => false), |
|
55 | + 'messenger' => array('MSG_messenger' => false), |
|
56 | + 'to' => array('MSG_to' => false), |
|
57 | + 'from' => array('MSG_from' => false), |
|
58 | + 'context' => array('MSG_context' => false), |
|
59 | + 'msg_id' => array('MSG_ID', false), |
|
60 | + ); |
|
61 | + |
|
62 | + $this->_primary_column = 'to'; |
|
63 | + |
|
64 | + $this->_hidden_columns = array( |
|
65 | + 'msg_id', |
|
66 | + ); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * This simply sets up the row class for the table rows. |
|
72 | + * Allows for easier overriding of child methods for setting up sorting. |
|
73 | + * |
|
74 | + * @param object $item the current item |
|
75 | + * @return string |
|
76 | + */ |
|
77 | + protected function _get_row_class($item) |
|
78 | + { |
|
79 | + $class = parent::_get_row_class($item); |
|
80 | + // add status class |
|
81 | + $class .= ' ee-status-strip msg-status-' . $item->STS_ID(); |
|
82 | + if ($this->_has_checkbox_column) { |
|
83 | + $class .= ' has-checkbox-column'; |
|
84 | + } |
|
85 | + return $class; |
|
86 | + } |
|
87 | + |
|
88 | + |
|
89 | + /** |
|
90 | + * _get_table_filters |
|
91 | + * We use this to assemble and return any filters that are associated with this table that help further refine what |
|
92 | + * get's shown in the table. |
|
93 | + * |
|
94 | + * @abstract |
|
95 | + * @access protected |
|
96 | + * @return string |
|
97 | + * @throws \EE_Error |
|
98 | + */ |
|
99 | + protected function _get_table_filters() |
|
100 | + { |
|
101 | + $filters = array(); |
|
102 | + |
|
103 | + // get select_inputs |
|
104 | + $select_inputs = array( |
|
105 | + $this->_get_messengers_dropdown_filter(), |
|
106 | + $this->_get_message_types_dropdown_filter(), |
|
107 | + $this->_get_contexts_for_message_types_dropdown_filter(), |
|
108 | + ); |
|
109 | + |
|
110 | + // set filters to select inputs if they aren't empty |
|
111 | + foreach ($select_inputs as $select_input) { |
|
112 | + if ($select_input) { |
|
113 | + $filters[] = $select_input; |
|
114 | + } |
|
115 | + } |
|
116 | + return $filters; |
|
117 | + } |
|
118 | + |
|
119 | + |
|
120 | + protected function _add_view_counts() |
|
121 | + { |
|
122 | + foreach ($this->_views as $view => $args) { |
|
123 | + $this->_views[ $view ]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
124 | + } |
|
125 | + } |
|
126 | + |
|
127 | + |
|
128 | + /** |
|
129 | + * @param EE_Message $message |
|
130 | + * @return string checkbox |
|
131 | + * @throws \EE_Error |
|
132 | + */ |
|
133 | + public function column_cb($message) |
|
134 | + { |
|
135 | + return sprintf('<input type="checkbox" name="MSG_ID[%s]" value="1" />', $message->ID()); |
|
136 | + } |
|
137 | + |
|
138 | + |
|
139 | + /** |
|
140 | + * @param EE_Message $message |
|
141 | + * @return string |
|
142 | + * @throws \EE_Error |
|
143 | + */ |
|
144 | + public function column_msg_id(EE_Message $message) |
|
145 | + { |
|
146 | + return $message->ID(); |
|
147 | + } |
|
148 | + |
|
149 | + |
|
150 | + /** |
|
151 | + * @param EE_Message $message |
|
152 | + * @return string The recipient of the message |
|
153 | + * @throws \EE_Error |
|
154 | + */ |
|
155 | + public function column_to(EE_Message $message) |
|
156 | + { |
|
157 | + EE_Registry::instance()->load_helper('URL'); |
|
158 | + $actions = array(); |
|
159 | + $actions['delete'] = '<a href="' |
|
160 | + . EEH_URL::add_query_args_and_nonce( |
|
161 | + array( |
|
162 | + 'page' => 'espresso_messages', |
|
163 | + 'action' => 'delete_ee_message', |
|
164 | + 'MSG_ID' => $message->ID(), |
|
165 | + ), |
|
166 | + admin_url('admin.php') |
|
167 | + ) |
|
168 | + . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
169 | + return esc_html($message->to()) . $this->row_actions($actions); |
|
170 | + } |
|
171 | + |
|
172 | + |
|
173 | + /** |
|
174 | + * @param EE_Message $message |
|
175 | + * @return string The sender of the message |
|
176 | + */ |
|
177 | + public function column_from(EE_Message $message) |
|
178 | + { |
|
179 | + return esc_html($message->from()); |
|
180 | + } |
|
181 | + |
|
182 | + |
|
183 | + /** |
|
184 | + * @param EE_Message $message |
|
185 | + * @return string The messenger used to send the message. |
|
186 | + */ |
|
187 | + public function column_messenger(EE_Message $message) |
|
188 | + { |
|
189 | + return ucwords($message->messenger_label()); |
|
190 | + } |
|
191 | + |
|
192 | + |
|
193 | + /** |
|
194 | + * @param EE_Message $message |
|
195 | + * @return string The message type used to generate the message. |
|
196 | + */ |
|
197 | + public function column_message_type(EE_Message $message) |
|
198 | + { |
|
199 | + return ucwords($message->message_type_label()); |
|
200 | + } |
|
201 | + |
|
202 | + |
|
203 | + /** |
|
204 | + * @param EE_Message $message |
|
205 | + * @return string The context the message was generated for. |
|
206 | + */ |
|
207 | + public function column_context(EE_Message $message) |
|
208 | + { |
|
209 | + return $message->context_label(); |
|
210 | + } |
|
211 | + |
|
212 | + |
|
213 | + /** |
|
214 | + * @param EE_Message $message |
|
215 | + * @return string The timestamp when this message was last modified. |
|
216 | + */ |
|
217 | + public function column_modified(EE_Message $message) |
|
218 | + { |
|
219 | + return $message->modified(); |
|
220 | + } |
|
221 | + |
|
222 | + |
|
223 | + /** |
|
224 | + * @param EE_Message $message |
|
225 | + * @return string Actions that can be done on the current message. |
|
226 | + */ |
|
227 | + public function column_action(EE_Message $message) |
|
228 | + { |
|
229 | + EE_Registry::instance()->load_helper('MSG_Template'); |
|
230 | + $action_links = array( |
|
231 | + 'view' => EEH_MSG_Template::get_message_action_link('view', $message), |
|
232 | + 'error' => EEH_MSG_Template::get_message_action_link('error', $message), |
|
233 | + 'generate_now' => EEH_MSG_Template::get_message_action_link('generate_now', $message), |
|
234 | + 'send_now' => EEH_MSG_Template::get_message_action_link('send_now', $message), |
|
235 | + 'queue_for_resending' => EEH_MSG_Template::get_message_action_link('queue_for_resending', $message), |
|
236 | + 'view_transaction' => EEH_MSG_Template::get_message_action_link('view_transaction', $message), |
|
237 | + ); |
|
238 | + $content = ''; |
|
239 | + switch ($message->STS_ID()) { |
|
240 | + case EEM_Message::status_sent: |
|
241 | + $content = $action_links['view'] . $action_links['queue_for_resending'] . $action_links['view_transaction']; |
|
242 | + break; |
|
243 | + case EEM_Message::status_resend: |
|
244 | + $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
245 | + break; |
|
246 | + case EEM_Message::status_retry: |
|
247 | + $content = $action_links['view'] . $action_links['send_now'] . $action_links['error'] . $action_links['view_transaction']; |
|
248 | + break; |
|
249 | + case EEM_Message::status_failed: |
|
250 | + case EEM_Message::status_debug_only: |
|
251 | + $content = $action_links['error'] . $action_links['view_transaction']; |
|
252 | + break; |
|
253 | + case EEM_Message::status_idle: |
|
254 | + $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
255 | + break; |
|
256 | + case EEM_Message::status_incomplete: |
|
257 | + $content = $action_links['generate_now'] . $action_links['view_transaction']; |
|
258 | + break; |
|
259 | + } |
|
260 | + return $content; |
|
261 | + } |
|
262 | + |
|
263 | + |
|
264 | + /** |
|
265 | + * Retrieve the EE_Message objects for the list table. |
|
266 | + * |
|
267 | + * @param int $perpage The number of items per page |
|
268 | + * @param string $view The view items are being retrieved for |
|
269 | + * @param bool $count Whether to just return a count or not. |
|
270 | + * @param bool $all Disregard any paging info (no limit on data returned). |
|
271 | + * @return int|EE_Message[] |
|
272 | + * @throws \EE_Error |
|
273 | + */ |
|
274 | + protected function _get_messages($perpage = 10, $view = 'all', $count = false, $all = false) |
|
275 | + { |
|
276 | + |
|
277 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) |
|
278 | + ? $this->_req_data['paged'] |
|
279 | + : 1; |
|
280 | + |
|
281 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) |
|
282 | + ? $this->_req_data['perpage'] |
|
283 | + : $perpage; |
|
284 | + |
|
285 | + $offset = ($current_page - 1) * $per_page; |
|
286 | + $limit = $all || $count ? null : array($offset, $per_page); |
|
287 | + $query_params = array( |
|
288 | + 'order_by' => empty($this->_req_data['orderby']) ? 'MSG_modified' : $this->_req_data['orderby'], |
|
289 | + 'order' => empty($this->_req_data['order']) ? 'DESC' : $this->_req_data['order'], |
|
290 | + 'limit' => $limit, |
|
291 | + ); |
|
292 | + |
|
293 | + /** |
|
294 | + * Any filters coming in from other routes? |
|
295 | + */ |
|
296 | + if (isset($this->_req_data['filterby'])) { |
|
297 | + $query_params = array_merge($query_params, EEM_Message::instance()->filter_by_query_params()); |
|
298 | + if (! $count) { |
|
299 | + $query_params['group_by'] = 'MSG_ID'; |
|
300 | + } |
|
301 | + } |
|
302 | + |
|
303 | + // view conditionals |
|
304 | + if ($view !== 'all' && $count && $all) { |
|
305 | + $query_params[0]['AND*view_conditional'] = array( |
|
306 | + 'STS_ID' => strtoupper($view), |
|
307 | + ); |
|
308 | + } |
|
309 | + |
|
310 | + if (! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
311 | + $query_params[0]['AND*view_conditional'] = $this->_req_data === EEM_Message::status_failed |
|
312 | + ? array( |
|
313 | + 'STS_ID' => array( |
|
314 | + 'IN', |
|
315 | + array(EEM_Message::status_failed, EEM_Message::status_messenger_executing), |
|
316 | + ), |
|
317 | + ) |
|
318 | + : array('STS_ID' => strtoupper($this->_req_data['status'])); |
|
319 | + } |
|
320 | + |
|
321 | + if (! $all && ! empty($this->_req_data['s'])) { |
|
322 | + $search_string = '%' . $this->_req_data['s'] . '%'; |
|
323 | + $query_params[0]['OR'] = array( |
|
324 | + 'MSG_to' => array('LIKE', $search_string), |
|
325 | + 'MSG_from' => array('LIKE', $search_string), |
|
326 | + 'MSG_subject' => array('LIKE', $search_string), |
|
327 | + 'MSG_content' => array('LIKE', $search_string), |
|
328 | + ); |
|
329 | + } |
|
330 | + |
|
331 | + // account for debug only status. We don't show Messages with the EEM_Message::status_debug_only to clients when |
|
332 | + // the messages system is in debug mode. |
|
333 | + // Note: for backward compat with previous iterations, this is necessary because there may be EEM_Message::status_debug_only |
|
334 | + // messages in the database. |
|
335 | + if (! EEM_Message::debug()) { |
|
336 | + $query_params[0]['AND*debug_only_conditional'] = array( |
|
337 | + 'STS_ID' => array('!=', EEM_Message::status_debug_only), |
|
338 | + ); |
|
339 | + } |
|
340 | + |
|
341 | + // account for filters |
|
342 | + if (! $all |
|
343 | + && isset($this->_req_data['ee_messenger_filter_by']) |
|
344 | + && $this->_req_data['ee_messenger_filter_by'] !== 'none_selected' |
|
345 | + ) { |
|
346 | + $query_params[0]['AND*messenger_filter'] = array( |
|
347 | + 'MSG_messenger' => $this->_req_data['ee_messenger_filter_by'], |
|
348 | + ); |
|
349 | + } |
|
350 | + if (! $all |
|
351 | + && ! empty($this->_req_data['ee_message_type_filter_by']) |
|
352 | + && $this->_req_data['ee_message_type_filter_by'] !== 'none_selected' |
|
353 | + ) { |
|
354 | + $query_params[0]['AND*message_type_filter'] = array( |
|
355 | + 'MSG_message_type' => $this->_req_data['ee_message_type_filter_by'], |
|
356 | + ); |
|
357 | + } |
|
358 | + |
|
359 | + if (! $all |
|
360 | + && ! empty($this->_req_data['ee_context_filter_by']) |
|
361 | + && $this->_req_data['ee_context_filter_by'] !== 'none_selected' |
|
362 | + ) { |
|
363 | + $query_params[0]['AND*context_filter'] = array( |
|
364 | + 'MSG_context' => array('IN', explode(',', $this->_req_data['ee_context_filter_by'])), |
|
365 | + ); |
|
366 | + } |
|
367 | + |
|
368 | + return $count |
|
369 | + /** @type int */ |
|
370 | + ? EEM_Message::instance()->count($query_params, null, true) |
|
371 | + /** @type EE_Message[] */ |
|
372 | + : EEM_Message::instance()->get_all($query_params); |
|
373 | + } |
|
374 | + |
|
375 | + |
|
376 | + /** |
|
377 | + * Generate dropdown filter select input for messengers. |
|
378 | + * |
|
379 | + * @return string |
|
380 | + */ |
|
381 | + protected function _get_messengers_dropdown_filter() |
|
382 | + { |
|
383 | + $messenger_options = array(); |
|
384 | + $active_messages_grouped_by_messenger = EEM_Message::instance()->get_all(array('group_by' => 'MSG_messenger')); |
|
385 | + |
|
386 | + // setup array of messenger options |
|
387 | + foreach ($active_messages_grouped_by_messenger as $active_message) { |
|
388 | + if ($active_message instanceof EE_Message) { |
|
389 | + $messenger_options[ $active_message->messenger() ] = ucwords($active_message->messenger_label()); |
|
390 | + } |
|
391 | + } |
|
392 | + return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
|
393 | + } |
|
394 | + |
|
395 | + |
|
396 | + /** |
|
397 | + * Generate dropdown filter select input for message types |
|
398 | + * |
|
399 | + * @return string |
|
400 | + */ |
|
401 | + protected function _get_message_types_dropdown_filter() |
|
402 | + { |
|
403 | + $message_type_options = array(); |
|
404 | + $active_messages_grouped_by_message_type = EEM_Message::instance()->get_all( |
|
405 | + array('group_by' => 'MSG_message_type') |
|
406 | + ); |
|
407 | + |
|
408 | + // setup array of message type options |
|
409 | + foreach ($active_messages_grouped_by_message_type as $active_message) { |
|
410 | + if ($active_message instanceof EE_Message) { |
|
411 | + $message_type_options[ $active_message->message_type() ] = ucwords( |
|
412 | + $active_message->message_type_label() |
|
413 | + ); |
|
414 | + } |
|
415 | + } |
|
416 | + return $this->get_admin_page()->get_message_types_select_input($message_type_options); |
|
417 | + } |
|
418 | + |
|
419 | + |
|
420 | + /** |
|
421 | + * Generate dropdown filter select input for message type contexts |
|
422 | + * |
|
423 | + * @return string |
|
424 | + */ |
|
425 | + protected function _get_contexts_for_message_types_dropdown_filter() |
|
426 | + { |
|
427 | + $context_options = array(); |
|
428 | + $active_messages_grouped_by_context = EEM_Message::instance()->get_all(array('group_by' => 'MSG_context')); |
|
429 | + |
|
430 | + // setup array of context options |
|
431 | + foreach ($active_messages_grouped_by_context as $active_message) { |
|
432 | + if ($active_message instanceof EE_Message) { |
|
433 | + $message_type = $active_message->message_type_object(); |
|
434 | + if ($message_type instanceof EE_message_type) { |
|
435 | + foreach ($message_type->get_contexts() as $context => $context_details) { |
|
436 | + if (isset($context_details['label'])) { |
|
437 | + $context_options[ $context ] = $context_details['label']; |
|
438 | + } |
|
439 | + } |
|
440 | + } |
|
441 | + } |
|
442 | + } |
|
443 | + return $this->get_admin_page()->get_contexts_for_message_types_select_input($context_options); |
|
444 | + } |
|
445 | 445 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $class = parent::_get_row_class($item); |
80 | 80 | // add status class |
81 | - $class .= ' ee-status-strip msg-status-' . $item->STS_ID(); |
|
81 | + $class .= ' ee-status-strip msg-status-'.$item->STS_ID(); |
|
82 | 82 | if ($this->_has_checkbox_column) { |
83 | 83 | $class .= ' has-checkbox-column'; |
84 | 84 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | protected function _add_view_counts() |
121 | 121 | { |
122 | 122 | foreach ($this->_views as $view => $args) { |
123 | - $this->_views[ $view ]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
123 | + $this->_views[$view]['count'] = $this->_get_messages($this->_per_page, $view, true, true); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | ), |
166 | 166 | admin_url('admin.php') |
167 | 167 | ) |
168 | - . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
169 | - return esc_html($message->to()) . $this->row_actions($actions); |
|
168 | + . '">'.__('Delete', 'event_espresso').'</a>'; |
|
169 | + return esc_html($message->to()).$this->row_actions($actions); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
@@ -238,23 +238,23 @@ discard block |
||
238 | 238 | $content = ''; |
239 | 239 | switch ($message->STS_ID()) { |
240 | 240 | case EEM_Message::status_sent: |
241 | - $content = $action_links['view'] . $action_links['queue_for_resending'] . $action_links['view_transaction']; |
|
241 | + $content = $action_links['view'].$action_links['queue_for_resending'].$action_links['view_transaction']; |
|
242 | 242 | break; |
243 | 243 | case EEM_Message::status_resend: |
244 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
244 | + $content = $action_links['view'].$action_links['send_now'].$action_links['view_transaction']; |
|
245 | 245 | break; |
246 | 246 | case EEM_Message::status_retry: |
247 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['error'] . $action_links['view_transaction']; |
|
247 | + $content = $action_links['view'].$action_links['send_now'].$action_links['error'].$action_links['view_transaction']; |
|
248 | 248 | break; |
249 | 249 | case EEM_Message::status_failed: |
250 | 250 | case EEM_Message::status_debug_only: |
251 | - $content = $action_links['error'] . $action_links['view_transaction']; |
|
251 | + $content = $action_links['error'].$action_links['view_transaction']; |
|
252 | 252 | break; |
253 | 253 | case EEM_Message::status_idle: |
254 | - $content = $action_links['view'] . $action_links['send_now'] . $action_links['view_transaction']; |
|
254 | + $content = $action_links['view'].$action_links['send_now'].$action_links['view_transaction']; |
|
255 | 255 | break; |
256 | 256 | case EEM_Message::status_incomplete: |
257 | - $content = $action_links['generate_now'] . $action_links['view_transaction']; |
|
257 | + $content = $action_links['generate_now'].$action_links['view_transaction']; |
|
258 | 258 | break; |
259 | 259 | } |
260 | 260 | return $content; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | if (isset($this->_req_data['filterby'])) { |
297 | 297 | $query_params = array_merge($query_params, EEM_Message::instance()->filter_by_query_params()); |
298 | - if (! $count) { |
|
298 | + if ( ! $count) { |
|
299 | 299 | $query_params['group_by'] = 'MSG_ID'; |
300 | 300 | } |
301 | 301 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | ); |
308 | 308 | } |
309 | 309 | |
310 | - if (! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
310 | + if ( ! $all && ! empty($this->_req_data['status']) && $this->_req_data['status'] !== 'all') { |
|
311 | 311 | $query_params[0]['AND*view_conditional'] = $this->_req_data === EEM_Message::status_failed |
312 | 312 | ? array( |
313 | 313 | 'STS_ID' => array( |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | : array('STS_ID' => strtoupper($this->_req_data['status'])); |
319 | 319 | } |
320 | 320 | |
321 | - if (! $all && ! empty($this->_req_data['s'])) { |
|
322 | - $search_string = '%' . $this->_req_data['s'] . '%'; |
|
321 | + if ( ! $all && ! empty($this->_req_data['s'])) { |
|
322 | + $search_string = '%'.$this->_req_data['s'].'%'; |
|
323 | 323 | $query_params[0]['OR'] = array( |
324 | 324 | 'MSG_to' => array('LIKE', $search_string), |
325 | 325 | 'MSG_from' => array('LIKE', $search_string), |
@@ -332,14 +332,14 @@ discard block |
||
332 | 332 | // the messages system is in debug mode. |
333 | 333 | // Note: for backward compat with previous iterations, this is necessary because there may be EEM_Message::status_debug_only |
334 | 334 | // messages in the database. |
335 | - if (! EEM_Message::debug()) { |
|
335 | + if ( ! EEM_Message::debug()) { |
|
336 | 336 | $query_params[0]['AND*debug_only_conditional'] = array( |
337 | 337 | 'STS_ID' => array('!=', EEM_Message::status_debug_only), |
338 | 338 | ); |
339 | 339 | } |
340 | 340 | |
341 | 341 | // account for filters |
342 | - if (! $all |
|
342 | + if ( ! $all |
|
343 | 343 | && isset($this->_req_data['ee_messenger_filter_by']) |
344 | 344 | && $this->_req_data['ee_messenger_filter_by'] !== 'none_selected' |
345 | 345 | ) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | 'MSG_messenger' => $this->_req_data['ee_messenger_filter_by'], |
348 | 348 | ); |
349 | 349 | } |
350 | - if (! $all |
|
350 | + if ( ! $all |
|
351 | 351 | && ! empty($this->_req_data['ee_message_type_filter_by']) |
352 | 352 | && $this->_req_data['ee_message_type_filter_by'] !== 'none_selected' |
353 | 353 | ) { |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | ); |
357 | 357 | } |
358 | 358 | |
359 | - if (! $all |
|
359 | + if ( ! $all |
|
360 | 360 | && ! empty($this->_req_data['ee_context_filter_by']) |
361 | 361 | && $this->_req_data['ee_context_filter_by'] !== 'none_selected' |
362 | 362 | ) { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | // setup array of messenger options |
387 | 387 | foreach ($active_messages_grouped_by_messenger as $active_message) { |
388 | 388 | if ($active_message instanceof EE_Message) { |
389 | - $messenger_options[ $active_message->messenger() ] = ucwords($active_message->messenger_label()); |
|
389 | + $messenger_options[$active_message->messenger()] = ucwords($active_message->messenger_label()); |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | return $this->get_admin_page()->get_messengers_select_input($messenger_options); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | // setup array of message type options |
409 | 409 | foreach ($active_messages_grouped_by_message_type as $active_message) { |
410 | 410 | if ($active_message instanceof EE_Message) { |
411 | - $message_type_options[ $active_message->message_type() ] = ucwords( |
|
411 | + $message_type_options[$active_message->message_type()] = ucwords( |
|
412 | 412 | $active_message->message_type_label() |
413 | 413 | ); |
414 | 414 | } |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | if ($message_type instanceof EE_message_type) { |
435 | 435 | foreach ($message_type->get_contexts() as $context => $context_details) { |
436 | 436 | if (isset($context_details['label'])) { |
437 | - $context_options[ $context ] = $context_details['label']; |
|
437 | + $context_options[$context] = $context_details['label']; |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | } |