@@ -337,8 +337,8 @@ |
||
337 | 337 | ) + $_aAttributes |
338 | 338 | ); |
339 | 339 | return "<p class='submit-confirm-container'><label>" |
340 | - . $_sInput |
|
341 | - . "<span>{$_aConfirm[ 'label' ]}</span>" |
|
340 | + . $_sInput |
|
341 | + . "<span>{$_aConfirm[ 'label' ]}</span>" |
|
342 | 342 | . "</label></p>"; |
343 | 343 | } |
344 | 344 |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | * @return array The label container attribute array. |
389 | 389 | * @internal |
390 | 390 | */ |
391 | - private function _getLabelContainerAttributes( array $aField ) { |
|
391 | + private function _getLabelContainerAttributes( array $aField ) { |
|
392 | 392 | return array( |
393 | 393 | 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ] |
394 | 394 | ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
@@ -636,19 +636,19 @@ discard block |
||
636 | 636 | * @internal |
637 | 637 | * @param array $aField |
638 | 638 | */ |
639 | - protected function _getInputFieldValueFromLabel( $aField ) { |
|
639 | + protected function _getInputFieldValueFromLabel( $aField ) { |
|
640 | 640 | |
641 | 641 | // If the value key is explicitly set, use it. But the empty string will be ignored. |
642 | - if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
642 | + if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
643 | 643 | return $aField[ 'value' ]; |
644 | 644 | } |
645 | 645 | |
646 | - if ( isset( $aField[ 'label' ] ) ) { |
|
646 | + if ( isset( $aField[ 'label' ] ) ) { |
|
647 | 647 | return $aField[ 'label' ]; |
648 | 648 | } |
649 | 649 | |
650 | 650 | // If the default value is set, |
651 | - if ( isset( $aField[ 'default' ] ) ) { |
|
651 | + if ( isset( $aField[ 'default' ] ) ) { |
|
652 | 652 | return $aField[ 'default' ]; |
653 | 653 | } |
654 | 654 |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | /** |
192 | 192 | * Defines the field type slugs used for this field type. |
193 | 193 | */ |
194 | - public $aFieldTypeSlugs = array( 'submit', ); |
|
194 | + public $aFieldTypeSlugs = array( 'submit',); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Defines the default key-values of this field type. |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | 'redirect_url' => null, |
203 | 203 | 'href' => null, |
204 | 204 | 'reset' => null, |
205 | - 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
205 | + 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
206 | 206 | 'confirm' => '', |
207 | 207 | /* |
208 | 208 | array( |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | '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. |
214 | 214 | ) |
215 | 215 | */ |
216 | - 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
216 | + 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
217 | 217 | 'attributes' => array( |
218 | 218 | 'class' => 'button button-primary', |
219 | 219 | ), |
@@ -294,17 +294,17 @@ discard block |
||
294 | 294 | |
295 | 295 | return |
296 | 296 | $aField[ 'before_label' ] |
297 | - . "<div " . $this->getAttributes( $_aLabelContainerAttributes ) . ">" |
|
297 | + . "<div ".$this->getAttributes( $_aLabelContainerAttributes ).">" |
|
298 | 298 | . $this->_getExtraFieldsBeforeLabel( $aField ) // this is for the import field type that cannot place file input tag inside the label tag. |
299 | - . "<label " . $this->getAttributes( $_aLabelAttributes ) . ">" |
|
299 | + . "<label ".$this->getAttributes( $_aLabelAttributes ).">" |
|
300 | 300 | . $aField[ 'before_input' ] |
301 | 301 | . $this->_getExtraInputFields( $aField ) |
302 | - . "<input " . $this->getAttributes( $_aInputAttributes ) . " />" // this method is defined in the base class |
|
302 | + . "<input ".$this->getAttributes( $_aInputAttributes )." />" // this method is defined in the base class |
|
303 | 303 | . $aField[ 'after_input' ] |
304 | 304 | . "</label>" |
305 | 305 | . $this->___getConfirmationCheckbox( $aField ) |
306 | 306 | . "</div>" |
307 | - . $aField['after_label']; |
|
307 | + . $aField[ 'after_label' ]; |
|
308 | 308 | |
309 | 309 | } |
310 | 310 | /** |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | if ( empty( $aField[ 'confirm' ] ) ) { |
317 | 317 | return ''; |
318 | 318 | } |
319 | - $_aConfirm = is_string( $aField[ 'confirm' ] ) |
|
319 | + $_aConfirm = is_string( $aField[ 'confirm' ] ) |
|
320 | 320 | ? array( |
321 | 321 | 'label' => $aField[ 'confirm' ] |
322 | 322 | ) |
323 | 323 | : $this->getAsArray( $aField[ 'confirm' ] ); |
324 | - $_aConfirm = $_aConfirm + array( |
|
324 | + $_aConfirm = $_aConfirm + array( |
|
325 | 325 | 'label' => $this->oMsg->get( 'submit_confirmation_label' ), |
326 | 326 | 'error' => $this->oMsg->get( 'submit_confirmation_error' ), |
327 | 327 | ); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | private function _getLabelAttributes( array $aField, array $aInputAttributes ) { |
373 | 373 | return array( |
374 | 374 | 'style' => $aField[ 'label_min_width' ] |
375 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
375 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
376 | 376 | : null, |
377 | 377 | 'for' => $aInputAttributes[ 'id' ], |
378 | 378 | 'class' => $aInputAttributes[ 'disabled' ] |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | private function _getLabelContainerAttributes( array $aField ) { |
392 | 392 | return array( |
393 | 393 | 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ] |
394 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
394 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
395 | 395 | : null, |
396 | 396 | 'class' => 'admin-page-framework-input-label-container' |
397 | 397 | . ' admin-page-framework-input-button-container' |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | protected function _getExtraInputFields( &$aField ) { |
446 | 446 | |
447 | 447 | $_aOutput = array(); |
448 | - $_aOutput[] = $this->getHTMLTag( |
|
448 | + $_aOutput[ ] = $this->getHTMLTag( |
|
449 | 449 | 'input', |
450 | 450 | array( |
451 | 451 | 'type' => 'hidden', |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | 'value' => $aField[ 'input_id' ], |
454 | 454 | ) |
455 | 455 | ); |
456 | - $_aOutput[] = $this->getHTMLTag( |
|
456 | + $_aOutput[ ] = $this->getHTMLTag( |
|
457 | 457 | 'input', |
458 | 458 | array( |
459 | 459 | 'type' => 'hidden', |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | 'value' => $aField[ 'field_id' ], |
462 | 462 | ) |
463 | 463 | ); |
464 | - $_aOutput[] = $this->getHTMLTag( |
|
464 | + $_aOutput[ ] = $this->getHTMLTag( |
|
465 | 465 | 'input', |
466 | 466 | array( |
467 | 467 | 'type' => 'hidden', |
@@ -469,11 +469,11 @@ discard block |
||
469 | 469 | 'value' => $aField[ '_input_name_flat' ], |
470 | 470 | ) |
471 | 471 | ); |
472 | - $_aOutput[] = $this->_getHiddenInput_SectionID( $aField ); |
|
473 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
474 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
475 | - $_aOutput[] = $this->_getHiddenInput_Reset( $aField ); |
|
476 | - $_aOutput[] = $this->_getHiddenInput_Email( $aField ); |
|
472 | + $_aOutput[ ] = $this->_getHiddenInput_SectionID( $aField ); |
|
473 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
474 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
475 | + $_aOutput[ ] = $this->_getHiddenInput_Reset( $aField ); |
|
476 | + $_aOutput[ ] = $this->_getHiddenInput_Email( $aField ); |
|
477 | 477 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
478 | 478 | |
479 | 479 | } |
@@ -490,9 +490,9 @@ discard block |
||
490 | 490 | 'input', |
491 | 491 | array( |
492 | 492 | 'type' => 'hidden', |
493 | - 'name' => "__submit[{$aField['input_id']}][section_id]", |
|
494 | - 'value' => isset( $aField['section_id'] ) && '_default' !== $aField['section_id'] |
|
495 | - ? $aField['section_id'] |
|
493 | + 'name' => "__submit[{$aField[ 'input_id' ]}][section_id]", |
|
494 | + 'value' => isset( $aField[ 'section_id' ] ) && '_default' !== $aField[ 'section_id' ] |
|
495 | + ? $aField[ 'section_id' ] |
|
496 | 496 | : '', |
497 | 497 | ) |
498 | 498 | ); |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | 'input', |
513 | 513 | array( |
514 | 514 | 'type' => 'hidden', |
515 | - 'name' => "__submit[{$aField['input_id']}][{$sKey}]", |
|
515 | + 'name' => "__submit[{$aField[ 'input_id' ]}][{$sKey}]", |
|
516 | 516 | 'value' => $aField[ $sKey ], |
517 | 517 | ) |
518 | 518 | ) |
@@ -527,15 +527,15 @@ discard block |
||
527 | 527 | * @return string the HTML input tag output for the 'reset' argument. |
528 | 528 | */ |
529 | 529 | private function _getHiddenInput_Reset( array $aField ) { |
530 | - if ( ! $aField[ 'reset' ] ) { |
|
530 | + if ( !$aField[ 'reset' ] ) { |
|
531 | 531 | return ''; |
532 | 532 | } |
533 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
533 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
534 | 534 | ? $this->getHTMLTag( |
535 | 535 | 'input', |
536 | 536 | array( |
537 | 537 | 'type' => 'hidden', |
538 | - 'name' => "__submit[{$aField['input_id']}][is_reset]", |
|
538 | + 'name' => "__submit[{$aField[ 'input_id' ]}][is_reset]", |
|
539 | 539 | 'value' => '1', |
540 | 540 | ) |
541 | 541 | ) |
@@ -564,12 +564,12 @@ discard block |
||
564 | 564 | return ''; |
565 | 565 | } |
566 | 566 | $this->setTransient( |
567 | - 'apf_em_' . md5( $aField[ '_input_name_flat' ] . get_current_user_id() ), |
|
567 | + 'apf_em_'.md5( $aField[ '_input_name_flat' ].get_current_user_id() ), |
|
568 | 568 | array( |
569 | - 'nonce' => $this->getNonceCreated( 'apf_email_nonce_' . md5( ( string ) site_url() ), 86400 ), // @todo the nonce is crated when the page is rendered so change this to when the form is submitted so that a shorter nonce lifespan can be set. |
|
569 | + 'nonce' => $this->getNonceCreated( 'apf_email_nonce_'.md5( ( string ) site_url() ), 86400 ), // @todo the nonce is crated when the page is rendered so change this to when the form is submitted so that a shorter nonce lifespan can be set. |
|
570 | 570 | ) + $this->getAsArray( $aField[ 'email' ] ) |
571 | 571 | ); |
572 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
572 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
573 | 573 | ? $this->getHTMLTag( |
574 | 574 | 'input', |
575 | 575 | array( |
@@ -597,19 +597,19 @@ discard block |
||
597 | 597 | * @return boolean |
598 | 598 | * @internal |
599 | 599 | */ |
600 | - private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType='reset' ) { |
|
600 | + private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType = 'reset' ) { |
|
601 | 601 | |
602 | - switch( $sType ) { |
|
602 | + switch ( $sType ) { |
|
603 | 603 | default: |
604 | 604 | case 'reset': // admin page framework _ reset confirmation |
605 | - $_sTransientKey = 'apf_rc_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
605 | + $_sTransientKey = 'apf_rc_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
606 | 606 | break; |
607 | 607 | case 'email': // admin page framework _ email confirmation |
608 | - $_sTransientKey = 'apf_ec_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
608 | + $_sTransientKey = 'apf_ec_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
609 | 609 | break; |
610 | 610 | } |
611 | 611 | |
612 | - $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && ! $aField[ 'skip_confirmation' ] |
|
612 | + $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && !$aField[ 'skip_confirmation' ] |
|
613 | 613 | ? false |
614 | 614 | : true; |
615 | 615 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Defines the field type slugs used for this field type. |
42 | 42 | */ |
43 | - public $aFieldTypeSlugs = array( 'import', ); |
|
43 | + public $aFieldTypeSlugs = array( 'import',); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Defines the default key-values of this field type. |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @return string |
135 | 135 | */ |
136 | 136 | protected function getField( $aField ) { |
137 | - $aField[ 'attributes'][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
137 | + $aField[ 'attributes' ][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
138 | 138 | $aField[ 'label' ] = $aField[ 'label' ] |
139 | 139 | ? $aField[ 'label' ] |
140 | 140 | : $this->oMsg->get( 'import' ); |
@@ -153,13 +153,13 @@ discard block |
||
153 | 153 | */ |
154 | 154 | protected function _getExtraFieldsBeforeLabel( &$aField ) { |
155 | 155 | return "<label>" |
156 | - . "<input " . $this->getAttributes( |
|
156 | + . "<input ".$this->getAttributes( |
|
157 | 157 | array( |
158 | 158 | 'id' => "{$aField[ 'input_id' ]}_file", |
159 | 159 | 'type' => 'file', |
160 | 160 | 'name' => "__import[{$aField[ 'input_id' ]}]", |
161 | 161 | ) + $aField[ 'attributes' ][ 'file' ] |
162 | - ) . " />" |
|
162 | + )." />" |
|
163 | 163 | . "</label>"; |
164 | 164 | } |
165 | 165 | |
@@ -172,44 +172,44 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function _getExtraInputFields( &$aField ) { |
174 | 174 | |
175 | - $aHiddenAttributes = array( 'type' => 'hidden', ); |
|
175 | + $aHiddenAttributes = array( 'type' => 'hidden',); |
|
176 | 176 | return |
177 | - "<input " . $this->getAttributes( |
|
177 | + "<input ".$this->getAttributes( |
|
178 | 178 | array( |
179 | - 'name' => "__import[{$aField['input_id']}][input_id]", |
|
180 | - 'value' => $aField['input_id'], |
|
179 | + 'name' => "__import[{$aField[ 'input_id' ]}][input_id]", |
|
180 | + 'value' => $aField[ 'input_id' ], |
|
181 | 181 | ) + $aHiddenAttributes |
182 | - ) . "/>" |
|
183 | - . "<input " . $this->getAttributes( |
|
182 | + )."/>" |
|
183 | + . "<input ".$this->getAttributes( |
|
184 | 184 | array( |
185 | - 'name' => "__import[{$aField['input_id']}][field_id]", |
|
186 | - 'value' => $aField['field_id'], |
|
185 | + 'name' => "__import[{$aField[ 'input_id' ]}][field_id]", |
|
186 | + 'value' => $aField[ 'field_id' ], |
|
187 | 187 | ) + $aHiddenAttributes |
188 | - ) . "/>" |
|
189 | - . "<input " . $this->getAttributes( |
|
188 | + )."/>" |
|
189 | + . "<input ".$this->getAttributes( |
|
190 | 190 | array( |
191 | - 'name' => "__import[{$aField['input_id']}][section_id]", |
|
192 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
191 | + 'name' => "__import[{$aField[ 'input_id' ]}][section_id]", |
|
192 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
193 | 193 | ) + $aHiddenAttributes |
194 | - ) . "/>" |
|
195 | - . "<input " . $this->getAttributes( |
|
194 | + )."/>" |
|
195 | + . "<input ".$this->getAttributes( |
|
196 | 196 | array( |
197 | - 'name' => "__import[{$aField['input_id']}][is_merge]", |
|
198 | - 'value' => $aField['is_merge'], |
|
197 | + 'name' => "__import[{$aField[ 'input_id' ]}][is_merge]", |
|
198 | + 'value' => $aField[ 'is_merge' ], |
|
199 | 199 | ) + $aHiddenAttributes |
200 | - ) . "/>" |
|
201 | - . "<input " . $this->getAttributes( |
|
200 | + )."/>" |
|
201 | + . "<input ".$this->getAttributes( |
|
202 | 202 | array( |
203 | - 'name' => "__import[{$aField['input_id']}][option_key]", |
|
204 | - 'value' => $aField['option_key'], |
|
203 | + 'name' => "__import[{$aField[ 'input_id' ]}][option_key]", |
|
204 | + 'value' => $aField[ 'option_key' ], |
|
205 | 205 | ) + $aHiddenAttributes |
206 | - ) . "/>" |
|
207 | - . "<input " . $this->getAttributes( |
|
206 | + )."/>" |
|
207 | + . "<input ".$this->getAttributes( |
|
208 | 208 | array( |
209 | - 'name' => "__import[{$aField['input_id']}][format]", |
|
210 | - 'value' => $aField['format'], |
|
209 | + 'name' => "__import[{$aField[ 'input_id' ]}][format]", |
|
210 | + 'value' => $aField[ 'format' ], |
|
211 | 211 | ) + $aHiddenAttributes |
212 | - ) . "/>" |
|
212 | + )."/>" |
|
213 | 213 | ; |
214 | 214 | } |
215 | 215 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * </code> |
73 | 73 | * @var array |
74 | 74 | */ |
75 | - public $aFieldTypeSlugs = array( 'system', ); |
|
75 | + public $aFieldTypeSlugs = array( 'system',); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Defines the default key-values of this field type. |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | * @remark `$_aDefaultKeys` holds shared default key-values defined in the base class. |
93 | 93 | */ |
94 | 94 | protected $aDefaultKeys = array( |
95 | - 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | - 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
95 | + 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | + 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
97 | 97 | 'attributes' => array( |
98 | 98 | 'rows' => 60, |
99 | 99 | 'autofocus' => null, |
@@ -233,13 +233,13 @@ discard block |
||
233 | 233 | . "<div class='admin-page-framework-input-label-container'>" |
234 | 234 | . "<label for='{$aField[ 'input_id' ]}'>" |
235 | 235 | . $aField[ 'before_input' ] |
236 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
237 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
236 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
237 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
238 | 238 | . $aField[ 'label' ] |
239 | 239 | . "</span>" |
240 | 240 | : "" |
241 | 241 | ) |
242 | - . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >" |
|
242 | + . "<textarea ".$this->getAttributes( $_aInputAttributes )." >" |
|
243 | 243 | . esc_textarea( $this->___getSystemInformation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) ) |
244 | 244 | . "</textarea>" |
245 | 245 | . $aField[ 'after_input' ] |
@@ -257,15 +257,15 @@ discard block |
||
257 | 257 | * @param integer $iPrintType |
258 | 258 | * @internal |
259 | 259 | */ |
260 | - private function ___getSystemInformation( $asValue=null, $asCustomData=null, $iPrintType=1 ) { |
|
260 | + private function ___getSystemInformation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) { |
|
261 | 261 | |
262 | 262 | if ( isset( $asValue ) ) { |
263 | 263 | return $asValue; |
264 | 264 | } |
265 | 265 | |
266 | - $_aOutput = array(); |
|
267 | - foreach( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | - $_aOutput[] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
266 | + $_aOutput = array(); |
|
267 | + foreach ( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | + $_aOutput[ ] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
269 | 269 | } |
270 | 270 | return implode( PHP_EOL, $_aOutput ); |
271 | 271 | |
@@ -281,15 +281,15 @@ discard block |
||
281 | 281 | |
282 | 282 | $_aData = $this->getAsArray( $asCustomData ); |
283 | 283 | $_aData = $_aData + array( |
284 | - 'WordPress' => $this->___getSiteInfoWithCache( ! isset( $_aData[ 'WordPress' ] ) ), |
|
285 | - 'PHP' => $this->_getPHPInfo( ! isset( $_aData[ 'PHP' ] ) ), |
|
286 | - 'PHP Error Log' => $this->___getErrorLogByType( 'php', ! isset( $_aData[ 'PHP Error Log' ] ) ), |
|
284 | + 'WordPress' => $this->___getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ), |
|
285 | + 'PHP' => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ), |
|
286 | + 'PHP Error Log' => $this->___getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ), |
|
287 | 287 | 'MySQL' => isset( $_aData[ 'MySQL' ] ) |
288 | 288 | ? null |
289 | - : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | - 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', ! isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | - 'Server' => $this->___getWebServerInfo( ! isset( $_aData[ 'Server' ] ) ), |
|
292 | - 'Browser' => $this->___getClientInfo( ! isset( $_aData[ 'Browser' ] ) ), |
|
289 | + : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | + 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | + 'Server' => $this->___getWebServerInfo( !isset( $_aData[ 'Server' ] ) ), |
|
292 | + 'Browser' => $this->___getClientInfo( !isset( $_aData[ 'Browser' ] ) ), |
|
293 | 293 | 'Admin Page Framework' => isset( $_aData[ 'Admin Page Framework' ] ) |
294 | 294 | ? null |
295 | 295 | : AdminPageFramework_Registry::getInfo(), |
@@ -312,10 +312,10 @@ discard block |
||
312 | 312 | switch ( $iPrintType ) { |
313 | 313 | default: |
314 | 314 | case 1: // use the framework readable representation of arrays. |
315 | - return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL; |
|
315 | + return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL; |
|
316 | 316 | case 2: // use print_r() |
317 | - return "[{$sSectionName}]" . PHP_EOL |
|
318 | - . print_r( $aData, true ) . PHP_EOL; |
|
317 | + return "[{$sSectionName}]".PHP_EOL |
|
318 | + . print_r( $aData, true ).PHP_EOL; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | /** |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | * @param boolean $bGenerateInfo |
328 | 328 | * @return string |
329 | 329 | */ |
330 | - private function ___getClientInfo( $bGenerateInfo=true ) { |
|
330 | + private function ___getClientInfo( $bGenerateInfo = true ) { |
|
331 | 331 | |
332 | - if ( ! $bGenerateInfo ) { |
|
332 | + if ( !$bGenerateInfo ) { |
|
333 | 333 | return ''; |
334 | 334 | } |
335 | 335 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $_aBrowser = @ini_get( 'browscap' ) |
338 | 338 | ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true ) |
339 | 339 | : array(); |
340 | - unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
340 | + unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
341 | 341 | return empty( $_aBrowser ) |
342 | 342 | ? __( 'No browser information found.', 'admin-page-framework' ) |
343 | 343 | : $_aBrowser; |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | * @param string $sType The error log type. Either 'php' or 'mysql' is accepted. |
354 | 354 | * @param boolean $bGenerateInfo Whether to generate a log. This is for the caller method to reduce a conditinal statement. |
355 | 355 | */ |
356 | - private function ___getErrorLogByType( $sType, $bGenerateInfo=true ) { |
|
356 | + private function ___getErrorLogByType( $sType, $bGenerateInfo = true ) { |
|
357 | 357 | |
358 | - if ( ! $bGenerateInfo ) { |
|
358 | + if ( !$bGenerateInfo ) { |
|
359 | 359 | return ''; |
360 | 360 | } |
361 | 361 | switch ( $sType ) { |
@@ -388,9 +388,9 @@ discard block |
||
388 | 388 | * @param boolean $bGenerateInfo |
389 | 389 | * @return array The generated site information array. |
390 | 390 | */ |
391 | - private function ___getSiteInfoWithCache( $bGenerateInfo=true ) { |
|
391 | + private function ___getSiteInfoWithCache( $bGenerateInfo = true ) { |
|
392 | 392 | |
393 | - if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
393 | + if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
394 | 394 | return self::$_aSiteInfo; |
395 | 395 | } |
396 | 396 | self::$_aSiteInfo = self::___getSiteInfo(); |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | 'wp_remote_get()' => $this->___getWPRemoteGetStatus(), |
425 | 425 | __( 'Multibite String Extension', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
426 | 426 | __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' ) => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
427 | - __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getActivePlugins(), |
|
428 | - __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getNetworkActivePlugins(), |
|
427 | + __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getActivePlugins(), |
|
428 | + __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getNetworkActivePlugins(), |
|
429 | 429 | __( 'Constants', 'admin-page-framework' ) => $this->___getDefinedConstants( 'user' ), |
430 | 430 | ); |
431 | 431 | } |
@@ -437,9 +437,9 @@ discard block |
||
437 | 437 | * @return string|array |
438 | 438 | * @internal |
439 | 439 | */ |
440 | - private function ___getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
|
440 | + private function ___getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) { |
|
441 | 441 | $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories ); |
442 | - if ( ! is_array( $_asConstants ) ) { |
|
442 | + if ( !is_array( $_asConstants ) ) { |
|
443 | 443 | return $_asConstants; |
444 | 444 | } |
445 | 445 | if ( isset( $_asConstants[ 'user' ] ) ) { |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | |
477 | 477 | // If the WordPress version is less than 3.4, |
478 | 478 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) { |
479 | - $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
480 | - return $_aThemeData[ 'Name' ] . ' ' . $_aThemeData[ 'Version' ]; |
|
479 | + $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' ); |
|
480 | + return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ]; |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | $_oThemeData = wp_get_theme(); |
484 | - return $_oThemeData->Name . ' ' . $_oThemeData->Version; |
|
484 | + return $_oThemeData->Name.' '.$_oThemeData->Version; |
|
485 | 485 | |
486 | 486 | } |
487 | 487 | /** |
@@ -495,10 +495,10 @@ discard block |
||
495 | 495 | $_aPluginList = array(); |
496 | 496 | $_aActivePlugins = get_option( 'active_plugins', array() ); |
497 | 497 | foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) { |
498 | - if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
498 | + if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
499 | 499 | continue; |
500 | 500 | } |
501 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ': ' . $_aPlugin[ 'Version' ]; |
|
501 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ]; |
|
502 | 502 | } |
503 | 503 | return implode( PHP_EOL, $_aPluginList ); |
504 | 504 | |
@@ -510,17 +510,17 @@ discard block |
||
510 | 510 | */ |
511 | 511 | private function ___getNetworkActivePlugins() { |
512 | 512 | |
513 | - if ( ! is_multisite() ) { |
|
513 | + if ( !is_multisite() ) { |
|
514 | 514 | return ''; |
515 | 515 | } |
516 | 516 | $_aPluginList = array(); |
517 | 517 | $_aActivePlugins = get_site_option( 'active_sitewide_plugins', array() ); |
518 | 518 | foreach ( wp_get_active_network_plugins() as $_sPluginPath ) { |
519 | - if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
519 | + if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
520 | 520 | continue; |
521 | 521 | } |
522 | 522 | $_aPlugin = get_plugin_data( $_sPluginPath ); |
523 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ' :' . $_aPlugin[ 'Version' ]; |
|
523 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ]; |
|
524 | 524 | } |
525 | 525 | return implode( PHP_EOL, $_aPluginList ); |
526 | 526 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if ( is_wp_error( $aoResponse ) ) { |
585 | 585 | return true; |
586 | 586 | } |
587 | - if ( $aoResponse[ 'response'][ 'code' ] < 200 ) { |
|
587 | + if ( $aoResponse[ 'response' ][ 'code' ] < 200 ) { |
|
588 | 588 | return true; |
589 | 589 | } |
590 | 590 | if ( $aoResponse[ 'response' ][ 'code' ] >= 300 ) { |
@@ -610,13 +610,13 @@ discard block |
||
610 | 610 | * @param boolean $bGenerateInfo |
611 | 611 | * @return array |
612 | 612 | */ |
613 | - private function _getPHPInfo( $bGenerateInfo=true ) { |
|
613 | + private function _getPHPInfo( $bGenerateInfo = true ) { |
|
614 | 614 | |
615 | - if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
615 | + if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
616 | 616 | return self::$_aPHPInfo; |
617 | 617 | } |
618 | 618 | |
619 | - $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
619 | + $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
620 | 620 | self::$_aPHPInfo = array( |
621 | 621 | __( 'Version', 'admin-page-framework' ) => phpversion(), |
622 | 622 | __( 'Safe Mode', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
@@ -627,16 +627,16 @@ discard block |
||
627 | 627 | __( 'Max Execution Time', 'admin-page-framework' ) => @ini_get( 'max_execution_time' ), |
628 | 628 | __( 'Max Input Vars', 'admin-page-framework' ) => @ini_get( 'max_input_vars' ), |
629 | 629 | __( 'Argument Separator', 'admin-page-framework' ) => @ini_get( 'arg_separator.output' ), |
630 | - __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | - __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | - __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
630 | + __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | + __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | + __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
633 | 633 | __( 'Error log location', 'admin-page-framework' ) => @ini_get( 'error_log' ), |
634 | 634 | __( 'Error Reporting Level', 'admin-page-framework' ) => $_oErrorReporting->getErrorLevel(), |
635 | - __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | - __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | - __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | - __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | - 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
635 | + __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | + __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | + __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | + __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | + 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
640 | 640 | ) |
641 | 641 | + $this->getPHPInfo() |
642 | 642 | + array( |
@@ -656,10 +656,10 @@ discard block |
||
656 | 656 | * @param boolean $bGenerateInfo |
657 | 657 | * @return array|string |
658 | 658 | */ |
659 | - private function ___getWebServerInfo( $bGenerateInfo=true ) { |
|
659 | + private function ___getWebServerInfo( $bGenerateInfo = true ) { |
|
660 | 660 | return $bGenerateInfo |
661 | 661 | ? array( |
662 | - __( 'Web Server', 'admin-page-framework' ) => $_SERVER['SERVER_SOFTWARE'], |
|
662 | + __( 'Web Server', 'admin-page-framework' ) => $_SERVER[ 'SERVER_SOFTWARE' ], |
|
663 | 663 | 'SSL' => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
664 | 664 | __( 'Session', 'admin-page-framework' ) => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
665 | 665 | __( 'Session Name', 'admin-page-framework' ) => esc_html( @ini_get( 'session.name' ) ), |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get() { |
43 | 43 | |
44 | - foreach( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
44 | + foreach ( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
45 | 45 | |
46 | 46 | $_aDimensionalKeys = explode( '|', $_sFlatFieldAddress ); |
47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | // If the retrieved value does not exist, null will be given. |
54 | 54 | // This occurs with page meta boxes. |
55 | - if ( ! is_array( $_aDynamicElements ) ) { |
|
55 | + if ( !is_array( $_aDynamicElements ) ) { |
|
56 | 56 | continue; |
57 | 57 | } |
58 | 58 |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | * @since 3.5.4 Added the `$aHeader` parameter. Deprecated the `$sFileName` parameter as it is included in the $aHeader definition. |
100 | 100 | * @since 2.0.0 |
101 | 101 | */ |
102 | - public function doExport( $vData, $sFormatType=null, array $aHeader=array() ) { |
|
102 | + public function doExport( $vData, $sFormatType = null, array $aHeader = array() ) { |
|
103 | 103 | |
104 | - $sFormatType = isset( $sFormatType ) |
|
104 | + $sFormatType = isset( $sFormatType ) |
|
105 | 105 | ? $sFormatType |
106 | 106 | : $this->sFormatType; |
107 | 107 | |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * @param string $sKey |
130 | 130 | * @return void |
131 | 131 | */ |
132 | - private function _outputHTTPHeader( array $aHeader, $sKey='' ) { |
|
132 | + private function _outputHTTPHeader( array $aHeader, $sKey = '' ) { |
|
133 | 133 | |
134 | - foreach( $aHeader as $_sKey => $_asValue ) { |
|
134 | + foreach ( $aHeader as $_sKey => $_asValue ) { |
|
135 | 135 | |
136 | 136 | // Nested items. Set the key to overrider array keys. |
137 | 137 | if ( is_array( $_asValue ) ) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return; |
174 | 174 | case 'json': // for json. |
175 | 175 | echo json_encode( ( array ) $vData ); |
176 | - return ; |
|
176 | + return; |
|
177 | 177 | case 'array': // for serialized PHP array. |
178 | 178 | default: // for anything else, |
179 | 179 | echo serialize( ( array ) $vData ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * Stores method names of the `WP_Widget` class, referred when the class is assumed as a WP_Widget subclass. |
116 | 116 | * @since 3.8.17 |
117 | 117 | */ |
118 | - public $aWPWidgetMethods = array(); |
|
118 | + public $aWPWidgetMethods = array(); |
|
119 | 119 | /** |
120 | 120 | * Stores property names of the `WP_Widget` class, , referred when the class is assumed as a WP_Widget subclass. |
121 | 121 | * @since 3.8.17 |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | * Sets up properties. |
127 | 127 | * @since 3.7.0 |
128 | 128 | */ |
129 | - public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='' ) { |
|
129 | + public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType = '' ) { |
|
130 | 130 | |
131 | 131 | // 3.7.0+ |
132 | - $this->_sFormRegistrationHook = 'load_' . $sClassName; |
|
132 | + $this->_sFormRegistrationHook = 'load_'.$sClassName; |
|
133 | 133 | |
134 | 134 | // 3.7.9+ - setting a custom action hook for admin notices prevents the form object from being instantiated unnecessarily. |
135 | - $this->sSettingNoticeActionHook = 'load_' . $sClassName; |
|
135 | + $this->sSettingNoticeActionHook = 'load_'.$sClassName; |
|
136 | 136 | |
137 | 137 | parent::__construct( |
138 | 138 | $oCaller, |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | * @since 3.8.4 When non-true value is passed, `0px` will be returned. |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - static public function getLengthSanitized( $sLength, $sUnit='px' ) { |
|
38 | + static public function getLengthSanitized( $sLength, $sUnit = 'px' ) { |
|
39 | 39 | $sLength = $sLength ? $sLength : 0; |
40 | 40 | return is_numeric( $sLength ) |
41 | - ? $sLength . $sUnit |
|
41 | + ? $sLength.$sUnit |
|
42 | 42 | : $sLength; |
43 | 43 | } |
44 | 44 | |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | * @since 3.8.11 Renamed from `fixNumber()`. |
81 | 81 | * @return string|integer A numeric value will be returned. |
82 | 82 | */ |
83 | - static public function getNumberFixed( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
83 | + static public function getNumberFixed( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
84 | 84 | |
85 | - if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
85 | + if ( !is_numeric( trim( $nToFix ) ) ) { |
|
86 | 86 | return $nDefault; |
87 | 87 | } |
88 | 88 | if ( $nMin !== '' && $nToFix < $nMin ) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @return string|integer A numeric value will be returned. |
101 | 101 | * @deprecated 3.8.11 |
102 | 102 | */ |
103 | - static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
103 | + static public function fixNumber( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
104 | 104 | return self::getNumberFixed( $nToFix, $nDefault, $nMin, $nMax ); |
105 | 105 | } |
106 | 106 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | static public function getCSSMinified( $sCSSRules ) { |
115 | 115 | return str_replace( |
116 | - array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' '), // remove line breaks, tab, and white sspaces. |
|
116 | + array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), // remove line breaks, tab, and white sspaces. |
|
117 | 117 | '', |
118 | 118 | preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $sCSSRules ) // remove comments |
119 | 119 | ); |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | */ |
151 | 151 | static public function getNumberOfReadableSize( $nSize ) { |
152 | 152 | |
153 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
154 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
153 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
154 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
155 | 155 | case 'P': |
156 | 156 | $_nReturn *= 1024; |
157 | 157 | case 'T': |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | * @since 3.8.26 Added the `$iRoundPrecision` parameter. |
176 | 176 | * @return string |
177 | 177 | */ |
178 | - static public function getReadableBytes( $nBytes, $iRoundPrecision=2 ) { |
|
178 | + static public function getReadableBytes( $nBytes, $iRoundPrecision = 2 ) { |
|
179 | 179 | $_aUnits = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); |
180 | 180 | $_nLog = log( $nBytes, 1024 ); |
181 | 181 | $_iPower = ( int ) $_nLog; |
182 | 182 | $_ifSize = pow( 1024, $_nLog - $_iPower ); |
183 | 183 | $_ifSize = round( $_ifSize, $iRoundPrecision ); |
184 | - return $_ifSize . $_aUnits[ $_iPower ]; |
|
184 | + return $_ifSize.$_aUnits[ $_iPower ]; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct( $oProp, $oMsg ) { |
29 | 29 | |
30 | - if ( ! $this->_shouldProceed( $oProp ) ) { |
|
30 | + if ( !$this->_shouldProceed( $oProp ) ) { |
|
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | private function _shouldProceed( $oProp ) { |
46 | 46 | |
47 | - if ( $oProp->bIsAdminAjax || ! $oProp->bIsAdmin ) { |
|
47 | + if ( $oProp->bIsAdminAjax || !$oProp->bIsAdmin ) { |
|
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | return ( boolean ) $oProp->bShowDebugInfo; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function _replyToGetPageLoadInfo( $sFooterHTML ) { |
72 | 72 | |
73 | 73 | // 3.8.8+ The `bShowDebugInfo` property may be updated by the user during the page load. |
74 | - if ( ! $this->oProp->bShowDebugInfo ) { |
|
74 | + if ( !$this->oProp->bShowDebugInfo ) { |
|
75 | 75 | return $sFooterHTML; |
76 | 76 | } |
77 | 77 | |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | $_sInitialMemoryUsage = $this->getReadableBytes( $_nInitialMemoryUsage ); |
106 | 106 | return "<div id='admin-page-framework-page-load-stats'>" |
107 | 107 | . "<ul>" |
108 | - . "<li>" . sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds ) . "</li>" |
|
109 | - . "<li>" . sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_sMemoryUsage, $_sMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100 . '%' ) . "</li>" |
|
110 | - . "<li>" . sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_sMemoryPeakUsage ) . "</li>" |
|
111 | - . "<li>" . sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage ) . "</li>" |
|
108 | + . "<li>".sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds )."</li>" |
|
109 | + . "<li>".sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_sMemoryUsage, $_sMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100.'%' )."</li>" |
|
110 | + . "<li>".sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_sMemoryPeakUsage )."</li>" |
|
111 | + . "<li>".sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage )."</li>" |
|
112 | 112 | . "</ul>" |
113 | 113 | . "</div>"; |
114 | 114 |
@@ -180,24 +180,24 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | - * Removes the given section(s) by section ID. |
|
184 | - * |
|
185 | - * This accesses the property storing the added section arrays and removes the specified ones. |
|
186 | - * |
|
187 | - * <h4>Example</h4> |
|
188 | - * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
189 | - * </code> |
|
190 | - * |
|
191 | - * @since 2.0.0 |
|
192 | - * @since 3.0.0 Changed the scope to public from protected. |
|
193 | - * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
194 | - * @access public |
|
195 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
196 | - * @param string $sSectionID1 the section ID to remove. |
|
197 | - * @param string $sSectionID2 (optional) another section ID to remove. |
|
198 | - * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
199 | - * @return void |
|
200 | - */ |
|
183 | + * Removes the given section(s) by section ID. |
|
184 | + * |
|
185 | + * This accesses the property storing the added section arrays and removes the specified ones. |
|
186 | + * |
|
187 | + * <h4>Example</h4> |
|
188 | + * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
189 | + * </code> |
|
190 | + * |
|
191 | + * @since 2.0.0 |
|
192 | + * @since 3.0.0 Changed the scope to public from protected. |
|
193 | + * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
194 | + * @access public |
|
195 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
196 | + * @param string $sSectionID1 the section ID to remove. |
|
197 | + * @param string $sSectionID2 (optional) another section ID to remove. |
|
198 | + * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
199 | + * @return void |
|
200 | + */ |
|
201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
202 | 202 | foreach( func_get_args() as $_sSectionID ) { |
203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
@@ -262,38 +262,38 @@ discard block |
||
262 | 262 | } |
263 | 263 | } |
264 | 264 | /** |
265 | - * Adds the given field array items into the field array property. |
|
266 | - * |
|
267 | - * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
268 | - * |
|
269 | - * @since 2.1.2 |
|
270 | - * @since 3.0.0 Changed the scope to public from protected. |
|
271 | - * @access public |
|
272 | - * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
273 | - * @return void |
|
274 | - */ |
|
265 | + * Adds the given field array items into the field array property. |
|
266 | + * |
|
267 | + * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
268 | + * |
|
269 | + * @since 2.1.2 |
|
270 | + * @since 3.0.0 Changed the scope to public from protected. |
|
271 | + * @access public |
|
272 | + * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
273 | + * @return void |
|
274 | + */ |
|
275 | 275 | public function addSettingField( $asField ) { |
276 | 276 | $this->oForm->addField( $asField ); |
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
280 | - * Removes the given field(s) by field ID. |
|
281 | - * |
|
282 | - * This accesses the property storing the added field arrays and removes the specified ones. |
|
283 | - * |
|
284 | - * <h4>Example</h4> |
|
285 | - * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
286 | - * </code> |
|
287 | - * |
|
288 | - * @since 2.0.0 |
|
289 | - * @since 3.0.0 Changed the scope to public from protected. |
|
290 | - * @access public |
|
291 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
292 | - * @param string $sFieldID1 the field ID to remove. |
|
293 | - * @param string $sFieldID2 (optional) another field ID to remove. |
|
294 | - * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
295 | - * @return void |
|
296 | - */ |
|
280 | + * Removes the given field(s) by field ID. |
|
281 | + * |
|
282 | + * This accesses the property storing the added field arrays and removes the specified ones. |
|
283 | + * |
|
284 | + * <h4>Example</h4> |
|
285 | + * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
286 | + * </code> |
|
287 | + * |
|
288 | + * @since 2.0.0 |
|
289 | + * @since 3.0.0 Changed the scope to public from protected. |
|
290 | + * @access public |
|
291 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
292 | + * @param string $sFieldID1 the field ID to remove. |
|
293 | + * @param string $sFieldID2 (optional) another field ID to remove. |
|
294 | + * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
295 | + * @return void |
|
296 | + */ |
|
297 | 297 | public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more=null ) { |
298 | 298 | foreach( func_get_args() as $_sFieldID ) { |
299 | 299 | $this->oForm->removeField( $_sFieldID ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
86 | 86 | |
87 | - foreach( func_get_args() as $asSection ) { |
|
87 | + foreach ( func_get_args() as $asSection ) { |
|
88 | 88 | $this->addSettingSection( $asSection ); |
89 | 89 | } |
90 | 90 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function addSettingSection( $asSection ) { |
109 | 109 | |
110 | - if ( ! is_array( $asSection ) ) { |
|
110 | + if ( !is_array( $asSection ) ) { |
|
111 | 111 | $this->_sTargetPageSlug = is_string( $asSection ) |
112 | 112 | ? $asSection |
113 | 113 | : $this->_sTargetPageSlug; |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | ) |
130 | 130 | ); |
131 | 131 | |
132 | - $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
132 | + $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
133 | 133 | |
134 | 134 | // A page slug is required. |
135 | - if ( ! $aSection[ 'page_slug' ] ) { |
|
135 | + if ( !$aSection[ 'page_slug' ] ) { |
|
136 | 136 | return; |
137 | 137 | } |
138 | 138 | $this->oForm->addSection( $aSection ); |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | private function _getTargetPageSlug( $aSection ) { |
149 | 149 | |
150 | 150 | $_sTargetPageSlug = $this->oUtil->getElement( |
151 | - $aSection, // subject |
|
152 | - 'page_slug', // key |
|
151 | + $aSection, // subject |
|
152 | + 'page_slug', // key |
|
153 | 153 | $this->_sTargetPageSlug // default |
154 | 154 | ); |
155 | 155 | |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | */ |
170 | 170 | private function _getTargetTabSlug( $aSection ) { |
171 | 171 | $_sTargetTabSlug = $this->oUtil->getElement( |
172 | - $aSection, // subject |
|
173 | - 'tab_slug', // key |
|
172 | + $aSection, // subject |
|
173 | + 'tab_slug', // key |
|
174 | 174 | $this->_sTargetTabSlug // default |
175 | 175 | ); |
176 | 176 | $_sTargetTabSlug = $_sTargetTabSlug |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @return void |
200 | 200 | */ |
201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
202 | - foreach( func_get_args() as $_sSectionID ) { |
|
202 | + foreach ( func_get_args() as $_sSectionID ) { |
|
203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
204 | 204 | } |
205 | 205 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * @remark The actual registration will be performed in the <em>_replyToRegisterSettings()</em> method with the <em>admin_menu</em> hook. |
258 | 258 | */ |
259 | 259 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
260 | - foreach( func_get_args() as $aField ) { |
|
260 | + foreach ( func_get_args() as $aField ) { |
|
261 | 261 | $this->addSettingField( $aField ); |
262 | 262 | } |
263 | 263 | } |
@@ -294,8 +294,8 @@ discard block |
||
294 | 294 | * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
295 | 295 | * @return void |
296 | 296 | */ |
297 | - public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more=null ) { |
|
298 | - foreach( func_get_args() as $_sFieldID ) { |
|
297 | + public function removeSettingFields( $sFieldID1, $sFieldID2 = null, $_and_more = null ) { |
|
298 | + foreach ( func_get_args() as $_sFieldID ) { |
|
299 | 299 | $this->oForm->removeField( $_sFieldID ); |
300 | 300 | } |
301 | 301 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $this->oProp->sOptionKey, |
343 | 343 | empty( $_aParams ) |
344 | 344 | ? null // will return the entire options array |
345 | - : $_aDimensionalKeys, // dimensional keys |
|
345 | + : $_aDimensionalKeys, // dimensional keys |
|
346 | 346 | $_mDefault, // default |
347 | 347 | $this->getSavedOptions() + $this->oForm->getDefaultFormValues() |
348 | 348 | ); |
@@ -361,21 +361,21 @@ discard block |
||
361 | 361 | * If the user has not submitted the form, the framework will try to return the default value set in the field definition array. |
362 | 362 | * @deprecated 3.3.0 |
363 | 363 | */ |
364 | - public function getFieldValue( $sFieldID, $sSectionID='' ) { |
|
364 | + public function getFieldValue( $sFieldID, $sSectionID = '' ) { |
|
365 | 365 | |
366 | 366 | $this->oUtil->showDeprecationNotice( |
367 | - 'The method,' . __METHOD__ . ',', // deprecated item |
|
367 | + 'The method,'.__METHOD__.',', // deprecated item |
|
368 | 368 | 'getValue()' // alternative |
369 | 369 | ); |
370 | 370 | |
371 | 371 | $_aOptions = $this->oUtil->uniteArrays( $this->oProp->aOptions, $this->oForm->getDefaultFormValues() ); |
372 | 372 | /* If it's saved, return it */ |
373 | - if ( ! $sSectionID ) { |
|
373 | + if ( !$sSectionID ) { |
|
374 | 374 | if ( array_key_exists( $sFieldID, $_aOptions ) ) { |
375 | 375 | return $_aOptions[ $sFieldID ]; |
376 | 376 | } |
377 | 377 | // loop through section elements |
378 | - foreach( $_aOptions as $aOptions ) { |
|
378 | + foreach ( $_aOptions as $aOptions ) { |
|
379 | 379 | if ( array_key_exists( $sFieldID, $aOptions ) ) { |
380 | 380 | return $aOptions[ $sFieldID ]; |
381 | 381 | } |