@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 4.6 |
9 | 9 | * |
10 | 10 | */ |
11 | -class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base{ |
|
11 | +class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * return EE_Admin_File_Uploader_Display_Strategy |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | * Besides that, no special consideration should be required to make the media uploader appear, besides having |
30 | 30 | * this input displayed. |
31 | 31 | */ |
32 | - static function enqueue_scripts(){ |
|
32 | + static function enqueue_scripts() { |
|
33 | 33 | wp_enqueue_media(); |
34 | 34 | wp_enqueue_script('media-upload'); |
35 | - wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
35 | + wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -42,20 +42,20 @@ discard block |
||
42 | 42 | * @return string of html to display the field |
43 | 43 | */ |
44 | 44 | |
45 | - function display(){ |
|
45 | + function display() { |
|
46 | 46 | |
47 | - EE_Registry::instance()->load_helper( 'HTML' ); |
|
47 | + EE_Registry::instance()->load_helper('HTML'); |
|
48 | 48 | // the actual input |
49 | 49 | $input = '<input type="text" size="34" '; |
50 | - $input .= 'name="' . $this->_input->html_name() . '" '; |
|
51 | - $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" '; |
|
52 | - $input .= 'value="' . $this->_input->raw_value_in_form() . '">'; |
|
50 | + $input .= 'name="'.$this->_input->html_name().'" '; |
|
51 | + $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url '.$this->_input->html_class().'" ' : 'class="large-text ee_media_url" '; |
|
52 | + $input .= 'value="'.$this->_input->raw_value_in_form().'">'; |
|
53 | 53 | // image uploader |
54 | - $uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' ); |
|
54 | + $uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload'); |
|
55 | 55 | //only attempt to show the image if it at least exists |
56 | - $image = $this->src_exists( $this->_input->raw_value() ) ? EEH_HTML::br(2) . EEH_HTML::img( $this->_input->raw_value(), __( 'logo', 'event_espresso' ), '', 'ee_media_image' ) : ''; |
|
56 | + $image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2).EEH_HTML::img($this->_input->raw_value(), __('logo', 'event_espresso'), '', 'ee_media_image') : ''; |
|
57 | 57 | // html string |
58 | - return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' ); |
|
58 | + return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | * @param string $src |
67 | 67 | * @return boolean |
68 | 68 | */ |
69 | - protected function src_exists( $src ){ |
|
70 | - $results = wp_remote_head( $src ); |
|
71 | - if( is_array( $results) && ! $results instanceof WP_Error){ |
|
72 | - return strpos($results['headers']['content-type'], "image" ) !== FALSE; |
|
73 | - }else{ |
|
69 | + protected function src_exists($src) { |
|
70 | + $results = wp_remote_head($src); |
|
71 | + if (is_array($results) && ! $results instanceof WP_Error) { |
|
72 | + return strpos($results['headers']['content-type'], "image") !== FALSE; |
|
73 | + } else { |
|
74 | 74 | return FALSE; |
75 | 75 | } |
76 | 76 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | //so in case teh IPN is arriving later, let's try to process an IPN! |
91 | 91 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ |
92 | 92 | return $this->handle_ipn($_POST, $transaction ); |
93 | - }else{ |
|
93 | + } else{ |
|
94 | 94 | return parent::finalize_payment_for( $transaction ); |
95 | 95 | } |
96 | 96 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 4.6 |
9 | 9 | * |
10 | 10 | */ |
11 | -abstract class EE_Display_Strategy_Base extends EE_Form_Input_Strategy_Base{ |
|
11 | +abstract class EE_Display_Strategy_Base extends EE_Form_Input_Strategy_Base { |
|
12 | 12 | /** |
13 | 13 | * returns HTML and javascript related to the displaying of this input |
14 | 14 | * @return string |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | * @param string $chars - exact string of characters to remove |
25 | 25 | * @return string |
26 | 26 | */ |
27 | - protected function _remove_chars( $string = '', $chars = '-' ) { |
|
28 | - $char_length = strlen( $chars ) * -1; |
|
27 | + protected function _remove_chars($string = '', $chars = '-') { |
|
28 | + $char_length = strlen($chars) * -1; |
|
29 | 29 | // if last three characters of string is " - ", then remove it |
30 | - return substr( $string, $char_length ) == $chars ? substr( $string, 0, $char_length ) : $string; |
|
30 | + return substr($string, $char_length) == $chars ? substr($string, 0, $char_length) : $string; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | * @param string $chars - exact string of characters to be added to end of string |
40 | 40 | * @return string |
41 | 41 | */ |
42 | - protected function _append_chars( $string = '', $chars = '-' ) { |
|
43 | - return $this->_remove_chars( $string, $chars ) . $chars; |
|
42 | + protected function _append_chars($string = '', $chars = '-') { |
|
43 | + return $this->_remove_chars($string, $chars).$chars; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * Class EE_Display_Strategy_Base |
|
4 | - * |
|
5 | - * @package Event Espresso |
|
6 | - * @subpackage core |
|
7 | - * @author Mike Nelson, Brent Christensen |
|
8 | - * @since 4.6 |
|
9 | - * |
|
10 | - */ |
|
3 | + * Class EE_Display_Strategy_Base |
|
4 | + * |
|
5 | + * @package Event Espresso |
|
6 | + * @subpackage core |
|
7 | + * @author Mike Nelson, Brent Christensen |
|
8 | + * @since 4.6 |
|
9 | + * |
|
10 | + */ |
|
11 | 11 | abstract class EE_Display_Strategy_Base extends EE_Form_Input_Strategy_Base{ |
12 | 12 | /** |
13 | 13 | * returns HTML and javascript related to the displaying of this 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()}'/>"; |
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 | * Event Espresso |
7 | 8 | * |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * |
4 | 4 | * Class EE_Radio_Button_Display_Strategy |
@@ -11,43 +11,43 @@ discard block |
||
11 | 11 | * @since $VID:$ |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Radio_Button_Display_Strategy extends EE_Display_Strategy_Base{ |
|
14 | +class EE_Radio_Button_Display_Strategy extends EE_Display_Strategy_Base { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * |
18 | 18 | * @throws EE_Error |
19 | 19 | * @return string of html to display the field |
20 | 20 | */ |
21 | - function display(){ |
|
22 | - if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base ){ |
|
23 | - throw new EE_Error(sprintf(__('Can not use Radio Button Display Strategy with an input that doesn\'t have options', 'event_espresso' ))); |
|
21 | + function display() { |
|
22 | + if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
23 | + throw new EE_Error(sprintf(__('Can not use Radio Button Display Strategy with an input that doesn\'t have options', 'event_espresso'))); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $this->_input->set_label_sizes(); |
27 | 27 | $label_size_class = $this->_input->get_label_size_class(); |
28 | 28 | $html = ''; |
29 | - foreach( $this->_input->options() as $value => $display_text ){ |
|
30 | - $value = $this->_input->get_normalization_strategy()->unnormalize( $value ); |
|
29 | + foreach ($this->_input->options() as $value => $display_text) { |
|
30 | + $value = $this->_input->get_normalization_strategy()->unnormalize($value); |
|
31 | 31 | |
32 | - $html_id = $this->_append_chars( $this->_input->html_id(), '-' ) . sanitize_key( $value ); |
|
33 | - $html .= EEH_HTML::nl( 0, 'radio' ); |
|
34 | - $html .= '<label for="' . $html_id . '"'; |
|
35 | - $html .= ' id="' . $html_id . '-lbl"'; |
|
36 | - $html .= ' class="ee-radio-label-after' . $label_size_class . '">'; |
|
37 | - $html .= EEH_HTML::nl( 1, 'radio' ); |
|
38 | - $html .= '<input id="' . $html_id . '"'; |
|
39 | - $html .= ' name="' . $this->_input->html_name() . '"'; |
|
40 | - $html .= ' class="' . $this->_input->html_class() . '"'; |
|
41 | - $html .= ' style="' . $this->_input->html_style() . '"'; |
|
32 | + $html_id = $this->_append_chars($this->_input->html_id(), '-').sanitize_key($value); |
|
33 | + $html .= EEH_HTML::nl(0, 'radio'); |
|
34 | + $html .= '<label for="'.$html_id.'"'; |
|
35 | + $html .= ' id="'.$html_id.'-lbl"'; |
|
36 | + $html .= ' class="ee-radio-label-after'.$label_size_class.'">'; |
|
37 | + $html .= EEH_HTML::nl(1, 'radio'); |
|
38 | + $html .= '<input id="'.$html_id.'"'; |
|
39 | + $html .= ' name="'.$this->_input->html_name().'"'; |
|
40 | + $html .= ' class="'.$this->_input->html_class().'"'; |
|
41 | + $html .= ' style="'.$this->_input->html_style().'"'; |
|
42 | 42 | $html .= ' type="radio"'; |
43 | - $html .= ' value="' . esc_attr( $value ) . '"'; |
|
43 | + $html .= ' value="'.esc_attr($value).'"'; |
|
44 | 44 | $html .= $this->_input->raw_value() === $value ? ' checked="checked"' : ''; |
45 | 45 | $html .= '> '; |
46 | 46 | $html .= $display_text; |
47 | - $html .= EEH_HTML::nl( -1, 'radio' ) . '</label>'; |
|
47 | + $html .= EEH_HTML::nl( -1, 'radio' ).'</label>'; |
|
48 | 48 | |
49 | 49 | } |
50 | - $html .= EEH_HTML::div( '', '', 'clear-float' ); |
|
50 | + $html .= EEH_HTML::div('', '', 'clear-float'); |
|
51 | 51 | $html .= EEH_HTML::divx(); |
52 | 52 | return $html; |
53 | 53 | } |
@@ -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,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_Select_Multiple_Display_Strategy extends EE_Select_Display_Strategy{ |
|
28 | +class EE_Select_Multiple_Display_Strategy extends EE_Select_Display_Strategy { |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * |
@@ -34,30 +34,30 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function display() { |
36 | 36 | |
37 | - if( ! $this->_input instanceof EE_Form_Input_With_Options_Base){ |
|
37 | + if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
38 | 38 | throw new EE_Error(sprintf(__('Cannot use Select Multiple Display Strategy with an input that doesn\'t have options', "event_espresso"))); |
39 | 39 | } |
40 | 40 | |
41 | - $html = EEH_HTML::nl( 0, 'select' ); |
|
41 | + $html = EEH_HTML::nl(0, 'select'); |
|
42 | 42 | $html .= '<select multiple'; |
43 | - $html .= ' id="' . $this->_input->html_id() . '"'; |
|
44 | - $html .= ' name="' . $this->_input->html_name() . '[]"'; |
|
45 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
46 | - $html .= ' class="' . $class . '"'; |
|
43 | + $html .= ' id="'.$this->_input->html_id().'"'; |
|
44 | + $html .= ' name="'.$this->_input->html_name().'[]"'; |
|
45 | + $class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class(); |
|
46 | + $html .= ' class="'.$class.'"'; |
|
47 | 47 | // add html5 required |
48 | 48 | $html .= $this->_input->required() ? ' required' : ''; |
49 | - $html .= ' style="' . $this->_input->html_style() . '"'; |
|
49 | + $html .= ' style="'.$this->_input->html_style().'"'; |
|
50 | 50 | $html .= '>'; |
51 | 51 | |
52 | 52 | EE_Registry::instance()->load_helper('Array'); |
53 | - EEH_HTML::indent( 1, 'select' ); |
|
54 | - if( EEH_Array::is_multi_dimensional_array( $this->_input->options() )){ |
|
53 | + EEH_HTML::indent(1, 'select'); |
|
54 | + if (EEH_Array::is_multi_dimensional_array($this->_input->options())) { |
|
55 | 55 | throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
56 | - }else{ |
|
57 | - $html.=$this->_display_options( $this->_input->options() ); |
|
56 | + } else { |
|
57 | + $html .= $this->_display_options($this->_input->options()); |
|
58 | 58 | } |
59 | 59 | |
60 | - $html.= EEH_HTML::nl( -1, 'select' ) . "</select>"; |
|
60 | + $html .= EEH_HTML::nl( -1, 'select' )."</select>"; |
|
61 | 61 | return $html; |
62 | 62 | } |
63 | 63 | |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | * @param string|int $value unnormalized value option (string) |
69 | 69 | * @return boolean |
70 | 70 | */ |
71 | - protected function _check_if_option_selected( $value ){ |
|
71 | + protected function _check_if_option_selected($value) { |
|
72 | 72 | $selected_options = $this->_input->raw_value(); |
73 | - if ( empty( $selected_options )){ |
|
73 | + if (empty($selected_options)) { |
|
74 | 74 | return FALSE; |
75 | 75 | } |
76 | - return in_array( $value, $selected_options ) ? TRUE : FALSE; |
|
76 | + return in_array($value, $selected_options) ? TRUE : FALSE; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 |
@@ -1,7 +1,8 @@ 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 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -53,7 +54,7 @@ discard block |
||
53 | 54 | EEH_HTML::indent( 1, 'select' ); |
54 | 55 | if( EEH_Array::is_multi_dimensional_array( $this->_input->options() )){ |
55 | 56 | throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
56 | - }else{ |
|
57 | + } else{ |
|
57 | 58 | $html.=$this->_display_options( $this->_input->options() ); |
58 | 59 | } |
59 | 60 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | -class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base{ |
|
2 | +class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base { |
|
3 | 3 | /** |
4 | 4 | * |
5 | 5 | * @return string of html to display the field |
6 | 6 | */ |
7 | - function display(){ |
|
7 | + function display() { |
|
8 | 8 | $input = $this->_input; |
9 | 9 | $raw_value = maybe_serialize($input->raw_value()); |
10 | - if( $input instanceof EE_Text_Area_Input ) { |
|
10 | + if ($input instanceof EE_Text_Area_Input) { |
|
11 | 11 | $rows = $input->get_rows(); |
12 | 12 | $cols = $input->get_cols(); |
13 | - }else{ |
|
13 | + } else { |
|
14 | 14 | $rows = 4; |
15 | 15 | $cols = 20; |
16 | 16 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | //so in case teh IPN is arriving later, let's try to process an IPN! |
91 | 91 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ |
92 | 92 | return $this->handle_ipn($_POST, $transaction ); |
93 | - }else{ |
|
93 | + } else{ |
|
94 | 94 | return parent::finalize_payment_for( $transaction ); |
95 | 95 | } |
96 | 96 | } |
@@ -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 | } |
@@ -31,23 +31,23 @@ discard block |
||
31 | 31 | * Gets the html "type" attribute's value |
32 | 32 | * @return string |
33 | 33 | */ |
34 | - function get_type(){ |
|
34 | + function get_type() { |
|
35 | 35 | return $this->_type; |
36 | 36 | } |
37 | 37 | /** |
38 | 38 | * |
39 | 39 | * @return string of html to display the field |
40 | 40 | */ |
41 | - function display(){ |
|
42 | - $input = '<input type="'. $this->get_type() .'"'; |
|
43 | - $input .= ' name="' . $this->_input->html_name() . '"'; |
|
44 | - $input .= ' id="' . $this->_input->html_id() . '"'; |
|
45 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
46 | - $input .= ' class="' . $class . '"'; |
|
41 | + function display() { |
|
42 | + $input = '<input type="'.$this->get_type().'"'; |
|
43 | + $input .= ' name="'.$this->_input->html_name().'"'; |
|
44 | + $input .= ' id="'.$this->_input->html_id().'"'; |
|
45 | + $class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class(); |
|
46 | + $input .= ' class="'.$class.'"'; |
|
47 | 47 | // add html5 required |
48 | 48 | $input .= $this->_input->required() ? ' required' : ''; |
49 | - $input .= ' value="' . $this->_input->raw_value_in_form() . '"'; |
|
50 | - $input .= ' style="' . $this->_input->html_style() . '"'; |
|
49 | + $input .= ' value="'.$this->_input->raw_value_in_form().'"'; |
|
50 | + $input .= ' style="'.$this->_input->html_style().'"'; |
|
51 | 51 | $input .= $this->_input->html_other_attributes(); |
52 | 52 | $input .= '/>'; |
53 | 53 | return $input; |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Fieldset_Section_Layout |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since $VID:$ |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Fieldset_Section_Layout |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since $VID:$ |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout{ |
15 | 15 | |
16 | 16 | /** |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @since $VID:$ |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout{ |
|
14 | +class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * legend_class |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param array $options |
34 | 34 | */ |
35 | - function __construct( $options = array() ){ |
|
36 | - foreach( $options as $key => $value ) { |
|
37 | - $key = '_' . $key; |
|
38 | - if ( property_exists( $this, $key )) { |
|
35 | + function __construct($options = array()) { |
|
36 | + foreach ($options as $key => $value) { |
|
37 | + $key = '_'.$key; |
|
38 | + if (property_exists($this, $key)) { |
|
39 | 39 | $this->$key = $value; |
40 | 40 | } |
41 | 41 | } |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @return string |
48 | 48 | */ |
49 | 49 | public function layout_form_begin() { |
50 | - $html = EEH_HTML::nl(1) . '<fieldset id="' . $this->_form_section->html_id() . '" class="' . $this->_form_section->html_class() . '" style="' . $this->_form_section->html_style() . '">'; |
|
51 | - $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>'; |
|
50 | + $html = EEH_HTML::nl(1).'<fieldset id="'.$this->_form_section->html_id().'" class="'.$this->_form_section->html_class().'" style="'.$this->_form_section->html_style().'">'; |
|
51 | + $html .= '<legend class="'.$this->legend_class().'">'.$this->legend_text().'</legend>'; |
|
52 | 52 | return $html; |
53 | 53 | } |
54 | 54 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | * closing div tag for a form |
59 | 59 | * @return string |
60 | 60 | */ |
61 | - public function layout_form_end(){ |
|
62 | - return EEH_HTML::nl(-1) . '</fieldset>'; |
|
61 | + public function layout_form_end() { |
|
62 | + return EEH_HTML::nl(-1).'</fieldset>'; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * @param string $legend_class |
69 | 69 | */ |
70 | - public function set_legend_class( $legend_class ) { |
|
70 | + public function set_legend_class($legend_class) { |
|
71 | 71 | $this->_legend_class = $legend_class; |
72 | 72 | } |
73 | 73 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | /** |
86 | 86 | * @param string $legend_text |
87 | 87 | */ |
88 | - public function set_legend_text( $legend_text ) { |
|
88 | + public function set_legend_text($legend_text) { |
|
89 | 89 | $this->_legend_text = $legend_text; |
90 | 90 | } |
91 | 91 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * stating where the proper subsections should be placed (but usually leaving them to layout |
9 | 9 | * their own headers and footers etc). |
10 | 10 | */ |
11 | -abstract class EE_Form_Section_Layout_Base{ |
|
11 | +abstract class EE_Form_Section_Layout_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Form form section to lay out |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * __construct |
23 | 23 | */ |
24 | - function __construct(){ |
|
24 | + function __construct() { |
|
25 | 25 | EE_Registry::instance()->load_helper('HTML'); |
26 | 26 | } |
27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * The form section on which this strategy is to perform |
32 | 32 | * @param EE_Form_Section_Proper $form |
33 | 33 | */ |
34 | - function _construct_finalize(EE_Form_Section_Proper $form){ |
|
34 | + function _construct_finalize(EE_Form_Section_Proper $form) { |
|
35 | 35 | $this->_form_section = $form; |
36 | 36 | } |
37 | 37 | |
@@ -54,28 +54,28 @@ discard block |
||
54 | 54 | * Returns the HTML |
55 | 55 | * @return string HTML for displaying |
56 | 56 | */ |
57 | - function layout_form(){ |
|
57 | + function layout_form() { |
|
58 | 58 | $html = ''; |
59 | 59 | // layout_form_begin |
60 | 60 | $html .= apply_filters( |
61 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_' . $this->_form_section->name(), |
|
61 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_'.$this->_form_section->name(), |
|
62 | 62 | $this->layout_form_begin(), |
63 | 63 | $this->_form_section |
64 | 64 | ); |
65 | 65 | // layout_form_loop |
66 | 66 | $html .= apply_filters( |
67 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_' . $this->_form_section->name(), |
|
67 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_'.$this->_form_section->name(), |
|
68 | 68 | $this->layout_form_loop(), |
69 | 69 | $this->_form_section |
70 | 70 | ); |
71 | 71 | // layout_form_end |
72 | 72 | $html .= apply_filters( |
73 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_' . $this->_form_section->name(), |
|
73 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_'.$this->_form_section->name(), |
|
74 | 74 | $this->layout_form_end(), |
75 | 75 | $this->_form_section |
76 | 76 | ); |
77 | 77 | |
78 | - $html = $this->add_form_section_hooks_and_filters( $html ); |
|
78 | + $html = $this->add_form_section_hooks_and_filters($html); |
|
79 | 79 | return $html; |
80 | 80 | } |
81 | 81 | |
@@ -84,20 +84,20 @@ discard block |
||
84 | 84 | /** |
85 | 85 | * @return string |
86 | 86 | */ |
87 | - function layout_form_loop(){ |
|
87 | + function layout_form_loop() { |
|
88 | 88 | $html = ''; |
89 | - foreach( $this->_form_section->subsections() as $name => $subsection ){ |
|
90 | - if ( $subsection instanceof EE_Form_Input_Base ){ |
|
89 | + foreach ($this->_form_section->subsections() as $name => $subsection) { |
|
90 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
91 | 91 | $html .= apply_filters( |
92 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_' . $name . '__in_' . $this->_form_section->name(), |
|
93 | - $this->layout_input( $subsection ), |
|
92 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_'.$name.'__in_'.$this->_form_section->name(), |
|
93 | + $this->layout_input($subsection), |
|
94 | 94 | $this->_form_section, |
95 | 95 | $subsection |
96 | 96 | ); |
97 | - } elseif ( $subsection instanceof EE_Form_Section_Base ){ |
|
97 | + } elseif ($subsection instanceof EE_Form_Section_Base) { |
|
98 | 98 | $html .= apply_filters( |
99 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_' . $name . '__in_' . $this->_form_section->name(), |
|
100 | - $this->layout_subsection( $subsection ), |
|
99 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_'.$name.'__in_'.$this->_form_section->name(), |
|
100 | + $this->layout_subsection($subsection), |
|
101 | 101 | $this->_form_section, |
102 | 102 | $subsection |
103 | 103 | ); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @param EE_Form_Section_Base $subsection |
146 | 146 | * @return string html |
147 | 147 | */ |
148 | - abstract function layout_subsection( $subsection ); |
|
148 | + abstract function layout_subsection($subsection); |
|
149 | 149 | |
150 | 150 | |
151 | 151 | |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | * @param EE_Form_Input_Base $input |
155 | 155 | * @return string |
156 | 156 | */ |
157 | - public function display_label($input){ |
|
158 | - $class = $input->required() ? 'ee-required-label ' . $input->html_label_class() : $input->html_label_class(); |
|
159 | - $label_text = $input->required() ? $input->html_label_text() . '<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
160 | - return '<label id="' . $input->html_label_id() . '" class="' . $class . '" style="' . $input->html_label_style() . '" for="' . $input->html_name() . '">' . $label_text . '</label>'; |
|
157 | + public function display_label($input) { |
|
158 | + $class = $input->required() ? 'ee-required-label '.$input->html_label_class() : $input->html_label_class(); |
|
159 | + $label_text = $input->required() ? $input->html_label_text().'<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
160 | + return '<label id="'.$input->html_label_id().'" class="'.$class.'" style="'.$input->html_label_style().'" for="'.$input->html_name().'">'.$label_text.'</label>'; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | |
@@ -170,10 +170,10 @@ discard block |
||
170 | 170 | * @param EE_Form_Input_Base $input |
171 | 171 | * @return string |
172 | 172 | */ |
173 | - public function display_errors($input){ |
|
174 | - if( $input->get_validation_errors() ){ |
|
175 | - return "<span id='" . $input->html_id() . "-error' class='ee-error-label red ee-red' for='{$input->html_name()}'>" . $input->get_validation_error_string() . "</span>"; |
|
176 | - }else{ |
|
173 | + public function display_errors($input) { |
|
174 | + if ($input->get_validation_errors()) { |
|
175 | + return "<span id='".$input->html_id()."-error' class='ee-error-label red ee-red' for='{$input->html_name()}'>".$input->get_validation_error_string()."</span>"; |
|
176 | + } else { |
|
177 | 177 | return ''; |
178 | 178 | } |
179 | 179 | } |
@@ -183,10 +183,10 @@ discard block |
||
183 | 183 | * @param EE_Form_Input_Base $input |
184 | 184 | * @return string |
185 | 185 | */ |
186 | - public function display_help_text( $input ){ |
|
187 | - if ( $input->html_help_text() != '' ) { |
|
186 | + public function display_help_text($input) { |
|
187 | + if ($input->html_help_text() != '') { |
|
188 | 188 | $tag = is_admin() ? 'p' : 'span'; |
189 | - return '<' . $tag . ' id="' . $input->html_id() . '-help" class="' . $input->html_help_class() . '" style="' . $input->html_help_style() . '">' . $input->html_help_text() . '</' . $tag . '>'; |
|
189 | + return '<'.$tag.' id="'.$input->html_id().'-help" class="'.$input->html_help_class().'" style="'.$input->html_help_style().'">'.$input->html_help_text().'</'.$tag.'>'; |
|
190 | 190 | } |
191 | 191 | return ''; |
192 | 192 | } |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | * @param string $html |
199 | 199 | * @return string |
200 | 200 | */ |
201 | - public function add_form_section_hooks_and_filters( $html ){ |
|
201 | + public function add_form_section_hooks_and_filters($html) { |
|
202 | 202 | // replace dashes and spaces with underscores |
203 | - $hook_name = str_replace( array( '-', ' ' ), '_', $this->_form_section->html_id() ); |
|
204 | - do_action( 'AHEE__Form_Section_Layout__' . $hook_name, $this->_form_section ); |
|
205 | - $html = apply_filters( 'AFEE__Form_Section_Layout__' . $hook_name . '__html', $html, $this->_form_section ); |
|
206 | - $html .= EEH_HTML::nl() . '<!-- AHEE__Form_Section_Layout__' . $hook_name . '__html -->'; |
|
207 | - $html .= EEH_HTML::nl() . '<!-- AFEE__Form_Section_Layout__' . $hook_name . ' -->'; |
|
203 | + $hook_name = str_replace(array('-', ' '), '_', $this->_form_section->html_id()); |
|
204 | + do_action('AHEE__Form_Section_Layout__'.$hook_name, $this->_form_section); |
|
205 | + $html = apply_filters('AFEE__Form_Section_Layout__'.$hook_name.'__html', $html, $this->_form_section); |
|
206 | + $html .= EEH_HTML::nl().'<!-- AHEE__Form_Section_Layout__'.$hook_name.'__html -->'; |
|
207 | + $html .= EEH_HTML::nl().'<!-- AFEE__Form_Section_Layout__'.$hook_name.' -->'; |
|
208 | 208 | return $html; |
209 | 209 | } |
210 | 210 |
@@ -90,7 +90,7 @@ |
||
90 | 90 | //so in case teh IPN is arriving later, let's try to process an IPN! |
91 | 91 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ |
92 | 92 | return $this->handle_ipn($_POST, $transaction ); |
93 | - }else{ |
|
93 | + } else{ |
|
94 | 94 | return parent::finalize_payment_for( $transaction ); |
95 | 95 | } |
96 | 96 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Abstract parent class for all form layouts. Mostly just contains a reference to the form |
|
4 | - * we are to lay out. |
|
5 | - * Form layouts should add HTML content for each form section (eg a header and footer) |
|
6 | - * for the form section, and dictate how to layout all the inputs and proper subsections |
|
7 | - * (laying out where to put the input's label, the actual input widget, and its errors; and |
|
8 | - * stating where the proper subsections should be placed (but usually leaving them to layout |
|
9 | - * their own headers and footers etc). |
|
10 | - */ |
|
3 | + * Abstract parent class for all form layouts. Mostly just contains a reference to the form |
|
4 | + * we are to lay out. |
|
5 | + * Form layouts should add HTML content for each form section (eg a header and footer) |
|
6 | + * for the form section, and dictate how to layout all the inputs and proper subsections |
|
7 | + * (laying out where to put the input's label, the actual input widget, and its errors; and |
|
8 | + * stating where the proper subsections should be placed (but usually leaving them to layout |
|
9 | + * their own headers and footers etc). |
|
10 | + */ |
|
11 | 11 | abstract class EE_Form_Section_Layout_Base{ |
12 | 12 | |
13 | 13 | /** |