@@ -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,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 | /** |
| 7 | 8 | * Event Espresso |
@@ -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,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | -class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base{ |
|
| 2 | +class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base { |
|
| 3 | 3 | /** |
| 4 | 4 | * |
| 5 | 5 | * @return string of html to display the input |
| 6 | 6 | */ |
| 7 | - function display(){ |
|
| 7 | + function display() { |
|
| 8 | 8 | $html = '<input type="submit" '; |
| 9 | - $html .= 'value="' . $this->_input->raw_value_in_form() . '" '; |
|
| 10 | - $html .= 'id="' . $this->_input->html_id() . '-submit" '; |
|
| 11 | - $html .= 'class="' . $this->_input->html_class() . ' ' . $this->_input->button_css_attributes() . '" '; |
|
| 12 | - $html .= 'style="' . $this->_input->html_style() . '" '; |
|
| 9 | + $html .= 'value="'.$this->_input->raw_value_in_form().'" '; |
|
| 10 | + $html .= 'id="'.$this->_input->html_id().'-submit" '; |
|
| 11 | + $html .= 'class="'.$this->_input->html_class().' '.$this->_input->button_css_attributes().'" '; |
|
| 12 | + $html .= 'style="'.$this->_input->html_style().'" '; |
|
| 13 | 13 | $html .= $this->_input->other_html_attributes(); |
| 14 | 14 | $html .= '/>'; |
| 15 | 15 | return $html; |
@@ -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 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 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 | } |
@@ -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; |
@@ -10,14 +10,14 @@ discard block |
||
| 10 | 10 | * @since 4.6.0 |
| 11 | 11 | * |
| 12 | 12 | */ |
| 13 | -class EE_Div_Per_Section_Layout extends EE_Form_Section_Layout_Base{ |
|
| 13 | +class EE_Div_Per_Section_Layout extends EE_Form_Section_Layout_Base { |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * opening div tag for a form |
| 17 | 17 | * @return string |
| 18 | 18 | */ |
| 19 | 19 | public function layout_form_begin() { |
| 20 | - return EEH_HTML::div( '', $this->_form_section->html_id(), $this->_form_section->html_class(), $this->_form_section->html_style() ); |
|
| 20 | + return EEH_HTML::div('', $this->_form_section->html_id(), $this->_form_section->html_class(), $this->_form_section->html_style()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -26,38 +26,38 @@ discard block |
||
| 26 | 26 | * @param EE_Form_Input_Base $input |
| 27 | 27 | * @return string |
| 28 | 28 | */ |
| 29 | - public function layout_input( $input ) { |
|
| 29 | + public function layout_input($input) { |
|
| 30 | 30 | $html = ''; |
| 31 | - if ( $input instanceof EE_Hidden_Input ) { |
|
| 32 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
| 33 | - } else if ( $input instanceof EE_Submit_Input ) { |
|
| 34 | - $html .= EEH_HTML::div( $input->get_html_for_input(), $input->html_id() . '-submit-dv', $input->html_class() . '-submit-dv' ); |
|
| 35 | - } else if ( $input instanceof EE_Select_Input ) { |
|
| 31 | + if ($input instanceof EE_Hidden_Input) { |
|
| 32 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
| 33 | + } else if ($input instanceof EE_Submit_Input) { |
|
| 34 | + $html .= EEH_HTML::div($input->get_html_for_input(), $input->html_id().'-submit-dv', $input->html_class().'-submit-dv'); |
|
| 35 | + } else if ($input instanceof EE_Select_Input) { |
|
| 36 | 36 | $html .= EEH_HTML::div( |
| 37 | - EEH_HTML::nl(1) . $input->get_html_for_label() . |
|
| 38 | - EEH_HTML::nl() . $input->get_html_for_errors() . |
|
| 39 | - EEH_HTML::nl() . $input->get_html_for_input() . |
|
| 40 | - EEH_HTML::nl() . $input->get_html_for_help(), |
|
| 41 | - $input->html_id() . '-input-dv', |
|
| 42 | - $input->html_class() . '-input-dv' |
|
| 37 | + EEH_HTML::nl(1).$input->get_html_for_label(). |
|
| 38 | + EEH_HTML::nl().$input->get_html_for_errors(). |
|
| 39 | + EEH_HTML::nl().$input->get_html_for_input(). |
|
| 40 | + EEH_HTML::nl().$input->get_html_for_help(), |
|
| 41 | + $input->html_id().'-input-dv', |
|
| 42 | + $input->html_class().'-input-dv' |
|
| 43 | 43 | ); |
| 44 | - } else if ( $input instanceof EE_Form_Input_With_Options_Base ) { |
|
| 44 | + } else if ($input instanceof EE_Form_Input_With_Options_Base) { |
|
| 45 | 45 | $html .= EEH_HTML::div( |
| 46 | - EEH_HTML::nl() . $this->_display_label_for_option_type_question( $input ) . |
|
| 47 | - EEH_HTML::nl() . $input->get_html_for_errors() . |
|
| 48 | - EEH_HTML::nl() . $input->get_html_for_input() . |
|
| 49 | - EEH_HTML::nl() . $input->get_html_for_help(), |
|
| 50 | - $input->html_id() . '-input-dv', |
|
| 51 | - $input->html_class() . '-input-dv' |
|
| 46 | + EEH_HTML::nl().$this->_display_label_for_option_type_question($input). |
|
| 47 | + EEH_HTML::nl().$input->get_html_for_errors(). |
|
| 48 | + EEH_HTML::nl().$input->get_html_for_input(). |
|
| 49 | + EEH_HTML::nl().$input->get_html_for_help(), |
|
| 50 | + $input->html_id().'-input-dv', |
|
| 51 | + $input->html_class().'-input-dv' |
|
| 52 | 52 | ); |
| 53 | 53 | } else { |
| 54 | 54 | $html .= EEH_HTML::div( |
| 55 | - EEH_HTML::nl(1) . $input->get_html_for_label() . |
|
| 56 | - EEH_HTML::nl() . $input->get_html_for_errors() . |
|
| 57 | - EEH_HTML::nl() . $input->get_html_for_input() . |
|
| 58 | - EEH_HTML::nl() . $input->get_html_for_help(), |
|
| 59 | - $input->html_id() . '-input-dv', |
|
| 60 | - $input->html_class() . '-input-dv' |
|
| 55 | + EEH_HTML::nl(1).$input->get_html_for_label(). |
|
| 56 | + EEH_HTML::nl().$input->get_html_for_errors(). |
|
| 57 | + EEH_HTML::nl().$input->get_html_for_input(). |
|
| 58 | + EEH_HTML::nl().$input->get_html_for_help(), |
|
| 59 | + $input->html_id().'-input-dv', |
|
| 60 | + $input->html_class().'-input-dv' |
|
| 61 | 61 | ); |
| 62 | 62 | } |
| 63 | 63 | return $html; |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | * @param EE_Form_Input_With_Options_Base $input |
| 75 | 75 | * @return string |
| 76 | 76 | */ |
| 77 | - protected function _display_label_for_option_type_question( EE_Form_Input_With_Options_Base $input ){ |
|
| 78 | - if ( $input->display_html_label_text() != '' ) { |
|
| 79 | - $class = $input->required() ? 'ee-required-label ' . $input->html_label_class() : $input->html_label_class(); |
|
| 80 | - $label_text = $input->required() ? $input->html_label_text() . '<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
| 81 | - $html = '<div id="' . $input->html_label_id() . '"'; |
|
| 82 | - $html .= ' class="' . $class . '"'; |
|
| 83 | - $html .= ' style="' . $input->html_label_style() . '">'; |
|
| 84 | - $html .= $label_text . '</div>'; |
|
| 77 | + protected function _display_label_for_option_type_question(EE_Form_Input_With_Options_Base $input) { |
|
| 78 | + if ($input->display_html_label_text() != '') { |
|
| 79 | + $class = $input->required() ? 'ee-required-label '.$input->html_label_class() : $input->html_label_class(); |
|
| 80 | + $label_text = $input->required() ? $input->html_label_text().'<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
| 81 | + $html = '<div id="'.$input->html_label_id().'"'; |
|
| 82 | + $html .= ' class="'.$class.'"'; |
|
| 83 | + $html .= ' style="'.$input->html_label_style().'">'; |
|
| 84 | + $html .= $label_text.'</div>'; |
|
| 85 | 85 | return $html; |
| 86 | 86 | } else { |
| 87 | 87 | return ''; |
@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | * @param EE_Form_Section_Proper $form_section |
| 96 | 96 | * @return string |
| 97 | 97 | */ |
| 98 | - public function layout_subsection( $form_section ){ |
|
| 98 | + public function layout_subsection($form_section) { |
|
| 99 | 99 | // d( $form_section ); |
| 100 | - return EEH_HTML::nl(1) . $form_section->get_html_and_js() . EEH_HTML::nl(-1); |
|
| 100 | + return EEH_HTML::nl(1).$form_section->get_html_and_js().EEH_HTML::nl(-1); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * closing div tag for a form |
| 106 | 106 | * @return string |
| 107 | 107 | */ |
| 108 | - public function layout_form_end(){ |
|
| 109 | - return EEH_HTML::divx( $this->_form_section->html_id(), $this->_form_section->html_class() ); |
|
| 108 | + public function layout_form_end() { |
|
| 109 | + return EEH_HTML::divx($this->_form_section->html_id(), $this->_form_section->html_class()); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | \ No newline at end of file |
@@ -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 | |