@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @since 4.6 |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -class EE_Text_Input_Display_Strategy extends EE_Display_Strategy_Base{ |
|
| 14 | +class EE_Text_Input_Display_Strategy extends EE_Display_Strategy_Base { |
|
| 15 | 15 | /** |
| 16 | 16 | * The html "type" attribute value. default is "text" |
| 17 | 17 | * @var string |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * @param string $type |
| 25 | 25 | */ |
| 26 | - function __construct( $type = 'text' ) { |
|
| 26 | + function __construct($type = 'text') { |
|
| 27 | 27 | $this->_type = $type; |
| 28 | 28 | parent::__construct(); |
| 29 | 29 | } |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | * Gets the html "type" attribute's value |
| 35 | 35 | * @return string |
| 36 | 36 | */ |
| 37 | - function get_type(){ |
|
| 37 | + function get_type() { |
|
| 38 | 38 | if ( |
| 39 | 39 | $this->_type == 'email' |
| 40 | - && ! apply_filters( 'FHEE__EE_Text_Input_Display_Strategy__use_html5_email', false ) |
|
| 40 | + && ! apply_filters('FHEE__EE_Text_Input_Display_Strategy__use_html5_email', false) |
|
| 41 | 41 | ) { |
| 42 | 42 | return 'text'; |
| 43 | 43 | } |
@@ -50,16 +50,16 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @return string of html to display the field |
| 52 | 52 | */ |
| 53 | - function display(){ |
|
| 54 | - $input = '<input type="'. $this->get_type() .'"'; |
|
| 55 | - $input .= ' name="' . $this->_input->html_name() . '"'; |
|
| 56 | - $input .= ' id="' . $this->_input->html_id() . '"'; |
|
| 57 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
| 58 | - $input .= ' class="' . $class . '"'; |
|
| 53 | + function display() { |
|
| 54 | + $input = '<input type="'.$this->get_type().'"'; |
|
| 55 | + $input .= ' name="'.$this->_input->html_name().'"'; |
|
| 56 | + $input .= ' id="'.$this->_input->html_id().'"'; |
|
| 57 | + $class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class(); |
|
| 58 | + $input .= ' class="'.$class.'"'; |
|
| 59 | 59 | // add html5 required |
| 60 | 60 | $input .= $this->_input->required() ? ' required' : ''; |
| 61 | - $input .= ' value="' . $this->_input->raw_value_in_form() . '"'; |
|
| 62 | - $input .= ' style="' . $this->_input->html_style() . '"'; |
|
| 61 | + $input .= ' value="'.$this->_input->raw_value_in_form().'"'; |
|
| 62 | + $input .= ' style="'.$this->_input->html_style().'"'; |
|
| 63 | 63 | $input .= $this->_input->other_html_attributes(); |
| 64 | 64 | $input .= '/>'; |
| 65 | 65 | return $input; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -25,12 +25,12 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * ------------------------------------------------------------------------ |
| 27 | 27 | */ |
| 28 | -class EE_Hidden_Display_Strategy extends EE_Display_Strategy_Base{ |
|
| 28 | +class EE_Hidden_Display_Strategy extends EE_Display_Strategy_Base { |
|
| 29 | 29 | /** |
| 30 | 30 | * |
| 31 | 31 | * @return string of html to display the HIDDEN field |
| 32 | 32 | */ |
| 33 | - function display(){ |
|
| 33 | + function display() { |
|
| 34 | 34 | $input = $this->_input; |
| 35 | 35 | return "<input type='hidden' id='{$input->html_id()}' name='{$input->html_name()}' class='{$input->html_class()}' style='{$input->html_style()}' value='{$input->raw_value_in_form()}' {$input->other_html_attributes()}/>"; |
| 36 | 36 | } |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | |
| 6 | 7 | /** |
| 7 | 8 | * Event Espresso |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @subpackage Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php. |
| 11 | 11 | * @author Mike Nelson |
| 12 | 12 | */ |
| 13 | -class EE_Model_Matching_Query_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
| 13 | +class EE_Model_Matching_Query_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * |
@@ -29,17 +29,17 @@ discard block |
||
| 29 | 29 | * @param string $input_field_name the input will be treated as this field's value |
| 30 | 30 | * @throws \EE_Error |
| 31 | 31 | */ |
| 32 | - public function __construct( $validation_error_message = NULL, $model_name = '', $query_params = array(), $input_field_name = '' ) { |
|
| 33 | - if( ! EE_Registry::instance()->is_model_name( $model_name ) ) { |
|
| 34 | - throw new EE_Error( sprintf( __( 'You must provide a valid model object ', 'event_espresso'), $model_name ) ); |
|
| 32 | + public function __construct($validation_error_message = NULL, $model_name = '', $query_params = array(), $input_field_name = '') { |
|
| 33 | + if ( ! EE_Registry::instance()->is_model_name($model_name)) { |
|
| 34 | + throw new EE_Error(sprintf(__('You must provide a valid model object ', 'event_espresso'), $model_name)); |
|
| 35 | 35 | } |
| 36 | - $this->_model = EE_Registry::instance()->load_model( $model_name ); |
|
| 36 | + $this->_model = EE_Registry::instance()->load_model($model_name); |
|
| 37 | 37 | $this->_query_params = $query_params; |
| 38 | - if( empty( $input_field_name ) ) { |
|
| 38 | + if (empty($input_field_name)) { |
|
| 39 | 39 | $input_field_name = $this->_model->primary_key_name(); |
| 40 | 40 | } |
| 41 | 41 | $this->_input_field_name = $input_field_name; |
| 42 | - parent::__construct( $validation_error_message ); |
|
| 42 | + parent::__construct($validation_error_message); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | * @throws \EE_Validation_Error |
| 52 | 52 | */ |
| 53 | 53 | public function validate($normalized_value) { |
| 54 | - if( empty( $normalized_value ) ) { |
|
| 54 | + if (empty($normalized_value)) { |
|
| 55 | 55 | return true; |
| 56 | 56 | } |
| 57 | 57 | $combined_query_params = $this->get_query_params(); |
| 58 | - $combined_query_params[0][ $this->treat_input_as_field() ] = $normalized_value; |
|
| 59 | - if( ! $this->get_model()->exists( $combined_query_params ) ) { |
|
| 60 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'no_matching_model_object' ); |
|
| 58 | + $combined_query_params[0][$this->treat_input_as_field()] = $normalized_value; |
|
| 59 | + if ( ! $this->get_model()->exists($combined_query_params)) { |
|
| 60 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'no_matching_model_object'); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @return array |
| 75 | 75 | */ |
| 76 | 76 | public function get_query_params() { |
| 77 | - return (array)$this->_query_params; |
|
| 77 | + return (array) $this->_query_params; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | class EE_Email_Validation_Strategy extends EE_Text_Validation_Strategy{ |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * @param null $validation_error_message |
|
| 15 | - */ |
|
| 14 | + * @param null $validation_error_message |
|
| 15 | + */ |
|
| 16 | 16 | public function __construct( $validation_error_message = NULL ) { |
| 17 | 17 | if( ! $validation_error_message ){ |
| 18 | 18 | $validation_error_message = __("Please enter a valid email address.", "event_espresso"); |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | - * @return array |
|
| 42 | - */ |
|
| 41 | + * @return array |
|
| 42 | + */ |
|
| 43 | 43 | public function get_jquery_validation_rule_array(){ |
| 44 | 44 | return array( 'email'=>true, 'messages' => array( 'email' => $this->get_validation_error_message() ) ); |
| 45 | 45 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 2 | - exit( 'No direct script access allowed' ); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | 3 | } |
| 4 | 4 | |
| 5 | 5 | |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | /** |
| 23 | 23 | * @param null $validation_error_message |
| 24 | 24 | */ |
| 25 | - public function __construct( $validation_error_message = null ) { |
|
| 25 | + public function __construct($validation_error_message = null) { |
|
| 26 | 26 | $this->_validation_error_message = $validation_error_message === null |
| 27 | - ? __( 'Input invalid', 'event_espresso' ) |
|
| 27 | + ? __('Input invalid', 'event_espresso') |
|
| 28 | 28 | : $validation_error_message; |
| 29 | 29 | parent::__construct(); |
| 30 | 30 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * this validation strategy is the 'required' validation strategy, |
| 42 | 42 | * most should be OK with a null, empty string, etc) |
| 43 | 43 | */ |
| 44 | - public function validate( $normalized_value ) { |
|
| 44 | + public function validate($normalized_value) { |
|
| 45 | 45 | //by default, the validation strategy does no validation. this should be implemented |
| 46 | 46 | } |
| 47 | 47 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @param array $other_js_data |
| 93 | 93 | * @return array |
| 94 | 94 | */ |
| 95 | - public function get_other_js_data( $other_js_data = array() ) { |
|
| 95 | + public function get_other_js_data($other_js_data = array()) { |
|
| 96 | 96 | return $other_js_data; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | if( ! $this->_html_id ){ |
| 174 | 174 | if( $this->_parent_section && $this->_parent_section instanceof EE_Form_Section_Proper ){ |
| 175 | 175 | $this->_html_id = $this->_parent_section->html_id() . '-' . $this->_prep_name_for_html_id( $this->name() ); |
| 176 | - }else{ |
|
| 176 | + } else{ |
|
| 177 | 177 | $this->_html_id = $this->_prep_name_for_html_id( $this->name() ); |
| 178 | 178 | } |
| 179 | 179 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION')){ |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 3 | 3 | exit('No direct script access allowed'); |
| 4 | 4 | } |
| 5 | 5 | /** |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | * @type $name string the name for this form section, if you want to explicitly define it |
| 80 | 80 | * } |
| 81 | 81 | */ |
| 82 | - public function __construct( $options_array = array() ) { |
|
| 82 | + public function __construct($options_array = array()) { |
|
| 83 | 83 | // used by display strategies |
| 84 | 84 | // assign incoming values to properties |
| 85 | - foreach( $options_array as $key => $value ) { |
|
| 86 | - $key = '_' . $key; |
|
| 87 | - if ( property_exists( $this, $key ) && empty( $this->{$key} )) { |
|
| 85 | + foreach ($options_array as $key => $value) { |
|
| 86 | + $key = '_'.$key; |
|
| 87 | + if (property_exists($this, $key) && empty($this->{$key} )) { |
|
| 88 | 88 | $this->{$key} = $value; |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @param $name |
| 98 | 98 | * @throws \EE_Error |
| 99 | 99 | */ |
| 100 | - protected function _construct_finalize( $parent_form_section, $name ){ |
|
| 100 | + protected function _construct_finalize($parent_form_section, $name) { |
|
| 101 | 101 | $this->_construction_finalized = TRUE; |
| 102 | 102 | $this->_parent_section = $parent_form_section; |
| 103 | 103 | $this->_name = $name; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | /** |
| 119 | 119 | * @param string $action |
| 120 | 120 | */ |
| 121 | - public function set_action( $action ) { |
|
| 121 | + public function set_action($action) { |
|
| 122 | 122 | $this->_action = $action; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @return string |
| 129 | 129 | */ |
| 130 | 130 | public function method() { |
| 131 | - return ! empty( $this->_method ) ? $this->_method : 'POST'; |
|
| 131 | + return ! empty($this->_method) ? $this->_method : 'POST'; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | /** |
| 137 | 137 | * @param string $method |
| 138 | 138 | */ |
| 139 | - public function set_method( $method ) { |
|
| 140 | - switch ( $method ) { |
|
| 139 | + public function set_method($method) { |
|
| 140 | + switch ($method) { |
|
| 141 | 141 | case 'get' : |
| 142 | 142 | case 'GET' : |
| 143 | 143 | $this->_method = 'GET'; |
@@ -156,12 +156,12 @@ discard block |
||
| 156 | 156 | * |
| 157 | 157 | * @throws \EE_Error |
| 158 | 158 | */ |
| 159 | - protected function _set_default_html_id_if_empty(){ |
|
| 160 | - if( ! $this->_html_id ){ |
|
| 161 | - if( $this->_parent_section && $this->_parent_section instanceof EE_Form_Section_Proper ){ |
|
| 162 | - $this->_html_id = $this->_parent_section->html_id() . '-' . $this->_prep_name_for_html_id( $this->name() ); |
|
| 163 | - }else{ |
|
| 164 | - $this->_html_id = $this->_prep_name_for_html_id( $this->name() ); |
|
| 159 | + protected function _set_default_html_id_if_empty() { |
|
| 160 | + if ( ! $this->_html_id) { |
|
| 161 | + if ($this->_parent_section && $this->_parent_section instanceof EE_Form_Section_Proper) { |
|
| 162 | + $this->_html_id = $this->_parent_section->html_id().'-'.$this->_prep_name_for_html_id($this->name()); |
|
| 163 | + } else { |
|
| 164 | + $this->_html_id = $this->_prep_name_for_html_id($this->name()); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | * @param $name |
| 174 | 174 | * @return string |
| 175 | 175 | */ |
| 176 | - private function _prep_name_for_html_id( $name ) { |
|
| 177 | - return sanitize_key( str_replace( array( ' ', ' ', '_' ), '-', $name )); |
|
| 176 | + private function _prep_name_for_html_id($name) { |
|
| 177 | + return sanitize_key(str_replace(array(' ', ' ', '_'), '-', $name)); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | * and so might stop working anytime. |
| 189 | 189 | * @return string |
| 190 | 190 | */ |
| 191 | - public function get_html_and_js(){ |
|
| 191 | + public function get_html_and_js() { |
|
| 192 | 192 | return $this->get_html(); |
| 193 | 193 | } |
| 194 | 194 | |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | * @param bool $add_pound_sign |
| 205 | 205 | * @return string |
| 206 | 206 | */ |
| 207 | - public function html_id( $add_pound_sign = FALSE ){ |
|
| 208 | - return $add_pound_sign ? '#' . $this->_html_id : $this->_html_id; |
|
| 207 | + public function html_id($add_pound_sign = FALSE) { |
|
| 208 | + return $add_pound_sign ? '#'.$this->_html_id : $this->_html_id; |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | /** |
| 214 | 214 | * @return string |
| 215 | 215 | */ |
| 216 | - public function html_class(){ |
|
| 216 | + public function html_class() { |
|
| 217 | 217 | return $this->_html_class; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | /** |
| 223 | 223 | * @return string |
| 224 | 224 | */ |
| 225 | - public function html_style(){ |
|
| 225 | + public function html_style() { |
|
| 226 | 226 | return $this->_html_style; |
| 227 | 227 | } |
| 228 | 228 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | /** |
| 232 | 232 | * @param mixed $html_class |
| 233 | 233 | */ |
| 234 | - public function set_html_class( $html_class ) { |
|
| 234 | + public function set_html_class($html_class) { |
|
| 235 | 235 | $this->_html_class = $html_class; |
| 236 | 236 | } |
| 237 | 237 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | /** |
| 241 | 241 | * @param mixed $html_id |
| 242 | 242 | */ |
| 243 | - public function set_html_id( $html_id ) { |
|
| 243 | + public function set_html_id($html_id) { |
|
| 244 | 244 | $this->_html_id = $html_id; |
| 245 | 245 | } |
| 246 | 246 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | /** |
| 250 | 250 | * @param mixed $html_style |
| 251 | 251 | */ |
| 252 | - public function set_html_style( $html_style ) { |
|
| 252 | + public function set_html_style($html_style) { |
|
| 253 | 253 | $this->_html_style = $html_style; |
| 254 | 254 | } |
| 255 | 255 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | /** |
| 259 | 259 | * @param string $other_html_attributes |
| 260 | 260 | */ |
| 261 | - public function set_other_html_attributes( $other_html_attributes ) { |
|
| 261 | + public function set_other_html_attributes($other_html_attributes) { |
|
| 262 | 262 | $this->_other_html_attributes = $other_html_attributes; |
| 263 | 263 | } |
| 264 | 264 | |
@@ -278,9 +278,9 @@ discard block |
||
| 278 | 278 | * @throws EE_Error |
| 279 | 279 | * @return string |
| 280 | 280 | */ |
| 281 | - public function name(){ |
|
| 282 | - if( ! $this->_construction_finalized ){ |
|
| 283 | - throw new EE_Error(sprintf( __( 'You cannot use the form section\s name until _construct_finalize has been called on it (when we set the name). It was called on a form section of type \'s\'', 'event_espresso' ), get_class($this) ) ); |
|
| 281 | + public function name() { |
|
| 282 | + if ( ! $this->_construction_finalized) { |
|
| 283 | + throw new EE_Error(sprintf(__('You cannot use the form section\s name until _construct_finalize has been called on it (when we set the name). It was called on a form section of type \'s\'', 'event_espresso'), get_class($this))); |
|
| 284 | 284 | } |
| 285 | 285 | return $this->_name; |
| 286 | 286 | } |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | * Gets the parent section |
| 292 | 292 | * @return EE_Form_Section_Proper |
| 293 | 293 | */ |
| 294 | - public function parent_section(){ |
|
| 294 | + public function parent_section() { |
|
| 295 | 295 | return $this->_parent_section; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -304,18 +304,18 @@ discard block |
||
| 304 | 304 | * @param string $other_attributes anything else added to the form open tag, MUST BE VALID HTML |
| 305 | 305 | * @return string |
| 306 | 306 | */ |
| 307 | - public function form_open( $action = '', $method = '', $other_attributes = '' ) { |
|
| 308 | - if ( ! empty( $action )) { |
|
| 309 | - $this->set_action( $action ); |
|
| 307 | + public function form_open($action = '', $method = '', $other_attributes = '') { |
|
| 308 | + if ( ! empty($action)) { |
|
| 309 | + $this->set_action($action); |
|
| 310 | 310 | } |
| 311 | - if ( ! empty( $method )) { |
|
| 312 | - $this->set_method( $method ); |
|
| 311 | + if ( ! empty($method)) { |
|
| 312 | + $this->set_method($method); |
|
| 313 | 313 | } |
| 314 | - $html = EEH_HTML::nl( 1, 'form' ) . '<form'; |
|
| 315 | - $html .= $this->html_id() !== '' ? ' id="' . $this->html_id() . '"' : ''; |
|
| 316 | - $html .= ' action="' . $this->action() . '"'; |
|
| 317 | - $html .= ' method="' . $this->method() . '"'; |
|
| 318 | - $html .= $other_attributes . '>'; |
|
| 314 | + $html = EEH_HTML::nl(1, 'form').'<form'; |
|
| 315 | + $html .= $this->html_id() !== '' ? ' id="'.$this->html_id().'"' : ''; |
|
| 316 | + $html .= ' action="'.$this->action().'"'; |
|
| 317 | + $html .= ' method="'.$this->method().'"'; |
|
| 318 | + $html .= $other_attributes.'>'; |
|
| 319 | 319 | return $html; |
| 320 | 320 | } |
| 321 | 321 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @return string |
| 327 | 327 | */ |
| 328 | 328 | public function form_close() { |
| 329 | - return EEH_HTML::nl( -1, 'form' ) . '</form>' . EEH_HTML::nl() . '<!-- end of ee-' . $this->html_id() . '-form -->' . EEH_HTML::nl(); |
|
| 329 | + return EEH_HTML::nl( -1, 'form' ).'</form>'.EEH_HTML::nl().'<!-- end of ee-'.$this->html_id().'-form -->'.EEH_HTML::nl(); |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * Default does nothing, but child classes can override |
| 336 | 336 | * @return void |
| 337 | 337 | */ |
| 338 | - public function enqueue_js(){ |
|
| 338 | + public function enqueue_js() { |
|
| 339 | 339 | //defaults to enqueue NO js or css |
| 340 | 340 | } |
| 341 | 341 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | * @param array $form_other_js_data |
| 352 | 352 | * @return array |
| 353 | 353 | */ |
| 354 | - public function get_other_js_data( $form_other_js_data = array() ) { |
|
| 354 | + public function get_other_js_data($form_other_js_data = array()) { |
|
| 355 | 355 | return $form_other_js_data; |
| 356 | 356 | } |
| 357 | 357 | |
@@ -369,20 +369,20 @@ discard block |
||
| 369 | 369 | * @param string|false $form_section_path we accept false also because substr( '../', '../' ) = false |
| 370 | 370 | * @return EE_Form_Section_Base |
| 371 | 371 | */ |
| 372 | - public function find_section_from_path( $form_section_path ) { |
|
| 373 | - if( strpos( $form_section_path, '/' ) === 0 ) { |
|
| 374 | - $form_section_path = substr( $form_section_path, strlen( '/' ) ); |
|
| 372 | + public function find_section_from_path($form_section_path) { |
|
| 373 | + if (strpos($form_section_path, '/') === 0) { |
|
| 374 | + $form_section_path = substr($form_section_path, strlen('/')); |
|
| 375 | 375 | } |
| 376 | - if( empty( $form_section_path ) ) { |
|
| 376 | + if (empty($form_section_path)) { |
|
| 377 | 377 | return $this; |
| 378 | 378 | } |
| 379 | - if( strpos( $form_section_path, '../' ) === 0 ) { |
|
| 379 | + if (strpos($form_section_path, '../') === 0) { |
|
| 380 | 380 | $parent = $this->parent_section(); |
| 381 | 381 | |
| 382 | - $form_section_path = substr( $form_section_path, strlen( '../' ) ); |
|
| 383 | - if( $parent instanceof EE_Form_Section_Base ) { |
|
| 384 | - return $parent->find_section_from_path( $form_section_path ); |
|
| 385 | - } elseif( empty( $form_section_path ) ) { |
|
| 382 | + $form_section_path = substr($form_section_path, strlen('../')); |
|
| 383 | + if ($parent instanceof EE_Form_Section_Base) { |
|
| 384 | + return $parent->find_section_from_path($form_section_path); |
|
| 385 | + } elseif (empty($form_section_path)) { |
|
| 386 | 386 | return $this; |
| 387 | 387 | } |
| 388 | 388 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 2 | - exit( 'No direct script access allowed' ); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | 3 | } |
| 4 | 4 | /** |
| 5 | 5 | * Event Espresso |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | * @param array $props_n_values |
| 31 | 31 | * @return EE_Country|mixed |
| 32 | 32 | */ |
| 33 | - public static function new_instance( $props_n_values = array() ) { |
|
| 34 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
| 35 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
| 33 | + public static function new_instance($props_n_values = array()) { |
|
| 34 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 35 | + return $has_object ? $has_object : new self($props_n_values); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | * @param array $props_n_values |
| 42 | 42 | * @return EE_Country |
| 43 | 43 | */ |
| 44 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
| 45 | - return new self( $props_n_values, TRUE ); |
|
| 44 | + public static function new_instance_from_db($props_n_values = array()) { |
|
| 45 | + return new self($props_n_values, TRUE); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @return string |
| 55 | 55 | */ |
| 56 | 56 | public function name() { |
| 57 | - return $this->get( 'CNT_name' ); |
|
| 57 | + return $this->get('CNT_name'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @return string |
| 65 | 65 | */ |
| 66 | 66 | public function currency_code() { |
| 67 | - return $this->get( 'CNT_cur_code' ); |
|
| 67 | + return $this->get('CNT_cur_code'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @return string |
| 75 | 75 | */ |
| 76 | 76 | public function currency_sign() { |
| 77 | - $CNT_cur_sign = $this->get( 'CNT_cur_sign' ); |
|
| 77 | + $CNT_cur_sign = $this->get('CNT_cur_sign'); |
|
| 78 | 78 | return $CNT_cur_sign ? $CNT_cur_sign : ''; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @return string |
| 86 | 86 | */ |
| 87 | 87 | public function currency_name_single() { |
| 88 | - return $this->get( 'CNT_cur_single' ); |
|
| 88 | + return $this->get('CNT_cur_single'); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @return string |
| 96 | 96 | */ |
| 97 | 97 | public function currency_name_plural() { |
| 98 | - return $this->get( 'CNT_cur_plural' ); |
|
| 98 | + return $this->get('CNT_cur_plural'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * @return boolean |
| 106 | 106 | */ |
| 107 | 107 | public function currency_sign_before() { |
| 108 | - return $this->get( 'CNT_cur_sign_b4' ); |
|
| 108 | + return $this->get('CNT_cur_sign_b4'); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @return integer |
| 116 | 116 | */ |
| 117 | 117 | public function currency_decimal_places() { |
| 118 | - return $this->get( 'CNT_cur_dec_plc' ); |
|
| 118 | + return $this->get('CNT_cur_dec_plc'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return string |
| 126 | 126 | */ |
| 127 | 127 | public function currency_decimal_mark() { |
| 128 | - return $this->get( 'CNT_cur_dec_mrk' ); |
|
| 128 | + return $this->get('CNT_cur_dec_mrk'); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * @return string |
| 136 | 136 | */ |
| 137 | 137 | public function currency_thousands_separator() { |
| 138 | - return $this->get( 'CNT_cur_thsnds' ); |
|
| 138 | + return $this->get('CNT_cur_thsnds'); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | /* End of file EE_Country.class.php */ |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | 5 | /** |
| 6 | 6 | * Event Espresso |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | ?> |
| 28 | 28 | <div class="event-display-boxes"> |
| 29 | 29 | <?php |
| 30 | - if ( ! empty( $page_title )) { |
|
| 31 | - echo '<h4 id="invoice_title" class="payment_type_title section-heading">' . stripslashes_deep( $page_title ) . '</h4>'; |
|
| 30 | + if ( ! empty($page_title)) { |
|
| 31 | + echo '<h4 id="invoice_title" class="payment_type_title section-heading">'.stripslashes_deep($page_title).'</h4>'; |
|
| 32 | 32 | } |
| 33 | - if ( ! empty( $invoice_url )) { |
|
| 33 | + if ( ! empty($invoice_url)) { |
|
| 34 | 34 | ?> |
| 35 | 35 | <p> |
| 36 | 36 | <a href="<?php echo $invoice_url; ?>" class="ee-button-lnk inline-button ee-invoice-lnk" target="_blank"> |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | <?php |
| 41 | 41 | |
| 42 | 42 | if (isset($page_confirmation_text)) { |
| 43 | - echo '<div class="event-messages ui-state-highlight"><span class="ui-icon ui-icon-alert"></span><p class="instruct">' . stripslashes_deep($page_confirmation_text) . '</p></div>'; |
|
| 43 | + echo '<div class="event-messages ui-state-highlight"><span class="ui-icon ui-icon-alert"></span><p class="instruct">'.stripslashes_deep($page_confirmation_text).'</p></div>'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if ( ! empty( $page_extra_info )) { |
|
| 46 | + if ( ! empty($page_extra_info)) { |
|
| 47 | 47 | ?> |
| 48 | 48 | <div class="address-block"> |
| 49 | 49 | <?php echo wpautop(stripslashes_deep($page_extra_info)); ?> |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
| 7 | 8 | * |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |
| 336 | - * @param $method_name |
|
| 336 | + * @param string $method_name |
|
| 337 | 337 | */ |
| 338 | 338 | public static function doing_it_wrong_call( $method_name ) { |
| 339 | 339 | EE_Error::doing_it_wrong( __CLASS__, sprintf( __('The %s in this class is deprecated as of EE4.5.0. All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name ), '4.5.0' ); |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | |
| 1147 | 1147 | /** |
| 1148 | 1148 | * @deprecated 4.9.0 |
| 1149 | - * @return array |
|
| 1149 | + * @return EE_messenger[] |
|
| 1150 | 1150 | */ |
| 1151 | 1151 | public function get_installed_messengers() { |
| 1152 | 1152 | // EE_messages has been deprecated |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 3 | - exit( 'No direct script access allowed' ); |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 3 | + exit('No direct script access allowed'); |
|
| 4 | 4 | } |
| 5 | 5 | /** |
| 6 | 6 | * ************************************************************************ |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @param \EE_Checkout $checkout |
| 32 | 32 | * @return string |
| 33 | 33 | */ |
| 34 | -function ee_deprecated__registration_checkout__button_text( $submit_button_text, EE_Checkout $checkout ) { |
|
| 34 | +function ee_deprecated__registration_checkout__button_text($submit_button_text, EE_Checkout $checkout) { |
|
| 35 | 35 | // list of old filters |
| 36 | 36 | $deprecated_filters = array( |
| 37 | 37 | 'update_registration_details' => true, |
@@ -41,16 +41,16 @@ discard block |
||
| 41 | 41 | 'proceed_to' => true, |
| 42 | 42 | ); |
| 43 | 43 | // loop thru and call doing_it_wrong() or remove any that aren't being used |
| 44 | - foreach ( $deprecated_filters as $deprecated_filter => $on ) { |
|
| 44 | + foreach ($deprecated_filters as $deprecated_filter => $on) { |
|
| 45 | 45 | // was this filter called ? |
| 46 | - if ( has_action( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter )) { |
|
| 46 | + if (has_action('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter)) { |
|
| 47 | 47 | // only display doing_it_wrong() notice to Event Admins during non-AJAX requests |
| 48 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter' ) && ! defined( 'DOING_AJAX' ) ) { |
|
| 48 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter') && ! defined('DOING_AJAX')) { |
|
| 49 | 49 | EE_Error::doing_it_wrong( |
| 50 | - 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter, |
|
| 50 | + 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter, |
|
| 51 | 51 | sprintf( |
| 52 | - __( 'The %1$s filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso' ), |
|
| 53 | - 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter, |
|
| 52 | + __('The %1$s filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso'), |
|
| 53 | + 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter, |
|
| 54 | 54 | '<br />', |
| 55 | 55 | 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', |
| 56 | 56 | '/modules/single_page_checkout/inc/EE_SPCO_Reg_Step.class.php' |
@@ -59,24 +59,24 @@ discard block |
||
| 59 | 59 | ); |
| 60 | 60 | } |
| 61 | 61 | } else { |
| 62 | - unset( $deprecated_filters[ $deprecated_filter ] ); |
|
| 62 | + unset($deprecated_filters[$deprecated_filter]); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | - if ( ! empty( $deprecated_filters )) { |
|
| 66 | - |
|
| 67 | - if ( $checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset( $deprecated_filters[ 'update_registration_details' ] )) { |
|
| 68 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text ); |
|
| 69 | - } else if ( $checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset( $deprecated_filters[ 'process_payment' ] ) ) { |
|
| 70 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text ); |
|
| 71 | - } else if ( $checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset( $deprecated_filters[ 'finalize_registration' ] ) ) { |
|
| 72 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text ); |
|
| 65 | + if ( ! empty($deprecated_filters)) { |
|
| 66 | + |
|
| 67 | + if ($checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset($deprecated_filters['update_registration_details'])) { |
|
| 68 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text); |
|
| 69 | + } else if ($checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset($deprecated_filters['process_payment'])) { |
|
| 70 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text); |
|
| 71 | + } else if ($checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset($deprecated_filters['finalize_registration'])) { |
|
| 72 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text); |
|
| 73 | 73 | } |
| 74 | - if ( $checkout->next_step instanceof EE_SPCO_Reg_Step ) { |
|
| 75 | - if ( $checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset( $deprecated_filters[ 'and_proceed_to_payment' ] ) ) { |
|
| 76 | - $submit_button_text .= apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text ); |
|
| 74 | + if ($checkout->next_step instanceof EE_SPCO_Reg_Step) { |
|
| 75 | + if ($checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset($deprecated_filters['and_proceed_to_payment'])) { |
|
| 76 | + $submit_button_text .= apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text); |
|
| 77 | 77 | } |
| 78 | - if ( $checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset( $deprecated_filters[ 'proceed_to' ] ) ) { |
|
| 79 | - $submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text ) . $checkout->next_step->name(); |
|
| 78 | + if ($checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset($deprecated_filters['proceed_to'])) { |
|
| 79 | + $submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text).$checkout->next_step->name(); |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | return $submit_button_text; |
| 85 | 85 | |
| 86 | 86 | } |
| 87 | -add_filter( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2 ); |
|
| 87 | +add_filter('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2); |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | |
@@ -95,16 +95,16 @@ discard block |
||
| 95 | 95 | * @param \EE_Checkout $checkout |
| 96 | 96 | * @param boolean $status_updates |
| 97 | 97 | */ |
| 98 | -function ee_deprecated_finalize_transaction( EE_Checkout $checkout, $status_updates ) { |
|
| 98 | +function ee_deprecated_finalize_transaction(EE_Checkout $checkout, $status_updates) { |
|
| 99 | 99 | $action_ref = NULL; |
| 100 | - $action_ref = has_action( 'AHEE__EE_Transaction__finalize__new_transaction' ) ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref; |
|
| 101 | - $action_ref = has_action( 'AHEE__EE_Transaction__finalize__all_transaction' ) ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref; |
|
| 102 | - if ( $action_ref ) { |
|
| 100 | + $action_ref = has_action('AHEE__EE_Transaction__finalize__new_transaction') ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref; |
|
| 101 | + $action_ref = has_action('AHEE__EE_Transaction__finalize__all_transaction') ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref; |
|
| 102 | + if ($action_ref) { |
|
| 103 | 103 | |
| 104 | 104 | EE_Error::doing_it_wrong( |
| 105 | 105 | $action_ref, |
| 106 | 106 | sprintf( |
| 107 | - __( 'This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso' ), |
|
| 107 | + __('This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso'), |
|
| 108 | 108 | '<br />', |
| 109 | 109 | '/core/business/EE_Transaction_Processor.class.php', |
| 110 | 110 | 'AHEE__EE_Transaction_Processor__finalize', |
@@ -114,39 +114,39 @@ discard block |
||
| 114 | 114 | ), |
| 115 | 115 | '4.6.0' |
| 116 | 116 | ); |
| 117 | - switch ( $action_ref ) { |
|
| 117 | + switch ($action_ref) { |
|
| 118 | 118 | case 'AHEE__EE_Transaction__finalize__new_transaction' : |
| 119 | - do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request ); |
|
| 119 | + do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request); |
|
| 120 | 120 | break; |
| 121 | 121 | case 'AHEE__EE_Transaction__finalize__all_transaction' : |
| 122 | - do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array( 'new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates ), $checkout->admin_request ); |
|
| 122 | + do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array('new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates), $checkout->admin_request); |
|
| 123 | 123 | break; |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | -add_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2 ); |
|
| 127 | +add_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2); |
|
| 128 | 128 | /** |
| 129 | 129 | * ee_deprecated_finalize_registration |
| 130 | 130 | * |
| 131 | 131 | * @param EE_Registration $registration |
| 132 | 132 | */ |
| 133 | -function ee_deprecated_finalize_registration( EE_Registration $registration ) { |
|
| 134 | - $action_ref = has_action( 'AHEE__EE_Registration__finalize__update_and_new_reg' ) ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL; |
|
| 135 | - if ( $action_ref ) { |
|
| 133 | +function ee_deprecated_finalize_registration(EE_Registration $registration) { |
|
| 134 | + $action_ref = has_action('AHEE__EE_Registration__finalize__update_and_new_reg') ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL; |
|
| 135 | + if ($action_ref) { |
|
| 136 | 136 | EE_Error::doing_it_wrong( |
| 137 | 137 | $action_ref, |
| 138 | 138 | sprintf( |
| 139 | - __( 'This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso' ), |
|
| 139 | + __('This action is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso'), |
|
| 140 | 140 | '<br />', |
| 141 | 141 | '/core/business/EE_Registration_Processor.class.php', |
| 142 | 142 | 'AHEE__EE_Registration_Processor__trigger_registration_status_changed_hook' |
| 143 | 143 | ), |
| 144 | 144 | '4.6.0' |
| 145 | 145 | ); |
| 146 | - do_action( 'AHEE__EE_Registration__finalize__update_and_new_reg', $registration, ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ))); |
|
| 146 | + do_action('AHEE__EE_Registration__finalize__update_and_new_reg', $registration, (is_admin() && ! (defined('DOING_AJAX') && DOING_AJAX))); |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | -add_action( 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1 ); |
|
| 149 | +add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1); |
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * |
| 168 | 168 | * @return array |
| 169 | 169 | */ |
| 170 | -function ee_deprecated_get_templates( $templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack ) { |
|
| 170 | +function ee_deprecated_get_templates($templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack) { |
|
| 171 | 171 | $old_default_classnames = array( |
| 172 | 172 | 'EE_Messages_Email_Cancelled_Registration_Defaults', |
| 173 | 173 | 'EE_Messages_Email_Declined_Registration_Defaults', |
@@ -183,23 +183,23 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $old_class_instance = new stdClass(); |
| 185 | 185 | |
| 186 | - foreach ( $old_default_classnames as $classname ) { |
|
| 187 | - $filter_ref = 'FHEE__' . $classname . '___create_new_templates___templates'; |
|
| 188 | - if ( has_filter( $filter_ref ) ) { |
|
| 189 | - EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0' ); |
|
| 186 | + foreach ($old_default_classnames as $classname) { |
|
| 187 | + $filter_ref = 'FHEE__'.$classname.'___create_new_templates___templates'; |
|
| 188 | + if (has_filter($filter_ref)) { |
|
| 189 | + EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0'); |
|
| 190 | 190 | } |
| 191 | - $templates = apply_filters( $filter_ref, $templates, $old_class_instance ); |
|
| 191 | + $templates = apply_filters($filter_ref, $templates, $old_class_instance); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | return $templates; |
| 195 | 195 | } |
| 196 | -add_filter( 'FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4 ); |
|
| 196 | +add_filter('FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4); |
|
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | 199 | * Called after EED_Module::set_hooks() and EED_Module::set_admin_hooks() was called. |
| 200 | 200 | * Checks if any deprecated hooks were hooked-into and provide doing_it_wrong messages appropriately. |
| 201 | 201 | */ |
| 202 | -function ee_deprecated_hooks(){ |
|
| 202 | +function ee_deprecated_hooks() { |
|
| 203 | 203 | /** |
| 204 | 204 | * @var $hooks array where keys are hook names, and their values are array{ |
| 205 | 205 | * @type string $version when deprecated |
@@ -210,25 +210,25 @@ discard block |
||
| 210 | 210 | $hooks = array( |
| 211 | 211 | 'AHEE__EE_System___do_setup_validations' => array( |
| 212 | 212 | 'version' => '4.6.0', |
| 213 | - 'alternative' => __( 'Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso' ), |
|
| 213 | + 'alternative' => __('Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso'), |
|
| 214 | 214 | 'still_works' => FALSE |
| 215 | 215 | ) |
| 216 | 216 | ); |
| 217 | - foreach( $hooks as $name => $deprecation_info ){ |
|
| 218 | - if( has_action( $name ) ){ |
|
| 217 | + foreach ($hooks as $name => $deprecation_info) { |
|
| 218 | + if (has_action($name)) { |
|
| 219 | 219 | EE_Error::doing_it_wrong( |
| 220 | 220 | $name, |
| 221 | 221 | sprintf( |
| 222 | - __('This filter is deprecated. %1$s%2$s','event_espresso'), |
|
| 223 | - $deprecation_info[ 'still_works' ] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __( 'It has been completely removed.', 'event_espresso' ), |
|
| 224 | - isset( $deprecation_info[ 'alternative' ] ) ? $deprecation_info[ 'alternative' ] : __( 'Please read the current EE4 documentation further or contact Support.', 'event_espresso' ) |
|
| 222 | + __('This filter is deprecated. %1$s%2$s', 'event_espresso'), |
|
| 223 | + $deprecation_info['still_works'] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __('It has been completely removed.', 'event_espresso'), |
|
| 224 | + isset($deprecation_info['alternative']) ? $deprecation_info['alternative'] : __('Please read the current EE4 documentation further or contact Support.', 'event_espresso') |
|
| 225 | 225 | ), |
| 226 | - isset( $deprecation_info[ 'version' ] ) ? $deprecation_info[ 'version' ] : __( 'recently', 'event_espresso' ) |
|
| 226 | + isset($deprecation_info['version']) ? $deprecation_info['version'] : __('recently', 'event_espresso') |
|
| 227 | 227 | ); |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | -add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks' ); |
|
| 231 | +add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks'); |
|
| 232 | 232 | |
| 233 | 233 | |
| 234 | 234 | |
@@ -251,25 +251,25 @@ discard block |
||
| 251 | 251 | * |
| 252 | 252 | * @return string The default contents for the messenger, message type, context and field. |
| 253 | 253 | */ |
| 254 | -function ee_deprecated_get_default_field_content( $contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack ) { |
|
| 254 | +function ee_deprecated_get_default_field_content($contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack) { |
|
| 255 | 255 | |
| 256 | 256 | $classnames_to_try = array( |
| 257 | - get_class( $messenger ) => $messenger, |
|
| 258 | - get_class( $message_type ) => $message_type, |
|
| 257 | + get_class($messenger) => $messenger, |
|
| 258 | + get_class($message_type) => $message_type, |
|
| 259 | 259 | 'EE_Messages_Base' => $message_type |
| 260 | 260 | ); |
| 261 | 261 | |
| 262 | - foreach ( $classnames_to_try as $classname => $obj ) { |
|
| 263 | - $filter_ref = 'FHEE__' . $classname . '__get_default_field_content'; |
|
| 264 | - if ( has_filter( $filter_ref ) ) { |
|
| 265 | - EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0' ); |
|
| 262 | + foreach ($classnames_to_try as $classname => $obj) { |
|
| 263 | + $filter_ref = 'FHEE__'.$classname.'__get_default_field_content'; |
|
| 264 | + if (has_filter($filter_ref)) { |
|
| 265 | + EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated. It *may* work as an attempt to build in backwards compatibility. However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0'); |
|
| 266 | 266 | } |
| 267 | - $contents = apply_filters( $filter_ref, $contents, $obj ); |
|
| 267 | + $contents = apply_filters($filter_ref, $contents, $obj); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | return $contents; |
| 271 | 271 | } |
| 272 | -add_filter( 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7 ); |
|
| 272 | +add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7); |
|
| 273 | 273 | |
| 274 | 274 | |
| 275 | 275 | |
@@ -297,23 +297,23 @@ discard block |
||
| 297 | 297 | * |
| 298 | 298 | * @return string The path to the file being used. |
| 299 | 299 | */ |
| 300 | -function ee_deprecated_get_inline_css_template_filters( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) { |
|
| 300 | +function ee_deprecated_get_inline_css_template_filters($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) { |
|
| 301 | 301 | |
| 302 | - if ( $messenger == 'email' ) { |
|
| 302 | + if ($messenger == 'email') { |
|
| 303 | 303 | $filter_ref = $url ? 'FHEE__EE_Email_messenger__get_inline_css_template__css_url' : 'FHEE__EE_Email_messenger__get_inline_css_template__css_path'; |
| 304 | - } elseif ( $messenger == 'html' ) { |
|
| 304 | + } elseif ($messenger == 'html') { |
|
| 305 | 305 | $filter_ref = $url ? 'FHEE__EE_Html_messenger__get_inline_css_template__css_url' : 'FHEE__EE_Html_messenger__get_inline_css_template__css_path'; |
| 306 | 306 | } else { |
| 307 | 307 | return $variation_path; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - if ( has_filter( $filter_ref ) ) { |
|
| 311 | - EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated. It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0' ); |
|
| 310 | + if (has_filter($filter_ref)) { |
|
| 311 | + EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated. It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0'); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - return apply_filters( $filter_ref, $variation_path, $url, $type ); |
|
| 314 | + return apply_filters($filter_ref, $variation_path, $url, $type); |
|
| 315 | 315 | } |
| 316 | -add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8 ); |
|
| 316 | +add_filter('FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8); |
|
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | |
@@ -329,78 +329,78 @@ discard block |
||
| 329 | 329 | class EE_Messages_Init extends EE_Base { |
| 330 | 330 | |
| 331 | 331 | public function __construct() { |
| 332 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 332 | + self::doing_it_wrong_call(__METHOD__); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |
| 336 | 336 | * @param $method_name |
| 337 | 337 | */ |
| 338 | - public static function doing_it_wrong_call( $method_name ) { |
|
| 339 | - EE_Error::doing_it_wrong( __CLASS__, sprintf( __('The %s in this class is deprecated as of EE4.5.0. All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name ), '4.5.0' ); |
|
| 338 | + public static function doing_it_wrong_call($method_name) { |
|
| 339 | + EE_Error::doing_it_wrong(__CLASS__, sprintf(__('The %s in this class is deprecated as of EE4.5.0. All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name), '4.5.0'); |
|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | /** |
| 343 | 343 | * @deprecated 4.5.0 |
| 344 | 344 | */ |
| 345 | 345 | public static function set_autoloaders() { |
| 346 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 346 | + self::doing_it_wrong_call(__METHOD__); |
|
| 347 | 347 | EED_Messages::set_autoloaders(); |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
| 351 | 351 | * @deprecated 4.5.0 |
| 352 | 352 | */ |
| 353 | - public function payment_reminder( $transaction ) { |
|
| 354 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 355 | - EED_Messages::payment_reminder( $transaction ); |
|
| 353 | + public function payment_reminder($transaction) { |
|
| 354 | + self::doing_it_wrong_call(__METHOD__); |
|
| 355 | + EED_Messages::payment_reminder($transaction); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
| 359 | 359 | * @deprecated 4.5.0 |
| 360 | 360 | */ |
| 361 | - public function payment( $transaction, $payment ) { |
|
| 362 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 363 | - EED_Messages::payment( $transaction, $payment ); |
|
| 361 | + public function payment($transaction, $payment) { |
|
| 362 | + self::doing_it_wrong_call(__METHOD__); |
|
| 363 | + EED_Messages::payment($transaction, $payment); |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | /** |
| 367 | 367 | * @deprecated 4.5.0 |
| 368 | 368 | */ |
| 369 | - public function cancelled_registration( $transaction ) { |
|
| 370 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 371 | - EED_Messages::cancelled_registration( $transaction ); |
|
| 369 | + public function cancelled_registration($transaction) { |
|
| 370 | + self::doing_it_wrong_call(__METHOD__); |
|
| 371 | + EED_Messages::cancelled_registration($transaction); |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | /** |
| 375 | 375 | * @deprecated 4.5.0 |
| 376 | 376 | */ |
| 377 | - public function maybe_registration( $transaction, $reg_msg, $from_admin ) { |
|
| 378 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 379 | - EED_Messages::maybe_registration( $transaction, $reg_msg, $from_admin ); |
|
| 377 | + public function maybe_registration($transaction, $reg_msg, $from_admin) { |
|
| 378 | + self::doing_it_wrong_call(__METHOD__); |
|
| 379 | + EED_Messages::maybe_registration($transaction, $reg_msg, $from_admin); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /** |
| 383 | 383 | * @deprecated 4.5.0 |
| 384 | 384 | */ |
| 385 | - public function process_resend( $success, $req_data ) { |
|
| 386 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 387 | - EED_Messages::process_resend( $req_data ); |
|
| 385 | + public function process_resend($success, $req_data) { |
|
| 386 | + self::doing_it_wrong_call(__METHOD__); |
|
| 387 | + EED_Messages::process_resend($req_data); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | /** |
| 391 | 391 | * @deprecated 4.5.0 |
| 392 | 392 | */ |
| 393 | - public function process_admin_payment( $success, $payment ) { |
|
| 394 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 395 | - EED_Messages::process_admin_payment( $payment ); |
|
| 393 | + public function process_admin_payment($success, $payment) { |
|
| 394 | + self::doing_it_wrong_call(__METHOD__); |
|
| 395 | + EED_Messages::process_admin_payment($payment); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
| 399 | 399 | * @deprecated 4.5.0 |
| 400 | 400 | */ |
| 401 | - public function send_newsletter_message( $contacts, $grp_id ) { |
|
| 402 | - self::doing_it_wrong_call( __METHOD__ ); |
|
| 403 | - EED_Messages::send_newsletter_message( $contacts, $grp_id ); |
|
| 401 | + public function send_newsletter_message($contacts, $grp_id) { |
|
| 402 | + self::doing_it_wrong_call(__METHOD__); |
|
| 403 | + EED_Messages::send_newsletter_message($contacts, $grp_id); |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | |
@@ -421,13 +421,13 @@ discard block |
||
| 421 | 421 | * |
| 422 | 422 | * @return array additional cpts. |
| 423 | 423 | */ |
| 424 | -function ee_deprecated_get_cpts( $cpts ) { |
|
| 425 | - if ( has_filter( 'FHEE__EE_Register_CPTs__construct__CPTs' ) ) { |
|
| 426 | - EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0' ); |
|
| 424 | +function ee_deprecated_get_cpts($cpts) { |
|
| 425 | + if (has_filter('FHEE__EE_Register_CPTs__construct__CPTs')) { |
|
| 426 | + EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0'); |
|
| 427 | 427 | } |
| 428 | - return apply_filters( 'FHEE__EE_Register_CPTs__construct__CPTs', $cpts ); |
|
| 428 | + return apply_filters('FHEE__EE_Register_CPTs__construct__CPTs', $cpts); |
|
| 429 | 429 | } |
| 430 | -add_filter( 'FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10 ); |
|
| 430 | +add_filter('FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10); |
|
| 431 | 431 | |
| 432 | 432 | |
| 433 | 433 | |
@@ -441,13 +441,13 @@ discard block |
||
| 441 | 441 | * |
| 442 | 442 | * @return array additional custom taxonomies. |
| 443 | 443 | */ |
| 444 | -function ee_deprecated_get_taxonomies( $cts ) { |
|
| 445 | - if ( has_filter( 'FHEE__EE_Register_CPTs__construct__taxonomies' ) ) { |
|
| 446 | - EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0' ); |
|
| 444 | +function ee_deprecated_get_taxonomies($cts) { |
|
| 445 | + if (has_filter('FHEE__EE_Register_CPTs__construct__taxonomies')) { |
|
| 446 | + EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being. However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0'); |
|
| 447 | 447 | } |
| 448 | - return apply_filters( 'FHEE__EE_Register_CPTs__construct__taxonomies', $cts ); |
|
| 448 | + return apply_filters('FHEE__EE_Register_CPTs__construct__taxonomies', $cts); |
|
| 449 | 449 | } |
| 450 | -add_filter( 'FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10 ); |
|
| 450 | +add_filter('FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10); |
|
| 451 | 451 | |
| 452 | 452 | |
| 453 | 453 | |
@@ -459,9 +459,9 @@ discard block |
||
| 459 | 459 | * @return boolean |
| 460 | 460 | */ |
| 461 | 461 | function ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() { |
| 462 | - $in_use = has_filter( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns' ) |
|
| 463 | - || has_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save' ); |
|
| 464 | - if( $in_use ) { |
|
| 462 | + $in_use = has_filter('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns') |
|
| 463 | + || has_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save'); |
|
| 464 | + if ($in_use) { |
|
| 465 | 465 | $msg = __( |
| 466 | 466 | 'We detected you are using the filter FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns or AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save.' |
| 467 | 467 | . 'Both of these have been deprecated and should not be used anymore. You should instead use FHEE__EE_Form_Section_Proper___construct__options_array to customize the contents of the form,' |
@@ -470,18 +470,18 @@ discard block |
||
| 470 | 470 | 'event_espresso' ) |
| 471 | 471 | ; |
| 472 | 472 | EE_Error::doing_it_wrong( |
| 473 | - __CLASS__ . '::' . __FUNCTION__, |
|
| 473 | + __CLASS__.'::'.__FUNCTION__, |
|
| 474 | 474 | $msg, |
| 475 | 475 | '4.8.32.rc.000' |
| 476 | 476 | ); |
| 477 | 477 | //it seems the doing_it_wrong messages get output during some hidden html tags, so add an error to make sure this gets noticed |
| 478 | - if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { |
|
| 479 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 478 | + if (is_admin() && ! defined('DOING_AJAX')) { |
|
| 479 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | return $in_use; |
| 483 | 483 | } |
| 484 | -add_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks' ); |
|
| 484 | +add_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks'); |
|
| 485 | 485 | |
| 486 | 486 | /** |
| 487 | 487 | * @deprecated since 4.8.32.rc.000 because it has issues on https://events.codebasehq.com/projects/event-espresso/tickets/9165 |
@@ -490,34 +490,34 @@ discard block |
||
| 490 | 490 | * @param EE_Admin_Page $admin_page |
| 491 | 491 | * @return void |
| 492 | 492 | */ |
| 493 | -function ee_deprecated_update_attendee_registration_form_old( $admin_page ) { |
|
| 493 | +function ee_deprecated_update_attendee_registration_form_old($admin_page) { |
|
| 494 | 494 | //check if the old hooks are in use. If not, do the default |
| 495 | - if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 496 | - || ! $admin_page instanceof EE_Admin_Page ) { |
|
| 495 | + if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 496 | + || ! $admin_page instanceof EE_Admin_Page) { |
|
| 497 | 497 | return; |
| 498 | 498 | } |
| 499 | 499 | $req_data = $admin_page->get_request_data(); |
| 500 | - $qstns = isset( $req_data['qstn'] ) ? $req_data['qstn'] : FALSE; |
|
| 501 | - $REG_ID = isset( $req_data['_REG_ID'] ) ? absint( $req_data['_REG_ID'] ) : FALSE; |
|
| 502 | - $qstns = apply_filters( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns ); |
|
| 503 | - if ( ! $REG_ID || ! $qstns ) { |
|
| 504 | - EE_Error::add_error( __('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 500 | + $qstns = isset($req_data['qstn']) ? $req_data['qstn'] : FALSE; |
|
| 501 | + $REG_ID = isset($req_data['_REG_ID']) ? absint($req_data['_REG_ID']) : FALSE; |
|
| 502 | + $qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns); |
|
| 503 | + if ( ! $REG_ID || ! $qstns) { |
|
| 504 | + EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 505 | 505 | } |
| 506 | 506 | $success = TRUE; |
| 507 | 507 | |
| 508 | 508 | // allow others to get in on this awesome fun :D |
| 509 | - do_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns ); |
|
| 509 | + do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns); |
|
| 510 | 510 | // loop thru questions... FINALLY!!! |
| 511 | 511 | |
| 512 | - foreach ( $qstns as $QST_ID => $qstn ) { |
|
| 512 | + foreach ($qstns as $QST_ID => $qstn) { |
|
| 513 | 513 | //if $qstn isn't an array then it doesn't already have an answer, so let's create the answer |
| 514 | - if ( !is_array($qstn) ) { |
|
| 515 | - $success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn); |
|
| 514 | + if ( ! is_array($qstn)) { |
|
| 515 | + $success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn); |
|
| 516 | 516 | continue; |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | |
| 520 | - foreach ( $qstn as $ANS_ID => $ANS_value ) { |
|
| 520 | + foreach ($qstn as $ANS_ID => $ANS_value) { |
|
| 521 | 521 | //get answer |
| 522 | 522 | $query_params = array( |
| 523 | 523 | 0 => array( |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | ); |
| 529 | 529 | $answer = EEM_Answer::instance()->get_one($query_params); |
| 530 | 530 | //this MAY be an array but NOT have an answer because its multi select. If so then we need to create the answer |
| 531 | - if ( ! $answer instanceof EE_Answer ) { |
|
| 531 | + if ( ! $answer instanceof EE_Answer) { |
|
| 532 | 532 | $set_values = array( |
| 533 | 533 | 'QST_ID' => $QST_ID, |
| 534 | 534 | 'REG_ID' => $REG_ID, |
@@ -543,11 +543,11 @@ discard block |
||
| 543 | 543 | } |
| 544 | 544 | } |
| 545 | 545 | $what = __('Registration Form', 'event_espresso'); |
| 546 | - $route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' ); |
|
| 547 | - $admin_page->redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route ); |
|
| 546 | + $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default'); |
|
| 547 | + $admin_page->redirect_after_action($success, $what, __('updated', 'event_espresso'), $route); |
|
| 548 | 548 | exit; |
| 549 | 549 | } |
| 550 | -add_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1 ); |
|
| 550 | +add_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1); |
|
| 551 | 551 | /** |
| 552 | 552 | * Render the registration admin page's custom questions area in the old fashion |
| 553 | 553 | * and firing the old hooks. When this method is removed, we can probably also |
@@ -560,31 +560,31 @@ discard block |
||
| 560 | 560 | * @return bool |
| 561 | 561 | * @throws \EE_Error |
| 562 | 562 | */ |
| 563 | -function ee_deprecated_reg_questions_meta_box_old( $do_default_action, $admin_page, $registration ) { |
|
| 563 | +function ee_deprecated_reg_questions_meta_box_old($do_default_action, $admin_page, $registration) { |
|
| 564 | 564 | //check if the old hooks are in use. If not, do the default |
| 565 | - if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 566 | - || ! $admin_page instanceof EE_Admin_Page ) { |
|
| 565 | + if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() |
|
| 566 | + || ! $admin_page instanceof EE_Admin_Page) { |
|
| 567 | 567 | return $do_default_action; |
| 568 | 568 | } |
| 569 | - add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $admin_page, 'form_before_question_group' ), 10, 1 ); |
|
| 570 | - add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array( $admin_page, 'form_after_question_group' ), 10, 1 ); |
|
| 571 | - add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $admin_page, 'form_form_field_label_wrap' ), 10, 1 ); |
|
| 572 | - add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $admin_page, 'form_form_field_input__wrap' ), 10, 1 ); |
|
| 569 | + add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array($admin_page, 'form_before_question_group'), 10, 1); |
|
| 570 | + add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array($admin_page, 'form_after_question_group'), 10, 1); |
|
| 571 | + add_filter('FHEE__EEH_Form_Fields__label_html', array($admin_page, 'form_form_field_label_wrap'), 10, 1); |
|
| 572 | + add_filter('FHEE__EEH_Form_Fields__input_html', array($admin_page, 'form_form_field_input__wrap'), 10, 1); |
|
| 573 | 573 | |
| 574 | - $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options( $registration, $registration->get('EVT_ID') ); |
|
| 574 | + $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options($registration, $registration->get('EVT_ID')); |
|
| 575 | 575 | |
| 576 | - EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
| 576 | + EE_Registry::instance()->load_helper('Form_Fields'); |
|
| 577 | 577 | $template_args = array( |
| 578 | - 'att_questions' => EEH_Form_Fields::generate_question_groups_html( $question_groups ), |
|
| 578 | + 'att_questions' => EEH_Form_Fields::generate_question_groups_html($question_groups), |
|
| 579 | 579 | 'reg_questions_form_action' => 'edit_registration', |
| 580 | 580 | 'REG_ID' => $registration->ID() |
| 581 | 581 | ); |
| 582 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
| 583 | - echo EEH_Template::display_template( $template_path, $template_args, TRUE ); |
|
| 582 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
| 583 | + echo EEH_Template::display_template($template_path, $template_args, TRUE); |
|
| 584 | 584 | //indicate that we should not do the default admin page code |
| 585 | 585 | return false; |
| 586 | 586 | } |
| 587 | -add_action( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3 ); |
|
| 587 | +add_action('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3); |
|
| 588 | 588 | |
| 589 | 589 | |
| 590 | 590 | |
@@ -625,9 +625,9 @@ discard block |
||
| 625 | 625 | '4.9.0' |
| 626 | 626 | ); |
| 627 | 627 | /** @var EE_Message_Resource_Manager $message_resource_manager */ |
| 628 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
| 629 | - $messenger = $message_resource_manager->get_messenger( $messenger_name ); |
|
| 630 | - $message_type = $message_resource_manager->get_message_type( $message_type_name ); |
|
| 628 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 629 | + $messenger = $message_resource_manager->get_messenger($messenger_name); |
|
| 630 | + $message_type = $message_resource_manager->get_message_type($message_type_name); |
|
| 631 | 631 | return EE_Registry::instance()->load_lib( |
| 632 | 632 | 'Messages_Template_Defaults', |
| 633 | 633 | array( |
@@ -692,15 +692,15 @@ discard block |
||
| 692 | 692 | /** |
| 693 | 693 | * @param string $method |
| 694 | 694 | */ |
| 695 | - public function _class_is_deprecated( $method ) { |
|
| 695 | + public function _class_is_deprecated($method) { |
|
| 696 | 696 | EE_Error::doing_it_wrong( |
| 697 | - 'EE_messages::' . $method, |
|
| 698 | - __( 'EE_messages has been deprecated. Please use EE_Message_Resource_Manager instead.' ), |
|
| 697 | + 'EE_messages::'.$method, |
|
| 698 | + __('EE_messages has been deprecated. Please use EE_Message_Resource_Manager instead.'), |
|
| 699 | 699 | '4.9.0', |
| 700 | 700 | '4.10.0.p' |
| 701 | 701 | ); |
| 702 | 702 | // Please use EE_Message_Resource_Manager instead |
| 703 | - $this->_message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
| 703 | + $this->_message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | |
@@ -710,10 +710,10 @@ discard block |
||
| 710 | 710 | * @param string $messenger_name |
| 711 | 711 | * @return boolean TRUE if it was PREVIOUSLY active, and FALSE if it was previously inactive |
| 712 | 712 | */ |
| 713 | - public function ensure_messenger_is_active( $messenger_name ) { |
|
| 713 | + public function ensure_messenger_is_active($messenger_name) { |
|
| 714 | 714 | // EE_messages has been deprecated |
| 715 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 716 | - return $this->_message_resource_manager->ensure_messenger_is_active( $messenger_name ); |
|
| 715 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 716 | + return $this->_message_resource_manager->ensure_messenger_is_active($messenger_name); |
|
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | |
@@ -725,10 +725,10 @@ discard block |
||
| 725 | 725 | * @return bool true if it got activated (or was active) and false if not. |
| 726 | 726 | * @throws \EE_Error |
| 727 | 727 | */ |
| 728 | - public function ensure_message_type_is_active( $message_type, $messenger ) { |
|
| 728 | + public function ensure_message_type_is_active($message_type, $messenger) { |
|
| 729 | 729 | // EE_messages has been deprecated |
| 730 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 731 | - return $this->_message_resource_manager->ensure_message_type_is_active( $message_type, $messenger ); |
|
| 730 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 731 | + return $this->_message_resource_manager->ensure_message_type_is_active($message_type, $messenger); |
|
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | |
@@ -741,10 +741,10 @@ discard block |
||
| 741 | 741 | * they are already setup.) |
| 742 | 742 | * @return boolean an array of generated templates or false if nothing generated/activated. |
| 743 | 743 | */ |
| 744 | - public function activate_messenger( $messenger_name, $mts_to_activate = array() ) { |
|
| 744 | + public function activate_messenger($messenger_name, $mts_to_activate = array()) { |
|
| 745 | 745 | // EE_messages has been deprecated |
| 746 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 747 | - return $this->_message_resource_manager->activate_messenger( $messenger_name, $mts_to_activate ); |
|
| 746 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 747 | + return $this->_message_resource_manager->activate_messenger($messenger_name, $mts_to_activate); |
|
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | |
@@ -756,10 +756,10 @@ discard block |
||
| 756 | 756 | * |
| 757 | 757 | * @return bool true is a generating messenger and can be sent OR FALSE meaning cannot send. |
| 758 | 758 | */ |
| 759 | - public function is_generating_messenger_and_active( EE_messenger $messenger, EE_message_type $message_type ) { |
|
| 759 | + public function is_generating_messenger_and_active(EE_messenger $messenger, EE_message_type $message_type) { |
|
| 760 | 760 | // EE_messages has been deprecated |
| 761 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 762 | - return $this->_message_resource_manager->is_generating_messenger_and_active( $messenger, $message_type ); |
|
| 761 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 762 | + return $this->_message_resource_manager->is_generating_messenger_and_active($messenger, $message_type); |
|
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | |
@@ -769,10 +769,10 @@ discard block |
||
| 769 | 769 | * @param string $messenger |
| 770 | 770 | * @return EE_messenger | null |
| 771 | 771 | */ |
| 772 | - public function get_messenger_if_active( $messenger ) { |
|
| 772 | + public function get_messenger_if_active($messenger) { |
|
| 773 | 773 | // EE_messages has been deprecated |
| 774 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 775 | - return $this->_message_resource_manager->get_active_messenger( $messenger ); |
|
| 774 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 775 | + return $this->_message_resource_manager->get_active_messenger($messenger); |
|
| 776 | 776 | } |
| 777 | 777 | |
| 778 | 778 | |
@@ -793,9 +793,9 @@ discard block |
||
| 793 | 793 | * 'message_type' => null |
| 794 | 794 | * ) |
| 795 | 795 | */ |
| 796 | - public function validate_for_use( EE_Message $message ) { |
|
| 796 | + public function validate_for_use(EE_Message $message) { |
|
| 797 | 797 | // EE_messages has been deprecated |
| 798 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 798 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 799 | 799 | return array( |
| 800 | 800 | 'messenger' => $message->messenger_object(), |
| 801 | 801 | 'message_type' => $message->message_type_object(), |
@@ -823,41 +823,41 @@ discard block |
||
| 823 | 823 | $send = true |
| 824 | 824 | ) { |
| 825 | 825 | // EE_messages has been deprecated |
| 826 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 826 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 827 | 827 | /** @type EE_Messages_Processor $processor */ |
| 828 | - $processor = EE_Registry::instance()->load_lib( 'Messages_Processor' ); |
|
| 828 | + $processor = EE_Registry::instance()->load_lib('Messages_Processor'); |
|
| 829 | 829 | $error = false; |
| 830 | 830 | //try to intelligently determine what method we'll call based on the incoming data. |
| 831 | 831 | //if generating and sending are different then generate and send immediately. |
| 832 | - if ( ! empty( $sending_messenger ) && $sending_messenger != $generating_messenger && $send ) { |
|
| 832 | + if ( ! empty($sending_messenger) && $sending_messenger != $generating_messenger && $send) { |
|
| 833 | 833 | //in the legacy system, when generating and sending were different, that means all the |
| 834 | 834 | //vars are already in the request object. So let's just use that. |
| 835 | 835 | try { |
| 836 | 836 | /** @type EE_Message_To_Generate_From_Request $mtg */ |
| 837 | - $mtg = EE_Registry::instance()->load_lib( 'Message_To_Generate_From_Request' ); |
|
| 838 | - $processor->generate_and_send_now( $mtg ); |
|
| 839 | - } catch ( EE_Error $e ) { |
|
| 837 | + $mtg = EE_Registry::instance()->load_lib('Message_To_Generate_From_Request'); |
|
| 838 | + $processor->generate_and_send_now($mtg); |
|
| 839 | + } catch (EE_Error $e) { |
|
| 840 | 840 | $error_msg = __( |
| 841 | 841 | 'Please note that a system message failed to send due to a technical issue.', |
| 842 | 842 | 'event_espresso' |
| 843 | 843 | ); |
| 844 | 844 | // add specific message for developers if WP_DEBUG in on |
| 845 | - $error_msg .= '||' . $e->getMessage(); |
|
| 846 | - EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 845 | + $error_msg .= '||'.$e->getMessage(); |
|
| 846 | + EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 847 | 847 | $error = true; |
| 848 | 848 | } |
| 849 | 849 | } else { |
| 850 | - $processor->generate_for_all_active_messengers( $type, $vars, $send ); |
|
| 850 | + $processor->generate_for_all_active_messengers($type, $vars, $send); |
|
| 851 | 851 | //let's find out if there were any errors and how many successfully were queued. |
| 852 | 852 | $count_errors = $processor->get_queue()->count_STS_in_queue( |
| 853 | - array( EEM_Message::status_failed, EEM_Message::status_debug_only ) |
|
| 853 | + array(EEM_Message::status_failed, EEM_Message::status_debug_only) |
|
| 854 | 854 | ); |
| 855 | - $count_queued = $processor->get_queue()->count_STS_in_queue( EEM_Message::status_incomplete ); |
|
| 856 | - $count_retry = $processor->get_queue()->count_STS_in_queue( EEM_Message::status_retry ); |
|
| 855 | + $count_queued = $processor->get_queue()->count_STS_in_queue(EEM_Message::status_incomplete); |
|
| 856 | + $count_retry = $processor->get_queue()->count_STS_in_queue(EEM_Message::status_retry); |
|
| 857 | 857 | $count_errors = $count_errors + $count_retry; |
| 858 | - if ( $count_errors > 0 ) { |
|
| 858 | + if ($count_errors > 0) { |
|
| 859 | 859 | $error = true; |
| 860 | - if ( $count_errors > 1 && $count_retry > 1 && $count_queued > 1 ) { |
|
| 860 | + if ($count_errors > 1 && $count_retry > 1 && $count_queued > 1) { |
|
| 861 | 861 | $message = sprintf( |
| 862 | 862 | __( |
| 863 | 863 | 'There were %d errors and %d messages successfully queued for generation and sending', |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | $count_errors, |
| 867 | 867 | $count_queued |
| 868 | 868 | ); |
| 869 | - } elseif ( $count_errors > 1 && $count_queued === 1 ) { |
|
| 869 | + } elseif ($count_errors > 1 && $count_queued === 1) { |
|
| 870 | 870 | $message = sprintf( |
| 871 | 871 | __( |
| 872 | 872 | 'There were %d errors and %d message successfully queued for generation.', |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | $count_errors, |
| 876 | 876 | $count_queued |
| 877 | 877 | ); |
| 878 | - } elseif ( $count_errors === 1 && $count_queued > 1 ) { |
|
| 878 | + } elseif ($count_errors === 1 && $count_queued > 1) { |
|
| 879 | 879 | $message = sprintf( |
| 880 | 880 | __( |
| 881 | 881 | 'There was %d error and %d messages successfully queued for generation.', |
@@ -893,9 +893,9 @@ discard block |
||
| 893 | 893 | $count_errors |
| 894 | 894 | ); |
| 895 | 895 | } |
| 896 | - EE_Error::add_error( $message, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 896 | + EE_Error::add_error($message, __FILE__, __FUNCTION__, __LINE__); |
|
| 897 | 897 | } else { |
| 898 | - if ( $count_queued === 1 ) { |
|
| 898 | + if ($count_queued === 1) { |
|
| 899 | 899 | $message = sprintf( |
| 900 | 900 | __( |
| 901 | 901 | '%d message successfully queued for generation.', |
@@ -912,18 +912,18 @@ discard block |
||
| 912 | 912 | $count_queued |
| 913 | 913 | ); |
| 914 | 914 | } |
| 915 | - EE_Error::add_success( $message ); |
|
| 915 | + EE_Error::add_success($message); |
|
| 916 | 916 | } |
| 917 | 917 | } |
| 918 | 918 | //if no error then return the generated message(s). |
| 919 | - if ( ! $error && ! $send ) { |
|
| 920 | - $generated_queue = $processor->generate_queue( false ); |
|
| 919 | + if ( ! $error && ! $send) { |
|
| 920 | + $generated_queue = $processor->generate_queue(false); |
|
| 921 | 921 | //get message and return. |
| 922 | 922 | $generated_queue->get_message_repository()->rewind(); |
| 923 | 923 | $messages = array(); |
| 924 | - while ( $generated_queue->get_message_repository()->valid() ) { |
|
| 924 | + while ($generated_queue->get_message_repository()->valid()) { |
|
| 925 | 925 | $message = $generated_queue->get_message_repository()->current(); |
| 926 | - if ( $message instanceof EE_Message ) { |
|
| 926 | + if ($message instanceof EE_Message) { |
|
| 927 | 927 | //set properties that might be expected by add-ons (backward compat) |
| 928 | 928 | $message->content = $message->content(); |
| 929 | 929 | $message->template_pack = $message->get_template_pack(); |
@@ -948,10 +948,10 @@ discard block |
||
| 948 | 948 | * @param bool $send true we will do a test send using the messenger delivery, false we just do a regular preview |
| 949 | 949 | * @return string The body of the message. |
| 950 | 950 | */ |
| 951 | - public function preview_message( $type, $context, $messenger, $send = false ) { |
|
| 951 | + public function preview_message($type, $context, $messenger, $send = false) { |
|
| 952 | 952 | // EE_messages has been deprecated |
| 953 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 954 | - return EED_Messages::preview_message( $type, $context, $messenger, $send ); |
|
| 953 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 954 | + return EED_Messages::preview_message($type, $context, $messenger, $send); |
|
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | |
@@ -965,14 +965,14 @@ discard block |
||
| 965 | 965 | * |
| 966 | 966 | * @return bool success or fail. |
| 967 | 967 | */ |
| 968 | - public function send_message_with_messenger_only( $messenger, $message_type, $message ) { |
|
| 968 | + public function send_message_with_messenger_only($messenger, $message_type, $message) { |
|
| 969 | 969 | // EE_messages has been deprecated |
| 970 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 970 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 971 | 971 | //setup for sending to new method. |
| 972 | 972 | /** @type EE_Messages_Queue $queue */ |
| 973 | - $queue = EE_Registry::instance()->load_lib( 'Messages_Queue' ); |
|
| 973 | + $queue = EE_Registry::instance()->load_lib('Messages_Queue'); |
|
| 974 | 974 | //make sure we have a proper message object |
| 975 | - if ( ! $message instanceof EE_Message && is_object( $message ) && isset( $message->content ) ) { |
|
| 975 | + if ( ! $message instanceof EE_Message && is_object($message) && isset($message->content)) { |
|
| 976 | 976 | $msg = EE_Message_Factory::create( |
| 977 | 977 | array( |
| 978 | 978 | 'MSG_messenger' => $messenger, |
@@ -984,15 +984,15 @@ discard block |
||
| 984 | 984 | } else { |
| 985 | 985 | $msg = $message; |
| 986 | 986 | } |
| 987 | - if ( ! $msg instanceof EE_Message ) { |
|
| 987 | + if ( ! $msg instanceof EE_Message) { |
|
| 988 | 988 | return false; |
| 989 | 989 | } |
| 990 | 990 | //make sure any content in a content property (if not empty) is set on the MSG_content. |
| 991 | - if ( ! empty( $msg->content ) ) { |
|
| 992 | - $msg->set( 'MSG_content', $msg->content ); |
|
| 991 | + if ( ! empty($msg->content)) { |
|
| 992 | + $msg->set('MSG_content', $msg->content); |
|
| 993 | 993 | } |
| 994 | - $queue->add( $msg ); |
|
| 995 | - return EED_Messages::send_message_with_messenger_only( $messenger, $message_type, $queue ); |
|
| 994 | + $queue->add($msg); |
|
| 995 | + return EED_Messages::send_message_with_messenger_only($messenger, $message_type, $queue); |
|
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | |
@@ -1006,11 +1006,11 @@ discard block |
||
| 1006 | 1006 | * @return array|object if creation is successful then we return an array of info, otherwise an error_object is returned. |
| 1007 | 1007 | * @throws \EE_Error |
| 1008 | 1008 | */ |
| 1009 | - public function create_new_templates( $messenger, $message_type, $GRP_ID = 0, $is_global = false ) { |
|
| 1009 | + public function create_new_templates($messenger, $message_type, $GRP_ID = 0, $is_global = false) { |
|
| 1010 | 1010 | // EE_messages has been deprecated |
| 1011 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1012 | - EE_Registry::instance()->load_helper( 'MSG_Template' ); |
|
| 1013 | - return EEH_MSG_Template::create_new_templates( $messenger, $message_type, $GRP_ID, $is_global ); |
|
| 1011 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1012 | + EE_Registry::instance()->load_helper('MSG_Template'); |
|
| 1013 | + return EEH_MSG_Template::create_new_templates($messenger, $message_type, $GRP_ID, $is_global); |
|
| 1014 | 1014 | } |
| 1015 | 1015 | |
| 1016 | 1016 | |
@@ -1021,11 +1021,11 @@ discard block |
||
| 1021 | 1021 | * @param string $message_type_name name of EE_message_type |
| 1022 | 1022 | * @return array |
| 1023 | 1023 | */ |
| 1024 | - public function get_fields( $messenger_name, $message_type_name ) { |
|
| 1024 | + public function get_fields($messenger_name, $message_type_name) { |
|
| 1025 | 1025 | // EE_messages has been deprecated |
| 1026 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1027 | - EE_Registry::instance()->load_helper( 'MSG_Template' ); |
|
| 1028 | - return EEH_MSG_Template::get_fields( $messenger_name, $message_type_name ); |
|
| 1026 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1027 | + EE_Registry::instance()->load_helper('MSG_Template'); |
|
| 1028 | + return EEH_MSG_Template::get_fields($messenger_name, $message_type_name); |
|
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | |
@@ -1039,13 +1039,13 @@ discard block |
||
| 1039 | 1039 | * @return array multidimensional array of messenger and message_type objects |
| 1040 | 1040 | * (messengers index, and message_type index); |
| 1041 | 1041 | */ |
| 1042 | - public function get_installed( $type = 'all', $skip_cache = false ) { |
|
| 1042 | + public function get_installed($type = 'all', $skip_cache = false) { |
|
| 1043 | 1043 | // EE_messages has been deprecated |
| 1044 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1045 | - if ( $skip_cache ) { |
|
| 1044 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1045 | + if ($skip_cache) { |
|
| 1046 | 1046 | $this->_message_resource_manager->reset_active_messengers_and_message_types(); |
| 1047 | 1047 | } |
| 1048 | - switch ( $type ) { |
|
| 1048 | + switch ($type) { |
|
| 1049 | 1049 | case 'messengers' : |
| 1050 | 1050 | return array( |
| 1051 | 1051 | 'messenger' => $this->_message_resource_manager->installed_messengers(), |
@@ -1074,7 +1074,7 @@ discard block |
||
| 1074 | 1074 | */ |
| 1075 | 1075 | public function get_active_messengers() { |
| 1076 | 1076 | // EE_messages has been deprecated |
| 1077 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1077 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1078 | 1078 | return $this->_message_resource_manager->active_messengers(); |
| 1079 | 1079 | } |
| 1080 | 1080 | |
@@ -1086,7 +1086,7 @@ discard block |
||
| 1086 | 1086 | */ |
| 1087 | 1087 | public function get_active_message_types() { |
| 1088 | 1088 | // EE_messages has been deprecated |
| 1089 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1089 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1090 | 1090 | return $this->_message_resource_manager->list_of_active_message_types(); |
| 1091 | 1091 | } |
| 1092 | 1092 | |
@@ -1098,7 +1098,7 @@ discard block |
||
| 1098 | 1098 | */ |
| 1099 | 1099 | public function get_active_message_type_objects() { |
| 1100 | 1100 | // EE_messages has been deprecated |
| 1101 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1101 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1102 | 1102 | return $this->_message_resource_manager->get_active_message_type_objects(); |
| 1103 | 1103 | } |
| 1104 | 1104 | |
@@ -1110,10 +1110,10 @@ discard block |
||
| 1110 | 1110 | * @param string $messenger The messenger being checked |
| 1111 | 1111 | * @return EE_message_type[] (or empty array if none present) |
| 1112 | 1112 | */ |
| 1113 | - public function get_active_message_types_per_messenger( $messenger ) { |
|
| 1113 | + public function get_active_message_types_per_messenger($messenger) { |
|
| 1114 | 1114 | // EE_messages has been deprecated |
| 1115 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1116 | - return $this->_message_resource_manager->get_active_message_types_for_messenger( $messenger ); |
|
| 1115 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1116 | + return $this->_message_resource_manager->get_active_message_types_for_messenger($messenger); |
|
| 1117 | 1117 | } |
| 1118 | 1118 | |
| 1119 | 1119 | |
@@ -1124,10 +1124,10 @@ discard block |
||
| 1124 | 1124 | * @param string $message_type The string should correspond to a message type. |
| 1125 | 1125 | * @return EE_message_type|null |
| 1126 | 1126 | */ |
| 1127 | - public function get_active_message_type( $messenger, $message_type ) { |
|
| 1127 | + public function get_active_message_type($messenger, $message_type) { |
|
| 1128 | 1128 | // EE_messages has been deprecated |
| 1129 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1130 | - return $this->_message_resource_manager->get_active_message_type_for_messenger( $messenger, $message_type ); |
|
| 1129 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1130 | + return $this->_message_resource_manager->get_active_message_type_for_messenger($messenger, $message_type); |
|
| 1131 | 1131 | } |
| 1132 | 1132 | |
| 1133 | 1133 | |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | */ |
| 1139 | 1139 | public function get_installed_message_types() { |
| 1140 | 1140 | // EE_messages has been deprecated |
| 1141 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1141 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1142 | 1142 | return $this->_message_resource_manager->installed_message_types(); |
| 1143 | 1143 | } |
| 1144 | 1144 | |
@@ -1150,7 +1150,7 @@ discard block |
||
| 1150 | 1150 | */ |
| 1151 | 1151 | public function get_installed_messengers() { |
| 1152 | 1152 | // EE_messages has been deprecated |
| 1153 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1153 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1154 | 1154 | return $this->_message_resource_manager->installed_messengers(); |
| 1155 | 1155 | } |
| 1156 | 1156 | |
@@ -1161,10 +1161,10 @@ discard block |
||
| 1161 | 1161 | * @param bool $slugs_only Whether to return an array of just slugs and labels (true) or all contexts indexed by message type. |
| 1162 | 1162 | * @return array |
| 1163 | 1163 | */ |
| 1164 | - public function get_all_contexts( $slugs_only = true ) { |
|
| 1164 | + public function get_all_contexts($slugs_only = true) { |
|
| 1165 | 1165 | // EE_messages has been deprecated |
| 1166 | - $this->_class_is_deprecated( __FUNCTION__ ); |
|
| 1167 | - return $this->_message_resource_manager->get_all_contexts( $slugs_only ); |
|
| 1166 | + $this->_class_is_deprecated(__FUNCTION__); |
|
| 1167 | + return $this->_message_resource_manager->get_all_contexts($slugs_only); |
|
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | 1170 | |