@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->aField[ '_field_path_array' ], |
39 | 39 | $this->aField[ 'error_message' ] |
40 | 40 | ); |
41 | - $_aOutputs[] = $_oFieldError->get(); |
|
41 | + $_aOutputs[ ] = $_oFieldError->get(); |
|
42 | 42 | |
43 | 43 | // 2. Construct fields array for sub-fields. |
44 | 44 | $_oFieldsFormatter = new AdminPageFramework_Form_Model___Format_Fields( |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $_aFields = $_oFieldsFormatter->get(); |
49 | 49 | |
50 | 50 | // 3. Get the field and its sub-fields output. |
51 | - $_aOutputs[] = $this->_getFieldsOutput( |
|
51 | + $_aOutputs[ ] = $this->_getFieldsOutput( |
|
52 | 52 | $_aFields, |
53 | 53 | $this->aCallbacks |
54 | 54 | ); |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | * @since 3.1.0 |
80 | 80 | * @since 3.2.0 Added the $aCallbacks parameter. |
81 | 81 | */ |
82 | - private function _getFieldsOutput( array $aFields, array $aCallbacks=array() ) { |
|
82 | + private function _getFieldsOutput( array $aFields, array $aCallbacks = array() ) { |
|
83 | 83 | |
84 | 84 | $_aOutput = array(); |
85 | - foreach( $aFields as $_isIndex => $_aField ) { |
|
86 | - $_aOutput[] = $this->_getEachFieldOutput( |
|
85 | + foreach ( $aFields as $_isIndex => $_aField ) { |
|
86 | + $_aOutput[ ] = $this->_getEachFieldOutput( |
|
87 | 87 | $_aField, |
88 | 88 | $_isIndex, |
89 | 89 | $aCallbacks, |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | * @since 3.5.3 |
101 | 101 | * @return string the HTML output of the given field. |
102 | 102 | */ |
103 | - private function _getEachFieldOutput( array $aField, $isIndex, array $aCallbacks, $bIsLastElement=false ) { |
|
103 | + private function _getEachFieldOutput( array $aField, $isIndex, array $aCallbacks, $bIsLastElement = false ) { |
|
104 | 104 | |
105 | 105 | // Field type definition - allows mixed field types in sub-fields |
106 | - $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField['type'] ); |
|
107 | - if ( ! is_callable( $_aFieldTypeDefinition['hfRenderField'] ) ) { |
|
106 | + $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField[ 'type' ] ); |
|
107 | + if ( !is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
108 | 108 | return ''; |
109 | 109 | } |
110 | 110 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | // Callback the registered function to output the field |
121 | 121 | $_oFieldAttribute = new AdminPageFramework_Form_View___Attribute_Field( $aField ); |
122 | 122 | return $aField[ 'before_field' ] |
123 | - . "<div " . $_oFieldAttribute->get() . ">" |
|
123 | + . "<div ".$_oFieldAttribute->get().">" |
|
124 | 124 | . call_user_func_array( |
125 | 125 | $_aFieldTypeDefinition[ 'hfRenderField' ], |
126 | 126 | array( $aField ) |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | 'input', |
147 | 147 | array( |
148 | 148 | 'type' => 'hidden', |
149 | - 'name' => '__unset_' . $aField[ '_fields_type' ] . '[' . $aField[ '_input_name_flat' ] . ']', |
|
149 | + 'name' => '__unset_'.$aField[ '_fields_type' ].'['.$aField[ '_input_name_flat' ].']', |
|
150 | 150 | 'value' => $aField[ '_input_name_flat' ], |
151 | 151 | 'class' => 'unset-element-names element-address', |
152 | 152 | ) |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | return $this->getElement( |
166 | 166 | $this->aFieldTypeDefinitions, |
167 | 167 | $sFieldTypeSlug, |
168 | - $this->aFieldTypeDefinitions['default'] |
|
168 | + $this->aFieldTypeDefinitions[ 'default' ] |
|
169 | 169 | ); |
170 | 170 | } |
171 | 171 | |
@@ -176,19 +176,19 @@ discard block |
||
176 | 176 | * @return string the HTML output of delimiter |
177 | 177 | */ |
178 | 178 | private function _getDelimiter( array $aField, $bIsLastElement ) { |
179 | - return $aField['delimiter'] |
|
180 | - ? "<div " . $this->getAttributes( |
|
179 | + return $aField[ 'delimiter' ] |
|
180 | + ? "<div ".$this->getAttributes( |
|
181 | 181 | array( |
182 | 182 | 'class' => 'delimiter', |
183 | - 'id' => "delimiter-{$aField['input_id']}", |
|
183 | + 'id' => "delimiter-{$aField[ 'input_id' ]}", |
|
184 | 184 | 'style' => $this->getAOrB( |
185 | 185 | $bIsLastElement, |
186 | 186 | "display:none;", |
187 | 187 | "" |
188 | 188 | ), |
189 | 189 | ) |
190 | - ) . ">" |
|
191 | - . $aField['delimiter'] |
|
190 | + ).">" |
|
191 | + . $aField[ 'delimiter' ] |
|
192 | 192 | . "</div>" |
193 | 193 | : ''; |
194 | 194 | } |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | */ |
202 | 202 | private function _getFinalOutput( array $aFieldset, array $aFieldsOutput, $iFieldsCount ) { |
203 | 203 | |
204 | - $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
204 | + $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
205 | 205 | return $aFieldset[ 'before_fieldset' ] |
206 | - . "<fieldset " . $_oFieldsetAttributes->get() . ">" |
|
206 | + . "<fieldset ".$_oFieldsetAttributes->get().">" |
|
207 | 207 | . $this->_getFieldsetContent( $aFieldset, $aFieldsOutput, $iFieldsCount ) |
208 | 208 | . $this->_getExtras( $aFieldset, $iFieldsCount ) |
209 | 209 | . "</fieldset>" |
@@ -220,12 +220,12 @@ discard block |
||
220 | 220 | return $aFieldset[ 'content' ]; |
221 | 221 | } |
222 | 222 | |
223 | - $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
223 | + $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
224 | 224 | $aFieldset, |
225 | - array(), // attribute array |
|
225 | + array(), // attribute array |
|
226 | 226 | $iFieldsCount |
227 | 227 | ); |
228 | - return "<div " . $_oFieldsAttributes->get() . ">" |
|
228 | + return "<div ".$_oFieldsAttributes->get().">" |
|
229 | 229 | . $aFieldset[ 'before_fields' ] |
230 | 230 | . implode( PHP_EOL, $aFieldsOutput ) |
231 | 231 | . $aFieldset[ 'after_fields' ] |
@@ -247,13 +247,13 @@ discard block |
||
247 | 247 | $aField[ 'description' ], |
248 | 248 | 'admin-page-framework-fields-description' // class selector |
249 | 249 | ); |
250 | - $_aOutput[] = $_oFieldDescription->get(); |
|
250 | + $_aOutput[ ] = $_oFieldDescription->get(); |
|
251 | 251 | |
252 | 252 | // Dimensional keys of repeatable and sortable fields |
253 | - $_aOutput[] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
253 | + $_aOutput[ ] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
254 | 254 | |
255 | 255 | // Repeatable and sortable scripts |
256 | - $_aOutput[] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
256 | + $_aOutput[ ] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
257 | 257 | |
258 | 258 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
259 | 259 | |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | 'input', |
284 | 284 | array( |
285 | 285 | 'type' => 'hidden', |
286 | - 'name' => '__repeatable_elements_' . $aFieldset[ '_structure_type' ] |
|
287 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
286 | + 'name' => '__repeatable_elements_'.$aFieldset[ '_structure_type' ] |
|
287 | + . '['.$aFieldset[ '_field_address' ].']', |
|
288 | 288 | 'class' => 'element-address', |
289 | 289 | 'value' => $aFieldset[ '_field_address' ], |
290 | 290 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -300,8 +300,8 @@ discard block |
||
300 | 300 | 'input', |
301 | 301 | array( |
302 | 302 | 'type' => 'hidden', |
303 | - 'name' => '__sortable_elements_' . $aFieldset[ '_structure_type' ] |
|
304 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
303 | + 'name' => '__sortable_elements_'.$aFieldset[ '_structure_type' ] |
|
304 | + . '['.$aFieldset[ '_field_address' ].']', |
|
305 | 305 | 'class' => 'element-address', |
306 | 306 | 'value' => $aFieldset[ '_field_address' ], |
307 | 307 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -320,14 +320,14 @@ discard block |
||
320 | 320 | $_aOutput = array(); |
321 | 321 | |
322 | 322 | // Add the repeater script |
323 | - $_aOutput[] = $aField['repeatable'] |
|
324 | - ? $this->_getRepeaterFieldEnablerScript( 'fields-' . $aField['tag_id'], $iFieldsCount, $aField['repeatable'] ) |
|
323 | + $_aOutput[ ] = $aField[ 'repeatable' ] |
|
324 | + ? $this->_getRepeaterFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ) |
|
325 | 325 | : ''; |
326 | 326 | |
327 | 327 | // Add the sortable script - if the number of fields is only one, no need to sort the field. |
328 | 328 | // Repeatable fields can make the number increase so here it checkes the repeatability. |
329 | - $_aOutput[] = $aField['sortable'] && ( $iFieldsCount > 1 || $aField['repeatable'] ) |
|
330 | - ? $this->_getSortableFieldEnablerScript( 'fields-' . $aField['tag_id'] ) |
|
329 | + $_aOutput[ ] = $aField[ 'sortable' ] && ( $iFieldsCount > 1 || $aField[ 'repeatable' ] ) |
|
330 | + ? $this->_getSortableFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ] ) |
|
331 | 331 | : ''; |
332 | 332 | |
333 | 333 | return implode( PHP_EOL, $_aOutput ); |
@@ -139,7 +139,7 @@ |
||
139 | 139 | */ |
140 | 140 | private function _getUnsetFlagFieldInputTag( array $aField ) { |
141 | 141 | |
142 | - if ( false !== $aField[ 'save' ] ) { |
|
142 | + if ( false !== $aField[ 'save' ] ) { |
|
143 | 143 | return ''; |
144 | 144 | } |
145 | 145 | return $this->getHTMLTag( |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @return string The generated string value. |
50 | 50 | */ |
51 | 51 | public function get() { |
52 | - return $this->_getFiltered( $this->_getBaseFieldTagID() . '__' . $this->isIndex ); |
|
52 | + return $this->_getFiltered( $this->_getBaseFieldTagID().'__'.$this->isIndex ); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | return $_sResult; |
27 | 27 | } |
28 | 28 | |
29 | - public function getModel() { |
|
30 | - return $this->get() . '[' . $this->sIndexMark . ']'; |
|
29 | + public function getModel() { |
|
30 | + return $this->get().'['.$this->sIndexMark.']'; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | */ |
36 | 36 | protected function _getFieldName() { |
37 | 37 | |
38 | - $_aFieldPath = $this->aArguments[ '_field_path_array' ]; |
|
39 | - if ( ! $this->_isSectionSet() ) { |
|
38 | + $_aFieldPath = $this->aArguments[ '_field_path_array' ]; |
|
39 | + if ( !$this->_isSectionSet() ) { |
|
40 | 40 | return $this->_getInputNameConstructed( $_aFieldPath ); |
41 | 41 | } |
42 | 42 | |
43 | 43 | $_aSectionPath = $this->aArguments[ '_section_path_array' ]; |
44 | 44 | if ( $this->_isSectionSet() && isset( $this->aArguments[ '_section_index' ] ) ) { |
45 | - $_aSectionPath[] = $this->aArguments[ '_section_index' ]; |
|
45 | + $_aSectionPath[ ] = $this->aArguments[ '_section_index' ]; |
|
46 | 46 | } |
47 | 47 | $_sFieldName = $this->_getInputNameConstructed( |
48 | 48 | array_merge( $_aSectionPath, $_aFieldPath ) |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | : ""; |
61 | 61 | $_sFieldName = $this->getAOrB( |
62 | 62 | $this->_isSectionSet(), |
63 | - $this->aArguments[ 'section_id' ] . $_sSectionIndex . "[" . $this->aArguments[ 'field_id' ] . "]", |
|
63 | + $this->aArguments[ 'section_id' ].$_sSectionIndex."[".$this->aArguments[ 'field_id' ]."]", |
|
64 | 64 | $this->aArguments[ 'field_id' ] |
65 | 65 | ); |
66 | 66 | return $_sFieldName; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | return $this->_getFiltered( $this->_getSectionName() ); |
26 | 26 | } |
27 | 27 | |
28 | - public function getModel() { |
|
28 | + public function getModel() { |
|
29 | 29 | return $this->get() . '[' . $this->sIndexMark . ']'; |
30 | 30 | } |
31 | 31 |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | } |
61 | 61 | |
62 | - // @deprecated |
|
62 | + // @deprecated |
|
63 | 63 | // protected function _getBaseFieldTagID() { |
64 | 64 | |
65 | 65 | // $_sSectionIndex = isset( $this->aArguments[ '_section_index' ] ) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @return string |
41 | 41 | */ |
42 | 42 | public function getModel() { |
43 | - return $this->get() . '__' . $this->sIndexMark; |
|
43 | + return $this->get().'__'.$this->sIndexMark; |
|
44 | 44 | } |
45 | 45 | /** |
46 | 46 | * @since 3.6.0 |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | protected function _getBaseFieldTagID() { |
50 | 50 | |
51 | 51 | $_sSectionIndex = isset( $this->aArguments[ '_section_index' ] ) |
52 | - ? '__' . $this->aArguments[ '_section_index' ] |
|
52 | + ? '__'.$this->aArguments[ '_section_index' ] |
|
53 | 53 | : ''; |
54 | 54 | $_sSectionPart = implode( '_', $this->aArguments[ '_section_path_array' ] ); |
55 | 55 | $_sFieldPart = implode( '_', $this->aArguments[ '_field_path_array' ] ); |
56 | 56 | return $this->_isSectionSet() |
57 | - ? $_sSectionPart . $_sSectionIndex . '_' . $_sFieldPart |
|
57 | + ? $_sSectionPart.$_sSectionIndex.'_'.$_sFieldPart |
|
58 | 58 | : $_sFieldPart; |
59 | 59 | |
60 | 60 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | * @since 3.6.0 Moved from `AdminPageFramework_FormField`. |
31 | 31 | * @return string The generated string value. |
32 | 32 | */ |
33 | - public function get() { |
|
33 | + public function get() { |
|
34 | 34 | return $this->_getFiltered( $this->_getBaseFieldTagID() ); |
35 | 35 | } |
36 | 36 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | '', |
39 | 39 | "|{$this->sIndex}" |
40 | 40 | ); |
41 | - return $this->_getFiltered( $this->_getFlatFieldName() . $_sIndex ); |
|
41 | + return $this->_getFiltered( $this->_getFlatFieldName().$_sIndex ); |
|
42 | 42 | |
43 | 43 | } |
44 | 44 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * @return string The generated field name model. |
32 | 32 | */ |
33 | 33 | public function getModel() { |
34 | - return $this->get() . '|' . $this->sIndexMark; |
|
34 | + return $this->get().'|'.$this->sIndexMark; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -25,26 +25,26 @@ |
||
25 | 25 | return $this->_getFiltered( $this->_getSectionName() ); |
26 | 26 | } |
27 | 27 | |
28 | - public function getModel() { |
|
29 | - return $this->get() . '[' . $this->sIndexMark . ']'; |
|
28 | + public function getModel() { |
|
29 | + return $this->get().'['.$this->sIndexMark.']'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @return string |
34 | 34 | */ |
35 | - protected function _getSectionName( $isIndex=null ) { |
|
35 | + protected function _getSectionName( $isIndex = null ) { |
|
36 | 36 | |
37 | 37 | $this->aArguments = $this->aArguments + array( |
38 | 38 | 'section_id' => null, |
39 | 39 | '_index' => null, |
40 | 40 | ); |
41 | - if( isset( $isIndex ) ) { |
|
41 | + if ( isset( $isIndex ) ) { |
|
42 | 42 | $this->aArguments[ '_index' ] = $isIndex; |
43 | 43 | } |
44 | 44 | |
45 | 45 | $_aNameParts = $this->aArguments[ '_section_path_array' ]; |
46 | 46 | if ( isset( $this->aArguments[ 'section_id' ], $this->aArguments[ '_index' ] ) ) { |
47 | - $_aNameParts[] = $this->aArguments[ '_index' ]; |
|
47 | + $_aNameParts[ ] = $this->aArguments[ '_index' ]; |
|
48 | 48 | } |
49 | 49 | $_sResult = $this->_getInputNameConstructed( $_aNameParts ); |
50 | 50 | return $_sResult; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | return $this->_getFiltered( $this->_getSectionName() ); |
26 | 26 | } |
27 | 27 | |
28 | - public function getModel() { |
|
28 | + public function getModel() { |
|
29 | 29 | return $this->get() . '[' . $this->sIndexMark . ']'; |
30 | 30 | } |
31 | 31 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $_aParams = func_get_args() + array( null ); |
44 | 44 | $_oMsg = $_aParams[ 0 ]; |
45 | - $_sToggleAllButtonHTML = '"' . self::_getToggleAllButtonHTML( $_oMsg ) . '"'; |
|
45 | + $_sToggleAllButtonHTML = '"'.self::_getToggleAllButtonHTML( $_oMsg ).'"'; |
|
46 | 46 | |
47 | 47 | return <<<JAVASCRIPTS |
48 | 48 | ( function( $ ) { |
@@ -192,18 +192,18 @@ discard block |
||
192 | 192 | $_sLabelToggleAll = $oMsg->get( 'toggle_all' ); |
193 | 193 | $_sLabelToggleAllSections = $oMsg->get( 'toggle_all_collapsible_sections' ); |
194 | 194 | $_sDashIconSort = self::getAOrB( |
195 | - version_compare( $GLOBALS['wp_version'], '3.8', '<' ), // evaluate |
|
195 | + version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' ), // evaluate |
|
196 | 196 | '', // true |
197 | 197 | 'dashicons dashicons-sort' // false |
198 | 198 | ); |
199 | - $_sText = self::getAOrB( |
|
199 | + $_sText = self::getAOrB( |
|
200 | 200 | $_sDashIconSort, // evaluate |
201 | 201 | '', // true |
202 | 202 | $_sLabelToggleAll // false |
203 | 203 | ); |
204 | 204 | return "<div class='admin-page-framework-collapsible-toggle-all-button-container'>" |
205 | - . "<span class='admin-page-framework-collapsible-toggle-all-button button " . $_sDashIconSort . "'" |
|
206 | - . " title='" . esc_attr( $_sLabelToggleAllSections ) |
|
205 | + . "<span class='admin-page-framework-collapsible-toggle-all-button button ".$_sDashIconSort."'" |
|
206 | + . " title='".esc_attr( $_sLabelToggleAllSections ) |
|
207 | 207 | . "'>" |
208 | 208 | . $_sText |
209 | 209 | . "</span>" |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $_oMsg = $_aParams[ 0 ]; |
58 | 58 | |
59 | 59 | // means the WordPress version is 3.4.x or below |
60 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
60 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
61 | 61 | return ""; |
62 | 62 | } |
63 | 63 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $_oMsg = $_aParams[ 0 ]; |
58 | 58 | |
59 | 59 | // means the WordPress version is 3.4.x or below |
60 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
60 | + if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
61 | 61 | return ""; |
62 | 62 | } |
63 | 63 |