@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @since 3.6.0 |
27 | 27 | */ |
28 | - public $sContext = ''; |
|
28 | + public $sContext = ''; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @since 3.6.0 |
26 | 26 | */ |
27 | - public $sContext = 'fieldrow'; |
|
27 | + public $sContext = 'fieldrow'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @return array The formatted attributes array. |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | 'class' => $this->getClassAttribute( |
62 | 62 | 'admin-page-framework-sections', |
63 | 63 | $this->getAOrB( |
64 | - ! $this->sSectionTabSlug || '_default' === $this->sSectionTabSlug, |
|
64 | + !$this->sSectionTabSlug || '_default' === $this->sSectionTabSlug, |
|
65 | 65 | null, |
66 | 66 | 'admin-page-framework-section-tabs-contents' |
67 | 67 | ), |
68 | 68 | $this->getAOrB( |
69 | 69 | empty( $this->aCollapsible ), |
70 | 70 | null, |
71 | - 'admin-page-framework-collapsible-sections-content' . ' ' |
|
72 | - . 'admin-page-framework-collapsible-content' . ' ' |
|
71 | + 'admin-page-framework-collapsible-sections-content'.' ' |
|
72 | + . 'admin-page-framework-collapsible-content'.' ' |
|
73 | 73 | . 'accordion-section-content' |
74 | 74 | |
75 | 75 | ), |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // 3.6.0+ - dimensional section address without the option key, used by the 'save' argument and when sorting dynamic elements. |
86 | 86 | 'data-section_address' => $this->aSectionset[ 'section_id' ], |
87 | - 'data-section_address_model' => $this->aSectionset[ 'section_id' ] . '|' . '___i___', |
|
87 | + 'data-section_address_model' => $this->aSectionset[ 'section_id' ].'|'.'___i___', |
|
88 | 88 | |
89 | 89 | ) |
90 | 90 | + $this->_getDynamicElementArguments( $this->aSectionset ); |
@@ -123,12 +123,12 @@ discard block |
||
123 | 123 | return array( |
124 | 124 | // 3.6.0+ Stores the total number of dynamic elements, used to generate the input id and name of repeated sections which contain an incremented index number. |
125 | 125 | 'data-largest_index' => max( |
126 | - ( int ) $this->iSubSectionCount - 1, // zero-base index |
|
126 | + ( int ) $this->iSubSectionCount - 1, // zero-base index |
|
127 | 127 | 0 |
128 | 128 | ), // convert negative numbers to zero. |
129 | 129 | |
130 | - 'data-section_id_model' => $aSectionset[ 'section_id' ] . '__' . '___i___', |
|
131 | - 'data-flat_section_name_model' => $aSectionset[ 'section_id' ] . '|___i___', |
|
130 | + 'data-section_id_model' => $aSectionset[ 'section_id' ].'__'.'___i___', |
|
131 | + 'data-flat_section_name_model' => $aSectionset[ 'section_id' ].'|___i___', |
|
132 | 132 | // @todo apply a callback |
133 | 133 | // 'data-section_name_model' => $aSectionset[ 'section_id' ] . '[___i___]', |
134 | 134 | 'data-section_name_model' => $_oSectionNameGenerator->getModel(), |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @since 3.6.0 |
26 | 26 | */ |
27 | - public $sContext = 'field'; |
|
27 | + public $sContext = 'field'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Returns the field container attribute array. |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | protected function _getAttributes() { |
41 | 41 | |
42 | 42 | // 3.8.0+ Supports omitting the `type` argument. |
43 | - $_sFieldTypeSelector = $this->getAOrB( |
|
43 | + $_sFieldTypeSelector = $this->getAOrB( |
|
44 | 44 | $this->aArguments[ 'type' ], |
45 | 45 | " admin-page-framework-field-{$this->aArguments[ 'type' ]}", |
46 | 46 | '' |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | return array( |
67 | 67 | 'id' => $this->aArguments[ '_field_container_id' ], |
68 | - 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
68 | + 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
69 | 69 | 'class' => "admin-page-framework-field{$_sFieldTypeSelector}{$_sNestedFieldSelector}{$_sMixedFieldSelector}{$_sChildFieldSelector}" |
70 | 70 | . $this->getAOrB( |
71 | 71 | $this->aArguments[ 'attributes' ][ 'disabled' ], |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->aAttributes, |
39 | 39 | $this->iFieldsCount, |
40 | 40 | ); |
41 | - $this->aArguments = $_aParameters[ 0 ]; |
|
41 | + $this->aArguments = $_aParameters[ 0 ]; |
|
42 | 42 | $this->aAttributes = $_aParameters[ 1 ]; |
43 | 43 | $this->iFieldsCount = $_aParameters[ 2 ]; |
44 | 44 | |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | */ |
52 | 52 | protected function _getAttributes() { |
53 | 53 | return array( |
54 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
55 | - 'class' => 'admin-page-framework-' . $this->sContext |
|
56 | - . $this->getAOrB( ! empty( $this->aArguments[ 'repeatable' ] ), ' repeatable dynamic-fields', '' ) // 3.6.0+ Added the 'dynamic-fields' class selector. |
|
57 | - . $this->getAOrB( ! empty( $this->aArguments[ 'sortable' ] ), ' sortable dynamic-fields', '' ), |
|
54 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
55 | + 'class' => 'admin-page-framework-'.$this->sContext |
|
56 | + . $this->getAOrB( !empty( $this->aArguments[ 'repeatable' ] ), ' repeatable dynamic-fields', '' ) // 3.6.0+ Added the 'dynamic-fields' class selector. |
|
57 | + . $this->getAOrB( !empty( $this->aArguments[ 'sortable' ] ), ' sortable dynamic-fields', '' ), |
|
58 | 58 | |
59 | 59 | // referred by the sortable field JavaScript script. |
60 | 60 | 'data-type' => $this->aArguments[ 'type' ], |
61 | 61 | |
62 | 62 | // 3.6.0+ Stores the total number of dynamic fields, used to generate the input id and name of repeated fields which contain an incremented index number. |
63 | 63 | 'data-largest_index' => max( |
64 | - ( int ) $this->iFieldsCount - 1, // zero-base index |
|
64 | + ( int ) $this->iFieldsCount - 1, // zero-base index |
|
65 | 65 | 0 |
66 | 66 | ), // convert negative numbers to zero. |
67 | 67 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @since 3.6.0 |
26 | 26 | */ |
27 | - public $sContext = 'fieldset'; |
|
27 | + public $sContext = 'fieldset'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Returns an attribute array. |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | */ |
33 | 33 | protected function _getAttributes() { |
34 | 34 | return array( |
35 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
35 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
36 | 36 | 'class' => implode( |
37 | 37 | ' ', |
38 | 38 | array( |
39 | - 'admin-page-framework-' . $this->sContext, |
|
39 | + 'admin-page-framework-'.$this->sContext, |
|
40 | 40 | $this->_getSelectorForChildFieldset() |
41 | 41 | ) |
42 | 42 | ), |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | return ''; |
68 | 68 | } |
69 | 69 | if ( $this->aArguments[ '_nested_depth' ] == 1 ) { |
70 | - return 'child-fieldset nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
70 | + return 'child-fieldset nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
71 | 71 | } |
72 | - return 'child-fieldset multiple-nesting nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
72 | + return 'child-fieldset multiple-nesting nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
73 | 73 | |
74 | 74 | } |
75 | 75 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Stores the default argument values. |
22 | 22 | */ |
23 | - public $aArguments = array( |
|
23 | + public $aArguments = array( |
|
24 | 24 | 'attributes' => array( |
25 | 25 | 'container' => array(), |
26 | 26 | 'title' => array(), |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | 'description' => array(), |
29 | 29 | 'icon' => array(), |
30 | 30 | ), |
31 | - 'icon' => null, // the icon output to override |
|
32 | - 'dash-icon' => 'dashicons-editor-help', // the dash-icon class selector for the icon |
|
33 | - 'icon_alt_text' => '[?]', // [3.8.5+] alternative text when icon is not available. For WP v3.7.x or below. |
|
31 | + 'icon' => null, // the icon output to override |
|
32 | + 'dash-icon' => 'dashicons-editor-help', // the dash-icon class selector for the icon |
|
33 | + 'icon_alt_text' => '[?]', // [3.8.5+] alternative text when icon is not available. For WP v3.7.x or below. |
|
34 | 34 | 'title' => null, |
35 | - 'content' => null, // will be assigned in the constructor |
|
35 | + 'content' => null, // will be assigned in the constructor |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | public $sTitleElementID; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if ( is_string( $asContent ) ) { |
90 | 90 | return true; |
91 | 91 | } |
92 | - if ( is_array( $asContent ) && ! $this->isAssociative( $asContent ) ) { |
|
92 | + if ( is_array( $asContent ) && !$this->isAssociative( $asContent ) ) { |
|
93 | 93 | return true; |
94 | 94 | } |
95 | 95 | return false; |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | * @return string The output. |
104 | 104 | */ |
105 | 105 | public function get() { |
106 | - if ( ! $this->aArguments[ 'content' ] ) { |
|
106 | + if ( !$this->aArguments[ 'content' ] ) { |
|
107 | 107 | return ''; |
108 | 108 | } |
109 | - return "<a " . $this->_getElementAttributes( 'container', 'admin-page-framework-form-tooltip' ) . ">" |
|
109 | + return "<a ".$this->_getElementAttributes( 'container', 'admin-page-framework-form-tooltip' ).">" |
|
110 | 110 | . $this->_getTipLinkIcon() |
111 | - . "<span " . $this->_getElementAttributes( 'content', 'admin-page-framework-form-tooltip-content' ) . ">" |
|
111 | + . "<span ".$this->_getElementAttributes( 'content', 'admin-page-framework-form-tooltip-content' ).">" |
|
112 | 112 | . $this->_getTipTitle() |
113 | 113 | . $this->_getDescriptions() |
114 | 114 | . "</span>" |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return $this->aArguments[ 'icon' ]; |
127 | 127 | } |
128 | 128 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
129 | - return "<span " . $this->_getElementAttributes( |
|
129 | + return "<span ".$this->_getElementAttributes( |
|
130 | 130 | 'icon', |
131 | 131 | array( |
132 | 132 | 'dashicons', |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | private function _getTipTitle() { |
146 | 146 | if ( isset( $this->aArguments[ 'title' ] ) ) { |
147 | - return "<span " . $this->_getElementAttributes( 'title', 'admin-page-framework-form-tooltip-title' ) . ">" |
|
147 | + return "<span ".$this->_getElementAttributes( 'title', 'admin-page-framework-form-tooltip-title' ).">" |
|
148 | 148 | . $this->aArguments[ 'title' ] |
149 | 149 | . "</span>"; |
150 | 150 | } |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | */ |
157 | 157 | private function _getDescriptions() { |
158 | 158 | if ( isset( $this->aArguments[ 'content' ] ) ) { |
159 | - return "<span " . $this->_getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ) . ">" |
|
159 | + return "<span ".$this->_getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ).">" |
|
160 | 160 | . implode( |
161 | - "</span><span " . $this->_getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ) . ">", |
|
161 | + "</span><span ".$this->_getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ).">", |
|
162 | 162 | $this->getAsArray( $this->aArguments[ 'content' ] ) |
163 | 163 | ) |
164 | 164 | . "</span>" |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $_aContainerAttributes = $this->getElementAsArray( |
178 | 178 | $this->aArguments, |
179 | 179 | array( 'attributes', $sElementKey ) |
180 | - ) + array( 'class' => '' ) ; |
|
180 | + ) + array( 'class' => '' ); |
|
181 | 181 | $_aContainerAttributes[ 'class' ] = $this->getClassAttribute( |
182 | 182 | $_aContainerAttributes[ 'class' ], |
183 | 183 | $asClassSelectors |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $this->aFieldset[ '_field_path_array' ], |
38 | 38 | $this->aFieldset[ 'error_message' ] |
39 | 39 | ); |
40 | - $_aOutputs[] = $_oFieldError->get(); |
|
40 | + $_aOutputs[ ] = $_oFieldError->get(); |
|
41 | 41 | |
42 | 42 | // 2. Construct fields array for sub-fields. |
43 | 43 | $_oFieldsFormatter = new AdminPageFramework_Form_Model___Format_Fields( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $_aFields = $_oFieldsFormatter->get(); |
48 | 48 | |
49 | 49 | // 3. Get the field and its sub-fields output. |
50 | - $_aOutputs[] = $this->_getFieldsOutput( |
|
50 | + $_aOutputs[ ] = $this->_getFieldsOutput( |
|
51 | 51 | $this->aFieldset, |
52 | 52 | $_aFields, |
53 | 53 | $this->aCallbacks |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | * @since 3.8.0 Added the `$aFieldset` parameter |
71 | 71 | * @return string |
72 | 72 | */ |
73 | - private function _getFieldsOutput( $aFieldset, array $aFields, array $aCallbacks=array() ) { |
|
73 | + private function _getFieldsOutput( $aFieldset, array $aFields, array $aCallbacks = array() ) { |
|
74 | 74 | |
75 | 75 | $_aOutput = array(); |
76 | - foreach( $aFields as $_isIndex => $_aField ) { |
|
77 | - $_aOutput[] = $this->_getEachFieldOutput( |
|
76 | + foreach ( $aFields as $_isIndex => $_aField ) { |
|
77 | + $_aOutput[ ] = $this->_getEachFieldOutput( |
|
78 | 78 | $_aField, |
79 | 79 | $_isIndex, |
80 | 80 | $aCallbacks, |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | * @since 3.5.3 |
94 | 94 | * @return string the HTML output of the given field. |
95 | 95 | */ |
96 | - private function _getEachFieldOutput( $aField, $isIndex, array $aCallbacks, $bIsLastElement=false ) { |
|
96 | + private function _getEachFieldOutput( $aField, $isIndex, array $aCallbacks, $bIsLastElement = false ) { |
|
97 | 97 | |
98 | 98 | // Field type definition - allows mixed field types in sub-fields |
99 | 99 | $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField[ 'type' ] ); |
100 | - if ( ! is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
100 | + if ( !is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
101 | 101 | return ''; |
102 | 102 | } |
103 | 103 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | private function _getFieldOutput( $sContent, $aField, $bIsLastElement ) { |
132 | 132 | $_oFieldAttribute = new AdminPageFramework_Form_View___Attribute_Field( $aField ); |
133 | 133 | return $aField[ 'before_field' ] |
134 | - . "<div " . $_oFieldAttribute->get() . ">" |
|
134 | + . "<div ".$_oFieldAttribute->get().">" |
|
135 | 135 | . $sContent |
136 | 136 | . $this->_getUnsetFlagFieldInputTag( $aField ) |
137 | 137 | . $this->_getDelimiter( $aField, $bIsLastElement ) |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | 'input', |
154 | 154 | array( |
155 | 155 | 'type' => 'hidden', |
156 | - 'name' => '__unset_' . $aField[ '_fields_type' ] . '[' . $aField[ '_input_name_flat' ] . ']', |
|
156 | + 'name' => '__unset_'.$aField[ '_fields_type' ].'['.$aField[ '_input_name_flat' ].']', |
|
157 | 157 | 'value' => $aField[ '_input_name_flat' ], |
158 | 158 | 'class' => 'unset-element-names element-address', |
159 | 159 | ) |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | private function _getDelimiter( $aField, $bIsLastElement ) { |
186 | 186 | return $aField[ 'delimiter' ] |
187 | - ? "<div " . $this->getAttributes( |
|
187 | + ? "<div ".$this->getAttributes( |
|
188 | 188 | array( |
189 | 189 | 'class' => 'delimiter', |
190 | 190 | 'id' => "delimiter-{$aField[ 'input_id' ]}", |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | "" |
195 | 195 | ), |
196 | 196 | ) |
197 | - ) . ">" |
|
197 | + ).">" |
|
198 | 198 | . $aField[ 'delimiter' ] |
199 | 199 | . "</div>" |
200 | 200 | : ''; |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | */ |
209 | 209 | private function _getFinalOutput( $aFieldset, array $aFieldsOutput, $iFieldsCount ) { |
210 | 210 | |
211 | - $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
211 | + $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
212 | 212 | return $aFieldset[ 'before_fieldset' ] |
213 | - . "<fieldset " . $_oFieldsetAttributes->get() . ">" |
|
213 | + . "<fieldset ".$_oFieldsetAttributes->get().">" |
|
214 | 214 | . $this->_getEmbeddedFieldTitle( $aFieldset ) |
215 | 215 | . $this->_getChildFieldTitle( $aFieldset ) |
216 | 216 | . $this->_getFieldsetContent( $aFieldset, $aFieldsOutput, $iFieldsCount ) |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | private function _getEmbeddedFieldTitle( $aFieldset ) { |
229 | 229 | |
230 | - if ( ! $aFieldset[ '_is_title_embedded' ] ) { |
|
230 | + if ( !$aFieldset[ '_is_title_embedded' ] ) { |
|
231 | 231 | return ''; |
232 | 232 | } |
233 | 233 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function _getChildFieldTitle( $aFieldset ) { |
254 | 254 | |
255 | - if ( ! $aFieldset[ '_nested_depth' ] ) { |
|
255 | + if ( !$aFieldset[ '_nested_depth' ] ) { |
|
256 | 256 | return ''; |
257 | 257 | } |
258 | 258 | if ( $aFieldset[ '_is_title_embedded' ] ) { |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | return $aFieldset[ 'content' ]; |
282 | 282 | } |
283 | 283 | |
284 | - $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
284 | + $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
285 | 285 | $aFieldset, |
286 | - array(), // attribute array |
|
286 | + array(), // attribute array |
|
287 | 287 | $iFieldsCount |
288 | 288 | ); |
289 | - return "<div " . $_oFieldsAttributes->get() . ">" |
|
289 | + return "<div ".$_oFieldsAttributes->get().">" |
|
290 | 290 | . $aFieldset[ 'before_fields' ] |
291 | 291 | . implode( PHP_EOL, $aFieldsOutput ) |
292 | 292 | . $aFieldset[ 'after_fields' ] |
@@ -309,13 +309,13 @@ discard block |
||
309 | 309 | $aField[ 'description' ], |
310 | 310 | 'admin-page-framework-fields-description' // class selector |
311 | 311 | ); |
312 | - $_aOutput[] = $_oFieldDescription->get(); |
|
312 | + $_aOutput[ ] = $_oFieldDescription->get(); |
|
313 | 313 | |
314 | 314 | // Dimensional keys of repeatable and sortable fields |
315 | - $_aOutput[] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
315 | + $_aOutput[ ] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
316 | 316 | |
317 | 317 | // Repeatable and sortable scripts |
318 | - $_aOutput[] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
318 | + $_aOutput[ ] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
319 | 319 | |
320 | 320 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
321 | 321 | |
@@ -327,10 +327,10 @@ discard block |
||
327 | 327 | */ |
328 | 328 | private function _getDynamicElementFlagFieldInputTag( $aFieldset ) { |
329 | 329 | |
330 | - if ( ! empty( $aFieldset[ 'repeatable' ] ) ) { |
|
330 | + if ( !empty( $aFieldset[ 'repeatable' ] ) ) { |
|
331 | 331 | return $this->_getRepeatableFieldFlagTag( $aFieldset ); |
332 | 332 | } |
333 | - if ( ! empty( $aFieldset[ 'sortable' ] ) ) { |
|
333 | + if ( !empty( $aFieldset[ 'sortable' ] ) ) { |
|
334 | 334 | return $this->_getSortableFieldFlagTag( $aFieldset ); |
335 | 335 | } |
336 | 336 | return ''; |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | 'input', |
346 | 346 | array( |
347 | 347 | 'type' => 'hidden', |
348 | - 'name' => '__repeatable_elements_' . $aFieldset[ '_structure_type' ] |
|
349 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
348 | + 'name' => '__repeatable_elements_'.$aFieldset[ '_structure_type' ] |
|
349 | + . '['.$aFieldset[ '_field_address' ].']', |
|
350 | 350 | 'class' => 'element-address', |
351 | 351 | 'value' => $aFieldset[ '_field_address' ], |
352 | 352 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -362,8 +362,8 @@ discard block |
||
362 | 362 | 'input', |
363 | 363 | array( |
364 | 364 | 'type' => 'hidden', |
365 | - 'name' => '__sortable_elements_' . $aFieldset[ '_structure_type' ] |
|
366 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
365 | + 'name' => '__sortable_elements_'.$aFieldset[ '_structure_type' ] |
|
366 | + . '['.$aFieldset[ '_field_address' ].']', |
|
367 | 367 | 'class' => 'element-address', |
368 | 368 | 'value' => $aFieldset[ '_field_address' ], |
369 | 369 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -382,14 +382,14 @@ discard block |
||
382 | 382 | $_aOutput = array(); |
383 | 383 | |
384 | 384 | // Add the repeater script |
385 | - $_aOutput[] = ! empty( $aField[ 'repeatable' ] ) |
|
386 | - ? $this->_getRepeaterFieldEnablerScript( 'fields-' . $aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ) |
|
385 | + $_aOutput[ ] = !empty( $aField[ 'repeatable' ] ) |
|
386 | + ? $this->_getRepeaterFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ) |
|
387 | 387 | : ''; |
388 | 388 | |
389 | 389 | // Add the sortable script - if the number of fields is only one, no need to sort the field. |
390 | 390 | // Repeatable fields can make the number increase so here it checks the repeatability. |
391 | - $_aOutput[] = ! empty( $aField[ 'sortable' ] ) && ( $iFieldsCount > 1 || ! empty( $aField[ 'repeatable' ] ) ) |
|
392 | - ? $this->_getSortableFieldEnablerScript( 'fields-' . $aField[ 'tag_id' ] ) |
|
391 | + $_aOutput[ ] = !empty( $aField[ 'sortable' ] ) && ( $iFieldsCount > 1 || !empty( $aField[ 'repeatable' ] ) ) |
|
392 | + ? $this->_getSortableFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ] ) |
|
393 | 393 | : ''; |
394 | 394 | |
395 | 395 | return implode( PHP_EOL, $_aOutput ); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param object $oForm |
31 | 31 | * @param string $sHeadActionHook The action hook triggered inside the `<head>` tag. For front-end forms, use `wp_head`. |
32 | 32 | */ |
33 | - public function __construct( $oForm, $sHeadActionHook='admin_head' ) { |
|
33 | + public function __construct( $oForm, $sHeadActionHook = 'admin_head' ) { |
|
34 | 34 | |
35 | 35 | $this->oForm = $oForm; |
36 | 36 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * as multiple instances of the factory class is loaded among separate pages, |
55 | 55 | * one gets denied here and if it can load earlier than the one which should insert the below script. |
56 | 56 | */ |
57 | - if ( ! $this->oForm->isInThePage() ) { |
|
57 | + if ( !$this->oForm->isInThePage() ) { |
|
58 | 58 | return; |
59 | 59 | } |
60 | 60 | |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | private function _getScripts_RequiredInHead() { |
78 | 78 | return 'document.write( "<style class=\'admin-page-framework-js-embedded-internal-style\'>' |
79 | 79 | . str_replace( |
80 | - '\\n', // search |
|
81 | - '', // replace |
|
80 | + '\\n', // search |
|
81 | + '', // replace |
|
82 | 82 | esc_js( $this->_getInternalCSS() ) // subject |
83 | 83 | ) |
84 | 84 | . '</style>" );'; |