@@ -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' ) ), |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
49 | 49 | $_sTabSlug = sanitize_text_field( $_sTabSlug ); |
50 | 50 | $_sUserID = get_current_user_id(); |
51 | - return "apf_fe_" . md5( |
|
51 | + return "apf_fe_".md5( |
|
52 | 52 | $_sPageNow |
53 | 53 | . $_sPageSlug |
54 | 54 | . $_sTabSlug |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function get() { |
137 | 137 | |
138 | 138 | // Use a cache if exists. |
139 | - self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
139 | + self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
140 | 140 | ? self::$_aFieldErrorCaches[ $this->sTransientKey ] |
141 | 141 | : $this->getTransient( $this->sTransientKey ); |
142 | 142 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @since 3.7.0 |
154 | 154 | */ |
155 | 155 | public function delete() { |
156 | - if ( $this->hasBeenCalled( 'delete_' . $this->sTransientKey ) ) { |
|
156 | + if ( $this->hasBeenCalled( 'delete_'.$this->sTransientKey ) ) { |
|
157 | 157 | return; |
158 | 158 | } |
159 | 159 | add_action( 'shutdown', array( $this, '_replyToDelete' ) ); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
59 | 59 | $_sTabSlug = sanitize_text_field( $_sTabSlug ); |
60 | 60 | $_sUserID = get_current_user_id(); |
61 | - return "apf_li_" . md5( |
|
61 | + return "apf_li_".md5( |
|
62 | 62 | $_sPageNow |
63 | 63 | . $_sPageSlug |
64 | 64 | . $_sTabSlug |
@@ -96,13 +96,13 @@ discard block |
||
96 | 96 | * @return void |
97 | 97 | */ |
98 | 98 | public function _replyToSave() { |
99 | - if ( ! isset( self::$_aLastInputs ) ) { |
|
99 | + if ( !isset( self::$_aLastInputs ) ) { |
|
100 | 100 | return; |
101 | 101 | } |
102 | 102 | $this->setTransient( |
103 | 103 | $this->sTransientKey, |
104 | 104 | self::$_aLastInputs, |
105 | - 60*60 // store it for 1 hour |
|
105 | + 60 * 60 // store it for 1 hour |
|
106 | 106 | ); |
107 | 107 | } |
108 | 108 | |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | $_aLastInputs = self::$_aCaches[ $this->sTransientKey ]; |
123 | 123 | } else { |
124 | 124 | $_aLastInputs = $this->getTransient( $this->sTransientKey ); |
125 | - self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
125 | + self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
126 | 126 | if ( false !== $_aLastInputs ) { |
127 | - $this->delete(); // deletes at the end of the script. |
|
127 | + $this->delete(); // deletes at the end of the script. |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 |
@@ -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 |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | 'confirm_perform_task' => 'Please confirm your action.', |
82 | 82 | 'specified_option_been_deleted' => 'The specified options have been deleted.', |
83 | 83 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
84 | - 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
85 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
86 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
84 | + 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
85 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
86 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
87 | 87 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+ |
88 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
88 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
89 | 89 | |
90 | 90 | // AdminPageFramework_PostType |
91 | 91 | 'title' => 'Title', |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | 'upload_file' => 'Upload File', |
113 | 113 | 'use_this_file' => 'Use This File', |
114 | 114 | 'select_file' => 'Select File', |
115 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | - 'select_all' => 'Select All', // 3.3.0+ |
|
117 | - 'select_none' => 'Select None', // 3.3.0+ |
|
115 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | + 'select_all' => 'Select All', // 3.3.0+ |
|
117 | + 'select_none' => 'Select None', // 3.3.0+ |
|
118 | 118 | 'no_term_found' => 'No term found.', // 3.3.2+ |
119 | 119 | |
120 | 120 | // AdminPageFramework_Form_View___Script_{...} |
121 | 121 | 'select' => 'Select', // 3.4.2+ |
122 | - 'insert' => 'Insert', // 3.4.2+ |
|
122 | + 'insert' => 'Insert', // 3.4.2+ |
|
123 | 123 | 'use_this' => 'Use This', // 3.4.2+ |
124 | 124 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
125 | 125 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | |
132 | 132 | // Repeatable sections & fields |
133 | 133 | 'repeatable_section_is_disabled' => 'The ability to repeat sections is disabled.', // 3.8.13+ |
134 | - 'repeatable_field_is_disabled' => 'The ability to repeat fields is disabled.', // 3.8.13+ |
|
135 | - 'warning_caption' => 'Warning', // 3.8.13+ |
|
134 | + 'repeatable_field_is_disabled' => 'The ability to repeat fields is disabled.', // 3.8.13+ |
|
135 | + 'warning_caption' => 'Warning', // 3.8.13+ |
|
136 | 136 | |
137 | 137 | // AdminPageFramework_FormField |
138 | 138 | 'allowed_maximum_number_of_fields' => 'The allowed maximum number of fields is {0}.', |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @remark This class should be instantiated via this method. |
215 | 215 | * @return AdminPageFramework_Message |
216 | 216 | */ |
217 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
217 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
218 | 218 | |
219 | 219 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
220 | 220 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
228 | 228 | * @deprecated 3.2.0 |
229 | 229 | */ |
230 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
230 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
231 | 231 | return self::getInstance( $sTextDomain ); |
232 | 232 | } |
233 | 233 | |
@@ -235,14 +235,14 @@ discard block |
||
235 | 235 | * Sets up properties. |
236 | 236 | * @param string $sTextDomain |
237 | 237 | */ |
238 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
238 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
239 | 239 | |
240 | 240 | $this->_sTextDomain = $sTextDomain; |
241 | 241 | |
242 | 242 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
243 | 243 | // with the value of null. The null is set to let it trigger the __get() method |
244 | 244 | // so that each translation item gets processed individually. |
245 | - $this->aMessages = array_fill_keys( |
|
245 | + $this->aMessages = array_fill_keys( |
|
246 | 246 | array_keys( $this->aDefaults ), |
247 | 247 | null |
248 | 248 | ); |
@@ -277,13 +277,13 @@ discard block |
||
277 | 277 | * @param string $sKey |
278 | 278 | * @return string|array |
279 | 279 | */ |
280 | - public function get( $sKey='' ) { |
|
281 | - if ( ! $sKey ) { |
|
280 | + public function get( $sKey = '' ) { |
|
281 | + if ( !$sKey ) { |
|
282 | 282 | return $this->_getAllMessages(); |
283 | 283 | } |
284 | 284 | return isset( $this->aMessages[ $sKey ] ) |
285 | 285 | ? __( $this->aMessages[ $sKey ], $this->_sTextDomain ) |
286 | - : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
286 | + : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
287 | 287 | } |
288 | 288 | /** |
289 | 289 | * Returns the all registered messag items. |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
34 | 34 | |
35 | - if ( ! $this->_shouldProceed() ) { |
|
35 | + if ( !$this->_shouldProceed() ) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | $this->_exportOptions( |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected function _exportOptions( $mData, $sPageSlug, $sTabSlug ) { |
69 | 69 | |
70 | - $_oExport = new AdminPageFramework_ExportOptions( |
|
70 | + $_oExport = new AdminPageFramework_ExportOptions( |
|
71 | 71 | $this->getHTTPRequestSanitized( $this->getElementAsArray( $_POST, array( '__export' ) ), true ), |
72 | 72 | $this->oFactory->oProp->sClassName |
73 | 73 | ); |
74 | - $_aArguments = array( |
|
74 | + $_aArguments = array( |
|
75 | 75 | 'class_name' => $this->oFactory->oProp->sClassName, |
76 | 76 | 'page_slug' => $sPageSlug, |
77 | 77 | 'tab_slug' => $sTabSlug, |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $sExportFileName, |
144 | 144 | $aArguments[ 'pressed_field_id' ], |
145 | 145 | $aArguments[ 'pressed_input_id' ], |
146 | - $mData, // 3.4.6+ |
|
146 | + $mData, // 3.4.6+ |
|
147 | 147 | $this->oFactory // 3.4.6+ |
148 | 148 | ); |
149 | 149 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @since 3.6.3 |
36 | 36 | */ |
37 | 37 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
38 | - if ( ! $this->_shouldProceed() ) { |
|
38 | + if ( !$this->_shouldProceed() ) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | $this->_doImportOptions( |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | */ |
94 | 94 | private function _importOptions( $aStoredOptions, $sPageSlug, $sTabSlug ) { |
95 | 95 | |
96 | - $_oImport = new AdminPageFramework_ImportOptions( |
|
96 | + $_oImport = new AdminPageFramework_ImportOptions( |
|
97 | 97 | $this->getHTTPRequestSanitized( $_FILES[ '__import' ], false ), |
98 | 98 | $this->getHTTPRequestSanitized( $_POST[ '__import' ], true ) |
99 | 99 | ); |
100 | - $_aArguments = array( |
|
100 | + $_aArguments = array( |
|
101 | 101 | 'class_name' => $this->oFactory->oProp->sClassName, |
102 | 102 | 'page_slug' => $sPageSlug, |
103 | 103 | 'tab_slug' => $sTabSlug, |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | // Check the uploaded file MIME type. |
117 | 117 | $_aMIMEType = $this->_getImportMIMEType( $_aArguments ); |
118 | 118 | $_sType = $_oImport->getType(); |
119 | - if ( ! in_array( $_sType, $_aMIMEType ) ) { |
|
119 | + if ( !in_array( $_sType, $_aMIMEType ) ) { |
|
120 | 120 | $this->oFactory->setSettingNotice( sprintf( $this->oFactory->oMsg->get( 'uploaded_file_type_not_supported' ), $_sType ) ); |
121 | - return $aStoredOptions; // do not change the framework's options. |
|
121 | + return $aStoredOptions; // do not change the framework's options. |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // Retrieve the importing data. |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | array( |
184 | 184 | 'text/plain', |
185 | 185 | 'application/octet-stream', // .json file is dealt as a binary file. |
186 | - 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
187 | - 'text/html', // 3.7.2+ |
|
188 | - 'application/txt', // 3.7.2+ |
|
186 | + 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
187 | + 'text/html', // 3.7.2+ |
|
188 | + 'application/txt', // 3.7.2+ |
|
189 | 189 | ), |
190 | 190 | $aArguments |
191 | 191 | ); |
@@ -274,18 +274,18 @@ discard block |
||
274 | 274 | protected function _getPortFilterHookNames( $sPrefix, array $aArguments ) { |
275 | 275 | |
276 | 276 | return array( |
277 | - $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_input_id' ], |
|
277 | + $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_input_id' ], |
|
278 | 278 | $aArguments[ 'section_id' ] |
279 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] .'_' . $aArguments[ 'pressed_field_id' ] |
|
280 | - : $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_field_id' ], |
|
279 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ].'_'.$aArguments[ 'pressed_field_id' ] |
|
280 | + : $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_field_id' ], |
|
281 | 281 | $aArguments[ 'section_id' ] |
282 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] |
|
282 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ] |
|
283 | 283 | : null, |
284 | 284 | $aArguments[ 'tab_slug' ] |
285 | - ? $sPrefix . $aArguments[ 'page_slug' ] . '_' . $aArguments[ 'tab_slug' ] |
|
285 | + ? $sPrefix.$aArguments[ 'page_slug' ].'_'.$aArguments[ 'tab_slug' ] |
|
286 | 286 | : null, |
287 | - $sPrefix . $aArguments[ 'page_slug' ], |
|
288 | - $sPrefix . $aArguments[ 'class_name' ] |
|
287 | + $sPrefix.$aArguments[ 'page_slug' ], |
|
288 | + $sPrefix.$aArguments[ 'class_name' ] |
|
289 | 289 | ); |
290 | 290 | |
291 | 291 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct( $oFactory ) { |
30 | 30 | |
31 | - $this->oFactory = $oFactory; |
|
31 | + $this->oFactory = $oFactory; |
|
32 | 32 | |
33 | 33 | // wp_mail() will be loaded by the time 'after_setup_theme' is loaded. |
34 | 34 | // @deprecated 3.7.0 |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function _replyToCheckRedirects() { |
54 | 54 | |
55 | - if ( ! $this->_shouldProceed() ) { |
|
55 | + if ( !$this->_shouldProceed() ) { |
|
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | 59 | // The redirect transient key. |
60 | 60 | $_sPageSlug = sanitize_text_field( $_GET[ 'page' ] ); |
61 | - $_sTransient = 'apf_rurl' . md5( trim( "redirect_{$this->oFactory->oProp->sClassName}_{$_sPageSlug}" ) ); |
|
61 | + $_sTransient = 'apf_rurl'.md5( trim( "redirect_{$this->oFactory->oProp->sClassName}_{$_sPageSlug}" ) ); |
|
62 | 62 | |
63 | 63 | // Check the settings error transient. |
64 | 64 | $_aError = $this->oFactory->getFieldErrors(); |
65 | - if ( ! empty( $_aError ) ) { |
|
65 | + if ( !empty( $_aError ) ) { |
|
66 | 66 | $this->deleteTransient( $_sTransient ); // we don't need it any more. |
67 | 67 | return; |
68 | 68 | } |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | private function _shouldProceed() { |
90 | 90 | |
91 | 91 | // Check if it's one of the plugin's added page. If not, do nothing. |
92 | - if ( ! $this->oFactory->isInThePage() ) { |
|
92 | + if ( !$this->oFactory->isInThePage() ) { |
|
93 | 93 | return false; |
94 | 94 | } |
95 | 95 | |
96 | 96 | // If the settings have not updated the options, do nothing. |
97 | - if ( ! $this->getElement( $_GET, 'settings-updated', false ) ) { |
|
97 | + if ( !$this->getElement( $_GET, 'settings-updated', false ) ) { |
|
98 | 98 | return false; |
99 | 99 | } |
100 | 100 |