@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
3 | - exit('NO direct script access allowed'); |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -18,64 +18,64 @@ discard block |
||
18 | 18 | class Registration_Form_Questions_Overview_Help_Tour extends EE_Help_Tour |
19 | 19 | { |
20 | 20 | |
21 | - protected function _set_tour_properties() |
|
22 | - { |
|
23 | - $this->_label = __('Questions Overview Tour', 'event_espresso'); |
|
24 | - $this->_slug = $this->_is_caf ? 'questions-overview-caf-joyride' : 'questions-overview-joyride'; |
|
25 | - } |
|
21 | + protected function _set_tour_properties() |
|
22 | + { |
|
23 | + $this->_label = __('Questions Overview Tour', 'event_espresso'); |
|
24 | + $this->_slug = $this->_is_caf ? 'questions-overview-caf-joyride' : 'questions-overview-joyride'; |
|
25 | + } |
|
26 | 26 | |
27 | - protected function _set_tour_stops() |
|
28 | - { |
|
29 | - $this->_stops = array( |
|
30 | - 10 => array( |
|
31 | - 'content' => $this->_start(), |
|
32 | - ), |
|
33 | - 30 => array( |
|
34 | - 'id' => 'display_text', |
|
35 | - 'content' => $this->_display_text_stop(), |
|
36 | - 'options' => array( |
|
37 | - 'tipLocation' => 'top', |
|
38 | - 'tipAdjustmentX' => -5, |
|
39 | - 'tipAdjustmentY' => -25 |
|
40 | - ) |
|
41 | - ), |
|
42 | - 40 => array( |
|
43 | - 'id' => 'admin_label', |
|
44 | - 'content' => $this->_admin_label_stop(), |
|
45 | - 'options' => array( |
|
46 | - 'tipLocation' => 'top', |
|
47 | - 'tipAdjustmentX' => 20, |
|
48 | - 'tipAdjustmentY' => -25 |
|
49 | - ) |
|
50 | - ), |
|
51 | - 50 => array( |
|
52 | - 'id' => 'type', |
|
53 | - 'content' => $this->_type_stop(), |
|
54 | - 'options' => array( |
|
55 | - 'tipLocation' => 'top', |
|
56 | - 'tipAdjustmentX' => -5, |
|
57 | - 'tipAdjustmentY' => -25 |
|
58 | - ) |
|
59 | - ), |
|
60 | - 60 => array( |
|
61 | - 'id' => 'values', |
|
62 | - 'content' => $this->_values_stop(), |
|
63 | - 'options' => array( |
|
64 | - 'tipLocation' => 'top', |
|
65 | - 'tipAdjustmentX' => -5, |
|
66 | - 'tipAdjustmentY' => -25 |
|
67 | - ) |
|
68 | - ), |
|
69 | - 70 => array( |
|
70 | - 'id' => 'required', |
|
71 | - 'content' => $this->_required_stop(), |
|
72 | - 'options' => array( |
|
73 | - 'tipLocation' => 'top', |
|
74 | - 'tipAdjustmentY' => -20, |
|
75 | - 'tipAdjustmentX' => -15 |
|
76 | - ) |
|
77 | - ), |
|
78 | - /*80 => array( |
|
27 | + protected function _set_tour_stops() |
|
28 | + { |
|
29 | + $this->_stops = array( |
|
30 | + 10 => array( |
|
31 | + 'content' => $this->_start(), |
|
32 | + ), |
|
33 | + 30 => array( |
|
34 | + 'id' => 'display_text', |
|
35 | + 'content' => $this->_display_text_stop(), |
|
36 | + 'options' => array( |
|
37 | + 'tipLocation' => 'top', |
|
38 | + 'tipAdjustmentX' => -5, |
|
39 | + 'tipAdjustmentY' => -25 |
|
40 | + ) |
|
41 | + ), |
|
42 | + 40 => array( |
|
43 | + 'id' => 'admin_label', |
|
44 | + 'content' => $this->_admin_label_stop(), |
|
45 | + 'options' => array( |
|
46 | + 'tipLocation' => 'top', |
|
47 | + 'tipAdjustmentX' => 20, |
|
48 | + 'tipAdjustmentY' => -25 |
|
49 | + ) |
|
50 | + ), |
|
51 | + 50 => array( |
|
52 | + 'id' => 'type', |
|
53 | + 'content' => $this->_type_stop(), |
|
54 | + 'options' => array( |
|
55 | + 'tipLocation' => 'top', |
|
56 | + 'tipAdjustmentX' => -5, |
|
57 | + 'tipAdjustmentY' => -25 |
|
58 | + ) |
|
59 | + ), |
|
60 | + 60 => array( |
|
61 | + 'id' => 'values', |
|
62 | + 'content' => $this->_values_stop(), |
|
63 | + 'options' => array( |
|
64 | + 'tipLocation' => 'top', |
|
65 | + 'tipAdjustmentX' => -5, |
|
66 | + 'tipAdjustmentY' => -25 |
|
67 | + ) |
|
68 | + ), |
|
69 | + 70 => array( |
|
70 | + 'id' => 'required', |
|
71 | + 'content' => $this->_required_stop(), |
|
72 | + 'options' => array( |
|
73 | + 'tipLocation' => 'top', |
|
74 | + 'tipAdjustmentY' => -20, |
|
75 | + 'tipAdjustmentX' => -15 |
|
76 | + ) |
|
77 | + ), |
|
78 | + /*80 => array( |
|
79 | 79 | 'class' => 'bulkactions', |
80 | 80 | 'content' => $this->_bulk_actions_stop(), |
81 | 81 | 'options' => array( |
@@ -84,77 +84,77 @@ discard block |
||
84 | 84 | 'tipAdjustmentX' => -15 |
85 | 85 | ) |
86 | 86 | ),*/ |
87 | - 90 => array( |
|
88 | - 'id' => 'event-espresso_page_espresso_registration_form-search-input', |
|
89 | - 'content' => $this->_search_stop(), |
|
90 | - 'options' => array( |
|
91 | - 'tipLocation' => 'left', |
|
92 | - 'tipAdjustmentY' => -50, |
|
93 | - 'tipAdjustmentX' => -15 |
|
94 | - ) |
|
95 | - ), |
|
96 | - 100 => array( |
|
97 | - 'id' => 'add-new-question', |
|
98 | - 'content' => $this->_add_new_question_stop(), |
|
99 | - 'options' => array( |
|
100 | - 'tipLocation' => 'right', |
|
101 | - 'tipAdjustmentY' => -50, |
|
102 | - 'tipAdjustmentX' => 15 |
|
103 | - ) |
|
104 | - ), |
|
105 | - ); |
|
106 | - } |
|
87 | + 90 => array( |
|
88 | + 'id' => 'event-espresso_page_espresso_registration_form-search-input', |
|
89 | + 'content' => $this->_search_stop(), |
|
90 | + 'options' => array( |
|
91 | + 'tipLocation' => 'left', |
|
92 | + 'tipAdjustmentY' => -50, |
|
93 | + 'tipAdjustmentX' => -15 |
|
94 | + ) |
|
95 | + ), |
|
96 | + 100 => array( |
|
97 | + 'id' => 'add-new-question', |
|
98 | + 'content' => $this->_add_new_question_stop(), |
|
99 | + 'options' => array( |
|
100 | + 'tipLocation' => 'right', |
|
101 | + 'tipAdjustmentY' => -50, |
|
102 | + 'tipAdjustmentX' => 15 |
|
103 | + ) |
|
104 | + ), |
|
105 | + ); |
|
106 | + } |
|
107 | 107 | |
108 | 108 | |
109 | - protected function _start() |
|
110 | - { |
|
111 | - $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
112 | - $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | - 'event_espresso') . '</p>'; |
|
109 | + protected function _start() |
|
110 | + { |
|
111 | + $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
112 | + $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | + 'event_espresso') . '</p>'; |
|
114 | 114 | |
115 | - return $content; |
|
116 | - } |
|
115 | + return $content; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _display_text_stop() |
|
119 | - { |
|
120 | - return '<p>' . __('View available questions.', 'event_espresso') . '</p>'; |
|
121 | - } |
|
118 | + protected function _display_text_stop() |
|
119 | + { |
|
120 | + return '<p>' . __('View available questions.', 'event_espresso') . '</p>'; |
|
121 | + } |
|
122 | 122 | |
123 | - protected function _admin_label_stop() |
|
124 | - { |
|
125 | - return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
126 | - } |
|
123 | + protected function _admin_label_stop() |
|
124 | + { |
|
125 | + return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
126 | + } |
|
127 | 127 | |
128 | - protected function _type_stop() |
|
129 | - { |
|
130 | - return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
131 | - 'event_espresso') . '</p>'; |
|
132 | - } |
|
128 | + protected function _type_stop() |
|
129 | + { |
|
130 | + return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
131 | + 'event_espresso') . '</p>'; |
|
132 | + } |
|
133 | 133 | |
134 | - protected function _values_stop() |
|
135 | - { |
|
136 | - return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', |
|
137 | - 'event_espresso') . '</p>'; |
|
138 | - } |
|
134 | + protected function _values_stop() |
|
135 | + { |
|
136 | + return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', |
|
137 | + 'event_espresso') . '</p>'; |
|
138 | + } |
|
139 | 139 | |
140 | - protected function _required_stop() |
|
141 | - { |
|
142 | - return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
143 | - } |
|
140 | + protected function _required_stop() |
|
141 | + { |
|
142 | + return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
143 | + } |
|
144 | 144 | |
145 | - /* protected function _bulk_actions_stop() { |
|
145 | + /* protected function _bulk_actions_stop() { |
|
146 | 146 | return '<p>' . __('Perform bulk actions to multiple questions.', 'event_espresso') . '</p>'; |
147 | 147 | } */ |
148 | 148 | |
149 | - protected function _search_stop() |
|
150 | - { |
|
151 | - return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
152 | - 'event_espresso') . '</p>'; |
|
153 | - } |
|
149 | + protected function _search_stop() |
|
150 | + { |
|
151 | + return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
152 | + 'event_espresso') . '</p>'; |
|
153 | + } |
|
154 | 154 | |
155 | - protected function _add_new_question_stop() |
|
156 | - { |
|
157 | - return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
158 | - } |
|
155 | + protected function _add_new_question_stop() |
|
156 | + { |
|
157 | + return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
158 | + } |
|
159 | 159 | |
160 | 160 | } |
161 | 161 | \ No newline at end of file |
@@ -108,38 +108,38 @@ discard block |
||
108 | 108 | |
109 | 109 | protected function _start() |
110 | 110 | { |
111 | - $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
112 | - $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | - 'event_espresso') . '</p>'; |
|
111 | + $content = '<h3>'.__('Questions Overview', 'event_espresso').'</h3>'; |
|
112 | + $content .= '<p>'.__('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | + 'event_espresso').'</p>'; |
|
114 | 114 | |
115 | 115 | return $content; |
116 | 116 | } |
117 | 117 | |
118 | 118 | protected function _display_text_stop() |
119 | 119 | { |
120 | - return '<p>' . __('View available questions.', 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('View available questions.', 'event_espresso').'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _admin_label_stop() |
124 | 124 | { |
125 | - return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
125 | + return '<p>'.__('View the admin label for your questions.', 'event_espresso').'</p>'; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | protected function _type_stop() |
129 | 129 | { |
130 | - return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
131 | - 'event_espresso') . '</p>'; |
|
130 | + return '<p>'.__('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
131 | + 'event_espresso').'</p>'; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | protected function _values_stop() |
135 | 135 | { |
136 | - return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', |
|
137 | - 'event_espresso') . '</p>'; |
|
136 | + return '<p>'.__('View stored values for checkboxes, radio buttons, and select boxes.', |
|
137 | + 'event_espresso').'</p>'; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | protected function _required_stop() |
141 | 141 | { |
142 | - return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
142 | + return '<p>'.__('View if a question is required.', 'event_espresso').'</p>'; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /* protected function _bulk_actions_stop() { |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | |
149 | 149 | protected function _search_stop() |
150 | 150 | { |
151 | - return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
152 | - 'event_espresso') . '</p>'; |
|
151 | + return '<p>'.__('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
152 | + 'event_espresso').'</p>'; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | protected function _add_new_question_stop() |
156 | 156 | { |
157 | - return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
157 | + return '<p>'.__('Click here to add a new question.', 'event_espresso').'</p>'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | } |
161 | 161 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * Returns the name of the model(s) pointed to |
36 | 36 | * |
37 | 37 | * @deprecated since version 4.6.7 |
38 | - * @return mixed string or array of strings |
|
38 | + * @return string string or array of strings |
|
39 | 39 | */ |
40 | 40 | function get_model_name_pointed_to() |
41 | 41 | { |
@@ -8,83 +8,83 @@ |
||
8 | 8 | */ |
9 | 9 | abstract class EE_Field_With_Model_Name extends EE_Model_Field_Base |
10 | 10 | { |
11 | - /** |
|
12 | - * Usually the name of a single model. However, as in the case for custom post types, |
|
13 | - * it can actually be an array of models |
|
14 | - * |
|
15 | - * @var string or array |
|
16 | - */ |
|
17 | - protected $_model_name_pointed_to; |
|
11 | + /** |
|
12 | + * Usually the name of a single model. However, as in the case for custom post types, |
|
13 | + * it can actually be an array of models |
|
14 | + * |
|
15 | + * @var string or array |
|
16 | + */ |
|
17 | + protected $_model_name_pointed_to; |
|
18 | 18 | |
19 | - /** |
|
20 | - * @param string $table_column name fo column for field |
|
21 | - * @param string $nicename should eb internationalized with __('blah','event_espresso') |
|
22 | - * @param boolean $nullable |
|
23 | - * @param mixed $default_value if this is a integer field, it shoudl be an int. if it's a string field, it shoul |
|
24 | - * dbe a string |
|
25 | - * @param string $model_name eg 'Event','Answer','Term', etc. Basically its the model class's name without the |
|
26 | - * "EEM_" |
|
27 | - */ |
|
28 | - function __construct($table_column, $nicename, $nullable, $default_value, $model_name) |
|
29 | - { |
|
30 | - $this->_model_name_pointed_to = $model_name; |
|
31 | - parent::__construct($table_column, $nicename, $nullable, $default_value); |
|
32 | - } |
|
19 | + /** |
|
20 | + * @param string $table_column name fo column for field |
|
21 | + * @param string $nicename should eb internationalized with __('blah','event_espresso') |
|
22 | + * @param boolean $nullable |
|
23 | + * @param mixed $default_value if this is a integer field, it shoudl be an int. if it's a string field, it shoul |
|
24 | + * dbe a string |
|
25 | + * @param string $model_name eg 'Event','Answer','Term', etc. Basically its the model class's name without the |
|
26 | + * "EEM_" |
|
27 | + */ |
|
28 | + function __construct($table_column, $nicename, $nullable, $default_value, $model_name) |
|
29 | + { |
|
30 | + $this->_model_name_pointed_to = $model_name; |
|
31 | + parent::__construct($table_column, $nicename, $nullable, $default_value); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Returns the name of the model(s) pointed to |
|
36 | - * |
|
37 | - * @deprecated since version 4.6.7 |
|
38 | - * @return mixed string or array of strings |
|
39 | - */ |
|
40 | - function get_model_name_pointed_to() |
|
41 | - { |
|
42 | - EE_Error::doing_it_wrong('get_model_name_pointed_to', |
|
43 | - __('This method has been deprecated in favour of instead using get_model_names_pointed_to, which consistently returns an array', |
|
44 | - 'event_espresso'), '4.6.7'); |
|
45 | - return $this->_model_name_pointed_to; |
|
46 | - } |
|
34 | + /** |
|
35 | + * Returns the name of the model(s) pointed to |
|
36 | + * |
|
37 | + * @deprecated since version 4.6.7 |
|
38 | + * @return mixed string or array of strings |
|
39 | + */ |
|
40 | + function get_model_name_pointed_to() |
|
41 | + { |
|
42 | + EE_Error::doing_it_wrong('get_model_name_pointed_to', |
|
43 | + __('This method has been deprecated in favour of instead using get_model_names_pointed_to, which consistently returns an array', |
|
44 | + 'event_espresso'), '4.6.7'); |
|
45 | + return $this->_model_name_pointed_to; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Gets the model names pointed to by this field, always as an array |
|
50 | - * (even if there's only one) |
|
51 | - * |
|
52 | - * @return array of model names pointed to by this field |
|
53 | - */ |
|
54 | - function get_model_names_pointed_to() |
|
55 | - { |
|
56 | - if (is_array($this->_model_name_pointed_to)) { |
|
57 | - return $this->_model_name_pointed_to; |
|
58 | - } else { |
|
59 | - return array($this->_model_name_pointed_to); |
|
60 | - } |
|
61 | - } |
|
48 | + /** |
|
49 | + * Gets the model names pointed to by this field, always as an array |
|
50 | + * (even if there's only one) |
|
51 | + * |
|
52 | + * @return array of model names pointed to by this field |
|
53 | + */ |
|
54 | + function get_model_names_pointed_to() |
|
55 | + { |
|
56 | + if (is_array($this->_model_name_pointed_to)) { |
|
57 | + return $this->_model_name_pointed_to; |
|
58 | + } else { |
|
59 | + return array($this->_model_name_pointed_to); |
|
60 | + } |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Returns the model's classname (eg EE_Event instead of just Event) |
|
65 | - * |
|
66 | - * @return array |
|
67 | - */ |
|
68 | - function get_model_class_names_pointed_to() |
|
69 | - { |
|
70 | - $model_names = array(); |
|
71 | - if (is_array($this->_model_name_pointed_to)) { |
|
72 | - foreach ($this->_model_name_pointed_to as $model_name) { |
|
73 | - $model_names[] = "EE_" . $model_name; |
|
74 | - } |
|
75 | - } else { |
|
76 | - $model_names = array("EE_" . $this->_model_name_pointed_to); |
|
77 | - } |
|
78 | - return $model_names; |
|
79 | - } |
|
63 | + /** |
|
64 | + * Returns the model's classname (eg EE_Event instead of just Event) |
|
65 | + * |
|
66 | + * @return array |
|
67 | + */ |
|
68 | + function get_model_class_names_pointed_to() |
|
69 | + { |
|
70 | + $model_names = array(); |
|
71 | + if (is_array($this->_model_name_pointed_to)) { |
|
72 | + foreach ($this->_model_name_pointed_to as $model_name) { |
|
73 | + $model_names[] = "EE_" . $model_name; |
|
74 | + } |
|
75 | + } else { |
|
76 | + $model_names = array("EE_" . $this->_model_name_pointed_to); |
|
77 | + } |
|
78 | + return $model_names; |
|
79 | + } |
|
80 | 80 | |
81 | - function is_model_obj_of_type_pointed_to($model_obj_or_ID) |
|
82 | - { |
|
83 | - foreach ($this->get_model_class_names_pointed_to() as $model_obj_classname) { |
|
84 | - if ($model_obj_or_ID instanceof $model_obj_classname) { |
|
85 | - return true; |
|
86 | - } |
|
87 | - } |
|
88 | - return false; |
|
89 | - } |
|
81 | + function is_model_obj_of_type_pointed_to($model_obj_or_ID) |
|
82 | + { |
|
83 | + foreach ($this->get_model_class_names_pointed_to() as $model_obj_classname) { |
|
84 | + if ($model_obj_or_ID instanceof $model_obj_classname) { |
|
85 | + return true; |
|
86 | + } |
|
87 | + } |
|
88 | + return false; |
|
89 | + } |
|
90 | 90 | } |
@@ -70,10 +70,10 @@ |
||
70 | 70 | $model_names = array(); |
71 | 71 | if (is_array($this->_model_name_pointed_to)) { |
72 | 72 | foreach ($this->_model_name_pointed_to as $model_name) { |
73 | - $model_names[] = "EE_" . $model_name; |
|
73 | + $model_names[] = "EE_".$model_name; |
|
74 | 74 | } |
75 | 75 | } else { |
76 | - $model_names = array("EE_" . $this->_model_name_pointed_to); |
|
76 | + $model_names = array("EE_".$this->_model_name_pointed_to); |
|
77 | 77 | } |
78 | 78 | return $model_names; |
79 | 79 | } |
@@ -7,6 +7,7 @@ |
||
7 | 7 | * |
8 | 8 | * @param string $table_column |
9 | 9 | * @param string $nicename |
10 | + * @param integer|null $default |
|
10 | 11 | */ |
11 | 12 | public function __construct($table_column, $nicename, $default) |
12 | 13 | { |
@@ -2,24 +2,24 @@ |
||
2 | 2 | |
3 | 3 | abstract class EE_Primary_Key_Field_Base extends EE_Field_With_Model_Name |
4 | 4 | { |
5 | - /** |
|
6 | - * Overrides parent so it doesn't need to provide so many non-applicable fields |
|
7 | - * |
|
8 | - * @param string $table_column |
|
9 | - * @param string $nicename |
|
10 | - */ |
|
11 | - public function __construct($table_column, $nicename, $default) |
|
12 | - { |
|
13 | - parent::__construct($table_column, $nicename, false, $default, null); |
|
14 | - } |
|
5 | + /** |
|
6 | + * Overrides parent so it doesn't need to provide so many non-applicable fields |
|
7 | + * |
|
8 | + * @param string $table_column |
|
9 | + * @param string $nicename |
|
10 | + */ |
|
11 | + public function __construct($table_column, $nicename, $default) |
|
12 | + { |
|
13 | + parent::__construct($table_column, $nicename, false, $default, null); |
|
14 | + } |
|
15 | 15 | |
16 | - /** |
|
17 | - * @param $table_alias |
|
18 | - * @param $name |
|
19 | - */ |
|
20 | - function _construct_finalize($table_alias, $name, $model_name) |
|
21 | - { |
|
22 | - $this->_model_name_pointed_to = $model_name; |
|
23 | - parent::_construct_finalize($table_alias, $name, $model_name); |
|
24 | - } |
|
16 | + /** |
|
17 | + * @param $table_alias |
|
18 | + * @param $name |
|
19 | + */ |
|
20 | + function _construct_finalize($table_alias, $name, $model_name) |
|
21 | + { |
|
22 | + $this->_model_name_pointed_to = $model_name; |
|
23 | + parent::_construct_finalize($table_alias, $name, $model_name); |
|
24 | + } |
|
25 | 25 | } |
@@ -33,8 +33,6 @@ |
||
33 | 33 | * ) |
34 | 34 | * ) |
35 | 35 | * @link http://codex.wordpress.org/Function_Reference/register_post_status for more info |
36 | - * @param boolean $store_in_db_as_int By default, enums are stored as STRINGS in the DB. However, if this var is |
|
37 | - * set to true, it will be stored as an INT |
|
38 | 36 | */ |
39 | 37 | function __construct($table_column, $nicename, $nullable, $default_value, $new_stati = array()) |
40 | 38 | { |
@@ -4,116 +4,116 @@ |
||
4 | 4 | class EE_WP_Post_Status_Field extends EE_Enum_Text_Field |
5 | 5 | { |
6 | 6 | |
7 | - protected $_wp_post_stati; |
|
8 | - |
|
9 | - |
|
10 | - /** |
|
11 | - * constructor |
|
12 | - * |
|
13 | - * @param string $table_column column on table |
|
14 | - * @param string $nicename nice name for column(field) |
|
15 | - * @param bool $nullable is this field nullable |
|
16 | - * @param string $default_value default status |
|
17 | - * @param array $new_stati If additional stati are to be used other than the default WP statuses then |
|
18 | - * they can be registered via this property. The format of the array should be |
|
19 | - * as follows: array( |
|
20 | - * 'status_reference' => array( |
|
21 | - * 'label' => __('Status Reference Label', 'event_espresso') |
|
22 | - * 'public' => true, //'Whether posts of this status should be shown on the |
|
23 | - * frontend of the site' |
|
24 | - * 'exclude_from_search' => false, //'Whether posts of this status should be |
|
25 | - * excluded from wp searches' |
|
26 | - * 'show_in_admin_all_list' => true, //whether posts of this status are included |
|
27 | - * in queries for the admin "all" view in list table views. |
|
28 | - * 'show_in_admin_status_list' => true, //Show in the list of statuses with post |
|
29 | - * counts at the top of the admin list tables (i.e. Status Reference(2) ) |
|
30 | - * 'label_count' => _n_noop( 'Status Reference <span class="count">(%s)</span>', |
|
31 | - * 'Status References <span class="count">(%s)</span>' ), //the text to display |
|
32 | - * on the admin screen( or you won't see your status count ). |
|
33 | - * ) |
|
34 | - * ) |
|
35 | - * @link http://codex.wordpress.org/Function_Reference/register_post_status for more info |
|
36 | - * @param boolean $store_in_db_as_int By default, enums are stored as STRINGS in the DB. However, if this var is |
|
37 | - * set to true, it will be stored as an INT |
|
38 | - */ |
|
39 | - function __construct($table_column, $nicename, $nullable, $default_value, $new_stati = array()) |
|
40 | - { |
|
41 | - $this->_register_new_stati($new_stati); |
|
42 | - $this->_set_allowed_enum_values(); |
|
43 | - parent::__construct($table_column, $nicename, $nullable, $default_value, $this->_allowed_enum_values); |
|
44 | - } |
|
45 | - |
|
46 | - |
|
47 | - /** |
|
48 | - * This registers any new statuses sent via the $new_stati array on construct |
|
49 | - * |
|
50 | - * @access protected |
|
51 | - * @param array $new_stati statuses |
|
52 | - * @return void |
|
53 | - */ |
|
54 | - protected function _register_new_stati($new_stati) |
|
55 | - { |
|
56 | - |
|
57 | - foreach ((array)$new_stati as $status_key => $status_args) { |
|
58 | - $args = array( |
|
59 | - 'label' => isset($status_args['label']) ? $status_args['label'] : $status_key, |
|
60 | - 'public' => isset($status_args['public']) && is_bool($status_args['public']) ? $status_args['public'] : true, |
|
61 | - 'exclude_from_search' => isset($status_args['exclude_from_search']) && is_bool($status_args['exclude_from_search']) ? $status_args['exclude_from_search'] : false, |
|
62 | - 'show_in_admin_all_list' => isset($status_args['show_in_admin_all_list']) && is_bool($status_args['show_in_admin_all_list']) ? $status_args['show_in_admin_all_list'] : false, |
|
63 | - 'show_in_admin_status_list' => isset($status_args['show_in_admin_status_list']) && is_bool($status_args['show_in_admin_status_list']) ? $status_args['show_in_admin_status_list'] : true, |
|
64 | - 'label_count' => isset($status_args['label_count']) ? $status_args['label_count'] : '', |
|
65 | - ); |
|
66 | - register_post_status($status_key, $status_args); |
|
67 | - } |
|
68 | - |
|
69 | - } |
|
70 | - |
|
71 | - |
|
72 | - /** |
|
73 | - * This sets the _allowed_enum_values property using the $wp_post_stati array |
|
74 | - * |
|
75 | - * @access protected |
|
76 | - * @regurn void |
|
77 | - */ |
|
78 | - protected function _set_allowed_enum_values() |
|
79 | - { |
|
80 | - //first let's get the post_statuses |
|
81 | - global $wp_post_statuses; |
|
82 | - $this->_wp_post_stati = $wp_post_statuses; |
|
83 | - |
|
84 | - foreach ($this->_wp_post_stati as $post_status => $args_object) { |
|
85 | - $this->_allowed_enum_values[$post_status] = $args_object->label; |
|
86 | - } |
|
87 | - |
|
88 | - } |
|
89 | - |
|
90 | - /** |
|
91 | - * Before calling parent, first double-checks our list of acceptable post |
|
92 | - * types is up-to-date |
|
93 | - * |
|
94 | - * @param string $value_inputted_for_field_on_model_object |
|
95 | - * @return string |
|
96 | - */ |
|
97 | - public function prepare_for_set($value_inputted_for_field_on_model_object) |
|
98 | - { |
|
99 | - $this->_set_allowed_enum_values(); |
|
100 | - return parent::prepare_for_set($value_inputted_for_field_on_model_object); |
|
101 | - } |
|
102 | - |
|
103 | - |
|
104 | - |
|
105 | - //helper methods for getting various $wp_post_statuses stuff. |
|
106 | - |
|
107 | - /** |
|
108 | - * This just returns the status object for the given status |
|
109 | - * |
|
110 | - * @access public |
|
111 | - * @see wp_register_post_status in wp-includes/post.php for a list of properties of the status object |
|
112 | - * @param string $status What status object you want |
|
113 | - * @return std_object the status object or FALSE if it doesn't exist. |
|
114 | - */ |
|
115 | - public function get_status_object($status) |
|
116 | - { |
|
117 | - return isset($this->_wp_post_stati[$status]) ? $this->_wp_post_stati[$status] : false; |
|
118 | - } |
|
7 | + protected $_wp_post_stati; |
|
8 | + |
|
9 | + |
|
10 | + /** |
|
11 | + * constructor |
|
12 | + * |
|
13 | + * @param string $table_column column on table |
|
14 | + * @param string $nicename nice name for column(field) |
|
15 | + * @param bool $nullable is this field nullable |
|
16 | + * @param string $default_value default status |
|
17 | + * @param array $new_stati If additional stati are to be used other than the default WP statuses then |
|
18 | + * they can be registered via this property. The format of the array should be |
|
19 | + * as follows: array( |
|
20 | + * 'status_reference' => array( |
|
21 | + * 'label' => __('Status Reference Label', 'event_espresso') |
|
22 | + * 'public' => true, //'Whether posts of this status should be shown on the |
|
23 | + * frontend of the site' |
|
24 | + * 'exclude_from_search' => false, //'Whether posts of this status should be |
|
25 | + * excluded from wp searches' |
|
26 | + * 'show_in_admin_all_list' => true, //whether posts of this status are included |
|
27 | + * in queries for the admin "all" view in list table views. |
|
28 | + * 'show_in_admin_status_list' => true, //Show in the list of statuses with post |
|
29 | + * counts at the top of the admin list tables (i.e. Status Reference(2) ) |
|
30 | + * 'label_count' => _n_noop( 'Status Reference <span class="count">(%s)</span>', |
|
31 | + * 'Status References <span class="count">(%s)</span>' ), //the text to display |
|
32 | + * on the admin screen( or you won't see your status count ). |
|
33 | + * ) |
|
34 | + * ) |
|
35 | + * @link http://codex.wordpress.org/Function_Reference/register_post_status for more info |
|
36 | + * @param boolean $store_in_db_as_int By default, enums are stored as STRINGS in the DB. However, if this var is |
|
37 | + * set to true, it will be stored as an INT |
|
38 | + */ |
|
39 | + function __construct($table_column, $nicename, $nullable, $default_value, $new_stati = array()) |
|
40 | + { |
|
41 | + $this->_register_new_stati($new_stati); |
|
42 | + $this->_set_allowed_enum_values(); |
|
43 | + parent::__construct($table_column, $nicename, $nullable, $default_value, $this->_allowed_enum_values); |
|
44 | + } |
|
45 | + |
|
46 | + |
|
47 | + /** |
|
48 | + * This registers any new statuses sent via the $new_stati array on construct |
|
49 | + * |
|
50 | + * @access protected |
|
51 | + * @param array $new_stati statuses |
|
52 | + * @return void |
|
53 | + */ |
|
54 | + protected function _register_new_stati($new_stati) |
|
55 | + { |
|
56 | + |
|
57 | + foreach ((array)$new_stati as $status_key => $status_args) { |
|
58 | + $args = array( |
|
59 | + 'label' => isset($status_args['label']) ? $status_args['label'] : $status_key, |
|
60 | + 'public' => isset($status_args['public']) && is_bool($status_args['public']) ? $status_args['public'] : true, |
|
61 | + 'exclude_from_search' => isset($status_args['exclude_from_search']) && is_bool($status_args['exclude_from_search']) ? $status_args['exclude_from_search'] : false, |
|
62 | + 'show_in_admin_all_list' => isset($status_args['show_in_admin_all_list']) && is_bool($status_args['show_in_admin_all_list']) ? $status_args['show_in_admin_all_list'] : false, |
|
63 | + 'show_in_admin_status_list' => isset($status_args['show_in_admin_status_list']) && is_bool($status_args['show_in_admin_status_list']) ? $status_args['show_in_admin_status_list'] : true, |
|
64 | + 'label_count' => isset($status_args['label_count']) ? $status_args['label_count'] : '', |
|
65 | + ); |
|
66 | + register_post_status($status_key, $status_args); |
|
67 | + } |
|
68 | + |
|
69 | + } |
|
70 | + |
|
71 | + |
|
72 | + /** |
|
73 | + * This sets the _allowed_enum_values property using the $wp_post_stati array |
|
74 | + * |
|
75 | + * @access protected |
|
76 | + * @regurn void |
|
77 | + */ |
|
78 | + protected function _set_allowed_enum_values() |
|
79 | + { |
|
80 | + //first let's get the post_statuses |
|
81 | + global $wp_post_statuses; |
|
82 | + $this->_wp_post_stati = $wp_post_statuses; |
|
83 | + |
|
84 | + foreach ($this->_wp_post_stati as $post_status => $args_object) { |
|
85 | + $this->_allowed_enum_values[$post_status] = $args_object->label; |
|
86 | + } |
|
87 | + |
|
88 | + } |
|
89 | + |
|
90 | + /** |
|
91 | + * Before calling parent, first double-checks our list of acceptable post |
|
92 | + * types is up-to-date |
|
93 | + * |
|
94 | + * @param string $value_inputted_for_field_on_model_object |
|
95 | + * @return string |
|
96 | + */ |
|
97 | + public function prepare_for_set($value_inputted_for_field_on_model_object) |
|
98 | + { |
|
99 | + $this->_set_allowed_enum_values(); |
|
100 | + return parent::prepare_for_set($value_inputted_for_field_on_model_object); |
|
101 | + } |
|
102 | + |
|
103 | + |
|
104 | + |
|
105 | + //helper methods for getting various $wp_post_statuses stuff. |
|
106 | + |
|
107 | + /** |
|
108 | + * This just returns the status object for the given status |
|
109 | + * |
|
110 | + * @access public |
|
111 | + * @see wp_register_post_status in wp-includes/post.php for a list of properties of the status object |
|
112 | + * @param string $status What status object you want |
|
113 | + * @return std_object the status object or FALSE if it doesn't exist. |
|
114 | + */ |
|
115 | + public function get_status_object($status) |
|
116 | + { |
|
117 | + return isset($this->_wp_post_stati[$status]) ? $this->_wp_post_stati[$status] : false; |
|
118 | + } |
|
119 | 119 | } |
120 | 120 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_Enum_Text_Field.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_Enum_Text_Field.php'); |
|
3 | 3 | |
4 | 4 | class EE_WP_Post_Status_Field extends EE_Enum_Text_Field |
5 | 5 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | protected function _register_new_stati($new_stati) |
55 | 55 | { |
56 | 56 | |
57 | - foreach ((array)$new_stati as $status_key => $status_args) { |
|
57 | + foreach ((array) $new_stati as $status_key => $status_args) { |
|
58 | 58 | $args = array( |
59 | 59 | 'label' => isset($status_args['label']) ? $status_args['label'] : $status_key, |
60 | 60 | 'public' => isset($status_args['public']) && is_bool($status_args['public']) ? $status_args['public'] : true, |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_Foreign_Key_Field_Base.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_Foreign_Key_Field_Base.php'); |
|
3 | 3 | |
4 | 4 | class EE_Foreign_Key_String_Field extends EE_Foreign_Key_Field_Base |
5 | 5 | { |
@@ -4,17 +4,17 @@ |
||
4 | 4 | class EE_Foreign_Key_String_Field extends EE_Foreign_Key_Field_Base |
5 | 5 | { |
6 | 6 | |
7 | - /** |
|
8 | - * removes all tags when setting |
|
9 | - * |
|
10 | - * @param string $value_inputted_for_field_on_model_object |
|
11 | - * @return string |
|
12 | - */ |
|
13 | - function prepare_for_set($value_inputted_for_field_on_model_object) |
|
14 | - { |
|
15 | - if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) { |
|
16 | - $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID(); |
|
17 | - } |
|
18 | - return strtoupper(wp_strip_all_tags($value_inputted_for_field_on_model_object)); |
|
19 | - } |
|
7 | + /** |
|
8 | + * removes all tags when setting |
|
9 | + * |
|
10 | + * @param string $value_inputted_for_field_on_model_object |
|
11 | + * @return string |
|
12 | + */ |
|
13 | + function prepare_for_set($value_inputted_for_field_on_model_object) |
|
14 | + { |
|
15 | + if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) { |
|
16 | + $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID(); |
|
17 | + } |
|
18 | + return strtoupper(wp_strip_all_tags($value_inputted_for_field_on_model_object)); |
|
19 | + } |
|
20 | 20 | } |
21 | 21 | \ No newline at end of file |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | class EE_Trashed_Flag_Field extends EE_Boolean_Field |
5 | 5 | { |
6 | - //note: some client code simply checks if a field IS an EE_Trashed_Flag_Field |
|
7 | - //...otherwise, these fields are mostly the same as boolean fields |
|
6 | + //note: some client code simply checks if a field IS an EE_Trashed_Flag_Field |
|
7 | + //...otherwise, these fields are mostly the same as boolean fields |
|
8 | 8 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_Boolean_Field.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_Boolean_Field.php'); |
|
3 | 3 | |
4 | 4 | class EE_Trashed_Flag_Field extends EE_Boolean_Field |
5 | 5 | { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once(EE_MODELS . 'fields/EE_DB_Only_Field_Base.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_DB_Only_Field_Base.php'); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Used by EE_Belongs_To_Any_Relations and EE_Has_Many_Any_Relations to identify the model the foreign key points to. |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php if (! defined('EVENT_ESPRESSO_VERSION')) { |
2 | - exit('No direct script access allowed'); |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | |
5 | 5 | /** |
@@ -24,34 +24,34 @@ discard block |
||
24 | 24 | */ |
25 | 25 | class EE_WP_User_Field extends EE_Foreign_Key_Int_Field |
26 | 26 | { |
27 | - /** |
|
28 | - * No need to provide a default or the model pointed to- the default is |
|
29 | - * always get_current_user_id() and the model pointed to is always WP_User |
|
30 | - * |
|
31 | - * @param string $table_column name fo column for field |
|
32 | - * @param string $nicename should eb internationalized with __('blah','event_espresso') |
|
33 | - * @param boolean $nullable |
|
34 | - */ |
|
35 | - function __construct($table_column, $nicename, $nullable) |
|
36 | - { |
|
37 | - parent::__construct($table_column, $nicename, $nullable, null, 'WP_User'); |
|
38 | - } |
|
27 | + /** |
|
28 | + * No need to provide a default or the model pointed to- the default is |
|
29 | + * always get_current_user_id() and the model pointed to is always WP_User |
|
30 | + * |
|
31 | + * @param string $table_column name fo column for field |
|
32 | + * @param string $nicename should eb internationalized with __('blah','event_espresso') |
|
33 | + * @param boolean $nullable |
|
34 | + */ |
|
35 | + function __construct($table_column, $nicename, $nullable) |
|
36 | + { |
|
37 | + parent::__construct($table_column, $nicename, $nullable, null, 'WP_User'); |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * Gets the default which is always the current user. This can't be set when initially |
|
42 | - * constructing the model field because that's done before $current_user is set |
|
43 | - * |
|
44 | - * @return mixed |
|
45 | - */ |
|
46 | - function get_default_value() |
|
47 | - { |
|
48 | - if (did_action('init')) { |
|
49 | - return get_current_user_id(); |
|
50 | - } else { |
|
51 | - EE_Error::doing_it_wrong('EE_WP_User_Field::get_default_value', |
|
52 | - __('You cant get a default value for a wp_User_Field because the "init" action is called, because current_user global hasnt yet been setup. Consider doing your business logic on the "init" hook or later.', |
|
53 | - 'event_espresso'), '4.6.20'); |
|
54 | - return 1; |
|
55 | - } |
|
56 | - } |
|
40 | + /** |
|
41 | + * Gets the default which is always the current user. This can't be set when initially |
|
42 | + * constructing the model field because that's done before $current_user is set |
|
43 | + * |
|
44 | + * @return mixed |
|
45 | + */ |
|
46 | + function get_default_value() |
|
47 | + { |
|
48 | + if (did_action('init')) { |
|
49 | + return get_current_user_id(); |
|
50 | + } else { |
|
51 | + EE_Error::doing_it_wrong('EE_WP_User_Field::get_default_value', |
|
52 | + __('You cant get a default value for a wp_User_Field because the "init" action is called, because current_user global hasnt yet been setup. Consider doing your business logic on the "init" hook or later.', |
|
53 | + 'event_espresso'), '4.6.20'); |
|
54 | + return 1; |
|
55 | + } |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if (! defined('EVENT_ESPRESSO_VERSION')) { |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | 2 | exit('No direct script access allowed'); |
3 | 3 | } |
4 | 4 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php if (! defined('EVENT_ESPRESSO_VERSION')) { |
2 | - exit('No direct script access allowed'); |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | |
5 | 5 | /** |
@@ -14,56 +14,56 @@ discard block |
||
14 | 14 | */ |
15 | 15 | class EE_Maybe_Serialized_Simple_HTML_Field extends EE_Maybe_Serialized_Text_Field |
16 | 16 | { |
17 | - /** |
|
18 | - * removes all non-basic tags when setting |
|
19 | - * |
|
20 | - * @param string $value_inputted_for_field_on_model_object |
|
21 | - * @return string |
|
22 | - */ |
|
23 | - function prepare_for_set($value_inputted_for_field_on_model_object) |
|
24 | - { |
|
25 | - return parent::prepare_for_set($this->_remove_tags($value_inputted_for_field_on_model_object)); |
|
26 | - } |
|
17 | + /** |
|
18 | + * removes all non-basic tags when setting |
|
19 | + * |
|
20 | + * @param string $value_inputted_for_field_on_model_object |
|
21 | + * @return string |
|
22 | + */ |
|
23 | + function prepare_for_set($value_inputted_for_field_on_model_object) |
|
24 | + { |
|
25 | + return parent::prepare_for_set($this->_remove_tags($value_inputted_for_field_on_model_object)); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Remove any non-"simple" html tags. @see EE_Simple_HTML_Field |
|
30 | - * |
|
31 | - * @param array|string $value |
|
32 | - * @return array|string |
|
33 | - */ |
|
34 | - protected function _remove_tags($value) |
|
35 | - { |
|
36 | - if (is_array($value)) { |
|
37 | - foreach ($value as $key => $v) { |
|
38 | - $value[$key] = $this->_remove_tags($v); |
|
39 | - } |
|
40 | - } elseif (is_string($value)) { |
|
41 | - $value = wp_kses("$value", $this->_get_allowed_tags()); |
|
42 | - } |
|
43 | - return $value; |
|
44 | - } |
|
28 | + /** |
|
29 | + * Remove any non-"simple" html tags. @see EE_Simple_HTML_Field |
|
30 | + * |
|
31 | + * @param array|string $value |
|
32 | + * @return array|string |
|
33 | + */ |
|
34 | + protected function _remove_tags($value) |
|
35 | + { |
|
36 | + if (is_array($value)) { |
|
37 | + foreach ($value as $key => $v) { |
|
38 | + $value[$key] = $this->_remove_tags($v); |
|
39 | + } |
|
40 | + } elseif (is_string($value)) { |
|
41 | + $value = wp_kses("$value", $this->_get_allowed_tags()); |
|
42 | + } |
|
43 | + return $value; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * In case unsafe data somehow got inserted into the database, we want to remove tags again |
|
48 | - * |
|
49 | - * @param array|string $value_found_in_db_for_model_object |
|
50 | - * @return array|string |
|
51 | - */ |
|
52 | - function prepare_for_set_from_db($value_found_in_db_for_model_object) |
|
53 | - { |
|
54 | - return $this->_remove_tags(parent::prepare_for_set_from_db($value_found_in_db_for_model_object)); |
|
55 | - } |
|
46 | + /** |
|
47 | + * In case unsafe data somehow got inserted into the database, we want to remove tags again |
|
48 | + * |
|
49 | + * @param array|string $value_found_in_db_for_model_object |
|
50 | + * @return array|string |
|
51 | + */ |
|
52 | + function prepare_for_set_from_db($value_found_in_db_for_model_object) |
|
53 | + { |
|
54 | + return $this->_remove_tags(parent::prepare_for_set_from_db($value_found_in_db_for_model_object)); |
|
55 | + } |
|
56 | 56 | |
57 | 57 | |
58 | - /** |
|
59 | - * Determines what tags to allow in this model field |
|
60 | - * |
|
61 | - * @global array $allowedtags |
|
62 | - * @return array |
|
63 | - */ |
|
64 | - function _get_allowed_tags() |
|
65 | - { |
|
66 | - return apply_filters('FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags', |
|
67 | - EEH_HTML::get_simple_tags(), $this); |
|
68 | - } |
|
58 | + /** |
|
59 | + * Determines what tags to allow in this model field |
|
60 | + * |
|
61 | + * @global array $allowedtags |
|
62 | + * @return array |
|
63 | + */ |
|
64 | + function _get_allowed_tags() |
|
65 | + { |
|
66 | + return apply_filters('FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags', |
|
67 | + EEH_HTML::get_simple_tags(), $this); |
|
68 | + } |
|
69 | 69 | } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if (! defined('EVENT_ESPRESSO_VERSION')) { |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | 2 | exit('No direct script access allowed'); |
3 | 3 | } |
4 | 4 |