@@ -15,20 +15,20 @@ discard block |
||
15 | 15 | class Pricing_Edit_Default_Price_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Edit Default Price Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'edit-default-price-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Edit Default Price Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'edit-default-price-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( |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + /*20 => array( |
|
32 | 32 | 'id' => 'PRT_ID', |
33 | 33 | 'content' => $this->_price_type_stop(), |
34 | 34 | 'options' => array( |
@@ -37,74 +37,74 @@ discard block |
||
37 | 37 | 'tipAdjustmentX' => -15 |
38 | 38 | ) |
39 | 39 | ),*/ |
40 | - 30 => array( |
|
41 | - 'id' => 'PRC_name', |
|
42 | - 'content' => $this->_price_name_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentY' => -40, |
|
46 | - ), |
|
47 | - ), |
|
48 | - 40 => array( |
|
49 | - 'id' => 'PRC_desc', |
|
50 | - 'content' => $this->_price_description_stop(), |
|
51 | - 'options' => array( |
|
52 | - 'tipLocation' => 'top', |
|
53 | - 'tipAdjustmentY' => -40, |
|
54 | - ), |
|
55 | - ), |
|
56 | - 50 => array( |
|
57 | - 'id' => 'PRC_amount', |
|
58 | - 'content' => $this->_price_amount_stop(), |
|
59 | - 'options' => array( |
|
60 | - 'tipLocation' => 'top', |
|
61 | - 'tipAdjustmentY' => -40, |
|
62 | - ), |
|
63 | - ), |
|
64 | - ); |
|
65 | - } |
|
40 | + 30 => array( |
|
41 | + 'id' => 'PRC_name', |
|
42 | + 'content' => $this->_price_name_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentY' => -40, |
|
46 | + ), |
|
47 | + ), |
|
48 | + 40 => array( |
|
49 | + 'id' => 'PRC_desc', |
|
50 | + 'content' => $this->_price_description_stop(), |
|
51 | + 'options' => array( |
|
52 | + 'tipLocation' => 'top', |
|
53 | + 'tipAdjustmentY' => -40, |
|
54 | + ), |
|
55 | + ), |
|
56 | + 50 => array( |
|
57 | + 'id' => 'PRC_amount', |
|
58 | + 'content' => $this->_price_amount_stop(), |
|
59 | + 'options' => array( |
|
60 | + 'tipLocation' => 'top', |
|
61 | + 'tipAdjustmentY' => -40, |
|
62 | + ), |
|
63 | + ), |
|
64 | + ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | - protected function _start() |
|
69 | - { |
|
70 | - $content = '<h3>' . __('Edit Default Price', 'event_espresso') . '</h3>'; |
|
71 | - $content .= '<p>' |
|
72 | - . __( |
|
73 | - 'This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | - 'event_espresso' |
|
75 | - ) . '</p>'; |
|
76 | - return $content; |
|
77 | - } |
|
68 | + protected function _start() |
|
69 | + { |
|
70 | + $content = '<h3>' . __('Edit Default Price', 'event_espresso') . '</h3>'; |
|
71 | + $content .= '<p>' |
|
72 | + . __( |
|
73 | + 'This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | + 'event_espresso' |
|
75 | + ) . '</p>'; |
|
76 | + return $content; |
|
77 | + } |
|
78 | 78 | |
79 | - protected function _price_type_stop() |
|
80 | - { |
|
81 | - return '<p>' |
|
82 | - . __( |
|
83 | - 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
84 | - 'event_espresso' |
|
85 | - ) . '</p>'; |
|
86 | - } |
|
79 | + protected function _price_type_stop() |
|
80 | + { |
|
81 | + return '<p>' |
|
82 | + . __( |
|
83 | + 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
84 | + 'event_espresso' |
|
85 | + ) . '</p>'; |
|
86 | + } |
|
87 | 87 | |
88 | - protected function _price_name_stop() |
|
89 | - { |
|
90 | - return '<p>' |
|
91 | - . __( |
|
92 | - 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
93 | - 'event_espresso' |
|
94 | - ) . '</p>'; |
|
95 | - } |
|
88 | + protected function _price_name_stop() |
|
89 | + { |
|
90 | + return '<p>' |
|
91 | + . __( |
|
92 | + 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
93 | + 'event_espresso' |
|
94 | + ) . '</p>'; |
|
95 | + } |
|
96 | 96 | |
97 | - protected function _price_description_stop() |
|
98 | - { |
|
99 | - return '<p>' |
|
100 | - . __( |
|
101 | - 'View the price type (price, discount, tax or surcharge) description.', |
|
102 | - 'event_espresso' |
|
103 | - ) . '</p>'; |
|
104 | - } |
|
97 | + protected function _price_description_stop() |
|
98 | + { |
|
99 | + return '<p>' |
|
100 | + . __( |
|
101 | + 'View the price type (price, discount, tax or surcharge) description.', |
|
102 | + 'event_espresso' |
|
103 | + ) . '</p>'; |
|
104 | + } |
|
105 | 105 | |
106 | - protected function _price_amount_stop() |
|
107 | - { |
|
108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
109 | - } |
|
106 | + protected function _price_amount_stop() |
|
107 | + { |
|
108 | + return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
109 | + } |
|
110 | 110 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | |
68 | 68 | protected function _start() |
69 | 69 | { |
70 | - $content = '<h3>' . __('Edit Default Price', 'event_espresso') . '</h3>'; |
|
70 | + $content = '<h3>'.__('Edit Default Price', 'event_espresso').'</h3>'; |
|
71 | 71 | $content .= '<p>' |
72 | 72 | . __( |
73 | 73 | 'This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', |
74 | 74 | 'event_espresso' |
75 | - ) . '</p>'; |
|
75 | + ).'</p>'; |
|
76 | 76 | return $content; |
77 | 77 | } |
78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | . __( |
83 | 83 | 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
84 | 84 | 'event_espresso' |
85 | - ) . '</p>'; |
|
85 | + ).'</p>'; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | protected function _price_name_stop() |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | . __( |
92 | 92 | 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
93 | 93 | 'event_espresso' |
94 | - ) . '</p>'; |
|
94 | + ).'</p>'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | protected function _price_description_stop() |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | . __( |
101 | 101 | 'View the price type (price, discount, tax or surcharge) description.', |
102 | 102 | 'event_espresso' |
103 | - ) . '</p>'; |
|
103 | + ).'</p>'; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | protected function _price_amount_stop() |
107 | 107 | { |
108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('The ticket amount before any deductions.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | } |
@@ -15,84 +15,84 @@ |
||
15 | 15 | class Pricing_Add_New_Price_Type_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Add New Price Type Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'add-new-price-type-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Add New Price Type Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'add-new-price-type-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' => 'base_type', |
|
33 | - 'content' => $this->_basic_type_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'top', |
|
36 | - 'tipAdjustmentY' => -50, |
|
37 | - 'tipAdjustmentX' => -15, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'PRT_name', |
|
42 | - 'content' => $this->_price_type_name_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentY' => -40, |
|
46 | - ), |
|
47 | - ), |
|
48 | - 40 => array( |
|
49 | - 'id' => 'PRT_name', |
|
50 | - 'content' => $this->_percentage_dollar_amount_stop(), |
|
51 | - 'options' => array( |
|
52 | - 'tipLocation' => 'top', |
|
53 | - 'tipAdjustmentY' => 45, |
|
54 | - ), |
|
55 | - ), |
|
56 | - 50 => array( |
|
57 | - 'id' => 'PRT_order', |
|
58 | - 'content' => $this->_order_of_application_stop(), |
|
59 | - 'options' => array( |
|
60 | - 'tipLocation' => 'top', |
|
61 | - 'tipAdjustmentY' => -40, |
|
62 | - ), |
|
63 | - ), |
|
64 | - ); |
|
65 | - } |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'id' => 'base_type', |
|
33 | + 'content' => $this->_basic_type_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'top', |
|
36 | + 'tipAdjustmentY' => -50, |
|
37 | + 'tipAdjustmentX' => -15, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'PRT_name', |
|
42 | + 'content' => $this->_price_type_name_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentY' => -40, |
|
46 | + ), |
|
47 | + ), |
|
48 | + 40 => array( |
|
49 | + 'id' => 'PRT_name', |
|
50 | + 'content' => $this->_percentage_dollar_amount_stop(), |
|
51 | + 'options' => array( |
|
52 | + 'tipLocation' => 'top', |
|
53 | + 'tipAdjustmentY' => 45, |
|
54 | + ), |
|
55 | + ), |
|
56 | + 50 => array( |
|
57 | + 'id' => 'PRT_order', |
|
58 | + 'content' => $this->_order_of_application_stop(), |
|
59 | + 'options' => array( |
|
60 | + 'tipLocation' => 'top', |
|
61 | + 'tipAdjustmentY' => -40, |
|
62 | + ), |
|
63 | + ), |
|
64 | + ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | - protected function _start() |
|
69 | - { |
|
70 | - $content = '<h3>' . __('Add New Price Type', 'event_espresso') . '</h3>'; |
|
71 | - $content .= '<p>' |
|
72 | - . __( |
|
73 | - 'This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | - 'event_espresso' |
|
75 | - ) . '</p>'; |
|
76 | - return $content; |
|
77 | - } |
|
68 | + protected function _start() |
|
69 | + { |
|
70 | + $content = '<h3>' . __('Add New Price Type', 'event_espresso') . '</h3>'; |
|
71 | + $content .= '<p>' |
|
72 | + . __( |
|
73 | + 'This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | + 'event_espresso' |
|
75 | + ) . '</p>'; |
|
76 | + return $content; |
|
77 | + } |
|
78 | 78 | |
79 | - protected function _basic_type_stop() |
|
80 | - { |
|
81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
82 | - } |
|
79 | + protected function _basic_type_stop() |
|
80 | + { |
|
81 | + return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
82 | + } |
|
83 | 83 | |
84 | - protected function _price_type_name_stop() |
|
85 | - { |
|
86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
87 | - } |
|
84 | + protected function _price_type_name_stop() |
|
85 | + { |
|
86 | + return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
87 | + } |
|
88 | 88 | |
89 | - protected function _percentage_dollar_amount_stop() |
|
90 | - { |
|
91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
92 | - } |
|
89 | + protected function _percentage_dollar_amount_stop() |
|
90 | + { |
|
91 | + return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
92 | + } |
|
93 | 93 | |
94 | - protected function _order_of_application_stop() |
|
95 | - { |
|
96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
97 | - } |
|
94 | + protected function _order_of_application_stop() |
|
95 | + { |
|
96 | + return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
97 | + } |
|
98 | 98 | } |
@@ -67,32 +67,32 @@ |
||
67 | 67 | |
68 | 68 | protected function _start() |
69 | 69 | { |
70 | - $content = '<h3>' . __('Add New Price Type', 'event_espresso') . '</h3>'; |
|
70 | + $content = '<h3>'.__('Add New Price Type', 'event_espresso').'</h3>'; |
|
71 | 71 | $content .= '<p>' |
72 | 72 | . __( |
73 | 73 | 'This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', |
74 | 74 | 'event_espresso' |
75 | - ) . '</p>'; |
|
75 | + ).'</p>'; |
|
76 | 76 | return $content; |
77 | 77 | } |
78 | 78 | |
79 | 79 | protected function _basic_type_stop() |
80 | 80 | { |
81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
81 | + return '<p>'.__('Set a price type to be a discount, surcharge, or tax.', 'event_espresso').'</p>'; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | protected function _price_type_name_stop() |
85 | 85 | { |
86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
86 | + return '<p>'.__('The name of the price type.', 'event_espresso').'</p>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | protected function _percentage_dollar_amount_stop() |
90 | 90 | { |
91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
91 | + return '<p>'.__('Set a price type to be percentage-based or a fixed amount.', 'event_espresso').'</p>'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function _order_of_application_stop() |
95 | 95 | { |
96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
96 | + return '<p>'.__('Set the order of application for a price type.', 'event_espresso').'</p>'; |
|
97 | 97 | } |
98 | 98 | } |
@@ -15,96 +15,96 @@ |
||
15 | 15 | class Pricing_Add_New_Default_Price_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Add New Default Price Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'add-new-default-price-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Add New Default Price Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'add-new-default-price-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' => 'PRT_ID', |
|
33 | - 'content' => $this->_price_type_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'top', |
|
36 | - 'tipAdjustmentY' => -50, |
|
37 | - 'tipAdjustmentX' => -15, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'PRC_name', |
|
42 | - 'content' => $this->_price_name_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentY' => -40, |
|
46 | - ), |
|
47 | - ), |
|
48 | - 40 => array( |
|
49 | - 'id' => 'PRC_desc', |
|
50 | - 'content' => $this->_price_description_stop(), |
|
51 | - 'options' => array( |
|
52 | - 'tipLocation' => 'top', |
|
53 | - 'tipAdjustmentY' => -40, |
|
54 | - ), |
|
55 | - ), |
|
56 | - 50 => array( |
|
57 | - 'id' => 'PRC_amount', |
|
58 | - 'content' => $this->_price_amount_stop(), |
|
59 | - 'options' => array( |
|
60 | - 'tipLocation' => 'top', |
|
61 | - 'tipAdjustmentY' => -40, |
|
62 | - ), |
|
63 | - ), |
|
64 | - ); |
|
65 | - } |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'id' => 'PRT_ID', |
|
33 | + 'content' => $this->_price_type_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'top', |
|
36 | + 'tipAdjustmentY' => -50, |
|
37 | + 'tipAdjustmentX' => -15, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'PRC_name', |
|
42 | + 'content' => $this->_price_name_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentY' => -40, |
|
46 | + ), |
|
47 | + ), |
|
48 | + 40 => array( |
|
49 | + 'id' => 'PRC_desc', |
|
50 | + 'content' => $this->_price_description_stop(), |
|
51 | + 'options' => array( |
|
52 | + 'tipLocation' => 'top', |
|
53 | + 'tipAdjustmentY' => -40, |
|
54 | + ), |
|
55 | + ), |
|
56 | + 50 => array( |
|
57 | + 'id' => 'PRC_amount', |
|
58 | + 'content' => $this->_price_amount_stop(), |
|
59 | + 'options' => array( |
|
60 | + 'tipLocation' => 'top', |
|
61 | + 'tipAdjustmentY' => -40, |
|
62 | + ), |
|
63 | + ), |
|
64 | + ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | - protected function _start() |
|
69 | - { |
|
70 | - $content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>'; |
|
71 | - $content .= '<p>' |
|
72 | - . __( |
|
73 | - 'This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | - 'event_espresso' |
|
75 | - ) . '</p>'; |
|
76 | - return $content; |
|
77 | - } |
|
68 | + protected function _start() |
|
69 | + { |
|
70 | + $content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>'; |
|
71 | + $content .= '<p>' |
|
72 | + . __( |
|
73 | + 'This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | + 'event_espresso' |
|
75 | + ) . '</p>'; |
|
76 | + return $content; |
|
77 | + } |
|
78 | 78 | |
79 | - protected function _price_type_stop() |
|
80 | - { |
|
81 | - return '<p>' |
|
82 | - . __( |
|
83 | - 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
84 | - 'event_espresso' |
|
85 | - ) . '</p>'; |
|
86 | - } |
|
79 | + protected function _price_type_stop() |
|
80 | + { |
|
81 | + return '<p>' |
|
82 | + . __( |
|
83 | + 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
84 | + 'event_espresso' |
|
85 | + ) . '</p>'; |
|
86 | + } |
|
87 | 87 | |
88 | - protected function _price_name_stop() |
|
89 | - { |
|
90 | - return '<p>' |
|
91 | - . __( |
|
92 | - 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
93 | - 'event_espresso' |
|
94 | - ) . '</p>'; |
|
95 | - } |
|
88 | + protected function _price_name_stop() |
|
89 | + { |
|
90 | + return '<p>' |
|
91 | + . __( |
|
92 | + 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
93 | + 'event_espresso' |
|
94 | + ) . '</p>'; |
|
95 | + } |
|
96 | 96 | |
97 | - protected function _price_description_stop() |
|
98 | - { |
|
99 | - return '<p>' |
|
100 | - . __( |
|
101 | - 'View the price type (price, discount, tax or surcharge) description.', |
|
102 | - 'event_espresso' |
|
103 | - ) . '</p>'; |
|
104 | - } |
|
97 | + protected function _price_description_stop() |
|
98 | + { |
|
99 | + return '<p>' |
|
100 | + . __( |
|
101 | + 'View the price type (price, discount, tax or surcharge) description.', |
|
102 | + 'event_espresso' |
|
103 | + ) . '</p>'; |
|
104 | + } |
|
105 | 105 | |
106 | - protected function _price_amount_stop() |
|
107 | - { |
|
108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
109 | - } |
|
106 | + protected function _price_amount_stop() |
|
107 | + { |
|
108 | + return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
109 | + } |
|
110 | 110 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | |
68 | 68 | protected function _start() |
69 | 69 | { |
70 | - $content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>'; |
|
70 | + $content = '<h3>'.__('Add New Default Price', 'event_espresso').'</h3>'; |
|
71 | 71 | $content .= '<p>' |
72 | 72 | . __( |
73 | 73 | 'This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', |
74 | 74 | 'event_espresso' |
75 | - ) . '</p>'; |
|
75 | + ).'</p>'; |
|
76 | 76 | return $content; |
77 | 77 | } |
78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | . __( |
83 | 83 | 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
84 | 84 | 'event_espresso' |
85 | - ) . '</p>'; |
|
85 | + ).'</p>'; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | protected function _price_name_stop() |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | . __( |
92 | 92 | 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
93 | 93 | 'event_espresso' |
94 | - ) . '</p>'; |
|
94 | + ).'</p>'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | protected function _price_description_stop() |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | . __( |
101 | 101 | 'View the price type (price, discount, tax or surcharge) description.', |
102 | 102 | 'event_espresso' |
103 | - ) . '</p>'; |
|
103 | + ).'</p>'; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | protected function _price_amount_stop() |
107 | 107 | { |
108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('The ticket amount before any deductions.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | } |
@@ -15,135 +15,135 @@ |
||
15 | 15 | class Pricing_Default_Prices_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Default Pricing Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'default-prices-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Default Pricing Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'default-prices-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' => 'name', |
|
33 | - 'content' => $this->_name_column_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'top', |
|
36 | - 'tipAdjustmentX' => -5, |
|
37 | - 'tipAdjustmentY' => -30, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'type', |
|
42 | - 'content' => $this->_type_column_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentX' => 5, |
|
46 | - 'tipAdjustmentY' => -30, |
|
47 | - ), |
|
48 | - ), |
|
49 | - 40 => array( |
|
50 | - 'id' => 'description', |
|
51 | - 'content' => $this->_description_column_stop(), |
|
52 | - 'options' => array( |
|
53 | - 'tipLocation' => 'top', |
|
54 | - 'tipAdjustmentX' => 5, |
|
55 | - 'tipAdjustmentY' => -30, |
|
56 | - ), |
|
57 | - ), |
|
58 | - 50 => array( |
|
59 | - 'id' => 'amount', |
|
60 | - 'content' => $this->_amount_column_stop(), |
|
61 | - 'options' => array( |
|
62 | - 'tipLocation' => 'left', |
|
63 | - 'tipAdjustmentY' => -50, |
|
64 | - 'tipAdjustmentX' => 20, |
|
65 | - ), |
|
66 | - ), |
|
67 | - 60 => array( |
|
68 | - 'class' => 'bulkactions', |
|
69 | - 'content' => $this->_bulk_actions_stop(), |
|
70 | - 'options' => array( |
|
71 | - 'tipLocation' => 'left', |
|
72 | - 'tipAdjustmentY' => -50, |
|
73 | - 'tipAdjustmentX' => -75, |
|
74 | - ), |
|
75 | - ), |
|
76 | - 70 => array( |
|
77 | - 'id' => 'event-espresso_page_pricing-search-input', |
|
78 | - 'content' => $this->_search_stop(), |
|
79 | - 'options' => array( |
|
80 | - 'tipLocation' => 'left', |
|
81 | - 'tipAdjustmentY' => -50, |
|
82 | - 'tipAdjustmentX' => -15, |
|
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' => 'name', |
|
33 | + 'content' => $this->_name_column_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'top', |
|
36 | + 'tipAdjustmentX' => -5, |
|
37 | + 'tipAdjustmentY' => -30, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'type', |
|
42 | + 'content' => $this->_type_column_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentX' => 5, |
|
46 | + 'tipAdjustmentY' => -30, |
|
47 | + ), |
|
48 | + ), |
|
49 | + 40 => array( |
|
50 | + 'id' => 'description', |
|
51 | + 'content' => $this->_description_column_stop(), |
|
52 | + 'options' => array( |
|
53 | + 'tipLocation' => 'top', |
|
54 | + 'tipAdjustmentX' => 5, |
|
55 | + 'tipAdjustmentY' => -30, |
|
56 | + ), |
|
57 | + ), |
|
58 | + 50 => array( |
|
59 | + 'id' => 'amount', |
|
60 | + 'content' => $this->_amount_column_stop(), |
|
61 | + 'options' => array( |
|
62 | + 'tipLocation' => 'left', |
|
63 | + 'tipAdjustmentY' => -50, |
|
64 | + 'tipAdjustmentX' => 20, |
|
65 | + ), |
|
66 | + ), |
|
67 | + 60 => array( |
|
68 | + 'class' => 'bulkactions', |
|
69 | + 'content' => $this->_bulk_actions_stop(), |
|
70 | + 'options' => array( |
|
71 | + 'tipLocation' => 'left', |
|
72 | + 'tipAdjustmentY' => -50, |
|
73 | + 'tipAdjustmentX' => -75, |
|
74 | + ), |
|
75 | + ), |
|
76 | + 70 => array( |
|
77 | + 'id' => 'event-espresso_page_pricing-search-input', |
|
78 | + 'content' => $this->_search_stop(), |
|
79 | + 'options' => array( |
|
80 | + 'tipLocation' => 'left', |
|
81 | + 'tipAdjustmentY' => -50, |
|
82 | + 'tipAdjustmentX' => -15, |
|
83 | + ), |
|
84 | + ), |
|
85 | + ); |
|
86 | + } |
|
87 | 87 | |
88 | 88 | |
89 | - protected function _start() |
|
90 | - { |
|
91 | - $content = '<h3>' . __('Default Pricing', 'event_espresso') . '</h3>'; |
|
92 | - $content .= '<p>' |
|
93 | - . __( |
|
94 | - 'This tour of the Default Pricing 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>' . __('Default Pricing', 'event_espresso') . '</h3>'; |
|
92 | + $content .= '<p>' |
|
93 | + . __( |
|
94 | + 'This tour of the Default Pricing 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 _name_column_stop() |
|
101 | - { |
|
102 | - return '<p>' |
|
103 | - . __( |
|
104 | - 'The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', |
|
105 | - 'event_espresso' |
|
106 | - ) . '</p>'; |
|
107 | - } |
|
100 | + protected function _name_column_stop() |
|
101 | + { |
|
102 | + return '<p>' |
|
103 | + . __( |
|
104 | + 'The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', |
|
105 | + 'event_espresso' |
|
106 | + ) . '</p>'; |
|
107 | + } |
|
108 | 108 | |
109 | - protected function _type_column_stop() |
|
110 | - { |
|
111 | - return '<p>' |
|
112 | - . __( |
|
113 | - 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', |
|
114 | - 'event_espresso' |
|
115 | - ) . '</p>'; |
|
116 | - } |
|
109 | + protected function _type_column_stop() |
|
110 | + { |
|
111 | + return '<p>' |
|
112 | + . __( |
|
113 | + 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', |
|
114 | + 'event_espresso' |
|
115 | + ) . '</p>'; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _description_column_stop() |
|
119 | - { |
|
120 | - return '<p>' |
|
121 | - . __( |
|
122 | - 'View the price type (price, discount, tax or surcharge) description.', |
|
123 | - 'event_espresso' |
|
124 | - ) . '</p>'; |
|
125 | - } |
|
118 | + protected function _description_column_stop() |
|
119 | + { |
|
120 | + return '<p>' |
|
121 | + . __( |
|
122 | + 'View the price type (price, discount, tax or surcharge) description.', |
|
123 | + 'event_espresso' |
|
124 | + ) . '</p>'; |
|
125 | + } |
|
126 | 126 | |
127 | - protected function _amount_column_stop() |
|
128 | - { |
|
129 | - return '<p>' |
|
130 | - . __( |
|
131 | - 'The ticket amount before any deductions. Can be sorted in ascending or descending order.', |
|
132 | - 'event_espresso' |
|
133 | - ) . '</p>'; |
|
134 | - } |
|
127 | + protected function _amount_column_stop() |
|
128 | + { |
|
129 | + return '<p>' |
|
130 | + . __( |
|
131 | + 'The ticket amount before any deductions. Can be sorted in ascending or descending order.', |
|
132 | + 'event_espresso' |
|
133 | + ) . '</p>'; |
|
134 | + } |
|
135 | 135 | |
136 | - protected function _bulk_actions_stop() |
|
137 | - { |
|
138 | - return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
139 | - } |
|
136 | + protected function _bulk_actions_stop() |
|
137 | + { |
|
138 | + return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
139 | + } |
|
140 | 140 | |
141 | - protected function _search_stop() |
|
142 | - { |
|
143 | - return '<p>' |
|
144 | - . __( |
|
145 | - 'Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', |
|
146 | - 'event_espresso' |
|
147 | - ) . '</p>'; |
|
148 | - } |
|
141 | + protected function _search_stop() |
|
142 | + { |
|
143 | + return '<p>' |
|
144 | + . __( |
|
145 | + 'Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', |
|
146 | + 'event_espresso' |
|
147 | + ) . '</p>'; |
|
148 | + } |
|
149 | 149 | } |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function _start() |
90 | 90 | { |
91 | - $content = '<h3>' . __('Default Pricing', 'event_espresso') . '</h3>'; |
|
91 | + $content = '<h3>'.__('Default Pricing', 'event_espresso').'</h3>'; |
|
92 | 92 | $content .= '<p>' |
93 | 93 | . __( |
94 | 94 | 'This tour of the Default Pricing 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 | 'The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', |
105 | 105 | 'event_espresso' |
106 | - ) . '</p>'; |
|
106 | + ).'</p>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function _type_column_stop() |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | . __( |
113 | 113 | 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', |
114 | 114 | 'event_espresso' |
115 | - ) . '</p>'; |
|
115 | + ).'</p>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | protected function _description_column_stop() |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | . __( |
122 | 122 | 'View the price type (price, discount, tax or surcharge) description.', |
123 | 123 | 'event_espresso' |
124 | - ) . '</p>'; |
|
124 | + ).'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _amount_column_stop() |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | . __( |
131 | 131 | 'The ticket amount before any deductions. Can be sorted in ascending or descending order.', |
132 | 132 | 'event_espresso' |
133 | - ) . '</p>'; |
|
133 | + ).'</p>'; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | protected function _bulk_actions_stop() |
137 | 137 | { |
138 | - return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
138 | + return '<p>'.__('Perform bulk actions to multiple price types.', 'event_espresso').'</p>'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | protected function _search_stop() |
@@ -144,6 +144,6 @@ discard block |
||
144 | 144 | . __( |
145 | 145 | 'Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', |
146 | 146 | 'event_espresso' |
147 | - ) . '</p>'; |
|
147 | + ).'</p>'; |
|
148 | 148 | } |
149 | 149 | } |
@@ -15,84 +15,84 @@ |
||
15 | 15 | class Pricing_Edit_Price_Type_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Edit Price Type Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'edit-price-type-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Edit Price Type Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'edit-price-type-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' => 'base_type', |
|
33 | - 'content' => $this->_basic_type_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'top', |
|
36 | - 'tipAdjustmentY' => -50, |
|
37 | - 'tipAdjustmentX' => -15, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'PRT_name', |
|
42 | - 'content' => $this->_price_type_name_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentY' => -40, |
|
46 | - ), |
|
47 | - ), |
|
48 | - 40 => array( |
|
49 | - 'id' => 'PRT_name', |
|
50 | - 'content' => $this->_percentage_dollar_amount_stop(), |
|
51 | - 'options' => array( |
|
52 | - 'tipLocation' => 'top', |
|
53 | - 'tipAdjustmentY' => 45, |
|
54 | - ), |
|
55 | - ), |
|
56 | - 50 => array( |
|
57 | - 'id' => 'PRT_order', |
|
58 | - 'content' => $this->_order_of_application_stop(), |
|
59 | - 'options' => array( |
|
60 | - 'tipLocation' => 'top', |
|
61 | - 'tipAdjustmentY' => -40, |
|
62 | - ), |
|
63 | - ), |
|
64 | - ); |
|
65 | - } |
|
25 | + protected function _set_tour_stops() |
|
26 | + { |
|
27 | + $this->_stops = array( |
|
28 | + 10 => array( |
|
29 | + 'content' => $this->_start(), |
|
30 | + ), |
|
31 | + 20 => array( |
|
32 | + 'id' => 'base_type', |
|
33 | + 'content' => $this->_basic_type_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'top', |
|
36 | + 'tipAdjustmentY' => -50, |
|
37 | + 'tipAdjustmentX' => -15, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'PRT_name', |
|
42 | + 'content' => $this->_price_type_name_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentY' => -40, |
|
46 | + ), |
|
47 | + ), |
|
48 | + 40 => array( |
|
49 | + 'id' => 'PRT_name', |
|
50 | + 'content' => $this->_percentage_dollar_amount_stop(), |
|
51 | + 'options' => array( |
|
52 | + 'tipLocation' => 'top', |
|
53 | + 'tipAdjustmentY' => 45, |
|
54 | + ), |
|
55 | + ), |
|
56 | + 50 => array( |
|
57 | + 'id' => 'PRT_order', |
|
58 | + 'content' => $this->_order_of_application_stop(), |
|
59 | + 'options' => array( |
|
60 | + 'tipLocation' => 'top', |
|
61 | + 'tipAdjustmentY' => -40, |
|
62 | + ), |
|
63 | + ), |
|
64 | + ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | - protected function _start() |
|
69 | - { |
|
70 | - $content = '<h3>' . __('Edit Price Type', 'event_espresso') . '</h3>'; |
|
71 | - $content .= '<p>' |
|
72 | - . __( |
|
73 | - 'This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | - 'event_espresso' |
|
75 | - ) . '</p>'; |
|
76 | - return $content; |
|
77 | - } |
|
68 | + protected function _start() |
|
69 | + { |
|
70 | + $content = '<h3>' . __('Edit Price Type', 'event_espresso') . '</h3>'; |
|
71 | + $content .= '<p>' |
|
72 | + . __( |
|
73 | + 'This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
74 | + 'event_espresso' |
|
75 | + ) . '</p>'; |
|
76 | + return $content; |
|
77 | + } |
|
78 | 78 | |
79 | - protected function _basic_type_stop() |
|
80 | - { |
|
81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
82 | - } |
|
79 | + protected function _basic_type_stop() |
|
80 | + { |
|
81 | + return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
82 | + } |
|
83 | 83 | |
84 | - protected function _price_type_name_stop() |
|
85 | - { |
|
86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
87 | - } |
|
84 | + protected function _price_type_name_stop() |
|
85 | + { |
|
86 | + return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
87 | + } |
|
88 | 88 | |
89 | - protected function _percentage_dollar_amount_stop() |
|
90 | - { |
|
91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
92 | - } |
|
89 | + protected function _percentage_dollar_amount_stop() |
|
90 | + { |
|
91 | + return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
92 | + } |
|
93 | 93 | |
94 | - protected function _order_of_application_stop() |
|
95 | - { |
|
96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
97 | - } |
|
94 | + protected function _order_of_application_stop() |
|
95 | + { |
|
96 | + return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
97 | + } |
|
98 | 98 | } |
@@ -67,32 +67,32 @@ |
||
67 | 67 | |
68 | 68 | protected function _start() |
69 | 69 | { |
70 | - $content = '<h3>' . __('Edit Price Type', 'event_espresso') . '</h3>'; |
|
70 | + $content = '<h3>'.__('Edit Price Type', 'event_espresso').'</h3>'; |
|
71 | 71 | $content .= '<p>' |
72 | 72 | . __( |
73 | 73 | 'This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', |
74 | 74 | 'event_espresso' |
75 | - ) . '</p>'; |
|
75 | + ).'</p>'; |
|
76 | 76 | return $content; |
77 | 77 | } |
78 | 78 | |
79 | 79 | protected function _basic_type_stop() |
80 | 80 | { |
81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
81 | + return '<p>'.__('Set a price type to be a discount, surcharge, or tax.', 'event_espresso').'</p>'; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | protected function _price_type_name_stop() |
85 | 85 | { |
86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
86 | + return '<p>'.__('The name of the price type.', 'event_espresso').'</p>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | protected function _percentage_dollar_amount_stop() |
90 | 90 | { |
91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
91 | + return '<p>'.__('Set a price type to be percentage-based or a fixed amount.', 'event_espresso').'</p>'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function _order_of_application_stop() |
95 | 95 | { |
96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
96 | + return '<p>'.__('Set the order of application for a price type.', 'event_espresso').'</p>'; |
|
97 | 97 | } |
98 | 98 | } |
@@ -15,140 +15,140 @@ |
||
15 | 15 | class Pricing_Price_Types_Default_Help_Tour extends EE_Help_Tour |
16 | 16 | { |
17 | 17 | |
18 | - protected function _set_tour_properties() |
|
19 | - { |
|
20 | - $this->_label = __('Price Types Tour', 'event_espresso'); |
|
21 | - $this->_slug = 'default-price-types-joyride'; |
|
22 | - } |
|
18 | + protected function _set_tour_properties() |
|
19 | + { |
|
20 | + $this->_label = __('Price Types Tour', 'event_espresso'); |
|
21 | + $this->_slug = 'default-price-types-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' => 'name', |
|
33 | - 'content' => $this->_name_column_stop(), |
|
34 | - 'options' => array( |
|
35 | - 'tipLocation' => 'top', |
|
36 | - 'tipAdjustmentX' => -5, |
|
37 | - 'tipAdjustmentY' => -30, |
|
38 | - ), |
|
39 | - ), |
|
40 | - 30 => array( |
|
41 | - 'id' => 'base_type', |
|
42 | - 'content' => $this->_base_type_stop(), |
|
43 | - 'options' => array( |
|
44 | - 'tipLocation' => 'top', |
|
45 | - 'tipAdjustmentX' => 120, |
|
46 | - 'tipAdjustmentY' => -30, |
|
47 | - ), |
|
48 | - ), |
|
49 | - 40 => array( |
|
50 | - 'id' => 'percent', |
|
51 | - 'content' => $this->_percent_column_stop(), |
|
52 | - 'options' => array( |
|
53 | - 'tipLocation' => 'top', |
|
54 | - 'tipAdjustmentX' => 120, |
|
55 | - 'tipAdjustmentY' => -30, |
|
56 | - ), |
|
57 | - ), |
|
58 | - 50 => array( |
|
59 | - 'id' => 'order', |
|
60 | - 'content' => $this->_order_column_stop(), |
|
61 | - 'options' => array( |
|
62 | - 'tipLocation' => 'left', |
|
63 | - 'tipAdjustmentY' => -30, |
|
64 | - 'tipAdjustmentX' => 100, |
|
65 | - ), |
|
66 | - ), |
|
67 | - 60 => array( |
|
68 | - 'class' => 'bulkactions', |
|
69 | - 'content' => $this->_bulk_actions_stop(), |
|
70 | - 'options' => array( |
|
71 | - 'tipLocation' => 'left', |
|
72 | - 'tipAdjustmentY' => -50, |
|
73 | - 'tipAdjustmentX' => -75, |
|
74 | - ), |
|
75 | - ), |
|
76 | - 70 => array( |
|
77 | - 'id' => 'event-espresso_page_pricing-search-input', |
|
78 | - 'content' => $this->_search_stop(), |
|
79 | - 'options' => array( |
|
80 | - 'tipLocation' => 'left', |
|
81 | - 'tipAdjustmentY' => -50, |
|
82 | - 'tipAdjustmentX' => -15, |
|
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' => 'name', |
|
33 | + 'content' => $this->_name_column_stop(), |
|
34 | + 'options' => array( |
|
35 | + 'tipLocation' => 'top', |
|
36 | + 'tipAdjustmentX' => -5, |
|
37 | + 'tipAdjustmentY' => -30, |
|
38 | + ), |
|
39 | + ), |
|
40 | + 30 => array( |
|
41 | + 'id' => 'base_type', |
|
42 | + 'content' => $this->_base_type_stop(), |
|
43 | + 'options' => array( |
|
44 | + 'tipLocation' => 'top', |
|
45 | + 'tipAdjustmentX' => 120, |
|
46 | + 'tipAdjustmentY' => -30, |
|
47 | + ), |
|
48 | + ), |
|
49 | + 40 => array( |
|
50 | + 'id' => 'percent', |
|
51 | + 'content' => $this->_percent_column_stop(), |
|
52 | + 'options' => array( |
|
53 | + 'tipLocation' => 'top', |
|
54 | + 'tipAdjustmentX' => 120, |
|
55 | + 'tipAdjustmentY' => -30, |
|
56 | + ), |
|
57 | + ), |
|
58 | + 50 => array( |
|
59 | + 'id' => 'order', |
|
60 | + 'content' => $this->_order_column_stop(), |
|
61 | + 'options' => array( |
|
62 | + 'tipLocation' => 'left', |
|
63 | + 'tipAdjustmentY' => -30, |
|
64 | + 'tipAdjustmentX' => 100, |
|
65 | + ), |
|
66 | + ), |
|
67 | + 60 => array( |
|
68 | + 'class' => 'bulkactions', |
|
69 | + 'content' => $this->_bulk_actions_stop(), |
|
70 | + 'options' => array( |
|
71 | + 'tipLocation' => 'left', |
|
72 | + 'tipAdjustmentY' => -50, |
|
73 | + 'tipAdjustmentX' => -75, |
|
74 | + ), |
|
75 | + ), |
|
76 | + 70 => array( |
|
77 | + 'id' => 'event-espresso_page_pricing-search-input', |
|
78 | + 'content' => $this->_search_stop(), |
|
79 | + 'options' => array( |
|
80 | + 'tipLocation' => 'left', |
|
81 | + 'tipAdjustmentY' => -50, |
|
82 | + 'tipAdjustmentX' => -15, |
|
83 | + ), |
|
84 | + ), |
|
85 | + ); |
|
86 | + } |
|
87 | 87 | |
88 | 88 | |
89 | - protected function _start() |
|
90 | - { |
|
91 | - $content = '<h3>' . __('Price Types', 'event_espresso') . '</h3>'; |
|
92 | - $content .= '<p>' |
|
93 | - . __( |
|
94 | - 'This tour of the Price Types 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>' . __('Price Types', 'event_espresso') . '</h3>'; |
|
92 | + $content .= '<p>' |
|
93 | + . __( |
|
94 | + 'This tour of the Price Types 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 _name_column_stop() |
|
101 | - { |
|
102 | - return '<p>' |
|
103 | - . __( |
|
104 | - 'The name of the price type. Can be sorted in ascending or descending order.', |
|
105 | - 'event_espresso' |
|
106 | - ) . '</p>'; |
|
107 | - } |
|
100 | + protected function _name_column_stop() |
|
101 | + { |
|
102 | + return '<p>' |
|
103 | + . __( |
|
104 | + 'The name of the price type. Can be sorted in ascending or descending order.', |
|
105 | + 'event_espresso' |
|
106 | + ) . '</p>'; |
|
107 | + } |
|
108 | 108 | |
109 | - protected function _base_type_stop() |
|
110 | - { |
|
111 | - return '<p>' . __('View if a price type is a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
112 | - } |
|
109 | + protected function _base_type_stop() |
|
110 | + { |
|
111 | + return '<p>' . __('View if a price type is a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
112 | + } |
|
113 | 113 | |
114 | - protected function _member_column_stop() |
|
115 | - { |
|
116 | - return '<p>' |
|
117 | - . __( |
|
118 | - 'Here you can see if the discount/surcharge is percentage based or a flat monetary amount.', |
|
119 | - 'event_espresso' |
|
120 | - ) . '</p>'; |
|
121 | - } |
|
114 | + protected function _member_column_stop() |
|
115 | + { |
|
116 | + return '<p>' |
|
117 | + . __( |
|
118 | + 'Here you can see if the discount/surcharge is percentage based or a flat monetary amount.', |
|
119 | + 'event_espresso' |
|
120 | + ) . '</p>'; |
|
121 | + } |
|
122 | 122 | |
123 | - protected function _percent_column_stop() |
|
124 | - { |
|
125 | - return '<p>' |
|
126 | - . __( |
|
127 | - 'View if the discount, surcharge, or tax is percentage-based or a fixed amount.', |
|
128 | - 'event_espresso' |
|
129 | - ) . '</p>'; |
|
130 | - } |
|
123 | + protected function _percent_column_stop() |
|
124 | + { |
|
125 | + return '<p>' |
|
126 | + . __( |
|
127 | + 'View if the discount, surcharge, or tax is percentage-based or a fixed amount.', |
|
128 | + 'event_espresso' |
|
129 | + ) . '</p>'; |
|
130 | + } |
|
131 | 131 | |
132 | - protected function _order_column_stop() |
|
133 | - { |
|
134 | - return '<p>' |
|
135 | - . __( |
|
136 | - 'View the order in which each discount, surcharge, or tax will be applied to the base ticket cost. Zero (0) means it will be applied first.', |
|
137 | - 'event_espresso' |
|
138 | - ) . '</p>'; |
|
139 | - } |
|
132 | + protected function _order_column_stop() |
|
133 | + { |
|
134 | + return '<p>' |
|
135 | + . __( |
|
136 | + 'View the order in which each discount, surcharge, or tax will be applied to the base ticket cost. Zero (0) means it will be applied first.', |
|
137 | + 'event_espresso' |
|
138 | + ) . '</p>'; |
|
139 | + } |
|
140 | 140 | |
141 | - protected function _bulk_actions_stop() |
|
142 | - { |
|
143 | - return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
144 | - } |
|
141 | + protected function _bulk_actions_stop() |
|
142 | + { |
|
143 | + return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
144 | + } |
|
145 | 145 | |
146 | - protected function _search_stop() |
|
147 | - { |
|
148 | - return '<p>' |
|
149 | - . __( |
|
150 | - 'Search through price types. The following source will be searched: Price Type Name.', |
|
151 | - 'event_espresso' |
|
152 | - ) . '</p>'; |
|
153 | - } |
|
146 | + protected function _search_stop() |
|
147 | + { |
|
148 | + return '<p>' |
|
149 | + . __( |
|
150 | + 'Search through price types. The following source will be searched: Price Type Name.', |
|
151 | + 'event_espresso' |
|
152 | + ) . '</p>'; |
|
153 | + } |
|
154 | 154 | } |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function _start() |
90 | 90 | { |
91 | - $content = '<h3>' . __('Price Types', 'event_espresso') . '</h3>'; |
|
91 | + $content = '<h3>'.__('Price Types', 'event_espresso').'</h3>'; |
|
92 | 92 | $content .= '<p>' |
93 | 93 | . __( |
94 | 94 | 'This tour of the Price Types 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,12 +103,12 @@ discard block |
||
103 | 103 | . __( |
104 | 104 | 'The name of the price type. Can be sorted in ascending or descending order.', |
105 | 105 | 'event_espresso' |
106 | - ) . '</p>'; |
|
106 | + ).'</p>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function _base_type_stop() |
110 | 110 | { |
111 | - return '<p>' . __('View if a price type is a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
111 | + return '<p>'.__('View if a price type is a discount, surcharge, or tax.', 'event_espresso').'</p>'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | protected function _member_column_stop() |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | . __( |
118 | 118 | 'Here you can see if the discount/surcharge is percentage based or a flat monetary amount.', |
119 | 119 | 'event_espresso' |
120 | - ) . '</p>'; |
|
120 | + ).'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _percent_column_stop() |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | . __( |
127 | 127 | 'View if the discount, surcharge, or tax is percentage-based or a fixed amount.', |
128 | 128 | 'event_espresso' |
129 | - ) . '</p>'; |
|
129 | + ).'</p>'; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | protected function _order_column_stop() |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | . __( |
136 | 136 | 'View the order in which each discount, surcharge, or tax will be applied to the base ticket cost. Zero (0) means it will be applied first.', |
137 | 137 | 'event_espresso' |
138 | - ) . '</p>'; |
|
138 | + ).'</p>'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | protected function _bulk_actions_stop() |
142 | 142 | { |
143 | - return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
143 | + return '<p>'.__('Perform bulk actions to multiple price types.', 'event_espresso').'</p>'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | protected function _search_stop() |
@@ -149,6 +149,6 @@ discard block |
||
149 | 149 | . __( |
150 | 150 | 'Search through price types. The following source will be searched: Price Type Name.', |
151 | 151 | 'event_espresso' |
152 | - ) . '</p>'; |
|
152 | + ).'</p>'; |
|
153 | 153 | } |
154 | 154 | } |
@@ -15,42 +15,42 @@ |
||
15 | 15 | class Global_EE_Caf_Hooks |
16 | 16 | { |
17 | 17 | |
18 | - public function __construct() |
|
19 | - { |
|
20 | - $this->_do_hooks(); |
|
21 | - } |
|
22 | - |
|
23 | - |
|
24 | - private function _do_hooks() |
|
25 | - { |
|
26 | - add_filter('FHEE_show_sponsors_meta_box', '__return_false', 10); |
|
27 | - add_filter('FHEE_show_ratings_request_meta_box', '__return_false', 10); |
|
28 | - add_filter( |
|
29 | - 'FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', |
|
30 | - array($this, 'forums_lazy_loading'), |
|
31 | - 10 |
|
32 | - ); |
|
33 | - add_action( |
|
34 | - 'AHEE__EE_Admin_Page__espresso_news_post_box__after_content', |
|
35 | - array($this, 'extra_news_box_content'), |
|
36 | - 10 |
|
37 | - ); |
|
38 | - } |
|
39 | - |
|
40 | - |
|
41 | - public function extra_news_box_content($content) |
|
42 | - { |
|
43 | - echo '<h3 style="margin:0">' . __('From the Forums', 'event_espresso') . '</h3>'; |
|
44 | - echo '<div id="ee_forum_posts_content">'; |
|
45 | - $url = 'http://eventespresso.com/forum/event-espresso-support/feed/'; |
|
46 | - EE_Admin_Page::cached_rss_display('ee_forum_posts_content', $url); |
|
47 | - echo '</div>'; |
|
48 | - } |
|
49 | - |
|
50 | - |
|
51 | - public function forums_lazy_loading($ids) |
|
52 | - { |
|
53 | - $ids[] = 'ee_forum_posts_content'; |
|
54 | - return $ids; |
|
55 | - } |
|
18 | + public function __construct() |
|
19 | + { |
|
20 | + $this->_do_hooks(); |
|
21 | + } |
|
22 | + |
|
23 | + |
|
24 | + private function _do_hooks() |
|
25 | + { |
|
26 | + add_filter('FHEE_show_sponsors_meta_box', '__return_false', 10); |
|
27 | + add_filter('FHEE_show_ratings_request_meta_box', '__return_false', 10); |
|
28 | + add_filter( |
|
29 | + 'FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', |
|
30 | + array($this, 'forums_lazy_loading'), |
|
31 | + 10 |
|
32 | + ); |
|
33 | + add_action( |
|
34 | + 'AHEE__EE_Admin_Page__espresso_news_post_box__after_content', |
|
35 | + array($this, 'extra_news_box_content'), |
|
36 | + 10 |
|
37 | + ); |
|
38 | + } |
|
39 | + |
|
40 | + |
|
41 | + public function extra_news_box_content($content) |
|
42 | + { |
|
43 | + echo '<h3 style="margin:0">' . __('From the Forums', 'event_espresso') . '</h3>'; |
|
44 | + echo '<div id="ee_forum_posts_content">'; |
|
45 | + $url = 'http://eventespresso.com/forum/event-espresso-support/feed/'; |
|
46 | + EE_Admin_Page::cached_rss_display('ee_forum_posts_content', $url); |
|
47 | + echo '</div>'; |
|
48 | + } |
|
49 | + |
|
50 | + |
|
51 | + public function forums_lazy_loading($ids) |
|
52 | + { |
|
53 | + $ids[] = 'ee_forum_posts_content'; |
|
54 | + return $ids; |
|
55 | + } |
|
56 | 56 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | public function extra_news_box_content($content) |
42 | 42 | { |
43 | - echo '<h3 style="margin:0">' . __('From the Forums', 'event_espresso') . '</h3>'; |
|
43 | + echo '<h3 style="margin:0">'.__('From the Forums', 'event_espresso').'</h3>'; |
|
44 | 44 | echo '<div id="ee_forum_posts_content">'; |
45 | 45 | $url = 'http://eventespresso.com/forum/event-espresso-support/feed/'; |
46 | 46 | EE_Admin_Page::cached_rss_display('ee_forum_posts_content', $url); |
@@ -13,803 +13,803 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | |
16 | - /** |
|
17 | - * constructor. |
|
18 | - */ |
|
19 | - public function __construct() |
|
20 | - { |
|
21 | - $this->_caf_hooks(); |
|
22 | - } |
|
23 | - |
|
24 | - |
|
25 | - /** |
|
26 | - * Contains all the hooks filters for setting up caffeinated messages functionality. |
|
27 | - * |
|
28 | - * @since 4.3.2 |
|
29 | - * |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - private function _caf_hooks() |
|
33 | - { |
|
34 | - add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array($this, 'messages_autoload_paths'), 5); |
|
35 | - add_filter( |
|
36 | - 'FHEE__EE_Email_messenger__get_validator_config', |
|
37 | - array($this, 'email_messenger_validator_config'), |
|
38 | - 5, |
|
39 | - 2 |
|
40 | - ); |
|
41 | - add_filter( |
|
42 | - 'FHEE__EE_Email_messenger__get_template_fields', |
|
43 | - array($this, 'email_messenger_template_fields'), |
|
44 | - 5, |
|
45 | - 2 |
|
46 | - ); |
|
47 | - add_filter( |
|
48 | - 'FHEE__EE_Html_messenger__get_template_fields', |
|
49 | - array($this, 'html_messenger_template_fields'), |
|
50 | - 5, |
|
51 | - 2 |
|
52 | - ); |
|
53 | - add_filter( |
|
54 | - 'FHEE__EE_Html_messenger__get_validator_config', |
|
55 | - array($this, 'html_messenger_validator_config'), |
|
56 | - 5, |
|
57 | - 2 |
|
58 | - ); |
|
59 | - add_filter('FHEE__EE_Pdf_messenger__get_template_fields', array($this, 'pdf_messenger_template_fields'), 5, 2); |
|
60 | - add_filter( |
|
61 | - 'FHEE__EE_Pdf_messenger__get_validator_config', |
|
62 | - array($this, 'pdf_messenger_validator_config'), |
|
63 | - 5, |
|
64 | - 2 |
|
65 | - ); |
|
66 | - add_filter( |
|
67 | - 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', |
|
68 | - array($this, 'new_default_templates'), |
|
69 | - 5, |
|
70 | - 7 |
|
71 | - ); |
|
72 | - add_filter( |
|
73 | - 'FHEE__EE_Messages_Base__get_valid_shortcodes', |
|
74 | - array($this, 'message_types_valid_shortcodes'), |
|
75 | - 5, |
|
76 | - 2 |
|
77 | - ); |
|
78 | - |
|
79 | - // shortcode parsers |
|
80 | - add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array($this, 'additional_attendee_shortcodes'), 5, 2); |
|
81 | - add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array($this, 'additional_attendee_parser'), 5, 5); |
|
82 | - add_filter( |
|
83 | - 'FHEE__EE_Recipient_List_Shortcodes__shortcodes', |
|
84 | - array($this, 'additional_recipient_details_shortcodes'), |
|
85 | - 5, |
|
86 | - 2 |
|
87 | - ); |
|
88 | - add_filter( |
|
89 | - 'FHEE__EE_Recipient_List_Shortcodes__parser_after', |
|
90 | - array($this, 'additional_recipient_details_parser'), |
|
91 | - 5, |
|
92 | - 5 |
|
93 | - ); |
|
94 | - add_filter( |
|
95 | - 'FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', |
|
96 | - array($this, 'additional_primary_registration_details_shortcodes'), |
|
97 | - 5, |
|
98 | - 2 |
|
99 | - ); |
|
100 | - add_filter( |
|
101 | - 'FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', |
|
102 | - array($this, 'additional_primary_registration_details_parser'), |
|
103 | - 5, |
|
104 | - 5 |
|
105 | - ); |
|
106 | - |
|
107 | - /** |
|
108 | - * @since 4.2.0 |
|
109 | - */ |
|
110 | - add_filter('FHEE__EE_Datetime_Shortcodes__shortcodes', array($this, 'additional_datetime_shortcodes'), 10, 2); |
|
111 | - add_filter('FHEE__EE_Datetime_Shortcodes__parser_after', array($this, 'additional_datetime_parser'), 10, 5); |
|
112 | - |
|
113 | - /** |
|
114 | - * @since 4.3.0 |
|
115 | - */ |
|
116 | - // eat our own dog food! |
|
117 | - add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_message_types')); |
|
118 | - add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_shortcodes')); |
|
119 | - do_action('EE_Brewing_Regular___messages_caf'); |
|
120 | - } |
|
121 | - |
|
122 | - |
|
123 | - /** |
|
124 | - * This just allows us to add additional paths to the autoloader (EED_Messages::autoload_messages()) for the |
|
125 | - * messages system. |
|
126 | - * |
|
127 | - * @param array $dir_ref original array of paths |
|
128 | - * |
|
129 | - * @return array appended paths |
|
130 | - */ |
|
131 | - public function messages_autoload_paths($dir_ref) |
|
132 | - { |
|
133 | - $dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/'; |
|
134 | - |
|
135 | - return $dir_ref; |
|
136 | - } |
|
137 | - |
|
138 | - |
|
139 | - public function email_messenger_validator_config($validator_config, EE_Email_messenger $messenger) |
|
140 | - { |
|
141 | - $validator_config['attendee_list'] = array( |
|
142 | - 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
143 | - 'required' => array('[ATTENDEE_LIST]'), |
|
144 | - ); |
|
145 | - $validator_config['question_list'] = array( |
|
146 | - 'shortcodes' => array('question'), |
|
147 | - 'required' => array('[QUESTION_LIST]'), |
|
148 | - ); |
|
149 | - |
|
150 | - return $validator_config; |
|
151 | - } |
|
152 | - |
|
153 | - |
|
154 | - public function html_messenger_validator_config($validator_config, EE_Html_messenger $messenger) |
|
155 | - { |
|
156 | - $validator_config['attendee_list'] = array( |
|
157 | - 'shortcodes' => array('attendee', 'question_list'), |
|
158 | - 'required' => array('[ATTENDEE_LIST]'), |
|
159 | - ); |
|
160 | - $validator_config['question_list'] = array( |
|
161 | - 'shortcodes' => array('question'), |
|
162 | - 'required' => array('[QUESTION_LIST]'), |
|
163 | - ); |
|
164 | - |
|
165 | - return $validator_config; |
|
166 | - } |
|
167 | - |
|
168 | - |
|
169 | - public function pdf_messenger_validator_config($validator_config, EE_Pdf_messenger $messenger) |
|
170 | - { |
|
171 | - $validator_config['attendee_list'] = array( |
|
172 | - 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
173 | - 'required' => array('[ATTENDEE_LIST]'), |
|
174 | - ); |
|
175 | - $validator_config['question_list'] = array( |
|
176 | - 'shortcodes' => array('question'), |
|
177 | - 'required' => array('[QUESTION_LIST]'), |
|
178 | - ); |
|
179 | - |
|
180 | - return $validator_config; |
|
181 | - } |
|
182 | - |
|
183 | - |
|
184 | - public function email_messenger_template_fields($template_fields, EE_Email_messenger $messenger) |
|
185 | - { |
|
186 | - $template_fields['extra']['content']['question_list'] = array( |
|
187 | - 'input' => 'textarea', |
|
188 | - 'label' => '[QUESTION_LIST]', |
|
189 | - 'type' => 'string', |
|
190 | - 'required' => true, |
|
191 | - 'validation' => true, |
|
192 | - 'format' => '%s', |
|
193 | - 'css_class' => 'large-text', |
|
194 | - 'rows' => '5', |
|
195 | - 'shortcodes_required' => array('[QUESTION_LIST]'), |
|
196 | - ); |
|
197 | - |
|
198 | - return $template_fields; |
|
199 | - } |
|
200 | - |
|
201 | - |
|
202 | - public function html_messenger_template_fields($template_fields, EE_Html_messenger $messenger) |
|
203 | - { |
|
204 | - $template_fields['extra']['content']['question_list'] = array( |
|
205 | - 'input' => 'textarea', |
|
206 | - 'label' => '[QUESTION_LIST]', |
|
207 | - 'type' => 'string', |
|
208 | - 'required' => true, |
|
209 | - 'validation' => true, |
|
210 | - 'format' => '%s', |
|
211 | - 'css_class' => 'large-text', |
|
212 | - 'rows' => '5', |
|
213 | - 'shortcodes_required' => array('[QUESTION_LIST]'), |
|
214 | - ); |
|
215 | - |
|
216 | - return $template_fields; |
|
217 | - } |
|
218 | - |
|
219 | - |
|
220 | - public function pdf_messenger_template_fields($template_fields, EE_Pdf_messenger $messenger) |
|
221 | - { |
|
222 | - $template_fields['extra']['content']['question_list'] = array( |
|
223 | - 'input' => 'textarea', |
|
224 | - 'label' => '[QUESTION_LIST]', |
|
225 | - 'type' => 'string', |
|
226 | - 'required' => true, |
|
227 | - 'validation' => true, |
|
228 | - 'format' => '%s', |
|
229 | - 'css_class' => 'large-text', |
|
230 | - 'rows' => '5', |
|
231 | - 'shortcodes_required' => array('[QUESTION_LIST]'), |
|
232 | - ); |
|
233 | - |
|
234 | - return $template_fields; |
|
235 | - } |
|
236 | - |
|
237 | - |
|
238 | - public function new_default_templates( |
|
239 | - $contents, |
|
240 | - $actual_path, |
|
241 | - EE_messenger $messenger, |
|
242 | - EE_message_type $message_type, |
|
243 | - $field, |
|
244 | - $context, |
|
245 | - EE_Messages_Template_Pack $template_pack |
|
246 | - ) { |
|
247 | - |
|
248 | - // we're only modifying templates for the default template pack |
|
249 | - if (! $template_pack instanceof EE_Messages_Template_Pack_Default) { |
|
250 | - return $contents; |
|
251 | - } |
|
252 | - |
|
253 | - // the template file name we're replacing contents for. |
|
254 | - $template_file_prefix = $field . '_' . $context; |
|
255 | - $msg_prefix = $messenger->name . '_' . $message_type->name . '_'; |
|
256 | - |
|
257 | - $base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/'; |
|
258 | - |
|
259 | - if ($messenger->name == 'email' && $message_type->name == 'registration') { |
|
260 | - switch ($template_file_prefix) { |
|
261 | - case 'question_list_admin': |
|
262 | - case 'question_list_attendee': |
|
263 | - case 'question_list_primary_attendee': |
|
264 | - $path = $base_path . $msg_prefix . 'question_list.template.php'; |
|
265 | - $contents = EEH_Template::display_template($path, array(), true); |
|
266 | - break; |
|
267 | - |
|
268 | - case 'attendee_list_primary_attendee': |
|
269 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
270 | - $contents = EEH_Template::display_template($path, array(), true); |
|
271 | - break; |
|
272 | - |
|
273 | - case 'attendee_list_admin': |
|
274 | - $path = $base_path . $msg_prefix . 'attendee_list_admin.template.php'; |
|
275 | - $contents = EEH_Template::display_template( |
|
276 | - $path, |
|
277 | - array(), |
|
278 | - true |
|
279 | - ); |
|
280 | - break; |
|
281 | - |
|
282 | - case 'attendee_list_attendee': |
|
283 | - $contents = ''; |
|
284 | - break; |
|
285 | - |
|
286 | - case 'event_list_attendee': |
|
287 | - $path = $base_path . $msg_prefix . 'event_list_attendee.template.php'; |
|
288 | - $contents = EEH_Template::display_template($path, array(), true); |
|
289 | - break; |
|
290 | - } |
|
291 | - } elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') { |
|
292 | - switch ($template_file_prefix) { |
|
293 | - case 'content_attendee': |
|
294 | - $path = $base_path . $msg_prefix . 'content.template.php'; |
|
295 | - $contents = EEH_Template::display_template($path, array(), true); |
|
296 | - break; |
|
297 | - |
|
298 | - case 'newsletter_content_attendee': |
|
299 | - $path = $base_path . $msg_prefix . 'newsletter_content.template.php'; |
|
300 | - $contents = EEH_Template::display_template($path, array(), true); |
|
301 | - break; |
|
302 | - |
|
303 | - case 'newsletter_subject_attendee': |
|
304 | - $path = $base_path . $msg_prefix . 'subject.template.php'; |
|
305 | - $contents = EEH_Template::display_template($path, array(), true); |
|
306 | - break; |
|
307 | - } |
|
308 | - } elseif ($messenger->name == 'html' && $message_type->name == 'receipt') { |
|
309 | - switch ($template_file_prefix) { |
|
310 | - case 'attendee_list_purchaser': |
|
311 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
312 | - $contents = EEH_Template::display_template($path, array(), true); |
|
313 | - break; |
|
314 | - } |
|
315 | - } |
|
316 | - |
|
317 | - return $contents; |
|
318 | - } |
|
319 | - |
|
320 | - |
|
321 | - public function message_types_valid_shortcodes($valid_shortcodes, EE_Messages_Base $msg) |
|
322 | - { |
|
323 | - // make sure question_list and question are ONLY added for the core message types. Any other message types will have to explicitly set question_list as a valid shortcode. |
|
324 | - $include_with = array( |
|
325 | - 'registration', |
|
326 | - 'cancelled_registration', |
|
327 | - 'declined_registration', |
|
328 | - 'not_approved_registration', |
|
329 | - 'payment_declined', |
|
330 | - 'payment_failed', |
|
331 | - 'payment_cancelled', |
|
332 | - 'payment', |
|
333 | - 'payment_reminder', |
|
334 | - 'pending_approval', |
|
335 | - 'registration_summary', |
|
336 | - 'invoice', |
|
337 | - 'receipt', |
|
338 | - ); |
|
339 | - if ($msg instanceof EE_message_type && in_array($msg->name, $include_with)) { |
|
340 | - $contexts = array_keys($msg->get_contexts()); |
|
341 | - foreach ($contexts as $context) { |
|
342 | - $valid_shortcodes[ $context ][] = 'question_list'; |
|
343 | - $valid_shortcodes[ $context ][] = 'question'; |
|
344 | - } |
|
345 | - } |
|
346 | - |
|
347 | - return $valid_shortcodes; |
|
348 | - } |
|
349 | - |
|
350 | - |
|
351 | - public function additional_attendee_shortcodes($shortcodes, $shortcode_parser) |
|
352 | - { |
|
353 | - $shortcodes['[ANSWER_*]'] = __( |
|
354 | - 'This is a special dynamic shortcode. Right after the "*", add the exact text of a existing question, and if there is an answer for that question for this registrant, that will take the place of this shortcode.', |
|
355 | - 'event_espresso' |
|
356 | - ); |
|
357 | - |
|
358 | - return $shortcodes; |
|
359 | - } |
|
360 | - |
|
361 | - |
|
362 | - public function additional_attendee_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
363 | - { |
|
364 | - |
|
365 | - if (strpos($shortcode, '[ANSWER_*') === false |
|
366 | - || ! isset($extra_data['data']->questions) |
|
367 | - || ! isset($extra_data['data']->registrations) |
|
368 | - ) { |
|
369 | - return $parsed; |
|
370 | - } |
|
371 | - |
|
372 | - // let's get the question from the code. |
|
373 | - $shortcode = str_replace('[ANSWER_*', '', $shortcode); |
|
374 | - $shortcode = trim(str_replace(']', '', $shortcode)); |
|
375 | - |
|
376 | - $registration = $data instanceof EE_Registration ? $data : null; |
|
377 | - $registration = ! $registration instanceof EE_Registration && is_array( |
|
378 | - $extra_data |
|
379 | - ) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration; |
|
380 | - |
|
381 | - $aee = $data instanceof EE_Messages_Addressee ? $data : null; |
|
382 | - $aee = ! $aee instanceof EE_Messages_Addressee && is_array( |
|
383 | - $extra_data |
|
384 | - ) && isset($extra_data['data']) ? $extra_data['data'] : $aee; |
|
385 | - |
|
386 | - if (! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) { |
|
387 | - return $parsed; |
|
388 | - } |
|
389 | - |
|
390 | - // now let's figure out which question has this text. |
|
391 | - foreach ($aee->questions as $ansid => $question) { |
|
392 | - if ($question instanceof EE_Question |
|
393 | - && trim($question->display_text()) == trim($shortcode) |
|
394 | - && isset($aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ]) |
|
395 | - ) { |
|
396 | - return $aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ]->get_pretty( |
|
397 | - 'ANS_value', |
|
398 | - 'no_wpautop' |
|
399 | - ); |
|
400 | - } |
|
401 | - } |
|
402 | - |
|
403 | - // nothing! |
|
404 | - return $parsed; |
|
405 | - } |
|
406 | - |
|
407 | - |
|
408 | - /** |
|
409 | - * Callback for additional shortcodes filter for adding additional datetime shortcodes. |
|
410 | - * |
|
411 | - * @since 4.2 |
|
412 | - * |
|
413 | - * @param array $shortcodes array of shortcodes and |
|
414 | - * descriptions |
|
415 | - * @param EE_Datetime_Shortcodes $shortcode_parser EE_Shortcodes object |
|
416 | - * |
|
417 | - * @return array array of shortcodes and |
|
418 | - * descriptions |
|
419 | - */ |
|
420 | - public function additional_datetime_shortcodes($shortcodes, $shortcode_parser) |
|
421 | - { |
|
422 | - $shortcodes['[DTT_NAME]'] = __( |
|
423 | - 'This will be parsed to the Title given for a Datetime', |
|
424 | - 'event_espresso' |
|
425 | - ); |
|
426 | - $shortcodes['[DTT_DESCRIPTION]'] = __( |
|
427 | - 'This will be parsed to the description for a Datetime', |
|
428 | - 'event_espresso' |
|
429 | - ); |
|
430 | - $shortcodes['[DTT_NAME_OR_DATES]'] = __( |
|
431 | - 'When parsed, if the Datetime has a name, it is used, otherwise a formatted string including the start date and end date will be used.', |
|
432 | - 'event_espresso' |
|
433 | - ); |
|
434 | - |
|
435 | - return $shortcodes; |
|
436 | - } |
|
437 | - |
|
438 | - |
|
439 | - /** |
|
440 | - * Callback for additional shortcodes parser filter used for adding parser for new |
|
441 | - * Datetime shortcodes |
|
442 | - * |
|
443 | - * @since 4.2 |
|
444 | - * |
|
445 | - * @param string $parsed The finished parsed string for the given shortcode. |
|
446 | - * @param string $shortcode The shortcode being parsed. |
|
447 | - * @param object $data The incoming data object for the Shortcode Parser. |
|
448 | - * @param object $extra_data The incoming extra date object for the Shortcode |
|
449 | - * Parser. |
|
450 | - * @param EE_Datetime_Shortcodes $shortcode_parser |
|
451 | - * |
|
452 | - * @return string The new parsed string. |
|
453 | - */ |
|
454 | - public function additional_datetime_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
455 | - { |
|
456 | - |
|
457 | - if (! $data instanceof EE_Datetime) { |
|
458 | - return ''; // get out because we can only parse with the datetime object. |
|
459 | - } |
|
460 | - |
|
461 | - switch ($shortcode) { |
|
462 | - case '[DTT_NAME]': |
|
463 | - return $data->name(); |
|
464 | - break; |
|
465 | - case '[DTT_DESCRIPTION]': |
|
466 | - return $data->description(); |
|
467 | - break; |
|
468 | - case '[DTT_NAME_OR_DATES]': |
|
469 | - return $data->get_dtt_display_name(true); |
|
470 | - break; |
|
471 | - default: |
|
472 | - return $parsed; |
|
473 | - break; |
|
474 | - } |
|
475 | - } |
|
476 | - |
|
477 | - |
|
478 | - public function additional_recipient_details_shortcodes($shortcodes, $shortcode_parser) |
|
479 | - { |
|
480 | - $shortcodes['[RECIPIENT_QUESTION_LIST]'] = __( |
|
481 | - 'This is used to indicate where you want the list of questions and answers to show for the person receiving the message.', |
|
482 | - 'event_espresso' |
|
483 | - ); |
|
484 | - |
|
485 | - return $shortcodes; |
|
486 | - } |
|
487 | - |
|
488 | - |
|
489 | - /** |
|
490 | - * Callback for FHEE__EE_Recipient_List_Shortcodes__parser_after filter (dynamic filter). |
|
491 | - * |
|
492 | - * @param string $parsed The original parsed content for the shortcode |
|
493 | - * @param string $shortcode The shortcode being parsed |
|
494 | - * @param array $data The shortcode parser data array |
|
495 | - * @param array $extra_data The shortcode parser extra data array |
|
496 | - * @param \EE_Shortcodes $shortcode_parser Shortcode parser. |
|
497 | - * |
|
498 | - * @return string |
|
499 | - */ |
|
500 | - public function additional_recipient_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
501 | - { |
|
502 | - |
|
503 | - if (array($data) && ! isset($data['data'])) { |
|
504 | - return $parsed; |
|
505 | - } |
|
506 | - |
|
507 | - $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
508 | - $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
509 | - |
|
510 | - if (! $recipient instanceof EE_Messages_Addressee) { |
|
511 | - return $parsed; |
|
512 | - } |
|
513 | - |
|
514 | - switch ($shortcode) { |
|
515 | - case '[RECIPIENT_QUESTION_LIST]': |
|
516 | - $att = $recipient->att_obj; |
|
517 | - $registrations_on_attendee = $att instanceof EE_Attendee |
|
518 | - ? $recipient->attendees[ $att->ID() ]['reg_objs'] |
|
519 | - : array(); |
|
520 | - $registrations_on_attendee = empty($registrations_on_attendee) && $recipient->reg_obj instanceof EE_Registration ? array($recipient->reg_obj) : $registrations_on_attendee; |
|
521 | - $answers = array(); |
|
522 | - |
|
523 | - $template = is_array($data['template']) && isset($data['template']['question_list']) |
|
524 | - ? $data['template']['question_list'] |
|
525 | - : $extra_data['template']['question_list']; |
|
526 | - $valid_shortcodes = array('question'); |
|
527 | - |
|
528 | - // if the context is main_content then get all answers for all registrations on this attendee |
|
529 | - if ($data['data'] instanceof EE_Messages_Addressee) { |
|
530 | - foreach ($registrations_on_attendee as $reg) { |
|
531 | - if ($reg instanceof EE_Registration) { |
|
532 | - $anss = ! empty($recipient->registrations[ $reg->ID() ]['ans_objs']) |
|
533 | - ? $recipient->registrations[ $reg->ID() ]['ans_objs'] |
|
534 | - : array(); |
|
535 | - foreach ($anss as $ans) { |
|
536 | - if ($ans instanceof EE_Answer) { |
|
537 | - $answers[ $ans->ID() ] = $ans; |
|
538 | - } |
|
539 | - } |
|
540 | - } |
|
541 | - } |
|
542 | - } |
|
543 | - |
|
544 | - // if the context is the event list parser, then let's return just the answers for all registrations attached to the recipient for that event. |
|
545 | - if ($data['data'] instanceof EE_Event) { |
|
546 | - $event = $data['data']; |
|
547 | - foreach ($registrations_on_attendee as $reg) { |
|
548 | - if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) { |
|
549 | - $anss = ! empty($recipient->registrations[ $reg->ID() ]['ans_objs']) |
|
550 | - ? $recipient->registrations[ $reg->ID() ]['ans_objs'] |
|
551 | - : array(); |
|
552 | - foreach ($anss as $ans) { |
|
553 | - if ($ans instanceof EE_Answer) { |
|
554 | - $answers[ $ans->ID() ] = $ans; |
|
555 | - } |
|
556 | - } |
|
557 | - } |
|
558 | - } |
|
559 | - } |
|
560 | - |
|
561 | - $questions = $questions = isset($recipient->questions) ? $recipient->questions : array(); |
|
562 | - |
|
563 | - // if $extra_data does not have a 'data' key then let's make sure we add it and set the EE_Messages_Addressee |
|
564 | - // object on it. |
|
565 | - if (! isset($extra_data['data'])) { |
|
566 | - $extra_data['data'] = $recipient; |
|
567 | - } |
|
568 | - |
|
569 | - return $this->_parse_question_list_for_primary_or_recipient_registration( |
|
570 | - $shortcode_parser, |
|
571 | - $questions, |
|
572 | - $answers, |
|
573 | - $template, |
|
574 | - $valid_shortcodes, |
|
575 | - $extra_data |
|
576 | - ); |
|
577 | - break; |
|
578 | - |
|
579 | - default: |
|
580 | - return $parsed; |
|
581 | - break; |
|
582 | - } |
|
583 | - } |
|
584 | - |
|
585 | - |
|
586 | - public function additional_primary_registration_details_shortcodes($shortcodes, $shortcode_parser) |
|
587 | - { |
|
588 | - $shortcodes['[PRIMARY_REGISTRANT_QUESTION_LIST]'] = __( |
|
589 | - 'This is used to indicate the questions and answers for the primary_registrant. It should be placed in the "[attendee_list]" field', |
|
590 | - 'event_espresso' |
|
591 | - ); |
|
592 | - |
|
593 | - return $shortcodes; |
|
594 | - } |
|
595 | - |
|
596 | - |
|
597 | - /** |
|
598 | - * Callback for FHEE__EE_Primary_Registration_List_Shortcodes__parser_after filter (dynamic filter). |
|
599 | - * |
|
600 | - * @param string $parsed The original parsed content for the shortcode |
|
601 | - * @param string $shortcode The shortcode being parsed |
|
602 | - * @param array $data The shortcode parser data array |
|
603 | - * @param array $extra_data The shortcode parser extra data array |
|
604 | - * @param \EE_Shortcodes $shortcode_parser Shortcode parser. |
|
605 | - * |
|
606 | - * @return string |
|
607 | - */ |
|
608 | - public function additional_primary_registration_details_parser( |
|
609 | - $parsed, |
|
610 | - $shortcode, |
|
611 | - $data, |
|
612 | - $extra_data, |
|
613 | - $shortcode_parser |
|
614 | - ) { |
|
615 | - if (array($data) && ! isset($data['data'])) { |
|
616 | - return $parsed; |
|
617 | - } |
|
618 | - |
|
619 | - $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
620 | - $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
621 | - |
|
622 | - if (! $recipient instanceof EE_Messages_Addressee) { |
|
623 | - return $parsed; |
|
624 | - } |
|
625 | - |
|
626 | - switch ($shortcode) { |
|
627 | - case '[PRIMARY_REGISTRANT_QUESTION_LIST]': |
|
628 | - if (! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration) { |
|
629 | - return ''; |
|
630 | - } |
|
631 | - $registration = $recipient->primary_reg_obj; |
|
632 | - $answers = isset($recipient->registrations[ $registration->ID() ]['ans_objs']) |
|
633 | - ? $recipient->registrations[ $registration->ID() ]['ans_objs'] |
|
634 | - : array(); |
|
635 | - if (empty($answers)) { |
|
636 | - return ''; |
|
637 | - } |
|
638 | - $template = is_array($data['template']) && isset($data['template']['question_list']) |
|
639 | - ? $data['template']['question_list'] |
|
640 | - : $extra_data['template']['question_list']; |
|
641 | - $valid_shortcodes = array('question'); |
|
642 | - $answers = $recipient->registrations[ $registration->ID() ]['ans_objs']; |
|
643 | - $questions = isset($recipient->questions) ? $recipient->questions : array(); |
|
644 | - // if $extra_data does not have a 'data' key then let's make sure we add it and set the EE_Messages_Addressee |
|
645 | - // object on it. |
|
646 | - if (! isset($extra_data['data'])) { |
|
647 | - $extra_data['data'] = $recipient; |
|
648 | - } |
|
649 | - return $this->_parse_question_list_for_primary_or_recipient_registration( |
|
650 | - $shortcode_parser, |
|
651 | - $questions, |
|
652 | - $answers, |
|
653 | - $template, |
|
654 | - $valid_shortcodes, |
|
655 | - $extra_data |
|
656 | - ); |
|
657 | - break; |
|
658 | - |
|
659 | - default: |
|
660 | - return $parsed; |
|
661 | - break; |
|
662 | - } |
|
663 | - } |
|
664 | - |
|
665 | - |
|
666 | - /** |
|
667 | - * Takes care of registering the message types that are only available in caffeinated EE. |
|
668 | - * |
|
669 | - * @since 4.3.2 |
|
670 | - * |
|
671 | - * @return void |
|
672 | - */ |
|
673 | - public function register_caf_message_types() |
|
674 | - { |
|
675 | - // register newsletter message type |
|
676 | - $setup_args = array( |
|
677 | - 'mtfilename' => 'EE_Newsletter_message_type.class.php', |
|
678 | - 'autoloadpaths' => array( |
|
679 | - EE_CAF_LIBRARIES . 'messages/message_type/newsletter/', |
|
680 | - ), |
|
681 | - 'messengers_to_activate_with' => array('email'), |
|
682 | - 'messengers_to_validate_with' => array('email'), |
|
683 | - 'messengers_supporting_default_template_pack_with' => array('email'), |
|
684 | - ); |
|
685 | - EE_Register_Message_Type::register('newsletter', $setup_args); |
|
686 | - |
|
687 | - // register payment reminder message type |
|
688 | - $setup_args = array( |
|
689 | - 'mtfilename' => 'EE_Payment_Reminder_message_type.class.php', |
|
690 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/'), |
|
691 | - 'messengers_to_activate_with' => array('email'), |
|
692 | - 'messengers_to_validate_with' => array('email'), |
|
693 | - 'messengers_supporting_default_template_pack_with' => array('email'), |
|
694 | - ); |
|
695 | - EE_Register_Message_Type::register('payment_reminder', $setup_args); |
|
696 | - |
|
697 | - // register payment declined message type |
|
698 | - $setup_args = array( |
|
699 | - 'mtfilename' => 'EE_Payment_Declined_message_type.class.php', |
|
700 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/'), |
|
701 | - 'messengers_to_activate_with' => array('email'), |
|
702 | - 'messengers_to_validate_with' => array('email'), |
|
703 | - 'messengers_supporting_default_template_pack_with' => array('email'), |
|
704 | - ); |
|
705 | - EE_Register_Message_Type::register('payment_declined', $setup_args); |
|
706 | - |
|
707 | - // register registration declined message type |
|
708 | - $setup_args = array( |
|
709 | - 'mtfilename' => 'EE_Declined_Registration_message_type.class.php', |
|
710 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/'), |
|
711 | - 'messengers_to_activate_with' => array('email'), |
|
712 | - 'messengers_to_validate_with' => array('email'), |
|
713 | - 'messengers_supporting_default_template_pack_with' => array('email'), |
|
714 | - ); |
|
715 | - EE_Register_Message_Type::register('declined_registration', $setup_args); |
|
716 | - |
|
717 | - // register registration cancelled message type |
|
718 | - $setup_args = array( |
|
719 | - 'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php', |
|
720 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/'), |
|
721 | - 'messengers_to_activate_with' => array('email'), |
|
722 | - 'messengers_to_validate_with' => array('email'), |
|
723 | - 'messengers_supporting_default_template_pack_with' => array('email'), |
|
724 | - ); |
|
725 | - EE_Register_Message_Type::register('cancelled_registration', $setup_args); |
|
726 | - |
|
727 | - |
|
728 | - // register payment failed message type |
|
729 | - $setup_args = array( |
|
730 | - 'mtfilename' => 'EE_Payment_Failed_message_type.class.php', |
|
731 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/'), |
|
732 | - 'messengers_to_activate_with' => array('email'), |
|
733 | - 'messengers_to_validate_with' => array('email'), |
|
734 | - 'messengers_supporting_default_template_pack_with' => array('email'), |
|
735 | - ); |
|
736 | - EE_Register_Message_Type::register('payment_failed', $setup_args); |
|
737 | - |
|
738 | - // register payment declined message type |
|
739 | - $setup_args = array( |
|
740 | - 'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php', |
|
741 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/'), |
|
742 | - 'messengers_to_activate_with' => array('email'), |
|
743 | - 'messengers_to_validate_with' => array('email'), |
|
744 | - 'messengers_supporting_default_template_pack_with' => array('email'), |
|
745 | - ); |
|
746 | - EE_Register_Message_Type::register('payment_cancelled', $setup_args); |
|
747 | - } |
|
748 | - |
|
749 | - |
|
750 | - /** |
|
751 | - * Takes care of registering the shortcode libraries implemented with caffeinated EE and set up related items. |
|
752 | - * |
|
753 | - * @since 4.3.2 |
|
754 | - * |
|
755 | - * @return void |
|
756 | - */ |
|
757 | - public function register_caf_shortcodes() |
|
758 | - { |
|
759 | - $setup_args = array( |
|
760 | - 'autoloadpaths' => array( |
|
761 | - EE_CAF_LIBRARIES . 'shortcodes/', |
|
762 | - ), |
|
763 | - 'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'), |
|
764 | - 'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'), |
|
765 | - 'list_type_shortcodes' => array('[NEWSLETTER_CONTENT]'), |
|
766 | - ); |
|
767 | - EE_Register_Messages_Shortcode_Library::register('newsletter', $setup_args); |
|
768 | - } |
|
769 | - |
|
770 | - |
|
771 | - /** |
|
772 | - * Parses a question list shortcode using given data and template |
|
773 | - * |
|
774 | - * @param \EE_Shortcodes $shortcode_parser |
|
775 | - * @param EE_Question[] $questions An array of questions indexed by answer id. |
|
776 | - * @param EE_Answer[] $answers An array of answer objects |
|
777 | - * @param string $template Template content to be parsed. |
|
778 | - * @param array $valid_shortcodes Valid shortcodes for the template being parsed. |
|
779 | - * @param array $extra_data Extra data that might be used when parsing the template. |
|
780 | - */ |
|
781 | - protected function _parse_question_list_for_primary_or_recipient_registration( |
|
782 | - $shortcode_parser, |
|
783 | - $questions, |
|
784 | - $answers, |
|
785 | - $template, |
|
786 | - $valid_shortcodes, |
|
787 | - $extra_data |
|
788 | - ) { |
|
789 | - $question_list = ''; |
|
790 | - /** @var EEH_Parse_Shortcodes $shortcode_helper */ |
|
791 | - $shortcode_helper = $shortcode_parser->get_shortcode_helper(); |
|
792 | - foreach ($answers as $answer) { |
|
793 | - if ($answer instanceof EE_Answer) { |
|
794 | - // first see if the question is in our $questions array. If not then try to get from answer object. |
|
795 | - $question = isset($questions[ $answer->ID() ]) ? $questions[ $answer->ID() ] : null; |
|
796 | - $question = ! $question instanceof EE_Question ? $answer->question() : $question; |
|
797 | - if (! $question instanceof EE_Question |
|
798 | - || ( |
|
799 | - $question instanceof EE_Question |
|
800 | - && $question->admin_only() |
|
801 | - ) |
|
802 | - ) { |
|
803 | - continue; |
|
804 | - } |
|
805 | - $question_list .= $shortcode_helper->parse_question_list_template( |
|
806 | - $template, |
|
807 | - $answer, |
|
808 | - $valid_shortcodes, |
|
809 | - $extra_data |
|
810 | - ); |
|
811 | - } |
|
812 | - } |
|
813 | - return $question_list; |
|
814 | - } |
|
16 | + /** |
|
17 | + * constructor. |
|
18 | + */ |
|
19 | + public function __construct() |
|
20 | + { |
|
21 | + $this->_caf_hooks(); |
|
22 | + } |
|
23 | + |
|
24 | + |
|
25 | + /** |
|
26 | + * Contains all the hooks filters for setting up caffeinated messages functionality. |
|
27 | + * |
|
28 | + * @since 4.3.2 |
|
29 | + * |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + private function _caf_hooks() |
|
33 | + { |
|
34 | + add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array($this, 'messages_autoload_paths'), 5); |
|
35 | + add_filter( |
|
36 | + 'FHEE__EE_Email_messenger__get_validator_config', |
|
37 | + array($this, 'email_messenger_validator_config'), |
|
38 | + 5, |
|
39 | + 2 |
|
40 | + ); |
|
41 | + add_filter( |
|
42 | + 'FHEE__EE_Email_messenger__get_template_fields', |
|
43 | + array($this, 'email_messenger_template_fields'), |
|
44 | + 5, |
|
45 | + 2 |
|
46 | + ); |
|
47 | + add_filter( |
|
48 | + 'FHEE__EE_Html_messenger__get_template_fields', |
|
49 | + array($this, 'html_messenger_template_fields'), |
|
50 | + 5, |
|
51 | + 2 |
|
52 | + ); |
|
53 | + add_filter( |
|
54 | + 'FHEE__EE_Html_messenger__get_validator_config', |
|
55 | + array($this, 'html_messenger_validator_config'), |
|
56 | + 5, |
|
57 | + 2 |
|
58 | + ); |
|
59 | + add_filter('FHEE__EE_Pdf_messenger__get_template_fields', array($this, 'pdf_messenger_template_fields'), 5, 2); |
|
60 | + add_filter( |
|
61 | + 'FHEE__EE_Pdf_messenger__get_validator_config', |
|
62 | + array($this, 'pdf_messenger_validator_config'), |
|
63 | + 5, |
|
64 | + 2 |
|
65 | + ); |
|
66 | + add_filter( |
|
67 | + 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', |
|
68 | + array($this, 'new_default_templates'), |
|
69 | + 5, |
|
70 | + 7 |
|
71 | + ); |
|
72 | + add_filter( |
|
73 | + 'FHEE__EE_Messages_Base__get_valid_shortcodes', |
|
74 | + array($this, 'message_types_valid_shortcodes'), |
|
75 | + 5, |
|
76 | + 2 |
|
77 | + ); |
|
78 | + |
|
79 | + // shortcode parsers |
|
80 | + add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array($this, 'additional_attendee_shortcodes'), 5, 2); |
|
81 | + add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array($this, 'additional_attendee_parser'), 5, 5); |
|
82 | + add_filter( |
|
83 | + 'FHEE__EE_Recipient_List_Shortcodes__shortcodes', |
|
84 | + array($this, 'additional_recipient_details_shortcodes'), |
|
85 | + 5, |
|
86 | + 2 |
|
87 | + ); |
|
88 | + add_filter( |
|
89 | + 'FHEE__EE_Recipient_List_Shortcodes__parser_after', |
|
90 | + array($this, 'additional_recipient_details_parser'), |
|
91 | + 5, |
|
92 | + 5 |
|
93 | + ); |
|
94 | + add_filter( |
|
95 | + 'FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', |
|
96 | + array($this, 'additional_primary_registration_details_shortcodes'), |
|
97 | + 5, |
|
98 | + 2 |
|
99 | + ); |
|
100 | + add_filter( |
|
101 | + 'FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', |
|
102 | + array($this, 'additional_primary_registration_details_parser'), |
|
103 | + 5, |
|
104 | + 5 |
|
105 | + ); |
|
106 | + |
|
107 | + /** |
|
108 | + * @since 4.2.0 |
|
109 | + */ |
|
110 | + add_filter('FHEE__EE_Datetime_Shortcodes__shortcodes', array($this, 'additional_datetime_shortcodes'), 10, 2); |
|
111 | + add_filter('FHEE__EE_Datetime_Shortcodes__parser_after', array($this, 'additional_datetime_parser'), 10, 5); |
|
112 | + |
|
113 | + /** |
|
114 | + * @since 4.3.0 |
|
115 | + */ |
|
116 | + // eat our own dog food! |
|
117 | + add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_message_types')); |
|
118 | + add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_shortcodes')); |
|
119 | + do_action('EE_Brewing_Regular___messages_caf'); |
|
120 | + } |
|
121 | + |
|
122 | + |
|
123 | + /** |
|
124 | + * This just allows us to add additional paths to the autoloader (EED_Messages::autoload_messages()) for the |
|
125 | + * messages system. |
|
126 | + * |
|
127 | + * @param array $dir_ref original array of paths |
|
128 | + * |
|
129 | + * @return array appended paths |
|
130 | + */ |
|
131 | + public function messages_autoload_paths($dir_ref) |
|
132 | + { |
|
133 | + $dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/'; |
|
134 | + |
|
135 | + return $dir_ref; |
|
136 | + } |
|
137 | + |
|
138 | + |
|
139 | + public function email_messenger_validator_config($validator_config, EE_Email_messenger $messenger) |
|
140 | + { |
|
141 | + $validator_config['attendee_list'] = array( |
|
142 | + 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
143 | + 'required' => array('[ATTENDEE_LIST]'), |
|
144 | + ); |
|
145 | + $validator_config['question_list'] = array( |
|
146 | + 'shortcodes' => array('question'), |
|
147 | + 'required' => array('[QUESTION_LIST]'), |
|
148 | + ); |
|
149 | + |
|
150 | + return $validator_config; |
|
151 | + } |
|
152 | + |
|
153 | + |
|
154 | + public function html_messenger_validator_config($validator_config, EE_Html_messenger $messenger) |
|
155 | + { |
|
156 | + $validator_config['attendee_list'] = array( |
|
157 | + 'shortcodes' => array('attendee', 'question_list'), |
|
158 | + 'required' => array('[ATTENDEE_LIST]'), |
|
159 | + ); |
|
160 | + $validator_config['question_list'] = array( |
|
161 | + 'shortcodes' => array('question'), |
|
162 | + 'required' => array('[QUESTION_LIST]'), |
|
163 | + ); |
|
164 | + |
|
165 | + return $validator_config; |
|
166 | + } |
|
167 | + |
|
168 | + |
|
169 | + public function pdf_messenger_validator_config($validator_config, EE_Pdf_messenger $messenger) |
|
170 | + { |
|
171 | + $validator_config['attendee_list'] = array( |
|
172 | + 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
173 | + 'required' => array('[ATTENDEE_LIST]'), |
|
174 | + ); |
|
175 | + $validator_config['question_list'] = array( |
|
176 | + 'shortcodes' => array('question'), |
|
177 | + 'required' => array('[QUESTION_LIST]'), |
|
178 | + ); |
|
179 | + |
|
180 | + return $validator_config; |
|
181 | + } |
|
182 | + |
|
183 | + |
|
184 | + public function email_messenger_template_fields($template_fields, EE_Email_messenger $messenger) |
|
185 | + { |
|
186 | + $template_fields['extra']['content']['question_list'] = array( |
|
187 | + 'input' => 'textarea', |
|
188 | + 'label' => '[QUESTION_LIST]', |
|
189 | + 'type' => 'string', |
|
190 | + 'required' => true, |
|
191 | + 'validation' => true, |
|
192 | + 'format' => '%s', |
|
193 | + 'css_class' => 'large-text', |
|
194 | + 'rows' => '5', |
|
195 | + 'shortcodes_required' => array('[QUESTION_LIST]'), |
|
196 | + ); |
|
197 | + |
|
198 | + return $template_fields; |
|
199 | + } |
|
200 | + |
|
201 | + |
|
202 | + public function html_messenger_template_fields($template_fields, EE_Html_messenger $messenger) |
|
203 | + { |
|
204 | + $template_fields['extra']['content']['question_list'] = array( |
|
205 | + 'input' => 'textarea', |
|
206 | + 'label' => '[QUESTION_LIST]', |
|
207 | + 'type' => 'string', |
|
208 | + 'required' => true, |
|
209 | + 'validation' => true, |
|
210 | + 'format' => '%s', |
|
211 | + 'css_class' => 'large-text', |
|
212 | + 'rows' => '5', |
|
213 | + 'shortcodes_required' => array('[QUESTION_LIST]'), |
|
214 | + ); |
|
215 | + |
|
216 | + return $template_fields; |
|
217 | + } |
|
218 | + |
|
219 | + |
|
220 | + public function pdf_messenger_template_fields($template_fields, EE_Pdf_messenger $messenger) |
|
221 | + { |
|
222 | + $template_fields['extra']['content']['question_list'] = array( |
|
223 | + 'input' => 'textarea', |
|
224 | + 'label' => '[QUESTION_LIST]', |
|
225 | + 'type' => 'string', |
|
226 | + 'required' => true, |
|
227 | + 'validation' => true, |
|
228 | + 'format' => '%s', |
|
229 | + 'css_class' => 'large-text', |
|
230 | + 'rows' => '5', |
|
231 | + 'shortcodes_required' => array('[QUESTION_LIST]'), |
|
232 | + ); |
|
233 | + |
|
234 | + return $template_fields; |
|
235 | + } |
|
236 | + |
|
237 | + |
|
238 | + public function new_default_templates( |
|
239 | + $contents, |
|
240 | + $actual_path, |
|
241 | + EE_messenger $messenger, |
|
242 | + EE_message_type $message_type, |
|
243 | + $field, |
|
244 | + $context, |
|
245 | + EE_Messages_Template_Pack $template_pack |
|
246 | + ) { |
|
247 | + |
|
248 | + // we're only modifying templates for the default template pack |
|
249 | + if (! $template_pack instanceof EE_Messages_Template_Pack_Default) { |
|
250 | + return $contents; |
|
251 | + } |
|
252 | + |
|
253 | + // the template file name we're replacing contents for. |
|
254 | + $template_file_prefix = $field . '_' . $context; |
|
255 | + $msg_prefix = $messenger->name . '_' . $message_type->name . '_'; |
|
256 | + |
|
257 | + $base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/'; |
|
258 | + |
|
259 | + if ($messenger->name == 'email' && $message_type->name == 'registration') { |
|
260 | + switch ($template_file_prefix) { |
|
261 | + case 'question_list_admin': |
|
262 | + case 'question_list_attendee': |
|
263 | + case 'question_list_primary_attendee': |
|
264 | + $path = $base_path . $msg_prefix . 'question_list.template.php'; |
|
265 | + $contents = EEH_Template::display_template($path, array(), true); |
|
266 | + break; |
|
267 | + |
|
268 | + case 'attendee_list_primary_attendee': |
|
269 | + $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
270 | + $contents = EEH_Template::display_template($path, array(), true); |
|
271 | + break; |
|
272 | + |
|
273 | + case 'attendee_list_admin': |
|
274 | + $path = $base_path . $msg_prefix . 'attendee_list_admin.template.php'; |
|
275 | + $contents = EEH_Template::display_template( |
|
276 | + $path, |
|
277 | + array(), |
|
278 | + true |
|
279 | + ); |
|
280 | + break; |
|
281 | + |
|
282 | + case 'attendee_list_attendee': |
|
283 | + $contents = ''; |
|
284 | + break; |
|
285 | + |
|
286 | + case 'event_list_attendee': |
|
287 | + $path = $base_path . $msg_prefix . 'event_list_attendee.template.php'; |
|
288 | + $contents = EEH_Template::display_template($path, array(), true); |
|
289 | + break; |
|
290 | + } |
|
291 | + } elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') { |
|
292 | + switch ($template_file_prefix) { |
|
293 | + case 'content_attendee': |
|
294 | + $path = $base_path . $msg_prefix . 'content.template.php'; |
|
295 | + $contents = EEH_Template::display_template($path, array(), true); |
|
296 | + break; |
|
297 | + |
|
298 | + case 'newsletter_content_attendee': |
|
299 | + $path = $base_path . $msg_prefix . 'newsletter_content.template.php'; |
|
300 | + $contents = EEH_Template::display_template($path, array(), true); |
|
301 | + break; |
|
302 | + |
|
303 | + case 'newsletter_subject_attendee': |
|
304 | + $path = $base_path . $msg_prefix . 'subject.template.php'; |
|
305 | + $contents = EEH_Template::display_template($path, array(), true); |
|
306 | + break; |
|
307 | + } |
|
308 | + } elseif ($messenger->name == 'html' && $message_type->name == 'receipt') { |
|
309 | + switch ($template_file_prefix) { |
|
310 | + case 'attendee_list_purchaser': |
|
311 | + $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
312 | + $contents = EEH_Template::display_template($path, array(), true); |
|
313 | + break; |
|
314 | + } |
|
315 | + } |
|
316 | + |
|
317 | + return $contents; |
|
318 | + } |
|
319 | + |
|
320 | + |
|
321 | + public function message_types_valid_shortcodes($valid_shortcodes, EE_Messages_Base $msg) |
|
322 | + { |
|
323 | + // make sure question_list and question are ONLY added for the core message types. Any other message types will have to explicitly set question_list as a valid shortcode. |
|
324 | + $include_with = array( |
|
325 | + 'registration', |
|
326 | + 'cancelled_registration', |
|
327 | + 'declined_registration', |
|
328 | + 'not_approved_registration', |
|
329 | + 'payment_declined', |
|
330 | + 'payment_failed', |
|
331 | + 'payment_cancelled', |
|
332 | + 'payment', |
|
333 | + 'payment_reminder', |
|
334 | + 'pending_approval', |
|
335 | + 'registration_summary', |
|
336 | + 'invoice', |
|
337 | + 'receipt', |
|
338 | + ); |
|
339 | + if ($msg instanceof EE_message_type && in_array($msg->name, $include_with)) { |
|
340 | + $contexts = array_keys($msg->get_contexts()); |
|
341 | + foreach ($contexts as $context) { |
|
342 | + $valid_shortcodes[ $context ][] = 'question_list'; |
|
343 | + $valid_shortcodes[ $context ][] = 'question'; |
|
344 | + } |
|
345 | + } |
|
346 | + |
|
347 | + return $valid_shortcodes; |
|
348 | + } |
|
349 | + |
|
350 | + |
|
351 | + public function additional_attendee_shortcodes($shortcodes, $shortcode_parser) |
|
352 | + { |
|
353 | + $shortcodes['[ANSWER_*]'] = __( |
|
354 | + 'This is a special dynamic shortcode. Right after the "*", add the exact text of a existing question, and if there is an answer for that question for this registrant, that will take the place of this shortcode.', |
|
355 | + 'event_espresso' |
|
356 | + ); |
|
357 | + |
|
358 | + return $shortcodes; |
|
359 | + } |
|
360 | + |
|
361 | + |
|
362 | + public function additional_attendee_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
363 | + { |
|
364 | + |
|
365 | + if (strpos($shortcode, '[ANSWER_*') === false |
|
366 | + || ! isset($extra_data['data']->questions) |
|
367 | + || ! isset($extra_data['data']->registrations) |
|
368 | + ) { |
|
369 | + return $parsed; |
|
370 | + } |
|
371 | + |
|
372 | + // let's get the question from the code. |
|
373 | + $shortcode = str_replace('[ANSWER_*', '', $shortcode); |
|
374 | + $shortcode = trim(str_replace(']', '', $shortcode)); |
|
375 | + |
|
376 | + $registration = $data instanceof EE_Registration ? $data : null; |
|
377 | + $registration = ! $registration instanceof EE_Registration && is_array( |
|
378 | + $extra_data |
|
379 | + ) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration; |
|
380 | + |
|
381 | + $aee = $data instanceof EE_Messages_Addressee ? $data : null; |
|
382 | + $aee = ! $aee instanceof EE_Messages_Addressee && is_array( |
|
383 | + $extra_data |
|
384 | + ) && isset($extra_data['data']) ? $extra_data['data'] : $aee; |
|
385 | + |
|
386 | + if (! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) { |
|
387 | + return $parsed; |
|
388 | + } |
|
389 | + |
|
390 | + // now let's figure out which question has this text. |
|
391 | + foreach ($aee->questions as $ansid => $question) { |
|
392 | + if ($question instanceof EE_Question |
|
393 | + && trim($question->display_text()) == trim($shortcode) |
|
394 | + && isset($aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ]) |
|
395 | + ) { |
|
396 | + return $aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ]->get_pretty( |
|
397 | + 'ANS_value', |
|
398 | + 'no_wpautop' |
|
399 | + ); |
|
400 | + } |
|
401 | + } |
|
402 | + |
|
403 | + // nothing! |
|
404 | + return $parsed; |
|
405 | + } |
|
406 | + |
|
407 | + |
|
408 | + /** |
|
409 | + * Callback for additional shortcodes filter for adding additional datetime shortcodes. |
|
410 | + * |
|
411 | + * @since 4.2 |
|
412 | + * |
|
413 | + * @param array $shortcodes array of shortcodes and |
|
414 | + * descriptions |
|
415 | + * @param EE_Datetime_Shortcodes $shortcode_parser EE_Shortcodes object |
|
416 | + * |
|
417 | + * @return array array of shortcodes and |
|
418 | + * descriptions |
|
419 | + */ |
|
420 | + public function additional_datetime_shortcodes($shortcodes, $shortcode_parser) |
|
421 | + { |
|
422 | + $shortcodes['[DTT_NAME]'] = __( |
|
423 | + 'This will be parsed to the Title given for a Datetime', |
|
424 | + 'event_espresso' |
|
425 | + ); |
|
426 | + $shortcodes['[DTT_DESCRIPTION]'] = __( |
|
427 | + 'This will be parsed to the description for a Datetime', |
|
428 | + 'event_espresso' |
|
429 | + ); |
|
430 | + $shortcodes['[DTT_NAME_OR_DATES]'] = __( |
|
431 | + 'When parsed, if the Datetime has a name, it is used, otherwise a formatted string including the start date and end date will be used.', |
|
432 | + 'event_espresso' |
|
433 | + ); |
|
434 | + |
|
435 | + return $shortcodes; |
|
436 | + } |
|
437 | + |
|
438 | + |
|
439 | + /** |
|
440 | + * Callback for additional shortcodes parser filter used for adding parser for new |
|
441 | + * Datetime shortcodes |
|
442 | + * |
|
443 | + * @since 4.2 |
|
444 | + * |
|
445 | + * @param string $parsed The finished parsed string for the given shortcode. |
|
446 | + * @param string $shortcode The shortcode being parsed. |
|
447 | + * @param object $data The incoming data object for the Shortcode Parser. |
|
448 | + * @param object $extra_data The incoming extra date object for the Shortcode |
|
449 | + * Parser. |
|
450 | + * @param EE_Datetime_Shortcodes $shortcode_parser |
|
451 | + * |
|
452 | + * @return string The new parsed string. |
|
453 | + */ |
|
454 | + public function additional_datetime_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
455 | + { |
|
456 | + |
|
457 | + if (! $data instanceof EE_Datetime) { |
|
458 | + return ''; // get out because we can only parse with the datetime object. |
|
459 | + } |
|
460 | + |
|
461 | + switch ($shortcode) { |
|
462 | + case '[DTT_NAME]': |
|
463 | + return $data->name(); |
|
464 | + break; |
|
465 | + case '[DTT_DESCRIPTION]': |
|
466 | + return $data->description(); |
|
467 | + break; |
|
468 | + case '[DTT_NAME_OR_DATES]': |
|
469 | + return $data->get_dtt_display_name(true); |
|
470 | + break; |
|
471 | + default: |
|
472 | + return $parsed; |
|
473 | + break; |
|
474 | + } |
|
475 | + } |
|
476 | + |
|
477 | + |
|
478 | + public function additional_recipient_details_shortcodes($shortcodes, $shortcode_parser) |
|
479 | + { |
|
480 | + $shortcodes['[RECIPIENT_QUESTION_LIST]'] = __( |
|
481 | + 'This is used to indicate where you want the list of questions and answers to show for the person receiving the message.', |
|
482 | + 'event_espresso' |
|
483 | + ); |
|
484 | + |
|
485 | + return $shortcodes; |
|
486 | + } |
|
487 | + |
|
488 | + |
|
489 | + /** |
|
490 | + * Callback for FHEE__EE_Recipient_List_Shortcodes__parser_after filter (dynamic filter). |
|
491 | + * |
|
492 | + * @param string $parsed The original parsed content for the shortcode |
|
493 | + * @param string $shortcode The shortcode being parsed |
|
494 | + * @param array $data The shortcode parser data array |
|
495 | + * @param array $extra_data The shortcode parser extra data array |
|
496 | + * @param \EE_Shortcodes $shortcode_parser Shortcode parser. |
|
497 | + * |
|
498 | + * @return string |
|
499 | + */ |
|
500 | + public function additional_recipient_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
501 | + { |
|
502 | + |
|
503 | + if (array($data) && ! isset($data['data'])) { |
|
504 | + return $parsed; |
|
505 | + } |
|
506 | + |
|
507 | + $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
508 | + $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
509 | + |
|
510 | + if (! $recipient instanceof EE_Messages_Addressee) { |
|
511 | + return $parsed; |
|
512 | + } |
|
513 | + |
|
514 | + switch ($shortcode) { |
|
515 | + case '[RECIPIENT_QUESTION_LIST]': |
|
516 | + $att = $recipient->att_obj; |
|
517 | + $registrations_on_attendee = $att instanceof EE_Attendee |
|
518 | + ? $recipient->attendees[ $att->ID() ]['reg_objs'] |
|
519 | + : array(); |
|
520 | + $registrations_on_attendee = empty($registrations_on_attendee) && $recipient->reg_obj instanceof EE_Registration ? array($recipient->reg_obj) : $registrations_on_attendee; |
|
521 | + $answers = array(); |
|
522 | + |
|
523 | + $template = is_array($data['template']) && isset($data['template']['question_list']) |
|
524 | + ? $data['template']['question_list'] |
|
525 | + : $extra_data['template']['question_list']; |
|
526 | + $valid_shortcodes = array('question'); |
|
527 | + |
|
528 | + // if the context is main_content then get all answers for all registrations on this attendee |
|
529 | + if ($data['data'] instanceof EE_Messages_Addressee) { |
|
530 | + foreach ($registrations_on_attendee as $reg) { |
|
531 | + if ($reg instanceof EE_Registration) { |
|
532 | + $anss = ! empty($recipient->registrations[ $reg->ID() ]['ans_objs']) |
|
533 | + ? $recipient->registrations[ $reg->ID() ]['ans_objs'] |
|
534 | + : array(); |
|
535 | + foreach ($anss as $ans) { |
|
536 | + if ($ans instanceof EE_Answer) { |
|
537 | + $answers[ $ans->ID() ] = $ans; |
|
538 | + } |
|
539 | + } |
|
540 | + } |
|
541 | + } |
|
542 | + } |
|
543 | + |
|
544 | + // if the context is the event list parser, then let's return just the answers for all registrations attached to the recipient for that event. |
|
545 | + if ($data['data'] instanceof EE_Event) { |
|
546 | + $event = $data['data']; |
|
547 | + foreach ($registrations_on_attendee as $reg) { |
|
548 | + if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) { |
|
549 | + $anss = ! empty($recipient->registrations[ $reg->ID() ]['ans_objs']) |
|
550 | + ? $recipient->registrations[ $reg->ID() ]['ans_objs'] |
|
551 | + : array(); |
|
552 | + foreach ($anss as $ans) { |
|
553 | + if ($ans instanceof EE_Answer) { |
|
554 | + $answers[ $ans->ID() ] = $ans; |
|
555 | + } |
|
556 | + } |
|
557 | + } |
|
558 | + } |
|
559 | + } |
|
560 | + |
|
561 | + $questions = $questions = isset($recipient->questions) ? $recipient->questions : array(); |
|
562 | + |
|
563 | + // if $extra_data does not have a 'data' key then let's make sure we add it and set the EE_Messages_Addressee |
|
564 | + // object on it. |
|
565 | + if (! isset($extra_data['data'])) { |
|
566 | + $extra_data['data'] = $recipient; |
|
567 | + } |
|
568 | + |
|
569 | + return $this->_parse_question_list_for_primary_or_recipient_registration( |
|
570 | + $shortcode_parser, |
|
571 | + $questions, |
|
572 | + $answers, |
|
573 | + $template, |
|
574 | + $valid_shortcodes, |
|
575 | + $extra_data |
|
576 | + ); |
|
577 | + break; |
|
578 | + |
|
579 | + default: |
|
580 | + return $parsed; |
|
581 | + break; |
|
582 | + } |
|
583 | + } |
|
584 | + |
|
585 | + |
|
586 | + public function additional_primary_registration_details_shortcodes($shortcodes, $shortcode_parser) |
|
587 | + { |
|
588 | + $shortcodes['[PRIMARY_REGISTRANT_QUESTION_LIST]'] = __( |
|
589 | + 'This is used to indicate the questions and answers for the primary_registrant. It should be placed in the "[attendee_list]" field', |
|
590 | + 'event_espresso' |
|
591 | + ); |
|
592 | + |
|
593 | + return $shortcodes; |
|
594 | + } |
|
595 | + |
|
596 | + |
|
597 | + /** |
|
598 | + * Callback for FHEE__EE_Primary_Registration_List_Shortcodes__parser_after filter (dynamic filter). |
|
599 | + * |
|
600 | + * @param string $parsed The original parsed content for the shortcode |
|
601 | + * @param string $shortcode The shortcode being parsed |
|
602 | + * @param array $data The shortcode parser data array |
|
603 | + * @param array $extra_data The shortcode parser extra data array |
|
604 | + * @param \EE_Shortcodes $shortcode_parser Shortcode parser. |
|
605 | + * |
|
606 | + * @return string |
|
607 | + */ |
|
608 | + public function additional_primary_registration_details_parser( |
|
609 | + $parsed, |
|
610 | + $shortcode, |
|
611 | + $data, |
|
612 | + $extra_data, |
|
613 | + $shortcode_parser |
|
614 | + ) { |
|
615 | + if (array($data) && ! isset($data['data'])) { |
|
616 | + return $parsed; |
|
617 | + } |
|
618 | + |
|
619 | + $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
620 | + $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
621 | + |
|
622 | + if (! $recipient instanceof EE_Messages_Addressee) { |
|
623 | + return $parsed; |
|
624 | + } |
|
625 | + |
|
626 | + switch ($shortcode) { |
|
627 | + case '[PRIMARY_REGISTRANT_QUESTION_LIST]': |
|
628 | + if (! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration) { |
|
629 | + return ''; |
|
630 | + } |
|
631 | + $registration = $recipient->primary_reg_obj; |
|
632 | + $answers = isset($recipient->registrations[ $registration->ID() ]['ans_objs']) |
|
633 | + ? $recipient->registrations[ $registration->ID() ]['ans_objs'] |
|
634 | + : array(); |
|
635 | + if (empty($answers)) { |
|
636 | + return ''; |
|
637 | + } |
|
638 | + $template = is_array($data['template']) && isset($data['template']['question_list']) |
|
639 | + ? $data['template']['question_list'] |
|
640 | + : $extra_data['template']['question_list']; |
|
641 | + $valid_shortcodes = array('question'); |
|
642 | + $answers = $recipient->registrations[ $registration->ID() ]['ans_objs']; |
|
643 | + $questions = isset($recipient->questions) ? $recipient->questions : array(); |
|
644 | + // if $extra_data does not have a 'data' key then let's make sure we add it and set the EE_Messages_Addressee |
|
645 | + // object on it. |
|
646 | + if (! isset($extra_data['data'])) { |
|
647 | + $extra_data['data'] = $recipient; |
|
648 | + } |
|
649 | + return $this->_parse_question_list_for_primary_or_recipient_registration( |
|
650 | + $shortcode_parser, |
|
651 | + $questions, |
|
652 | + $answers, |
|
653 | + $template, |
|
654 | + $valid_shortcodes, |
|
655 | + $extra_data |
|
656 | + ); |
|
657 | + break; |
|
658 | + |
|
659 | + default: |
|
660 | + return $parsed; |
|
661 | + break; |
|
662 | + } |
|
663 | + } |
|
664 | + |
|
665 | + |
|
666 | + /** |
|
667 | + * Takes care of registering the message types that are only available in caffeinated EE. |
|
668 | + * |
|
669 | + * @since 4.3.2 |
|
670 | + * |
|
671 | + * @return void |
|
672 | + */ |
|
673 | + public function register_caf_message_types() |
|
674 | + { |
|
675 | + // register newsletter message type |
|
676 | + $setup_args = array( |
|
677 | + 'mtfilename' => 'EE_Newsletter_message_type.class.php', |
|
678 | + 'autoloadpaths' => array( |
|
679 | + EE_CAF_LIBRARIES . 'messages/message_type/newsletter/', |
|
680 | + ), |
|
681 | + 'messengers_to_activate_with' => array('email'), |
|
682 | + 'messengers_to_validate_with' => array('email'), |
|
683 | + 'messengers_supporting_default_template_pack_with' => array('email'), |
|
684 | + ); |
|
685 | + EE_Register_Message_Type::register('newsletter', $setup_args); |
|
686 | + |
|
687 | + // register payment reminder message type |
|
688 | + $setup_args = array( |
|
689 | + 'mtfilename' => 'EE_Payment_Reminder_message_type.class.php', |
|
690 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/'), |
|
691 | + 'messengers_to_activate_with' => array('email'), |
|
692 | + 'messengers_to_validate_with' => array('email'), |
|
693 | + 'messengers_supporting_default_template_pack_with' => array('email'), |
|
694 | + ); |
|
695 | + EE_Register_Message_Type::register('payment_reminder', $setup_args); |
|
696 | + |
|
697 | + // register payment declined message type |
|
698 | + $setup_args = array( |
|
699 | + 'mtfilename' => 'EE_Payment_Declined_message_type.class.php', |
|
700 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/'), |
|
701 | + 'messengers_to_activate_with' => array('email'), |
|
702 | + 'messengers_to_validate_with' => array('email'), |
|
703 | + 'messengers_supporting_default_template_pack_with' => array('email'), |
|
704 | + ); |
|
705 | + EE_Register_Message_Type::register('payment_declined', $setup_args); |
|
706 | + |
|
707 | + // register registration declined message type |
|
708 | + $setup_args = array( |
|
709 | + 'mtfilename' => 'EE_Declined_Registration_message_type.class.php', |
|
710 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/'), |
|
711 | + 'messengers_to_activate_with' => array('email'), |
|
712 | + 'messengers_to_validate_with' => array('email'), |
|
713 | + 'messengers_supporting_default_template_pack_with' => array('email'), |
|
714 | + ); |
|
715 | + EE_Register_Message_Type::register('declined_registration', $setup_args); |
|
716 | + |
|
717 | + // register registration cancelled message type |
|
718 | + $setup_args = array( |
|
719 | + 'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php', |
|
720 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/'), |
|
721 | + 'messengers_to_activate_with' => array('email'), |
|
722 | + 'messengers_to_validate_with' => array('email'), |
|
723 | + 'messengers_supporting_default_template_pack_with' => array('email'), |
|
724 | + ); |
|
725 | + EE_Register_Message_Type::register('cancelled_registration', $setup_args); |
|
726 | + |
|
727 | + |
|
728 | + // register payment failed message type |
|
729 | + $setup_args = array( |
|
730 | + 'mtfilename' => 'EE_Payment_Failed_message_type.class.php', |
|
731 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/'), |
|
732 | + 'messengers_to_activate_with' => array('email'), |
|
733 | + 'messengers_to_validate_with' => array('email'), |
|
734 | + 'messengers_supporting_default_template_pack_with' => array('email'), |
|
735 | + ); |
|
736 | + EE_Register_Message_Type::register('payment_failed', $setup_args); |
|
737 | + |
|
738 | + // register payment declined message type |
|
739 | + $setup_args = array( |
|
740 | + 'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php', |
|
741 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/'), |
|
742 | + 'messengers_to_activate_with' => array('email'), |
|
743 | + 'messengers_to_validate_with' => array('email'), |
|
744 | + 'messengers_supporting_default_template_pack_with' => array('email'), |
|
745 | + ); |
|
746 | + EE_Register_Message_Type::register('payment_cancelled', $setup_args); |
|
747 | + } |
|
748 | + |
|
749 | + |
|
750 | + /** |
|
751 | + * Takes care of registering the shortcode libraries implemented with caffeinated EE and set up related items. |
|
752 | + * |
|
753 | + * @since 4.3.2 |
|
754 | + * |
|
755 | + * @return void |
|
756 | + */ |
|
757 | + public function register_caf_shortcodes() |
|
758 | + { |
|
759 | + $setup_args = array( |
|
760 | + 'autoloadpaths' => array( |
|
761 | + EE_CAF_LIBRARIES . 'shortcodes/', |
|
762 | + ), |
|
763 | + 'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'), |
|
764 | + 'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'), |
|
765 | + 'list_type_shortcodes' => array('[NEWSLETTER_CONTENT]'), |
|
766 | + ); |
|
767 | + EE_Register_Messages_Shortcode_Library::register('newsletter', $setup_args); |
|
768 | + } |
|
769 | + |
|
770 | + |
|
771 | + /** |
|
772 | + * Parses a question list shortcode using given data and template |
|
773 | + * |
|
774 | + * @param \EE_Shortcodes $shortcode_parser |
|
775 | + * @param EE_Question[] $questions An array of questions indexed by answer id. |
|
776 | + * @param EE_Answer[] $answers An array of answer objects |
|
777 | + * @param string $template Template content to be parsed. |
|
778 | + * @param array $valid_shortcodes Valid shortcodes for the template being parsed. |
|
779 | + * @param array $extra_data Extra data that might be used when parsing the template. |
|
780 | + */ |
|
781 | + protected function _parse_question_list_for_primary_or_recipient_registration( |
|
782 | + $shortcode_parser, |
|
783 | + $questions, |
|
784 | + $answers, |
|
785 | + $template, |
|
786 | + $valid_shortcodes, |
|
787 | + $extra_data |
|
788 | + ) { |
|
789 | + $question_list = ''; |
|
790 | + /** @var EEH_Parse_Shortcodes $shortcode_helper */ |
|
791 | + $shortcode_helper = $shortcode_parser->get_shortcode_helper(); |
|
792 | + foreach ($answers as $answer) { |
|
793 | + if ($answer instanceof EE_Answer) { |
|
794 | + // first see if the question is in our $questions array. If not then try to get from answer object. |
|
795 | + $question = isset($questions[ $answer->ID() ]) ? $questions[ $answer->ID() ] : null; |
|
796 | + $question = ! $question instanceof EE_Question ? $answer->question() : $question; |
|
797 | + if (! $question instanceof EE_Question |
|
798 | + || ( |
|
799 | + $question instanceof EE_Question |
|
800 | + && $question->admin_only() |
|
801 | + ) |
|
802 | + ) { |
|
803 | + continue; |
|
804 | + } |
|
805 | + $question_list .= $shortcode_helper->parse_question_list_template( |
|
806 | + $template, |
|
807 | + $answer, |
|
808 | + $valid_shortcodes, |
|
809 | + $extra_data |
|
810 | + ); |
|
811 | + } |
|
812 | + } |
|
813 | + return $question_list; |
|
814 | + } |
|
815 | 815 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function messages_autoload_paths($dir_ref) |
132 | 132 | { |
133 | - $dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/'; |
|
133 | + $dir_ref[] = EE_CAF_LIBRARIES.'shortcodes/'; |
|
134 | 134 | |
135 | 135 | return $dir_ref; |
136 | 136 | } |
@@ -246,32 +246,32 @@ discard block |
||
246 | 246 | ) { |
247 | 247 | |
248 | 248 | // we're only modifying templates for the default template pack |
249 | - if (! $template_pack instanceof EE_Messages_Template_Pack_Default) { |
|
249 | + if ( ! $template_pack instanceof EE_Messages_Template_Pack_Default) { |
|
250 | 250 | return $contents; |
251 | 251 | } |
252 | 252 | |
253 | 253 | // the template file name we're replacing contents for. |
254 | - $template_file_prefix = $field . '_' . $context; |
|
255 | - $msg_prefix = $messenger->name . '_' . $message_type->name . '_'; |
|
254 | + $template_file_prefix = $field.'_'.$context; |
|
255 | + $msg_prefix = $messenger->name.'_'.$message_type->name.'_'; |
|
256 | 256 | |
257 | - $base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/'; |
|
257 | + $base_path = EE_CAF_LIBRARIES.'messages/defaults/default/'; |
|
258 | 258 | |
259 | 259 | if ($messenger->name == 'email' && $message_type->name == 'registration') { |
260 | 260 | switch ($template_file_prefix) { |
261 | 261 | case 'question_list_admin': |
262 | 262 | case 'question_list_attendee': |
263 | 263 | case 'question_list_primary_attendee': |
264 | - $path = $base_path . $msg_prefix . 'question_list.template.php'; |
|
264 | + $path = $base_path.$msg_prefix.'question_list.template.php'; |
|
265 | 265 | $contents = EEH_Template::display_template($path, array(), true); |
266 | 266 | break; |
267 | 267 | |
268 | 268 | case 'attendee_list_primary_attendee': |
269 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
269 | + $path = $base_path.$msg_prefix.'attendee_list.template.php'; |
|
270 | 270 | $contents = EEH_Template::display_template($path, array(), true); |
271 | 271 | break; |
272 | 272 | |
273 | 273 | case 'attendee_list_admin': |
274 | - $path = $base_path . $msg_prefix . 'attendee_list_admin.template.php'; |
|
274 | + $path = $base_path.$msg_prefix.'attendee_list_admin.template.php'; |
|
275 | 275 | $contents = EEH_Template::display_template( |
276 | 276 | $path, |
277 | 277 | array(), |
@@ -284,31 +284,31 @@ discard block |
||
284 | 284 | break; |
285 | 285 | |
286 | 286 | case 'event_list_attendee': |
287 | - $path = $base_path . $msg_prefix . 'event_list_attendee.template.php'; |
|
287 | + $path = $base_path.$msg_prefix.'event_list_attendee.template.php'; |
|
288 | 288 | $contents = EEH_Template::display_template($path, array(), true); |
289 | 289 | break; |
290 | 290 | } |
291 | 291 | } elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') { |
292 | 292 | switch ($template_file_prefix) { |
293 | 293 | case 'content_attendee': |
294 | - $path = $base_path . $msg_prefix . 'content.template.php'; |
|
294 | + $path = $base_path.$msg_prefix.'content.template.php'; |
|
295 | 295 | $contents = EEH_Template::display_template($path, array(), true); |
296 | 296 | break; |
297 | 297 | |
298 | 298 | case 'newsletter_content_attendee': |
299 | - $path = $base_path . $msg_prefix . 'newsletter_content.template.php'; |
|
299 | + $path = $base_path.$msg_prefix.'newsletter_content.template.php'; |
|
300 | 300 | $contents = EEH_Template::display_template($path, array(), true); |
301 | 301 | break; |
302 | 302 | |
303 | 303 | case 'newsletter_subject_attendee': |
304 | - $path = $base_path . $msg_prefix . 'subject.template.php'; |
|
304 | + $path = $base_path.$msg_prefix.'subject.template.php'; |
|
305 | 305 | $contents = EEH_Template::display_template($path, array(), true); |
306 | 306 | break; |
307 | 307 | } |
308 | 308 | } elseif ($messenger->name == 'html' && $message_type->name == 'receipt') { |
309 | 309 | switch ($template_file_prefix) { |
310 | 310 | case 'attendee_list_purchaser': |
311 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
311 | + $path = $base_path.$msg_prefix.'attendee_list.template.php'; |
|
312 | 312 | $contents = EEH_Template::display_template($path, array(), true); |
313 | 313 | break; |
314 | 314 | } |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | if ($msg instanceof EE_message_type && in_array($msg->name, $include_with)) { |
340 | 340 | $contexts = array_keys($msg->get_contexts()); |
341 | 341 | foreach ($contexts as $context) { |
342 | - $valid_shortcodes[ $context ][] = 'question_list'; |
|
343 | - $valid_shortcodes[ $context ][] = 'question'; |
|
342 | + $valid_shortcodes[$context][] = 'question_list'; |
|
343 | + $valid_shortcodes[$context][] = 'question'; |
|
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $extra_data |
384 | 384 | ) && isset($extra_data['data']) ? $extra_data['data'] : $aee; |
385 | 385 | |
386 | - if (! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) { |
|
386 | + if ( ! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) { |
|
387 | 387 | return $parsed; |
388 | 388 | } |
389 | 389 | |
@@ -391,9 +391,9 @@ discard block |
||
391 | 391 | foreach ($aee->questions as $ansid => $question) { |
392 | 392 | if ($question instanceof EE_Question |
393 | 393 | && trim($question->display_text()) == trim($shortcode) |
394 | - && isset($aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ]) |
|
394 | + && isset($aee->registrations[$registration->ID()]['ans_objs'][$ansid]) |
|
395 | 395 | ) { |
396 | - return $aee->registrations[ $registration->ID() ]['ans_objs'][ $ansid ]->get_pretty( |
|
396 | + return $aee->registrations[$registration->ID()]['ans_objs'][$ansid]->get_pretty( |
|
397 | 397 | 'ANS_value', |
398 | 398 | 'no_wpautop' |
399 | 399 | ); |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | public function additional_datetime_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
455 | 455 | { |
456 | 456 | |
457 | - if (! $data instanceof EE_Datetime) { |
|
457 | + if ( ! $data instanceof EE_Datetime) { |
|
458 | 458 | return ''; // get out because we can only parse with the datetime object. |
459 | 459 | } |
460 | 460 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
508 | 508 | $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
509 | 509 | |
510 | - if (! $recipient instanceof EE_Messages_Addressee) { |
|
510 | + if ( ! $recipient instanceof EE_Messages_Addressee) { |
|
511 | 511 | return $parsed; |
512 | 512 | } |
513 | 513 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | case '[RECIPIENT_QUESTION_LIST]': |
516 | 516 | $att = $recipient->att_obj; |
517 | 517 | $registrations_on_attendee = $att instanceof EE_Attendee |
518 | - ? $recipient->attendees[ $att->ID() ]['reg_objs'] |
|
518 | + ? $recipient->attendees[$att->ID()]['reg_objs'] |
|
519 | 519 | : array(); |
520 | 520 | $registrations_on_attendee = empty($registrations_on_attendee) && $recipient->reg_obj instanceof EE_Registration ? array($recipient->reg_obj) : $registrations_on_attendee; |
521 | 521 | $answers = array(); |
@@ -529,12 +529,12 @@ discard block |
||
529 | 529 | if ($data['data'] instanceof EE_Messages_Addressee) { |
530 | 530 | foreach ($registrations_on_attendee as $reg) { |
531 | 531 | if ($reg instanceof EE_Registration) { |
532 | - $anss = ! empty($recipient->registrations[ $reg->ID() ]['ans_objs']) |
|
533 | - ? $recipient->registrations[ $reg->ID() ]['ans_objs'] |
|
532 | + $anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) |
|
533 | + ? $recipient->registrations[$reg->ID()]['ans_objs'] |
|
534 | 534 | : array(); |
535 | 535 | foreach ($anss as $ans) { |
536 | 536 | if ($ans instanceof EE_Answer) { |
537 | - $answers[ $ans->ID() ] = $ans; |
|
537 | + $answers[$ans->ID()] = $ans; |
|
538 | 538 | } |
539 | 539 | } |
540 | 540 | } |
@@ -546,12 +546,12 @@ discard block |
||
546 | 546 | $event = $data['data']; |
547 | 547 | foreach ($registrations_on_attendee as $reg) { |
548 | 548 | if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) { |
549 | - $anss = ! empty($recipient->registrations[ $reg->ID() ]['ans_objs']) |
|
550 | - ? $recipient->registrations[ $reg->ID() ]['ans_objs'] |
|
549 | + $anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) |
|
550 | + ? $recipient->registrations[$reg->ID()]['ans_objs'] |
|
551 | 551 | : array(); |
552 | 552 | foreach ($anss as $ans) { |
553 | 553 | if ($ans instanceof EE_Answer) { |
554 | - $answers[ $ans->ID() ] = $ans; |
|
554 | + $answers[$ans->ID()] = $ans; |
|
555 | 555 | } |
556 | 556 | } |
557 | 557 | } |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | |
563 | 563 | // if $extra_data does not have a 'data' key then let's make sure we add it and set the EE_Messages_Addressee |
564 | 564 | // object on it. |
565 | - if (! isset($extra_data['data'])) { |
|
565 | + if ( ! isset($extra_data['data'])) { |
|
566 | 566 | $extra_data['data'] = $recipient; |
567 | 567 | } |
568 | 568 | |
@@ -619,18 +619,18 @@ discard block |
||
619 | 619 | $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
620 | 620 | $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
621 | 621 | |
622 | - if (! $recipient instanceof EE_Messages_Addressee) { |
|
622 | + if ( ! $recipient instanceof EE_Messages_Addressee) { |
|
623 | 623 | return $parsed; |
624 | 624 | } |
625 | 625 | |
626 | 626 | switch ($shortcode) { |
627 | 627 | case '[PRIMARY_REGISTRANT_QUESTION_LIST]': |
628 | - if (! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration) { |
|
628 | + if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration) { |
|
629 | 629 | return ''; |
630 | 630 | } |
631 | 631 | $registration = $recipient->primary_reg_obj; |
632 | - $answers = isset($recipient->registrations[ $registration->ID() ]['ans_objs']) |
|
633 | - ? $recipient->registrations[ $registration->ID() ]['ans_objs'] |
|
632 | + $answers = isset($recipient->registrations[$registration->ID()]['ans_objs']) |
|
633 | + ? $recipient->registrations[$registration->ID()]['ans_objs'] |
|
634 | 634 | : array(); |
635 | 635 | if (empty($answers)) { |
636 | 636 | return ''; |
@@ -639,11 +639,11 @@ discard block |
||
639 | 639 | ? $data['template']['question_list'] |
640 | 640 | : $extra_data['template']['question_list']; |
641 | 641 | $valid_shortcodes = array('question'); |
642 | - $answers = $recipient->registrations[ $registration->ID() ]['ans_objs']; |
|
642 | + $answers = $recipient->registrations[$registration->ID()]['ans_objs']; |
|
643 | 643 | $questions = isset($recipient->questions) ? $recipient->questions : array(); |
644 | 644 | // if $extra_data does not have a 'data' key then let's make sure we add it and set the EE_Messages_Addressee |
645 | 645 | // object on it. |
646 | - if (! isset($extra_data['data'])) { |
|
646 | + if ( ! isset($extra_data['data'])) { |
|
647 | 647 | $extra_data['data'] = $recipient; |
648 | 648 | } |
649 | 649 | return $this->_parse_question_list_for_primary_or_recipient_registration( |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | $setup_args = array( |
677 | 677 | 'mtfilename' => 'EE_Newsletter_message_type.class.php', |
678 | 678 | 'autoloadpaths' => array( |
679 | - EE_CAF_LIBRARIES . 'messages/message_type/newsletter/', |
|
679 | + EE_CAF_LIBRARIES.'messages/message_type/newsletter/', |
|
680 | 680 | ), |
681 | 681 | 'messengers_to_activate_with' => array('email'), |
682 | 682 | 'messengers_to_validate_with' => array('email'), |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | // register payment reminder message type |
688 | 688 | $setup_args = array( |
689 | 689 | 'mtfilename' => 'EE_Payment_Reminder_message_type.class.php', |
690 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/'), |
|
690 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_reminder/'), |
|
691 | 691 | 'messengers_to_activate_with' => array('email'), |
692 | 692 | 'messengers_to_validate_with' => array('email'), |
693 | 693 | 'messengers_supporting_default_template_pack_with' => array('email'), |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | // register payment declined message type |
698 | 698 | $setup_args = array( |
699 | 699 | 'mtfilename' => 'EE_Payment_Declined_message_type.class.php', |
700 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/'), |
|
700 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_declined/'), |
|
701 | 701 | 'messengers_to_activate_with' => array('email'), |
702 | 702 | 'messengers_to_validate_with' => array('email'), |
703 | 703 | 'messengers_supporting_default_template_pack_with' => array('email'), |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | // register registration declined message type |
708 | 708 | $setup_args = array( |
709 | 709 | 'mtfilename' => 'EE_Declined_Registration_message_type.class.php', |
710 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/'), |
|
710 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/declined_registration/'), |
|
711 | 711 | 'messengers_to_activate_with' => array('email'), |
712 | 712 | 'messengers_to_validate_with' => array('email'), |
713 | 713 | 'messengers_supporting_default_template_pack_with' => array('email'), |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | // register registration cancelled message type |
718 | 718 | $setup_args = array( |
719 | 719 | 'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php', |
720 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/'), |
|
720 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/cancelled_registration/'), |
|
721 | 721 | 'messengers_to_activate_with' => array('email'), |
722 | 722 | 'messengers_to_validate_with' => array('email'), |
723 | 723 | 'messengers_supporting_default_template_pack_with' => array('email'), |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | // register payment failed message type |
729 | 729 | $setup_args = array( |
730 | 730 | 'mtfilename' => 'EE_Payment_Failed_message_type.class.php', |
731 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/'), |
|
731 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_failed/'), |
|
732 | 732 | 'messengers_to_activate_with' => array('email'), |
733 | 733 | 'messengers_to_validate_with' => array('email'), |
734 | 734 | 'messengers_supporting_default_template_pack_with' => array('email'), |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | // register payment declined message type |
739 | 739 | $setup_args = array( |
740 | 740 | 'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php', |
741 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/'), |
|
741 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_cancelled/'), |
|
742 | 742 | 'messengers_to_activate_with' => array('email'), |
743 | 743 | 'messengers_to_validate_with' => array('email'), |
744 | 744 | 'messengers_supporting_default_template_pack_with' => array('email'), |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | { |
759 | 759 | $setup_args = array( |
760 | 760 | 'autoloadpaths' => array( |
761 | - EE_CAF_LIBRARIES . 'shortcodes/', |
|
761 | + EE_CAF_LIBRARIES.'shortcodes/', |
|
762 | 762 | ), |
763 | 763 | 'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'), |
764 | 764 | 'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'), |
@@ -792,9 +792,9 @@ discard block |
||
792 | 792 | foreach ($answers as $answer) { |
793 | 793 | if ($answer instanceof EE_Answer) { |
794 | 794 | // first see if the question is in our $questions array. If not then try to get from answer object. |
795 | - $question = isset($questions[ $answer->ID() ]) ? $questions[ $answer->ID() ] : null; |
|
795 | + $question = isset($questions[$answer->ID()]) ? $questions[$answer->ID()] : null; |
|
796 | 796 | $question = ! $question instanceof EE_Question ? $answer->question() : $question; |
797 | - if (! $question instanceof EE_Question |
|
797 | + if ( ! $question instanceof EE_Question |
|
798 | 798 | || ( |
799 | 799 | $question instanceof EE_Question |
800 | 800 | && $question->admin_only() |
@@ -16,220 +16,220 @@ |
||
16 | 16 | class Prices_List_Table extends EE_Admin_List_Table |
17 | 17 | { |
18 | 18 | |
19 | - private $_PRT; |
|
20 | - |
|
21 | - /** |
|
22 | - * Array of price types. |
|
23 | - * |
|
24 | - * @var EE_Price_Type[] |
|
25 | - */ |
|
26 | - protected $_price_types = array(); |
|
27 | - |
|
28 | - public function __construct($admin_page) |
|
29 | - { |
|
30 | - parent::__construct($admin_page); |
|
31 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
32 | - $this->_PRT = EEM_Price_Type::instance(); |
|
33 | - $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted(); |
|
34 | - } |
|
35 | - |
|
36 | - |
|
37 | - protected function _setup_data() |
|
38 | - { |
|
39 | - $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false; |
|
40 | - $this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed); |
|
41 | - $this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false); |
|
42 | - $this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true); |
|
43 | - } |
|
44 | - |
|
45 | - |
|
46 | - protected function _set_properties() |
|
47 | - { |
|
48 | - $this->_wp_list_args = array( |
|
49 | - 'singular' => __('price', 'event_espresso'), |
|
50 | - 'plural' => __('prices', 'event_espresso'), |
|
51 | - 'ajax' => true, |
|
52 | - 'screen' => $this->_admin_page->get_current_screen()->id, |
|
53 | - ); |
|
54 | - |
|
55 | - $this->_columns = array( |
|
56 | - 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text |
|
57 | - 'name' => __('Name', 'event_espresso'), |
|
58 | - 'type' => __('Price Type', 'event_espresso'), |
|
59 | - 'description' => __('Description', 'event_espresso'), |
|
60 | - 'amount' => __('Amount', 'event_espresso'), |
|
61 | - ); |
|
62 | - |
|
63 | - $this->_sortable_columns = array( |
|
64 | - // true means its already sorted |
|
65 | - 'name' => array('name' => false), |
|
66 | - 'type' => array('type' => false), |
|
67 | - 'amount' => array('amount' => false), |
|
68 | - ); |
|
69 | - |
|
70 | - $this->_hidden_columns = array(); |
|
71 | - |
|
72 | - $this->_ajax_sorting_callback = 'update_prices_order'; |
|
73 | - } |
|
74 | - |
|
75 | - |
|
76 | - protected function _get_table_filters() |
|
77 | - { |
|
78 | - } |
|
79 | - |
|
80 | - |
|
81 | - protected function _add_view_counts() |
|
82 | - { |
|
83 | - $this->_views['all']['count'] = $this->_all_data_count; |
|
84 | - if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) { |
|
85 | - $this->_views['trashed']['count'] = $this->_trashed_count; |
|
86 | - } |
|
87 | - } |
|
88 | - |
|
89 | - |
|
90 | - /** |
|
91 | - * overriding parent method so that we can make sure the row isn't sortable for certain items |
|
92 | - * |
|
93 | - * @param object $item the current item |
|
94 | - * @return string |
|
95 | - */ |
|
96 | - protected function _get_row_class($item) |
|
97 | - { |
|
98 | - static $row_class = ''; |
|
99 | - $row_class = ($row_class == '' ? 'alternate' : ''); |
|
100 | - |
|
101 | - $new_row = $row_class; |
|
102 | - |
|
103 | - if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4) { |
|
104 | - $new_row .= ' rowsortable'; |
|
105 | - } |
|
106 | - |
|
107 | - return ' class="' . $new_row . '"'; |
|
108 | - } |
|
109 | - |
|
110 | - |
|
111 | - public function column_cb($item) |
|
112 | - { |
|
113 | - if ($item->type_obj()->base_type() !== 1) { |
|
114 | - return sprintf( |
|
115 | - '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', |
|
116 | - $item->ID() |
|
117 | - ); |
|
118 | - } |
|
119 | - return ''; |
|
120 | - } |
|
121 | - |
|
122 | - |
|
123 | - public function column_name($item) |
|
124 | - { |
|
125 | - |
|
126 | - // Build row actions |
|
127 | - $actions = array(); |
|
128 | - // edit price link |
|
129 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
130 | - 'ee_edit_default_price', |
|
131 | - 'pricing_edit_price', |
|
132 | - $item->ID() |
|
133 | - )) { |
|
134 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
135 | - 'action' => 'edit_price', |
|
136 | - 'id' => $item->ID(), |
|
137 | - ), PRICING_ADMIN_URL); |
|
138 | - $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="' |
|
139 | - . esc_attr__('Edit Price', 'event_espresso') . '">' |
|
140 | - . __('Edit', 'event_espresso') . '</a>'; |
|
141 | - } |
|
142 | - |
|
143 | - $name_link = EE_Registry::instance()->CAP->current_user_can( |
|
144 | - 'ee_edit_default_price', |
|
145 | - 'edit_price', |
|
146 | - $item->ID() |
|
147 | - ) |
|
148 | - ? '<a href="' . $edit_lnk_url . '" title="' |
|
149 | - . esc_attr__('Edit Price', 'event_espresso') . '">' |
|
150 | - . stripslashes($item->name()) . '</a>' |
|
151 | - : $item->name(); |
|
152 | - |
|
153 | - if ($item->type_obj()->base_type() !== 1) { |
|
154 | - if ($this->_view == 'all') { |
|
155 | - // trash price link |
|
156 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
157 | - 'ee_delete_default_price', |
|
158 | - 'pricing_trash_price', |
|
159 | - $item->ID() |
|
160 | - )) { |
|
161 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
162 | - 'action' => 'trash_price', |
|
163 | - 'id' => $item->ID(), |
|
164 | - 'noheader' => true, |
|
165 | - ), PRICING_ADMIN_URL); |
|
166 | - $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' |
|
167 | - . esc_attr__('Move Price to Trash', 'event_espresso') . '">' |
|
168 | - . __('Move to Trash', 'event_espresso') . '</a>'; |
|
169 | - } |
|
170 | - } else { |
|
171 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
172 | - 'ee_delete_default_price', |
|
173 | - 'pricing_restore_price', |
|
174 | - $item->ID() |
|
175 | - )) { |
|
176 | - // restore price link |
|
177 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
178 | - 'action' => 'restore_price', |
|
179 | - 'id' => $item->ID(), |
|
180 | - 'noheader' => true, |
|
181 | - ), PRICING_ADMIN_URL); |
|
182 | - $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' |
|
183 | - . esc_attr__('Restore Price', 'event_espresso') . '">' |
|
184 | - . __('Restore', 'event_espresso') . '</a>'; |
|
185 | - } |
|
186 | - |
|
187 | - // delete price link |
|
188 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
189 | - 'ee_delete_default_price', |
|
190 | - 'pricing_delete_price', |
|
191 | - $item->ID() |
|
192 | - )) { |
|
193 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
194 | - 'action' => 'delete_price', |
|
195 | - 'id' => $item->ID(), |
|
196 | - 'noheader' => true, |
|
197 | - ), PRICING_ADMIN_URL); |
|
198 | - $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' |
|
199 | - . esc_attr__('Delete Price Permanently', 'event_espresso') . '">' |
|
200 | - . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
201 | - } |
|
202 | - } |
|
203 | - } |
|
204 | - |
|
205 | - // Return the name contents |
|
206 | - return sprintf( |
|
207 | - '%1$s <span style="color:silver">(id:%2$s)</span>%3$s', |
|
208 | - $name_link, |
|
209 | - $item->ID(), |
|
210 | - $this->row_actions($actions) |
|
211 | - ); |
|
212 | - } |
|
213 | - |
|
214 | - |
|
215 | - public function column_type($item) |
|
216 | - { |
|
217 | - return $this->_price_types[ $item->type() ]->name(); |
|
218 | - } |
|
219 | - |
|
220 | - |
|
221 | - public function column_description($item) |
|
222 | - { |
|
223 | - return stripslashes($item->desc()); |
|
224 | - } |
|
225 | - |
|
226 | - |
|
227 | - public function column_amount($item) |
|
228 | - { |
|
229 | - if ($this->_price_types[ $item->type() ]->is_percent()) { |
|
230 | - return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>'; |
|
231 | - } else { |
|
232 | - return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>'; |
|
233 | - } |
|
234 | - } |
|
19 | + private $_PRT; |
|
20 | + |
|
21 | + /** |
|
22 | + * Array of price types. |
|
23 | + * |
|
24 | + * @var EE_Price_Type[] |
|
25 | + */ |
|
26 | + protected $_price_types = array(); |
|
27 | + |
|
28 | + public function __construct($admin_page) |
|
29 | + { |
|
30 | + parent::__construct($admin_page); |
|
31 | + require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
32 | + $this->_PRT = EEM_Price_Type::instance(); |
|
33 | + $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted(); |
|
34 | + } |
|
35 | + |
|
36 | + |
|
37 | + protected function _setup_data() |
|
38 | + { |
|
39 | + $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false; |
|
40 | + $this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed); |
|
41 | + $this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false); |
|
42 | + $this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true); |
|
43 | + } |
|
44 | + |
|
45 | + |
|
46 | + protected function _set_properties() |
|
47 | + { |
|
48 | + $this->_wp_list_args = array( |
|
49 | + 'singular' => __('price', 'event_espresso'), |
|
50 | + 'plural' => __('prices', 'event_espresso'), |
|
51 | + 'ajax' => true, |
|
52 | + 'screen' => $this->_admin_page->get_current_screen()->id, |
|
53 | + ); |
|
54 | + |
|
55 | + $this->_columns = array( |
|
56 | + 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text |
|
57 | + 'name' => __('Name', 'event_espresso'), |
|
58 | + 'type' => __('Price Type', 'event_espresso'), |
|
59 | + 'description' => __('Description', 'event_espresso'), |
|
60 | + 'amount' => __('Amount', 'event_espresso'), |
|
61 | + ); |
|
62 | + |
|
63 | + $this->_sortable_columns = array( |
|
64 | + // true means its already sorted |
|
65 | + 'name' => array('name' => false), |
|
66 | + 'type' => array('type' => false), |
|
67 | + 'amount' => array('amount' => false), |
|
68 | + ); |
|
69 | + |
|
70 | + $this->_hidden_columns = array(); |
|
71 | + |
|
72 | + $this->_ajax_sorting_callback = 'update_prices_order'; |
|
73 | + } |
|
74 | + |
|
75 | + |
|
76 | + protected function _get_table_filters() |
|
77 | + { |
|
78 | + } |
|
79 | + |
|
80 | + |
|
81 | + protected function _add_view_counts() |
|
82 | + { |
|
83 | + $this->_views['all']['count'] = $this->_all_data_count; |
|
84 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) { |
|
85 | + $this->_views['trashed']['count'] = $this->_trashed_count; |
|
86 | + } |
|
87 | + } |
|
88 | + |
|
89 | + |
|
90 | + /** |
|
91 | + * overriding parent method so that we can make sure the row isn't sortable for certain items |
|
92 | + * |
|
93 | + * @param object $item the current item |
|
94 | + * @return string |
|
95 | + */ |
|
96 | + protected function _get_row_class($item) |
|
97 | + { |
|
98 | + static $row_class = ''; |
|
99 | + $row_class = ($row_class == '' ? 'alternate' : ''); |
|
100 | + |
|
101 | + $new_row = $row_class; |
|
102 | + |
|
103 | + if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4) { |
|
104 | + $new_row .= ' rowsortable'; |
|
105 | + } |
|
106 | + |
|
107 | + return ' class="' . $new_row . '"'; |
|
108 | + } |
|
109 | + |
|
110 | + |
|
111 | + public function column_cb($item) |
|
112 | + { |
|
113 | + if ($item->type_obj()->base_type() !== 1) { |
|
114 | + return sprintf( |
|
115 | + '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', |
|
116 | + $item->ID() |
|
117 | + ); |
|
118 | + } |
|
119 | + return ''; |
|
120 | + } |
|
121 | + |
|
122 | + |
|
123 | + public function column_name($item) |
|
124 | + { |
|
125 | + |
|
126 | + // Build row actions |
|
127 | + $actions = array(); |
|
128 | + // edit price link |
|
129 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
130 | + 'ee_edit_default_price', |
|
131 | + 'pricing_edit_price', |
|
132 | + $item->ID() |
|
133 | + )) { |
|
134 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
135 | + 'action' => 'edit_price', |
|
136 | + 'id' => $item->ID(), |
|
137 | + ), PRICING_ADMIN_URL); |
|
138 | + $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="' |
|
139 | + . esc_attr__('Edit Price', 'event_espresso') . '">' |
|
140 | + . __('Edit', 'event_espresso') . '</a>'; |
|
141 | + } |
|
142 | + |
|
143 | + $name_link = EE_Registry::instance()->CAP->current_user_can( |
|
144 | + 'ee_edit_default_price', |
|
145 | + 'edit_price', |
|
146 | + $item->ID() |
|
147 | + ) |
|
148 | + ? '<a href="' . $edit_lnk_url . '" title="' |
|
149 | + . esc_attr__('Edit Price', 'event_espresso') . '">' |
|
150 | + . stripslashes($item->name()) . '</a>' |
|
151 | + : $item->name(); |
|
152 | + |
|
153 | + if ($item->type_obj()->base_type() !== 1) { |
|
154 | + if ($this->_view == 'all') { |
|
155 | + // trash price link |
|
156 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
157 | + 'ee_delete_default_price', |
|
158 | + 'pricing_trash_price', |
|
159 | + $item->ID() |
|
160 | + )) { |
|
161 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
162 | + 'action' => 'trash_price', |
|
163 | + 'id' => $item->ID(), |
|
164 | + 'noheader' => true, |
|
165 | + ), PRICING_ADMIN_URL); |
|
166 | + $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' |
|
167 | + . esc_attr__('Move Price to Trash', 'event_espresso') . '">' |
|
168 | + . __('Move to Trash', 'event_espresso') . '</a>'; |
|
169 | + } |
|
170 | + } else { |
|
171 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
172 | + 'ee_delete_default_price', |
|
173 | + 'pricing_restore_price', |
|
174 | + $item->ID() |
|
175 | + )) { |
|
176 | + // restore price link |
|
177 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
178 | + 'action' => 'restore_price', |
|
179 | + 'id' => $item->ID(), |
|
180 | + 'noheader' => true, |
|
181 | + ), PRICING_ADMIN_URL); |
|
182 | + $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' |
|
183 | + . esc_attr__('Restore Price', 'event_espresso') . '">' |
|
184 | + . __('Restore', 'event_espresso') . '</a>'; |
|
185 | + } |
|
186 | + |
|
187 | + // delete price link |
|
188 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
189 | + 'ee_delete_default_price', |
|
190 | + 'pricing_delete_price', |
|
191 | + $item->ID() |
|
192 | + )) { |
|
193 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
194 | + 'action' => 'delete_price', |
|
195 | + 'id' => $item->ID(), |
|
196 | + 'noheader' => true, |
|
197 | + ), PRICING_ADMIN_URL); |
|
198 | + $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' |
|
199 | + . esc_attr__('Delete Price Permanently', 'event_espresso') . '">' |
|
200 | + . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
201 | + } |
|
202 | + } |
|
203 | + } |
|
204 | + |
|
205 | + // Return the name contents |
|
206 | + return sprintf( |
|
207 | + '%1$s <span style="color:silver">(id:%2$s)</span>%3$s', |
|
208 | + $name_link, |
|
209 | + $item->ID(), |
|
210 | + $this->row_actions($actions) |
|
211 | + ); |
|
212 | + } |
|
213 | + |
|
214 | + |
|
215 | + public function column_type($item) |
|
216 | + { |
|
217 | + return $this->_price_types[ $item->type() ]->name(); |
|
218 | + } |
|
219 | + |
|
220 | + |
|
221 | + public function column_description($item) |
|
222 | + { |
|
223 | + return stripslashes($item->desc()); |
|
224 | + } |
|
225 | + |
|
226 | + |
|
227 | + public function column_amount($item) |
|
228 | + { |
|
229 | + if ($this->_price_types[ $item->type() ]->is_percent()) { |
|
230 | + return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>'; |
|
231 | + } else { |
|
232 | + return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>'; |
|
233 | + } |
|
234 | + } |
|
235 | 235 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function __construct($admin_page) |
29 | 29 | { |
30 | 30 | parent::__construct($admin_page); |
31 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
31 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
32 | 32 | $this->_PRT = EEM_Price_Type::instance(); |
33 | 33 | $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted(); |
34 | 34 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $new_row .= ' rowsortable'; |
105 | 105 | } |
106 | 106 | |
107 | - return ' class="' . $new_row . '"'; |
|
107 | + return ' class="'.$new_row.'"'; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | 'action' => 'edit_price', |
136 | 136 | 'id' => $item->ID(), |
137 | 137 | ), PRICING_ADMIN_URL); |
138 | - $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="' |
|
139 | - . esc_attr__('Edit Price', 'event_espresso') . '">' |
|
140 | - . __('Edit', 'event_espresso') . '</a>'; |
|
138 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' |
|
139 | + . esc_attr__('Edit Price', 'event_espresso').'">' |
|
140 | + . __('Edit', 'event_espresso').'</a>'; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | $name_link = EE_Registry::instance()->CAP->current_user_can( |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | 'edit_price', |
146 | 146 | $item->ID() |
147 | 147 | ) |
148 | - ? '<a href="' . $edit_lnk_url . '" title="' |
|
149 | - . esc_attr__('Edit Price', 'event_espresso') . '">' |
|
150 | - . stripslashes($item->name()) . '</a>' |
|
148 | + ? '<a href="'.$edit_lnk_url.'" title="' |
|
149 | + . esc_attr__('Edit Price', 'event_espresso').'">' |
|
150 | + . stripslashes($item->name()).'</a>' |
|
151 | 151 | : $item->name(); |
152 | 152 | |
153 | 153 | if ($item->type_obj()->base_type() !== 1) { |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | 'id' => $item->ID(), |
164 | 164 | 'noheader' => true, |
165 | 165 | ), PRICING_ADMIN_URL); |
166 | - $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' |
|
167 | - . esc_attr__('Move Price to Trash', 'event_espresso') . '">' |
|
168 | - . __('Move to Trash', 'event_espresso') . '</a>'; |
|
166 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' |
|
167 | + . esc_attr__('Move Price to Trash', 'event_espresso').'">' |
|
168 | + . __('Move to Trash', 'event_espresso').'</a>'; |
|
169 | 169 | } |
170 | 170 | } else { |
171 | 171 | if (EE_Registry::instance()->CAP->current_user_can( |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | 'id' => $item->ID(), |
180 | 180 | 'noheader' => true, |
181 | 181 | ), PRICING_ADMIN_URL); |
182 | - $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' |
|
183 | - . esc_attr__('Restore Price', 'event_espresso') . '">' |
|
184 | - . __('Restore', 'event_espresso') . '</a>'; |
|
182 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' |
|
183 | + . esc_attr__('Restore Price', 'event_espresso').'">' |
|
184 | + . __('Restore', 'event_espresso').'</a>'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | // delete price link |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | 'id' => $item->ID(), |
196 | 196 | 'noheader' => true, |
197 | 197 | ), PRICING_ADMIN_URL); |
198 | - $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' |
|
199 | - . esc_attr__('Delete Price Permanently', 'event_espresso') . '">' |
|
200 | - . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
198 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' |
|
199 | + . esc_attr__('Delete Price Permanently', 'event_espresso').'">' |
|
200 | + . __('Delete Permanently', 'event_espresso').'</a>'; |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | public function column_type($item) |
216 | 216 | { |
217 | - return $this->_price_types[ $item->type() ]->name(); |
|
217 | + return $this->_price_types[$item->type()]->name(); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | |
227 | 227 | public function column_amount($item) |
228 | 228 | { |
229 | - if ($this->_price_types[ $item->type() ]->is_percent()) { |
|
230 | - return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>'; |
|
229 | + if ($this->_price_types[$item->type()]->is_percent()) { |
|
230 | + return '<div class="pad-amnt-rght">'.number_format($item->amount(), 1).'%</div>'; |
|
231 | 231 | } else { |
232 | - return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>'; |
|
232 | + return '<div class="pad-amnt-rght">'.EEH_Template::format_currency($item->amount()).'</div>'; |
|
233 | 233 | } |
234 | 234 | } |
235 | 235 | } |