@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | /** |
187 | 187 | * Defines the field type slugs used for this field type. |
188 | 188 | */ |
189 | - public $aFieldTypeSlugs = array( 'submit', ); |
|
189 | + public $aFieldTypeSlugs = array( 'submit',); |
|
190 | 190 | |
191 | 191 | /** |
192 | 192 | * Defines the default key-values of this field type. |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | 'redirect_url' => null, |
198 | 198 | 'href' => null, |
199 | 199 | 'reset' => null, |
200 | - 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
200 | + 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
201 | 201 | /* |
202 | 202 | array( |
203 | 203 | 'to' => null, // string|array The email address to send to or an array representing the key structure of the submitted form data holding the value. The first key should be the section ID and the second key is the the field ID. |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | 'attachments' => null, // string|array The file path(s) or an array representing the key structure of the submitted form data holding the value. The first key should be the section ID and the second key is the the field ID. |
208 | 208 | ) |
209 | 209 | */ |
210 | - 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
210 | + 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
211 | 211 | 'attributes' => array( |
212 | 212 | 'class' => 'button button-primary', |
213 | 213 | ), |
@@ -247,16 +247,16 @@ discard block |
||
247 | 247 | |
248 | 248 | return |
249 | 249 | $aField[ 'before_label' ] |
250 | - . "<div " . $this->getAttributes( $_aLabelContainerAttributes ) . ">" |
|
250 | + . "<div ".$this->getAttributes( $_aLabelContainerAttributes ).">" |
|
251 | 251 | . $this->_getExtraFieldsBeforeLabel( $aField ) // this is for the import field type that cannot place file input tag inside the label tag. |
252 | - . "<label " . $this->getAttributes( $_aLabelAttributes ) . ">" |
|
252 | + . "<label ".$this->getAttributes( $_aLabelAttributes ).">" |
|
253 | 253 | . $aField[ 'before_input' ] |
254 | 254 | . $this->_getExtraInputFields( $aField ) |
255 | - . "<input " . $this->getAttributes( $_aInputAttributes ) . " />" // this method is defined in the base class |
|
255 | + . "<input ".$this->getAttributes( $_aInputAttributes )." />" // this method is defined in the base class |
|
256 | 256 | . $aField[ 'after_input' ] |
257 | 257 | . "</label>" |
258 | 258 | . "</div>" |
259 | - . $aField['after_label']; |
|
259 | + . $aField[ 'after_label' ]; |
|
260 | 260 | |
261 | 261 | } |
262 | 262 | /** |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | private function _getLabelAttributes( array $aField, array $aInputAttributes ) { |
289 | 289 | return array( |
290 | 290 | 'style' => $aField[ 'label_min_width' ] |
291 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
291 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
292 | 292 | : null, |
293 | 293 | 'for' => $aInputAttributes[ 'id' ], |
294 | 294 | 'class' => $aInputAttributes[ 'disabled' ] |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | private function _getLabelContainerAttributes( array $aField ) { |
307 | 307 | return array( |
308 | 308 | 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ] |
309 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
309 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
310 | 310 | : null, |
311 | 311 | 'class' => 'admin-page-framework-input-label-container' |
312 | 312 | . ' admin-page-framework-input-button-container' |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | protected function _getExtraInputFields( &$aField ) { |
358 | 358 | |
359 | 359 | $_aOutput = array(); |
360 | - $_aOutput[] = $this->getHTMLTag( |
|
360 | + $_aOutput[ ] = $this->getHTMLTag( |
|
361 | 361 | 'input', |
362 | 362 | array( |
363 | 363 | 'type' => 'hidden', |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | 'value' => $aField[ 'input_id' ], |
366 | 366 | ) |
367 | 367 | ); |
368 | - $_aOutput[] = $this->getHTMLTag( |
|
368 | + $_aOutput[ ] = $this->getHTMLTag( |
|
369 | 369 | 'input', |
370 | 370 | array( |
371 | 371 | 'type' => 'hidden', |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | 'value' => $aField[ 'field_id' ], |
374 | 374 | ) |
375 | 375 | ); |
376 | - $_aOutput[] = $this->getHTMLTag( |
|
376 | + $_aOutput[ ] = $this->getHTMLTag( |
|
377 | 377 | 'input', |
378 | 378 | array( |
379 | 379 | 'type' => 'hidden', |
@@ -381,11 +381,11 @@ discard block |
||
381 | 381 | 'value' => $aField[ '_input_name_flat' ], |
382 | 382 | ) |
383 | 383 | ); |
384 | - $_aOutput[] = $this->_getHiddenInput_SectionID( $aField ); |
|
385 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
386 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
387 | - $_aOutput[] = $this->_getHiddenInput_Reset( $aField ); |
|
388 | - $_aOutput[] = $this->_getHiddenInput_Email( $aField ); |
|
384 | + $_aOutput[ ] = $this->_getHiddenInput_SectionID( $aField ); |
|
385 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
386 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
387 | + $_aOutput[ ] = $this->_getHiddenInput_Reset( $aField ); |
|
388 | + $_aOutput[ ] = $this->_getHiddenInput_Email( $aField ); |
|
389 | 389 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
390 | 390 | |
391 | 391 | } |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | 'input', |
402 | 402 | array( |
403 | 403 | 'type' => 'hidden', |
404 | - 'name' => "__submit[{$aField['input_id']}][section_id]", |
|
405 | - 'value' => isset( $aField['section_id'] ) && '_default' !== $aField['section_id'] |
|
406 | - ? $aField['section_id'] |
|
404 | + 'name' => "__submit[{$aField[ 'input_id' ]}][section_id]", |
|
405 | + 'value' => isset( $aField[ 'section_id' ] ) && '_default' !== $aField[ 'section_id' ] |
|
406 | + ? $aField[ 'section_id' ] |
|
407 | 407 | : '', |
408 | 408 | ) |
409 | 409 | ); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | 'input', |
422 | 422 | array( |
423 | 423 | 'type' => 'hidden', |
424 | - 'name' => "__submit[{$aField['input_id']}][{$sKey}]", |
|
424 | + 'name' => "__submit[{$aField[ 'input_id' ]}][{$sKey}]", |
|
425 | 425 | 'value' => $aField[ $sKey ], |
426 | 426 | ) |
427 | 427 | ) |
@@ -435,15 +435,15 @@ discard block |
||
435 | 435 | * @return string the HTML input tag output for the 'reset' argument. |
436 | 436 | */ |
437 | 437 | private function _getHiddenInput_Reset( array $aField ) { |
438 | - if ( ! $aField['reset'] ) { |
|
438 | + if ( !$aField[ 'reset' ] ) { |
|
439 | 439 | return ''; |
440 | 440 | } |
441 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
441 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
442 | 442 | ? $this->getHTMLTag( |
443 | 443 | 'input', |
444 | 444 | array( |
445 | 445 | 'type' => 'hidden', |
446 | - 'name' => "__submit[{$aField['input_id']}][is_reset]", |
|
446 | + 'name' => "__submit[{$aField[ 'input_id' ]}][is_reset]", |
|
447 | 447 | 'value' => '1', |
448 | 448 | ) |
449 | 449 | ) |
@@ -451,10 +451,10 @@ discard block |
||
451 | 451 | 'input', |
452 | 452 | array( |
453 | 453 | 'type' => 'hidden', |
454 | - 'name' => "__submit[{$aField['input_id']}][reset_key]", |
|
455 | - 'value' => is_array( $aField['reset'] ) // set the option array key to delete. |
|
456 | - ? implode( '|', $aField['reset'] ) |
|
457 | - : $aField['reset'], |
|
454 | + 'name' => "__submit[{$aField[ 'input_id' ]}][reset_key]", |
|
455 | + 'value' => is_array( $aField[ 'reset' ] ) // set the option array key to delete. |
|
456 | + ? implode( '|', $aField[ 'reset' ] ) |
|
457 | + : $aField[ 'reset' ], |
|
458 | 458 | ) |
459 | 459 | ); |
460 | 460 | } |
@@ -471,10 +471,10 @@ discard block |
||
471 | 471 | return ''; |
472 | 472 | } |
473 | 473 | $this->setTransient( |
474 | - 'apf_em_' . md5( $aField[ '_input_name_flat' ] . get_current_user_id() ), |
|
474 | + 'apf_em_'.md5( $aField[ '_input_name_flat' ].get_current_user_id() ), |
|
475 | 475 | $aField[ 'email' ] |
476 | 476 | ); |
477 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
477 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
478 | 478 | ? $this->getHTMLTag( |
479 | 479 | 'input', |
480 | 480 | array( |
@@ -499,19 +499,19 @@ discard block |
||
499 | 499 | * @return boolean |
500 | 500 | * @internal |
501 | 501 | */ |
502 | - private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType='reset' ) { |
|
502 | + private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType = 'reset' ) { |
|
503 | 503 | |
504 | - switch( $sType ) { |
|
504 | + switch ( $sType ) { |
|
505 | 505 | default: |
506 | 506 | case 'reset': // admin page framework _ reset confirmation |
507 | - $_sTransientKey = 'apf_rc_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
507 | + $_sTransientKey = 'apf_rc_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
508 | 508 | break; |
509 | 509 | case 'email': // admin page framework _ email confirmation |
510 | - $_sTransientKey = 'apf_ec_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
510 | + $_sTransientKey = 'apf_ec_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
511 | 511 | break; |
512 | 512 | } |
513 | 513 | |
514 | - $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && ! $aField[ 'skip_confirmation' ] |
|
514 | + $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && !$aField[ 'skip_confirmation' ] |
|
515 | 515 | ? false |
516 | 516 | : true; |
517 | 517 |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * @return array The label container attribute array. |
304 | 304 | * @internal |
305 | 305 | */ |
306 | - private function _getLabelContainerAttributes( array $aField ) { |
|
306 | + private function _getLabelContainerAttributes( array $aField ) { |
|
307 | 307 | return array( |
308 | 308 | 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ] |
309 | 309 | ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
@@ -539,19 +539,19 @@ discard block |
||
539 | 539 | * @since 2.1.5 Moved from `AdminPageFramwrork_InputField`. Changed the scope to protected from private. Removed the second parameter. |
540 | 540 | * @internal |
541 | 541 | */ |
542 | - protected function _getInputFieldValueFromLabel( $aField ) { |
|
542 | + protected function _getInputFieldValueFromLabel( $aField ) { |
|
543 | 543 | |
544 | 544 | // If the value key is explicitly set, use it. But the empty string will be ignored. |
545 | - if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
545 | + if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
546 | 546 | return $aField[ 'value' ]; |
547 | 547 | } |
548 | 548 | |
549 | - if ( isset( $aField[ 'label' ] ) ) { |
|
549 | + if ( isset( $aField[ 'label' ] ) ) { |
|
550 | 550 | return $aField[ 'label' ]; |
551 | 551 | } |
552 | 552 | |
553 | 553 | // If the default value is set, |
554 | - if ( isset( $aField[ 'default' ] ) ) { |
|
554 | + if ( isset( $aField[ 'default' ] ) ) { |
|
555 | 555 | return $aField[ 'default' ]; |
556 | 556 | } |
557 | 557 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * Defines the field type slugs used for this field type. |
53 | 53 | */ |
54 | - public $aFieldTypeSlugs = array( 'export', ); |
|
54 | + public $aFieldTypeSlugs = array( 'export',); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Defines the default key-values of this field type. |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
60 | 60 | */ |
61 | 61 | protected $aDefaultKeys = array( |
62 | - 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
63 | - 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
64 | - 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
62 | + 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
63 | + 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
64 | + 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
65 | 65 | 'attributes' => array( |
66 | 66 | 'class' => 'button button-primary', |
67 | 67 | ), |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | protected function getField( $aField ) { |
107 | 107 | |
108 | 108 | /* Set the transient data to export - If the value is not an array and the export data is set. */ |
109 | - if ( isset( $aField['data'] ) ) { |
|
110 | - $this->setTransient( md5( "{$aField['class_name']}_{$aField['input_id']}" ), $aField['data'], 60*2 ); // 2 minutes. |
|
109 | + if ( isset( $aField[ 'data' ] ) ) { |
|
110 | + $this->setTransient( md5( "{$aField[ 'class_name' ]}_{$aField[ 'input_id' ]}" ), $aField[ 'data' ], 60 * 2 ); // 2 minutes. |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /* Set some required values */ |
114 | - $aField['attributes']['name'] = "__export[submit][{$aField['input_id']}]"; |
|
115 | - $aField['file_name'] = $aField['file_name'] ? $aField['file_name'] : $this->_generateExportFileName( $aField['option_key'] ? $aField['option_key'] : $aField['class_name'], $aField['format'] ); |
|
116 | - $aField['label'] = $aField['label'] ? $aField['label'] : $this->oMsg->get( 'export' ); |
|
114 | + $aField[ 'attributes' ][ 'name' ] = "__export[submit][{$aField[ 'input_id' ]}]"; |
|
115 | + $aField[ 'file_name' ] = $aField[ 'file_name' ] ? $aField[ 'file_name' ] : $this->_generateExportFileName( $aField[ 'option_key' ] ? $aField[ 'option_key' ] : $aField[ 'class_name' ], $aField[ 'format' ] ); |
|
116 | + $aField[ 'label' ] = $aField[ 'label' ] ? $aField[ 'label' ] : $this->oMsg->get( 'export' ); |
|
117 | 117 | |
118 | 118 | return parent::getField( $aField ); |
119 | 119 | |
@@ -129,42 +129,42 @@ discard block |
||
129 | 129 | |
130 | 130 | $_aAttributes = array( 'type' => 'hidden' ); |
131 | 131 | return |
132 | - "<input " . $this->getAttributes( |
|
132 | + "<input ".$this->getAttributes( |
|
133 | 133 | array( |
134 | - 'name' => "__export[{$aField['input_id']}][input_id]", |
|
135 | - 'value' => $aField['input_id'], |
|
134 | + 'name' => "__export[{$aField[ 'input_id' ]}][input_id]", |
|
135 | + 'value' => $aField[ 'input_id' ], |
|
136 | 136 | ) + $_aAttributes |
137 | - ) . "/>" |
|
138 | - . "<input " . $this->getAttributes( |
|
137 | + )."/>" |
|
138 | + . "<input ".$this->getAttributes( |
|
139 | 139 | array( |
140 | - 'name' => "__export[{$aField['input_id']}][field_id]", |
|
141 | - 'value' => $aField['field_id'], |
|
140 | + 'name' => "__export[{$aField[ 'input_id' ]}][field_id]", |
|
141 | + 'value' => $aField[ 'field_id' ], |
|
142 | 142 | ) + $_aAttributes |
143 | - ) . "/>" |
|
144 | - . "<input " . $this->getAttributes( |
|
143 | + )."/>" |
|
144 | + . "<input ".$this->getAttributes( |
|
145 | 145 | array( |
146 | - 'name' => "__export[{$aField['input_id']}][section_id]", |
|
147 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
146 | + 'name' => "__export[{$aField[ 'input_id' ]}][section_id]", |
|
147 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
148 | 148 | ) + $_aAttributes |
149 | - ) . "/>" |
|
150 | - . "<input " . $this->getAttributes( |
|
149 | + )."/>" |
|
150 | + . "<input ".$this->getAttributes( |
|
151 | 151 | array( |
152 | - 'name' => "__export[{$aField['input_id']}][file_name]", |
|
153 | - 'value' => $aField['file_name'], |
|
152 | + 'name' => "__export[{$aField[ 'input_id' ]}][file_name]", |
|
153 | + 'value' => $aField[ 'file_name' ], |
|
154 | 154 | ) + $_aAttributes |
155 | - ) . "/>" |
|
156 | - . "<input " . $this->getAttributes( |
|
155 | + )."/>" |
|
156 | + . "<input ".$this->getAttributes( |
|
157 | 157 | array( |
158 | - 'name' => "__export[{$aField['input_id']}][format]", |
|
159 | - 'value' => $aField['format'], |
|
158 | + 'name' => "__export[{$aField[ 'input_id' ]}][format]", |
|
159 | + 'value' => $aField[ 'format' ], |
|
160 | 160 | ) + $_aAttributes |
161 | - ) . "/>" |
|
162 | - . "<input " . $this->getAttributes( |
|
161 | + )."/>" |
|
162 | + . "<input ".$this->getAttributes( |
|
163 | 163 | array( |
164 | - 'name' => "__export[{$aField['input_id']}][transient]", |
|
165 | - 'value' => isset( $aField['data'] ), |
|
164 | + 'name' => "__export[{$aField[ 'input_id' ]}][transient]", |
|
165 | + 'value' => isset( $aField[ 'data' ] ), |
|
166 | 166 | ) + $_aAttributes |
167 | - ) . "/>" |
|
167 | + )."/>" |
|
168 | 168 | ; |
169 | 169 | } |
170 | 170 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @since 2.1.5 Moved from the AdminPageFramework_FormField class. |
179 | 179 | * @internal |
180 | 180 | */ |
181 | - private function _generateExportFileName( $sOptionKey, $sExportFormat='json' ) { |
|
181 | + private function _generateExportFileName( $sOptionKey, $sExportFormat = 'json' ) { |
|
182 | 182 | |
183 | 183 | switch ( trim( strtolower( $sExportFormat ) ) ) { |
184 | 184 | case 'text': // for plain text. |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | break; |
194 | 194 | } |
195 | 195 | |
196 | - return $sOptionKey . '_' . date("Ymd") . '.' . $sExt; |
|
196 | + return $sOptionKey.'_'.date( "Ymd" ).'.'.$sExt; |
|
197 | 197 | |
198 | 198 | } |
199 | 199 |
@@ -23,13 +23,13 @@ |
||
23 | 23 | protected function _get() { |
24 | 24 | return $this->_getFormSectionRules(); |
25 | 25 | } |
26 | - /** |
|
27 | - * Returns the CSS rules for form fields. |
|
28 | - * |
|
29 | - * @since 3.4.0 |
|
30 | - * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
31 | - * @internal |
|
32 | - */ |
|
26 | + /** |
|
27 | + * Returns the CSS rules for form fields. |
|
28 | + * |
|
29 | + * @since 3.4.0 |
|
30 | + * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
31 | + * @internal |
|
32 | + */ |
|
33 | 33 | private function _getFormSectionRules() { |
34 | 34 | $_sCSSRules = <<<CSSRULES |
35 | 35 | /* Section Table */ |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * @since 3.7.0 |
22 | 22 | * @return string |
23 | 23 | */ |
24 | - protected function _get() { |
|
24 | + protected function _get() { |
|
25 | 25 | return $this->_getFieldErrorRules(); |
26 | 26 | } |
27 | 27 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @since 3.7.0 |
31 | 31 | */ |
32 | 32 | public function add( $sCSSRules ) { |
33 | - $this->aAdded[] = $sCSSRules; |
|
33 | + $this->aAdded[ ] = $sCSSRules; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function get() { |
41 | 41 | |
42 | - $_sCSSRules = $this->_get() . PHP_EOL; |
|
42 | + $_sCSSRules = $this->_get().PHP_EOL; |
|
43 | 43 | $_sCSSRules .= $this->_getVersionSpecific(); |
44 | 44 | $_sCSSRules .= implode( PHP_EOL, $this->aAdded ); |
45 | 45 | return $_sCSSRules; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | protected function _get() { |
24 | 24 | |
25 | - $_sSpinnerURL = esc_url( admin_url( '/images/wpspin_light-2x.gif' ) ); |
|
25 | + $_sSpinnerURL = esc_url( admin_url( '/images/wpspin_light-2x.gif' ) ); |
|
26 | 26 | return <<<CSSRULES |
27 | 27 | .admin-page-framework-form-warning { |
28 | 28 | font-size: 1em; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * @return string The generated field name model. |
35 | 35 | */ |
36 | 36 | public function getModel() { |
37 | - return $this->get() . '|' . $this->sIndexMark; |
|
37 | + return $this->get().'|'.$this->sIndexMark; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * Only one depth at a time will be parsed. |
27 | 27 | */ |
28 | - public $iNestedDepth = 0; |
|
28 | + public $iNestedDepth = 0; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Stores the generated section tab slugs. |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | $_aFieldsBySectionTab = array(); |
122 | 122 | $_iIndex = 0; |
123 | 123 | |
124 | - foreach( $aSectionsets as $_sSectionPath => $_aSectionset ) { |
|
124 | + foreach ( $aSectionsets as $_sSectionPath => $_aSectionset ) { |
|
125 | 125 | |
126 | 126 | // If no fields for the section, no need to add the section |
127 | 127 | // unless the custom sectionset output is defined. |
128 | - if ( ! isset( $aFieldsets[ $_sSectionPath ] ) && ! $this->_isCustomContentSet( $_aSectionset ) ) { |
|
128 | + if ( !isset( $aFieldsets[ $_sSectionPath ] ) && !$this->_isCustomContentSet( $_aSectionset ) ) { |
|
129 | 129 | continue; |
130 | 130 | } |
131 | 131 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $_sSectionTaqbSlug = $this->getAOrB( |
138 | 138 | $_aSectionset[ 'section_tab_slug' ], |
139 | 139 | $_aSectionset[ 'section_tab_slug' ], |
140 | - '_default_' . $this->iNestedDepth . '_' . ( ++$_iIndex ) |
|
140 | + '_default_'.$this->iNestedDepth.'_'.( ++$_iIndex ) |
|
141 | 141 | ); |
142 | 142 | $_aSectionsBySectionTab[ $_sSectionTaqbSlug ][ $_sSectionPath ] = $_aSectionset; |
143 | 143 | $_aFieldsBySectionTab[ $_sSectionTaqbSlug ][ $_sSectionPath ] = $this->getElement( |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_Table`. |
159 | 159 | * @return boolean True if a custom content value is set. |
160 | 160 | */ |
161 | - private function _isCustomContentSet( array $aSectionset, array $aKeys=array( 'content' ) ) { |
|
161 | + private function _isCustomContentSet( array $aSectionset, array $aKeys = array( 'content' ) ) { |
|
162 | 162 | return isset( $aSectionset[ 'content' ] ); |
163 | 163 | // @deprecated |
164 | 164 | // foreach( $aKeys as $_sKey ) { |
@@ -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>" );'; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $this->oForm = $oForm; |
36 | 36 | |
37 | - if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
37 | + if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return string |
99 | 99 | * @since 3.7.0 |
100 | 100 | */ |
101 | - private function _getScriptElementConcealerCSSRules() { |
|
101 | + private function _getScriptElementConcealerCSSRules() { |
|
102 | 102 | |
103 | 103 | // Avoid hiding framework forms in widgets. In some cases, the user sets a form in any page, |
104 | 104 | // which causes a different structure form type including `admin_page` gets loaded even in widgets.php (or any page builder pages dealing with widgets) |