@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function __construct($options = array()) |
37 | 37 | { |
38 | 38 | foreach ($options as $key => $value) { |
39 | - $key = '_' . $key; |
|
39 | + $key = '_'.$key; |
|
40 | 40 | if (property_exists($this, $key)) { |
41 | 41 | $this->{$key} = $value; |
42 | 42 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | . '" style="' |
61 | 61 | . $this->_form_section->html_style() |
62 | 62 | . '">'; |
63 | - $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>'; |
|
63 | + $html .= '<legend class="'.$this->legend_class().'">'.$this->legend_text().'</legend>'; |
|
64 | 64 | return $html; |
65 | 65 | } |
66 | 66 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function layout_form_end() |
75 | 75 | { |
76 | - return EEH_HTML::nl(-1) . '</fieldset>'; |
|
76 | + return EEH_HTML::nl(-1).'</fieldset>'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 |
@@ -11,107 +11,107 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout |
13 | 13 | { |
14 | - /** |
|
15 | - * legend_class |
|
16 | - * |
|
17 | - * @var string |
|
18 | - */ |
|
19 | - protected $_legend_class; |
|
20 | - |
|
21 | - /** |
|
22 | - * legend_text |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $_legend_text; |
|
27 | - |
|
28 | - |
|
29 | - |
|
30 | - /** |
|
31 | - * construct |
|
32 | - * |
|
33 | - * @param array $options |
|
34 | - */ |
|
35 | - public function __construct($options = array()) |
|
36 | - { |
|
37 | - foreach ($options as $key => $value) { |
|
38 | - $key = '_' . $key; |
|
39 | - if (property_exists($this, $key)) { |
|
40 | - $this->{$key} = $value; |
|
41 | - } |
|
42 | - } |
|
43 | - } |
|
44 | - |
|
45 | - |
|
46 | - |
|
47 | - /** |
|
48 | - * opening div tag for a form |
|
49 | - * |
|
50 | - * @return string |
|
51 | - */ |
|
52 | - public function layout_form_begin() |
|
53 | - { |
|
54 | - $html = EEH_HTML::nl(1) |
|
55 | - . '<fieldset id="' |
|
56 | - . $this->_form_section->html_id() |
|
57 | - . '" class="' |
|
58 | - . $this->_form_section->html_class() |
|
59 | - . '" style="' |
|
60 | - . $this->_form_section->html_style() |
|
61 | - . '">'; |
|
62 | - $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>'; |
|
63 | - return $html; |
|
64 | - } |
|
65 | - |
|
66 | - |
|
67 | - |
|
68 | - /** |
|
69 | - * closing div tag for a form |
|
70 | - * |
|
71 | - * @return string |
|
72 | - */ |
|
73 | - public function layout_form_end() |
|
74 | - { |
|
75 | - return EEH_HTML::nl(-1) . '</fieldset>'; |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - |
|
80 | - /** |
|
81 | - * @param string $legend_class |
|
82 | - */ |
|
83 | - public function set_legend_class($legend_class) |
|
84 | - { |
|
85 | - $this->_legend_class = $legend_class; |
|
86 | - } |
|
87 | - |
|
88 | - |
|
89 | - |
|
90 | - /** |
|
91 | - * @return string |
|
92 | - */ |
|
93 | - public function legend_class() |
|
94 | - { |
|
95 | - return $this->_legend_class; |
|
96 | - } |
|
97 | - |
|
98 | - |
|
99 | - |
|
100 | - /** |
|
101 | - * @param string $legend_text |
|
102 | - */ |
|
103 | - public function set_legend_text($legend_text) |
|
104 | - { |
|
105 | - $this->_legend_text = $legend_text; |
|
106 | - } |
|
107 | - |
|
108 | - |
|
109 | - |
|
110 | - /** |
|
111 | - * @return string |
|
112 | - */ |
|
113 | - public function legend_text() |
|
114 | - { |
|
115 | - return $this->_legend_text; |
|
116 | - } |
|
14 | + /** |
|
15 | + * legend_class |
|
16 | + * |
|
17 | + * @var string |
|
18 | + */ |
|
19 | + protected $_legend_class; |
|
20 | + |
|
21 | + /** |
|
22 | + * legend_text |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $_legend_text; |
|
27 | + |
|
28 | + |
|
29 | + |
|
30 | + /** |
|
31 | + * construct |
|
32 | + * |
|
33 | + * @param array $options |
|
34 | + */ |
|
35 | + public function __construct($options = array()) |
|
36 | + { |
|
37 | + foreach ($options as $key => $value) { |
|
38 | + $key = '_' . $key; |
|
39 | + if (property_exists($this, $key)) { |
|
40 | + $this->{$key} = $value; |
|
41 | + } |
|
42 | + } |
|
43 | + } |
|
44 | + |
|
45 | + |
|
46 | + |
|
47 | + /** |
|
48 | + * opening div tag for a form |
|
49 | + * |
|
50 | + * @return string |
|
51 | + */ |
|
52 | + public function layout_form_begin() |
|
53 | + { |
|
54 | + $html = EEH_HTML::nl(1) |
|
55 | + . '<fieldset id="' |
|
56 | + . $this->_form_section->html_id() |
|
57 | + . '" class="' |
|
58 | + . $this->_form_section->html_class() |
|
59 | + . '" style="' |
|
60 | + . $this->_form_section->html_style() |
|
61 | + . '">'; |
|
62 | + $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>'; |
|
63 | + return $html; |
|
64 | + } |
|
65 | + |
|
66 | + |
|
67 | + |
|
68 | + /** |
|
69 | + * closing div tag for a form |
|
70 | + * |
|
71 | + * @return string |
|
72 | + */ |
|
73 | + public function layout_form_end() |
|
74 | + { |
|
75 | + return EEH_HTML::nl(-1) . '</fieldset>'; |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + |
|
80 | + /** |
|
81 | + * @param string $legend_class |
|
82 | + */ |
|
83 | + public function set_legend_class($legend_class) |
|
84 | + { |
|
85 | + $this->_legend_class = $legend_class; |
|
86 | + } |
|
87 | + |
|
88 | + |
|
89 | + |
|
90 | + /** |
|
91 | + * @return string |
|
92 | + */ |
|
93 | + public function legend_class() |
|
94 | + { |
|
95 | + return $this->_legend_class; |
|
96 | + } |
|
97 | + |
|
98 | + |
|
99 | + |
|
100 | + /** |
|
101 | + * @param string $legend_text |
|
102 | + */ |
|
103 | + public function set_legend_text($legend_text) |
|
104 | + { |
|
105 | + $this->_legend_text = $legend_text; |
|
106 | + } |
|
107 | + |
|
108 | + |
|
109 | + |
|
110 | + /** |
|
111 | + * @return string |
|
112 | + */ |
|
113 | + public function legend_text() |
|
114 | + { |
|
115 | + return $this->_legend_text; |
|
116 | + } |
|
117 | 117 | } |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | return EEH_HTML::table( |
15 | 15 | '', |
16 | 16 | $this->_form_section->html_id(), |
17 | - $this->_form_section->html_class() . ' form-table', |
|
17 | + $this->_form_section->html_class().' form-table', |
|
18 | 18 | $this->_form_section->html_style() |
19 | - ) . EEH_HTML::tbody(); |
|
19 | + ).EEH_HTML::tbody(); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function layout_form_end($additional_args = array()) |
30 | 30 | { |
31 | - return EEH_HTML::tbodyx() . EEH_HTML::tablex($this->_form_section->html_id()); |
|
31 | + return EEH_HTML::tbodyx().EEH_HTML::tablex($this->_form_section->html_id()); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy |
46 | 46 | || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy |
47 | 47 | ) { |
48 | - $input->set_html_class($input->html_class() . ' large-text'); |
|
48 | + $input->set_html_class($input->html_class().' large-text'); |
|
49 | 49 | } |
50 | 50 | $input_html = $input->get_html_for_input(); |
51 | 51 | // maybe add errors and help text ? |
52 | 52 | $input_html .= $input->get_html_for_errors() !== '' |
53 | - ? EEH_HTML::nl() . $input->get_html_for_errors() |
|
53 | + ? EEH_HTML::nl().$input->get_html_for_errors() |
|
54 | 54 | : ''; |
55 | 55 | $input_html .= $input->get_html_for_help() !== '' |
56 | - ? EEH_HTML::nl() . $input->get_html_for_help() |
|
56 | + ? EEH_HTML::nl().$input->get_html_for_help() |
|
57 | 57 | : ''; |
58 | 58 | // overriding parent to add wp admin specific things. |
59 | 59 | $html = ''; |
@@ -3,90 +3,90 @@ |
||
3 | 3 | class EE_Admin_One_Column_Layout extends EE_Form_Section_Layout_Base |
4 | 4 | { |
5 | 5 | |
6 | - /** |
|
7 | - * Starts the form section |
|
8 | - * |
|
9 | - * @param array $additional_args |
|
10 | - * @return string |
|
11 | - */ |
|
12 | - public function layout_form_begin($additional_args = array()) |
|
13 | - { |
|
14 | - return EEH_HTML::table( |
|
15 | - '', |
|
16 | - $this->_form_section->html_id(), |
|
17 | - $this->_form_section->html_class() . ' form-table', |
|
18 | - $this->_form_section->html_style() |
|
19 | - ) . EEH_HTML::tbody(); |
|
20 | - } |
|
6 | + /** |
|
7 | + * Starts the form section |
|
8 | + * |
|
9 | + * @param array $additional_args |
|
10 | + * @return string |
|
11 | + */ |
|
12 | + public function layout_form_begin($additional_args = array()) |
|
13 | + { |
|
14 | + return EEH_HTML::table( |
|
15 | + '', |
|
16 | + $this->_form_section->html_id(), |
|
17 | + $this->_form_section->html_class() . ' form-table', |
|
18 | + $this->_form_section->html_style() |
|
19 | + ) . EEH_HTML::tbody(); |
|
20 | + } |
|
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * Ends the form section |
|
25 | - * |
|
26 | - * @param array $additional_args |
|
27 | - * @return string |
|
28 | - */ |
|
29 | - public function layout_form_end($additional_args = array()) |
|
30 | - { |
|
31 | - return EEH_HTML::tbodyx() . EEH_HTML::tablex($this->_form_section->html_id()); |
|
32 | - } |
|
23 | + /** |
|
24 | + * Ends the form section |
|
25 | + * |
|
26 | + * @param array $additional_args |
|
27 | + * @return string |
|
28 | + */ |
|
29 | + public function layout_form_end($additional_args = array()) |
|
30 | + { |
|
31 | + return EEH_HTML::tbodyx() . EEH_HTML::tablex($this->_form_section->html_id()); |
|
32 | + } |
|
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * Lays out the row for the input, including label and errors |
|
37 | - * |
|
38 | - * @param EE_Form_Input_Base $input |
|
39 | - * @return string |
|
40 | - * @throws EE_Error |
|
41 | - */ |
|
42 | - public function layout_input($input) |
|
43 | - { |
|
44 | - if ( |
|
45 | - $input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy |
|
46 | - || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy |
|
47 | - || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy |
|
48 | - ) { |
|
49 | - $input->set_html_class($input->html_class() . ' large-text'); |
|
50 | - } |
|
51 | - $input_html = $input->get_html_for_input(); |
|
52 | - // maybe add errors and help text ? |
|
53 | - $input_html .= $input->get_html_for_errors() !== '' |
|
54 | - ? EEH_HTML::nl() . $input->get_html_for_errors() |
|
55 | - : ''; |
|
56 | - $input_html .= $input->get_html_for_help() !== '' |
|
57 | - ? EEH_HTML::nl() . $input->get_html_for_help() |
|
58 | - : ''; |
|
59 | - // overriding parent to add wp admin specific things. |
|
60 | - $html = ''; |
|
61 | - if ($input instanceof EE_Hidden_Input) { |
|
62 | - $html .= EEH_HTML::no_row($input->get_html_for_input()); |
|
63 | - } else { |
|
64 | - $html .= EEH_HTML::tr( |
|
65 | - EEH_HTML::td( |
|
66 | - $input->get_html_for_label() |
|
67 | - . EEH_HTML::nl() |
|
68 | - . $input_html |
|
69 | - ) |
|
70 | - ); |
|
71 | - } |
|
72 | - return $html; |
|
73 | - } |
|
35 | + /** |
|
36 | + * Lays out the row for the input, including label and errors |
|
37 | + * |
|
38 | + * @param EE_Form_Input_Base $input |
|
39 | + * @return string |
|
40 | + * @throws EE_Error |
|
41 | + */ |
|
42 | + public function layout_input($input) |
|
43 | + { |
|
44 | + if ( |
|
45 | + $input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy |
|
46 | + || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy |
|
47 | + || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy |
|
48 | + ) { |
|
49 | + $input->set_html_class($input->html_class() . ' large-text'); |
|
50 | + } |
|
51 | + $input_html = $input->get_html_for_input(); |
|
52 | + // maybe add errors and help text ? |
|
53 | + $input_html .= $input->get_html_for_errors() !== '' |
|
54 | + ? EEH_HTML::nl() . $input->get_html_for_errors() |
|
55 | + : ''; |
|
56 | + $input_html .= $input->get_html_for_help() !== '' |
|
57 | + ? EEH_HTML::nl() . $input->get_html_for_help() |
|
58 | + : ''; |
|
59 | + // overriding parent to add wp admin specific things. |
|
60 | + $html = ''; |
|
61 | + if ($input instanceof EE_Hidden_Input) { |
|
62 | + $html .= EEH_HTML::no_row($input->get_html_for_input()); |
|
63 | + } else { |
|
64 | + $html .= EEH_HTML::tr( |
|
65 | + EEH_HTML::td( |
|
66 | + $input->get_html_for_label() |
|
67 | + . EEH_HTML::nl() |
|
68 | + . $input_html |
|
69 | + ) |
|
70 | + ); |
|
71 | + } |
|
72 | + return $html; |
|
73 | + } |
|
74 | 74 | |
75 | 75 | |
76 | - /** |
|
77 | - * Lays out a row for the subsection |
|
78 | - * |
|
79 | - * @param EE_Form_Section_Proper $form_section |
|
80 | - * @return string |
|
81 | - */ |
|
82 | - public function layout_subsection($form_section) |
|
83 | - { |
|
84 | - if ( |
|
85 | - $form_section instanceof EE_Form_Section_Proper |
|
86 | - || $form_section instanceof EE_Form_Section_HTML |
|
87 | - ) { |
|
88 | - return EEH_HTML::no_row($form_section->get_html()); |
|
89 | - } |
|
90 | - return ''; |
|
91 | - } |
|
76 | + /** |
|
77 | + * Lays out a row for the subsection |
|
78 | + * |
|
79 | + * @param EE_Form_Section_Proper $form_section |
|
80 | + * @return string |
|
81 | + */ |
|
82 | + public function layout_subsection($form_section) |
|
83 | + { |
|
84 | + if ( |
|
85 | + $form_section instanceof EE_Form_Section_Proper |
|
86 | + || $form_section instanceof EE_Form_Section_HTML |
|
87 | + ) { |
|
88 | + return EEH_HTML::no_row($form_section->get_html()); |
|
89 | + } |
|
90 | + return ''; |
|
91 | + } |
|
92 | 92 | } |
@@ -13,58 +13,58 @@ |
||
13 | 13 | */ |
14 | 14 | class EE_Many_Valued_Validation_Strategy extends EE_Validation_Strategy_Base |
15 | 15 | { |
16 | - protected $_individual_item_validation_strategies = array(); |
|
17 | - /** |
|
18 | - * |
|
19 | - * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base) |
|
20 | - */ |
|
21 | - public function __construct($individual_item_validation_strategies) |
|
22 | - { |
|
23 | - if (! is_array($individual_item_validation_strategies)) { |
|
24 | - $individual_item_validation_strategies = array($individual_item_validation_strategies); |
|
25 | - } |
|
26 | - $this->_individual_item_validation_strategies = $individual_item_validation_strategies; |
|
27 | - parent::__construct(); |
|
28 | - } |
|
16 | + protected $_individual_item_validation_strategies = array(); |
|
17 | + /** |
|
18 | + * |
|
19 | + * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base) |
|
20 | + */ |
|
21 | + public function __construct($individual_item_validation_strategies) |
|
22 | + { |
|
23 | + if (! is_array($individual_item_validation_strategies)) { |
|
24 | + $individual_item_validation_strategies = array($individual_item_validation_strategies); |
|
25 | + } |
|
26 | + $this->_individual_item_validation_strategies = $individual_item_validation_strategies; |
|
27 | + parent::__construct(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * Applies all teh individual item validation strategies on each item in the array |
|
34 | - * @param array $normalized_value |
|
35 | - * @return boolean |
|
36 | - */ |
|
37 | - public function validate($normalized_value) |
|
38 | - { |
|
39 | - if (is_array($normalized_value)) { |
|
40 | - $items_to_validate = $normalized_value; |
|
41 | - } else { |
|
42 | - $items_to_validate = array($normalized_value); |
|
43 | - } |
|
44 | - foreach ($items_to_validate as $individual_item) { |
|
45 | - foreach ($this->_individual_item_validation_strategies as $validation_strategy) { |
|
46 | - if ($validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
47 | - $validation_strategy->validate($individual_item); |
|
48 | - } |
|
49 | - } |
|
50 | - } |
|
51 | - return true; |
|
52 | - } |
|
32 | + /** |
|
33 | + * Applies all teh individual item validation strategies on each item in the array |
|
34 | + * @param array $normalized_value |
|
35 | + * @return boolean |
|
36 | + */ |
|
37 | + public function validate($normalized_value) |
|
38 | + { |
|
39 | + if (is_array($normalized_value)) { |
|
40 | + $items_to_validate = $normalized_value; |
|
41 | + } else { |
|
42 | + $items_to_validate = array($normalized_value); |
|
43 | + } |
|
44 | + foreach ($items_to_validate as $individual_item) { |
|
45 | + foreach ($this->_individual_item_validation_strategies as $validation_strategy) { |
|
46 | + if ($validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
47 | + $validation_strategy->validate($individual_item); |
|
48 | + } |
|
49 | + } |
|
50 | + } |
|
51 | + return true; |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Extends parent's _construct_finalize so we ALSO set the input |
|
58 | - * on each sub-validation-strategy |
|
59 | - * @param \EE_Form_Input_Base $form_input |
|
60 | - */ |
|
61 | - public function _construct_finalize(\EE_Form_Input_Base $form_input) |
|
62 | - { |
|
63 | - parent::_construct_finalize($form_input); |
|
64 | - foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) { |
|
65 | - if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
66 | - $item_validation_strategy->_construct_finalize($form_input); |
|
67 | - } |
|
68 | - } |
|
69 | - } |
|
56 | + /** |
|
57 | + * Extends parent's _construct_finalize so we ALSO set the input |
|
58 | + * on each sub-validation-strategy |
|
59 | + * @param \EE_Form_Input_Base $form_input |
|
60 | + */ |
|
61 | + public function _construct_finalize(\EE_Form_Input_Base $form_input) |
|
62 | + { |
|
63 | + parent::_construct_finalize($form_input); |
|
64 | + foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) { |
|
65 | + if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
66 | + $item_validation_strategy->_construct_finalize($form_input); |
|
67 | + } |
|
68 | + } |
|
69 | + } |
|
70 | 70 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($individual_item_validation_strategies) |
22 | 22 | { |
23 | - if (! is_array($individual_item_validation_strategies)) { |
|
23 | + if ( ! is_array($individual_item_validation_strategies)) { |
|
24 | 24 | $individual_item_validation_strategies = array($individual_item_validation_strategies); |
25 | 25 | } |
26 | 26 | $this->_individual_item_validation_strategies = $individual_item_validation_strategies; |
@@ -11,16 +11,16 @@ |
||
11 | 11 | */ |
12 | 12 | abstract class EE_Sensitive_Data_Removal_Base extends EE_Form_Input_Strategy_Base |
13 | 13 | { |
14 | - /** |
|
15 | - * Removes all the sensitive data from this normalized value. |
|
16 | - * For example, should could 'mask' a credit card from |
|
17 | - * '1234 1234 1234 1234' TO '**** **** **** 1234'. |
|
18 | - * Or turn a ccv number from |
|
19 | - * '123' to '***', |
|
20 | - * or turn a password from |
|
21 | - * 'CantHac7Th15' to '*************', |
|
22 | - * or just leave htevalue as-is |
|
23 | - * @return mixed |
|
24 | - */ |
|
25 | - abstract public function remove_sensitive_data($normalized_value); |
|
14 | + /** |
|
15 | + * Removes all the sensitive data from this normalized value. |
|
16 | + * For example, should could 'mask' a credit card from |
|
17 | + * '1234 1234 1234 1234' TO '**** **** **** 1234'. |
|
18 | + * Or turn a ccv number from |
|
19 | + * '123' to '***', |
|
20 | + * or turn a password from |
|
21 | + * 'CantHac7Th15' to '*************', |
|
22 | + * or just leave htevalue as-is |
|
23 | + * @return mixed |
|
24 | + */ |
|
25 | + abstract public function remove_sensitive_data($normalized_value); |
|
26 | 26 | } |
@@ -11,23 +11,23 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_All_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base |
13 | 13 | { |
14 | - public function remove_sensitive_data($normalized_value) |
|
15 | - { |
|
16 | - switch (gettype($normalized_value)) { |
|
17 | - case "boolean": |
|
18 | - return false; |
|
19 | - case "integer": |
|
20 | - case "double": |
|
21 | - return 0; |
|
22 | - case "string": |
|
23 | - return ''; |
|
24 | - case "array": |
|
25 | - return array(); |
|
26 | - case "object": |
|
27 | - case "resource": |
|
28 | - case "NULL": |
|
29 | - default: |
|
30 | - return null; |
|
31 | - } |
|
32 | - } |
|
14 | + public function remove_sensitive_data($normalized_value) |
|
15 | + { |
|
16 | + switch (gettype($normalized_value)) { |
|
17 | + case "boolean": |
|
18 | + return false; |
|
19 | + case "integer": |
|
20 | + case "double": |
|
21 | + return 0; |
|
22 | + case "string": |
|
23 | + return ''; |
|
24 | + case "array": |
|
25 | + return array(); |
|
26 | + case "object": |
|
27 | + case "resource": |
|
28 | + case "NULL": |
|
29 | + default: |
|
30 | + return null; |
|
31 | + } |
|
32 | + } |
|
33 | 33 | } |
@@ -11,8 +11,8 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_No_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base |
13 | 13 | { |
14 | - public function remove_sensitive_data($normalized_value) |
|
15 | - { |
|
16 | - return $normalized_value; |
|
17 | - } |
|
14 | + public function remove_sensitive_data($normalized_value) |
|
15 | + { |
|
16 | + return $normalized_value; |
|
17 | + } |
|
18 | 18 | } |
@@ -11,11 +11,11 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML |
13 | 13 | { |
14 | - public function __construct($template_file, $args = array(), $options_array = array()) |
|
15 | - { |
|
16 | - $html = EEH_Template::locate_template($template_file, $args); |
|
14 | + public function __construct($template_file, $args = array(), $options_array = array()) |
|
15 | + { |
|
16 | + $html = EEH_Template::locate_template($template_file, $args); |
|
17 | 17 | |
18 | 18 | // echo " filepath:$template_file html $html"; |
19 | - parent::__construct($html, $options_array); |
|
20 | - } |
|
19 | + parent::__construct($html, $options_array); |
|
20 | + } |
|
21 | 21 | } |
@@ -2,47 +2,47 @@ |
||
2 | 2 | |
3 | 3 | class EE_Validation_Error extends Exception |
4 | 4 | { |
5 | - /** |
|
6 | - * Form Section from which this error originated. |
|
7 | - * @var EE_Form_Section |
|
8 | - */ |
|
9 | - protected $_form_section; |
|
10 | - /** |
|
11 | - * a short string for uniquely identifying the error, which isn't internationalized and |
|
12 | - * machines can use to identify the error |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $_string_code; |
|
5 | + /** |
|
6 | + * Form Section from which this error originated. |
|
7 | + * @var EE_Form_Section |
|
8 | + */ |
|
9 | + protected $_form_section; |
|
10 | + /** |
|
11 | + * a short string for uniquely identifying the error, which isn't internationalized and |
|
12 | + * machines can use to identify the error |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $_string_code; |
|
16 | 16 | |
17 | - /** |
|
18 | - * When creating a validation error, we need to know which field the error relates to. |
|
19 | - * @param string $message message you want to display about this error |
|
20 | - * @param string $string_code a code for uniquely identifying the exception |
|
21 | - * @param EE_Form_Section_Validatable $form_section |
|
22 | - * @param Exception $previous if there was an exception that caused this exception |
|
23 | - */ |
|
24 | - public function __construct($message = null, $string_code = null, $form_section = null, $previous = null) |
|
25 | - { |
|
26 | - $this->_form_section = $form_section; |
|
27 | - $this->_string_code = $string_code; |
|
28 | - parent::__construct($message, 500, $previous); |
|
29 | - } |
|
17 | + /** |
|
18 | + * When creating a validation error, we need to know which field the error relates to. |
|
19 | + * @param string $message message you want to display about this error |
|
20 | + * @param string $string_code a code for uniquely identifying the exception |
|
21 | + * @param EE_Form_Section_Validatable $form_section |
|
22 | + * @param Exception $previous if there was an exception that caused this exception |
|
23 | + */ |
|
24 | + public function __construct($message = null, $string_code = null, $form_section = null, $previous = null) |
|
25 | + { |
|
26 | + $this->_form_section = $form_section; |
|
27 | + $this->_string_code = $string_code; |
|
28 | + parent::__construct($message, 500, $previous); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * returns teh form section which caused the error. |
|
33 | - * @return EE_Form_Section_Validatable |
|
34 | - */ |
|
35 | - public function get_form_section() |
|
36 | - { |
|
37 | - return $this->_form_section; |
|
38 | - } |
|
39 | - /** |
|
40 | - * Sets teh form seciton of the error, in case it wasnt set previously |
|
41 | - * @param EE_Form_Section_Validatable $form_section |
|
42 | - * @return void |
|
43 | - */ |
|
44 | - public function set_form_section($form_section) |
|
45 | - { |
|
46 | - $this->_form_section = $form_section; |
|
47 | - } |
|
31 | + /** |
|
32 | + * returns teh form section which caused the error. |
|
33 | + * @return EE_Form_Section_Validatable |
|
34 | + */ |
|
35 | + public function get_form_section() |
|
36 | + { |
|
37 | + return $this->_form_section; |
|
38 | + } |
|
39 | + /** |
|
40 | + * Sets teh form seciton of the error, in case it wasnt set previously |
|
41 | + * @param EE_Form_Section_Validatable $form_section |
|
42 | + * @return void |
|
43 | + */ |
|
44 | + public function set_form_section($form_section) |
|
45 | + { |
|
46 | + $this->_form_section = $form_section; |
|
47 | + } |
|
48 | 48 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // price td |
109 | 109 | $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c'); |
110 | 110 | // total td |
111 | - $total = $line_item->is_taxable() ? $line_item->total_no_code() . '*' : $line_item->total_no_code(); |
|
111 | + $total = $line_item->is_taxable() ? $line_item->total_no_code().'*' : $line_item->total_no_code(); |
|
112 | 112 | $html .= EEH_HTML::td($total, '', 'item_r'); |
113 | 113 | // end of row |
114 | 114 | $html .= EEH_HTML::trx(); |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | $html .= EEH_HTML::td($line_item->name(), '', 'item_l sub-item'); |
133 | 133 | // desc td |
134 | 134 | $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
135 | - $html .= EEH_HTML::td() . EEH_HTML::tdx(); |
|
135 | + $html .= EEH_HTML::td().EEH_HTML::tdx(); |
|
136 | 136 | // discount/surcharge td |
137 | 137 | if ($line_item->is_percent()) { |
138 | - $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c'); |
|
138 | + $html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c'); |
|
139 | 139 | } else { |
140 | 140 | $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c'); |
141 | 141 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | // desc td |
165 | 165 | $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
166 | 166 | // percent td |
167 | - $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c', '', ' colspan="2"'); |
|
167 | + $html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c', '', ' colspan="2"'); |
|
168 | 168 | // total td |
169 | 169 | $html .= EEH_HTML::td($line_item->total_no_code(), '', 'item_r'); |
170 | 170 | // end of row |
@@ -1,223 +1,223 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** |
4 | - * |
|
5 | - * Class EE_Invoice_Line_Item_Display_Strategy |
|
6 | - * |
|
7 | - * Description |
|
8 | - * |
|
9 | - * @package Event Espresso |
|
10 | - * @subpackage core |
|
11 | - * @author Brent Christensen |
|
12 | - * |
|
13 | - * |
|
14 | - */ |
|
4 | + * |
|
5 | + * Class EE_Invoice_Line_Item_Display_Strategy |
|
6 | + * |
|
7 | + * Description |
|
8 | + * |
|
9 | + * @package Event Espresso |
|
10 | + * @subpackage core |
|
11 | + * @author Brent Christensen |
|
12 | + * |
|
13 | + * |
|
14 | + */ |
|
15 | 15 | class EE_Invoice_Line_Item_Display_Strategy implements EEI_Line_Item_Display |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * @param EE_Line_Item $line_item |
|
20 | - * @param array $options |
|
21 | - * @return mixed |
|
22 | - */ |
|
23 | - public function display_line_item(EE_Line_Item $line_item, $options = array()) |
|
24 | - { |
|
25 | - |
|
26 | - $html = ''; |
|
27 | - // set some default options and merge with incoming |
|
28 | - $default_options = array( |
|
29 | - 'show_desc' => true, |
|
30 | - 'odd' => false |
|
31 | - ); |
|
32 | - $options = array_merge($default_options, (array) $options); |
|
33 | - |
|
34 | - switch ($line_item->type()) { |
|
35 | - case EEM_Line_Item::type_total: |
|
36 | - // loop thru children |
|
37 | - foreach ($line_item->children() as $child_line_item) { |
|
38 | - // recursively feed children back into this method |
|
39 | - $html .= $this->display_line_item($child_line_item, $options); |
|
40 | - } |
|
41 | - $html .= $this->_separator_row($options); |
|
42 | - $html .= $this->_total_row($line_item, esc_html__('Total', 'event_espresso'), $options); |
|
43 | - break; |
|
44 | - |
|
45 | - |
|
46 | - case EEM_Line_Item::type_sub_total: |
|
47 | - // loop thru children |
|
48 | - foreach ($line_item->children() as $child_line_item) { |
|
49 | - // recursively feed children back into this method |
|
50 | - $html .= $this->display_line_item($child_line_item, $options); |
|
51 | - } |
|
52 | - $html .= $this->_total_row($line_item, esc_html__('Sub-Total', 'event_espresso'), $options); |
|
53 | - break; |
|
54 | - |
|
55 | - |
|
56 | - case EEM_Line_Item::type_tax_sub_total: |
|
57 | - // loop thru children |
|
58 | - foreach ($line_item->children() as $child_line_item) { |
|
59 | - // recursively feed children back into this method |
|
60 | - $html .= $this->display_line_item($child_line_item, $options); |
|
61 | - } |
|
62 | - $html .= $this->_total_row($line_item, esc_html__('Tax Total', 'event_espresso'), $options); |
|
63 | - break; |
|
64 | - |
|
65 | - |
|
66 | - case EEM_Line_Item::type_line_item: |
|
67 | - // item row |
|
68 | - $html .= $this->_item_row($line_item, $options); |
|
69 | - // got any kids? |
|
70 | - foreach ($line_item->children() as $child_line_item) { |
|
71 | - $this->display_line_item($child_line_item, $options); |
|
72 | - } |
|
73 | - break; |
|
74 | - |
|
75 | - |
|
76 | - case EEM_Line_Item::type_sub_line_item: |
|
77 | - $html .= $this->_sub_item_row($line_item, $options); |
|
78 | - break; |
|
79 | - |
|
80 | - |
|
81 | - case EEM_Line_Item::type_tax: |
|
82 | - $html .= $this->_tax_row($line_item, $options); |
|
83 | - break; |
|
84 | - } |
|
85 | - |
|
86 | - return $html; |
|
87 | - } |
|
88 | - |
|
89 | - |
|
90 | - |
|
91 | - /** |
|
92 | - * _total_row |
|
93 | - * |
|
94 | - * @param EE_Line_Item $line_item |
|
95 | - * @param array $options |
|
96 | - * @return mixed |
|
97 | - */ |
|
98 | - private function _item_row(EE_Line_Item $line_item, $options = array()) |
|
99 | - { |
|
100 | - // start of row |
|
101 | - $row_class = $options['odd'] ? 'item odd' : 'item'; |
|
102 | - $html = EEH_HTML::tr('', $row_class); |
|
103 | - // name td |
|
104 | - $html .= EEH_HTML::td($line_item->name(), '', 'item_l'); |
|
105 | - // desc td |
|
106 | - $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
|
107 | - // quantity td |
|
108 | - $html .= EEH_HTML::td($line_item->quantity(), '', 'item_l'); |
|
109 | - // price td |
|
110 | - $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c'); |
|
111 | - // total td |
|
112 | - $total = $line_item->is_taxable() ? $line_item->total_no_code() . '*' : $line_item->total_no_code(); |
|
113 | - $html .= EEH_HTML::td($total, '', 'item_r'); |
|
114 | - // end of row |
|
115 | - $html .= EEH_HTML::trx(); |
|
116 | - return $html; |
|
117 | - } |
|
118 | - |
|
119 | - |
|
120 | - |
|
121 | - /** |
|
122 | - * _sub_item_row |
|
123 | - * |
|
124 | - * @param EE_Line_Item $line_item |
|
125 | - * @param array $options |
|
126 | - * @return mixed |
|
127 | - */ |
|
128 | - private function _sub_item_row(EE_Line_Item $line_item, $options = array()) |
|
129 | - { |
|
130 | - // start of row |
|
131 | - $html = EEH_HTML::tr('', 'item sub-item-row'); |
|
132 | - // name td |
|
133 | - $html .= EEH_HTML::td($line_item->name(), '', 'item_l sub-item'); |
|
134 | - // desc td |
|
135 | - $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
|
136 | - $html .= EEH_HTML::td() . EEH_HTML::tdx(); |
|
137 | - // discount/surcharge td |
|
138 | - if ($line_item->is_percent()) { |
|
139 | - $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c'); |
|
140 | - } else { |
|
141 | - $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c'); |
|
142 | - } |
|
143 | - // total td |
|
144 | - $html .= EEH_HTML::td($line_item->total_no_code(), '', 'item_r'); |
|
145 | - // end of row |
|
146 | - $html .= EEH_HTML::trx(); |
|
147 | - return $html; |
|
148 | - } |
|
149 | - |
|
150 | - |
|
151 | - |
|
152 | - /** |
|
153 | - * _tax_row |
|
154 | - * |
|
155 | - * @param EE_Line_Item $line_item |
|
156 | - * @param array $options |
|
157 | - * @return mixed |
|
158 | - */ |
|
159 | - private function _tax_row(EE_Line_Item $line_item, $options = array()) |
|
160 | - { |
|
161 | - // start of row |
|
162 | - $html = EEH_HTML::tr('', 'item sub-item tax-total'); |
|
163 | - // name td |
|
164 | - $html .= EEH_HTML::td($line_item->name(), '', 'item_l sub-item'); |
|
165 | - // desc td |
|
166 | - $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
|
167 | - // percent td |
|
168 | - $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c', '', ' colspan="2"'); |
|
169 | - // total td |
|
170 | - $html .= EEH_HTML::td($line_item->total_no_code(), '', 'item_r'); |
|
171 | - // end of row |
|
172 | - $html .= EEH_HTML::trx(); |
|
173 | - return $html; |
|
174 | - } |
|
175 | - |
|
176 | - |
|
177 | - |
|
178 | - /** |
|
179 | - * _total_row |
|
180 | - * |
|
181 | - * @param EE_Line_Item $line_item |
|
182 | - * @param string $text |
|
183 | - * @param array $options |
|
184 | - * @return mixed |
|
185 | - */ |
|
186 | - private function _total_row(EE_Line_Item $line_item, $text = '', $options = array()) |
|
187 | - { |
|
188 | - // colspan |
|
189 | - $colspan = $options['show_desc'] ? ' colspan="2"' : ''; |
|
190 | - // start of row |
|
191 | - $html = EEH_HTML::tr('', '', 'total_tr odd'); |
|
192 | - // empty td |
|
193 | - $html .= EEH_HTML::td(EEH_HTML::nbsp(), '', '', '', $colspan); |
|
194 | - // total td |
|
195 | - $html .= EEH_HTML::td($text, '', 'total_currency total', '', $colspan); |
|
196 | - // total td |
|
197 | - $html .= EEH_HTML::td($line_item->total_no_code(), '', 'total'); |
|
198 | - // end of row |
|
199 | - $html .= EEH_HTML::trx(); |
|
200 | - return $html; |
|
201 | - } |
|
202 | - |
|
203 | - |
|
204 | - |
|
205 | - /** |
|
206 | - * _separator_row |
|
207 | - * |
|
208 | - * @param array $options |
|
209 | - * @return mixed |
|
210 | - */ |
|
211 | - private function _separator_row($options = array()) |
|
212 | - { |
|
213 | - // colspan |
|
214 | - $colspan = $options['show_desc'] ? ' colspan="5"' : ' colspan="4"'; |
|
215 | - // start of row |
|
216 | - $html = EEH_HTML::tr(EEH_HTML::td('<hr>', '', '', '', $colspan)); |
|
18 | + /** |
|
19 | + * @param EE_Line_Item $line_item |
|
20 | + * @param array $options |
|
21 | + * @return mixed |
|
22 | + */ |
|
23 | + public function display_line_item(EE_Line_Item $line_item, $options = array()) |
|
24 | + { |
|
25 | + |
|
26 | + $html = ''; |
|
27 | + // set some default options and merge with incoming |
|
28 | + $default_options = array( |
|
29 | + 'show_desc' => true, |
|
30 | + 'odd' => false |
|
31 | + ); |
|
32 | + $options = array_merge($default_options, (array) $options); |
|
33 | + |
|
34 | + switch ($line_item->type()) { |
|
35 | + case EEM_Line_Item::type_total: |
|
36 | + // loop thru children |
|
37 | + foreach ($line_item->children() as $child_line_item) { |
|
38 | + // recursively feed children back into this method |
|
39 | + $html .= $this->display_line_item($child_line_item, $options); |
|
40 | + } |
|
41 | + $html .= $this->_separator_row($options); |
|
42 | + $html .= $this->_total_row($line_item, esc_html__('Total', 'event_espresso'), $options); |
|
43 | + break; |
|
44 | + |
|
45 | + |
|
46 | + case EEM_Line_Item::type_sub_total: |
|
47 | + // loop thru children |
|
48 | + foreach ($line_item->children() as $child_line_item) { |
|
49 | + // recursively feed children back into this method |
|
50 | + $html .= $this->display_line_item($child_line_item, $options); |
|
51 | + } |
|
52 | + $html .= $this->_total_row($line_item, esc_html__('Sub-Total', 'event_espresso'), $options); |
|
53 | + break; |
|
54 | + |
|
55 | + |
|
56 | + case EEM_Line_Item::type_tax_sub_total: |
|
57 | + // loop thru children |
|
58 | + foreach ($line_item->children() as $child_line_item) { |
|
59 | + // recursively feed children back into this method |
|
60 | + $html .= $this->display_line_item($child_line_item, $options); |
|
61 | + } |
|
62 | + $html .= $this->_total_row($line_item, esc_html__('Tax Total', 'event_espresso'), $options); |
|
63 | + break; |
|
64 | + |
|
65 | + |
|
66 | + case EEM_Line_Item::type_line_item: |
|
67 | + // item row |
|
68 | + $html .= $this->_item_row($line_item, $options); |
|
69 | + // got any kids? |
|
70 | + foreach ($line_item->children() as $child_line_item) { |
|
71 | + $this->display_line_item($child_line_item, $options); |
|
72 | + } |
|
73 | + break; |
|
74 | + |
|
75 | + |
|
76 | + case EEM_Line_Item::type_sub_line_item: |
|
77 | + $html .= $this->_sub_item_row($line_item, $options); |
|
78 | + break; |
|
79 | + |
|
80 | + |
|
81 | + case EEM_Line_Item::type_tax: |
|
82 | + $html .= $this->_tax_row($line_item, $options); |
|
83 | + break; |
|
84 | + } |
|
85 | + |
|
86 | + return $html; |
|
87 | + } |
|
88 | + |
|
89 | + |
|
90 | + |
|
91 | + /** |
|
92 | + * _total_row |
|
93 | + * |
|
94 | + * @param EE_Line_Item $line_item |
|
95 | + * @param array $options |
|
96 | + * @return mixed |
|
97 | + */ |
|
98 | + private function _item_row(EE_Line_Item $line_item, $options = array()) |
|
99 | + { |
|
100 | + // start of row |
|
101 | + $row_class = $options['odd'] ? 'item odd' : 'item'; |
|
102 | + $html = EEH_HTML::tr('', $row_class); |
|
103 | + // name td |
|
104 | + $html .= EEH_HTML::td($line_item->name(), '', 'item_l'); |
|
105 | + // desc td |
|
106 | + $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
|
107 | + // quantity td |
|
108 | + $html .= EEH_HTML::td($line_item->quantity(), '', 'item_l'); |
|
109 | + // price td |
|
110 | + $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c'); |
|
111 | + // total td |
|
112 | + $total = $line_item->is_taxable() ? $line_item->total_no_code() . '*' : $line_item->total_no_code(); |
|
113 | + $html .= EEH_HTML::td($total, '', 'item_r'); |
|
114 | + // end of row |
|
115 | + $html .= EEH_HTML::trx(); |
|
116 | + return $html; |
|
117 | + } |
|
118 | + |
|
119 | + |
|
120 | + |
|
121 | + /** |
|
122 | + * _sub_item_row |
|
123 | + * |
|
124 | + * @param EE_Line_Item $line_item |
|
125 | + * @param array $options |
|
126 | + * @return mixed |
|
127 | + */ |
|
128 | + private function _sub_item_row(EE_Line_Item $line_item, $options = array()) |
|
129 | + { |
|
130 | + // start of row |
|
131 | + $html = EEH_HTML::tr('', 'item sub-item-row'); |
|
132 | + // name td |
|
133 | + $html .= EEH_HTML::td($line_item->name(), '', 'item_l sub-item'); |
|
134 | + // desc td |
|
135 | + $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
|
136 | + $html .= EEH_HTML::td() . EEH_HTML::tdx(); |
|
137 | + // discount/surcharge td |
|
138 | + if ($line_item->is_percent()) { |
|
139 | + $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c'); |
|
140 | + } else { |
|
141 | + $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c'); |
|
142 | + } |
|
143 | + // total td |
|
144 | + $html .= EEH_HTML::td($line_item->total_no_code(), '', 'item_r'); |
|
145 | + // end of row |
|
146 | + $html .= EEH_HTML::trx(); |
|
147 | + return $html; |
|
148 | + } |
|
149 | + |
|
150 | + |
|
151 | + |
|
152 | + /** |
|
153 | + * _tax_row |
|
154 | + * |
|
155 | + * @param EE_Line_Item $line_item |
|
156 | + * @param array $options |
|
157 | + * @return mixed |
|
158 | + */ |
|
159 | + private function _tax_row(EE_Line_Item $line_item, $options = array()) |
|
160 | + { |
|
161 | + // start of row |
|
162 | + $html = EEH_HTML::tr('', 'item sub-item tax-total'); |
|
163 | + // name td |
|
164 | + $html .= EEH_HTML::td($line_item->name(), '', 'item_l sub-item'); |
|
165 | + // desc td |
|
166 | + $html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : ''; |
|
167 | + // percent td |
|
168 | + $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c', '', ' colspan="2"'); |
|
169 | + // total td |
|
170 | + $html .= EEH_HTML::td($line_item->total_no_code(), '', 'item_r'); |
|
171 | + // end of row |
|
172 | + $html .= EEH_HTML::trx(); |
|
173 | + return $html; |
|
174 | + } |
|
175 | + |
|
176 | + |
|
177 | + |
|
178 | + /** |
|
179 | + * _total_row |
|
180 | + * |
|
181 | + * @param EE_Line_Item $line_item |
|
182 | + * @param string $text |
|
183 | + * @param array $options |
|
184 | + * @return mixed |
|
185 | + */ |
|
186 | + private function _total_row(EE_Line_Item $line_item, $text = '', $options = array()) |
|
187 | + { |
|
188 | + // colspan |
|
189 | + $colspan = $options['show_desc'] ? ' colspan="2"' : ''; |
|
190 | + // start of row |
|
191 | + $html = EEH_HTML::tr('', '', 'total_tr odd'); |
|
192 | + // empty td |
|
193 | + $html .= EEH_HTML::td(EEH_HTML::nbsp(), '', '', '', $colspan); |
|
194 | + // total td |
|
195 | + $html .= EEH_HTML::td($text, '', 'total_currency total', '', $colspan); |
|
196 | + // total td |
|
197 | + $html .= EEH_HTML::td($line_item->total_no_code(), '', 'total'); |
|
198 | + // end of row |
|
199 | + $html .= EEH_HTML::trx(); |
|
200 | + return $html; |
|
201 | + } |
|
202 | + |
|
203 | + |
|
204 | + |
|
205 | + /** |
|
206 | + * _separator_row |
|
207 | + * |
|
208 | + * @param array $options |
|
209 | + * @return mixed |
|
210 | + */ |
|
211 | + private function _separator_row($options = array()) |
|
212 | + { |
|
213 | + // colspan |
|
214 | + $colspan = $options['show_desc'] ? ' colspan="5"' : ' colspan="4"'; |
|
215 | + // start of row |
|
216 | + $html = EEH_HTML::tr(EEH_HTML::td('<hr>', '', '', '', $colspan)); |
|
217 | 217 | // // separator td |
218 | 218 | // $html .= EEH_HTML::td( '<hr>', '', '', '', $colspan ); |
219 | 219 | // // end of row |
220 | 220 | // $html .= EEH_HTML::trx(); |
221 | - return $html; |
|
222 | - } |
|
221 | + return $html; |
|
222 | + } |
|
223 | 223 | } |