@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | |
26 | 26 | $_aItems = $this->getContentsByHeader( $this->getReadmeContents(), 4 ); |
27 | 27 | $_iLastIndex = count( $_aItems ) - 1; |
28 | - foreach( $_aItems as $_iIndex => $_aContent ) { |
|
28 | + foreach ( $_aItems as $_iIndex => $_aContent ) { |
|
29 | 29 | |
30 | 30 | $_oParser = new AdminPageFramework_WPReadmeParser( $_aContent[ 1 ] ); |
31 | 31 | $_sContent = $_oParser->get(); |
32 | 32 | $oAdminPage->addSettingSections( |
33 | 33 | $this->sPageSlug, // the target page slug |
34 | 34 | array( |
35 | - 'section_id' => 'tips_' . $_iIndex, |
|
35 | + 'section_id' => 'tips_'.$_iIndex, |
|
36 | 36 | 'title' => $_aContent[ 0 ], |
37 | 37 | 'collapsible' => array( |
38 | 38 | 'toggle_all_button' => $_iLastIndex === $_iIndex |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * @return string |
55 | 55 | */ |
56 | - private function getReadMeContents() { |
|
56 | + private function getReadMeContents() { |
|
57 | 57 | return $this->_getReadmeContents( |
58 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', // source path |
|
58 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/readme.txt', // source path |
|
59 | 59 | '', // TOC title |
60 | 60 | array( 'Other Notes' ) // sections |
61 | 61 | ); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | /** |
54 | 54 | * @return string |
55 | 55 | */ |
56 | - private function getReadMeContents() { |
|
56 | + private function getReadMeContents() { |
|
57 | 57 | return $this->_getReadmeContents( |
58 | 58 | AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', // source path |
59 | 59 | '', // TOC title |
@@ -9,12 +9,12 @@ |
||
9 | 9 | * @since 3.5.0 |
10 | 10 | */ |
11 | 11 | |
12 | - /** |
|
13 | - * |
|
14 | - * |
|
15 | - * @action do admin_page_framework_loader_action_before_loading_demo |
|
16 | - * @action do admin_page_framework_loader_action_after_loading_demo |
|
17 | - */ |
|
12 | + /** |
|
13 | + * |
|
14 | + * |
|
15 | + * @action do admin_page_framework_loader_action_before_loading_demo |
|
16 | + * @action do admin_page_framework_loader_action_after_loading_demo |
|
17 | + */ |
|
18 | 18 | class AdminPageFrameworkLoader_Demo { |
19 | 19 | |
20 | 20 | public function __construct() { |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | |
20 | 20 | public function __construct() { |
21 | 21 | |
22 | - if ( ! $this->_shouldLoadDemo() ) { |
|
22 | + if ( !$this->_shouldLoadDemo() ) { |
|
23 | 23 | return; |
24 | 24 | } |
25 | 25 | |
26 | 26 | do_action( 'admin_page_framework_loader_action_before_loading_demo' ); |
27 | 27 | |
28 | 28 | // Include example components. |
29 | - include( AdminPageFrameworkLoader_Registry::$sDirPath . '/example/admin-page-framework-demo-bootstrap.php' ); |
|
29 | + include( AdminPageFrameworkLoader_Registry::$sDirPath.'/example/admin-page-framework-demo-bootstrap.php' ); |
|
30 | 30 | |
31 | 31 | do_action( 'admin_page_framework_loader_action_after_loading_demo' ); |
32 | 32 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | |
44 | 44 | // Check if the demo is enabled. |
45 | 45 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
46 | - if ( ! $_oOption->get( 'enable_admin_pages' ) ) { |
|
46 | + if ( !$_oOption->get( 'enable_admin_pages' ) ) { |
|
47 | 47 | return false; |
48 | 48 | } |
49 | - if ( ! $_oOption->get( 'enable_demo' ) ) { |
|
49 | + if ( !$_oOption->get( 'enable_demo' ) ) { |
|
50 | 50 | $this->_setPointerToolTips(); |
51 | 51 | return false; |
52 | 52 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'options' => array( |
75 | 75 | 'content' => sprintf( '<h3> %1$s </h3> <p> %2$s </p>', |
76 | 76 | AdminPageFrameworkLoader_Registry::NAME, |
77 | - __( 'Check out the functionality of Admin Page Framework by enabling the demo.','admin-page-framework-loader' ) |
|
77 | + __( 'Check out the functionality of Admin Page Framework by enabling the demo.', 'admin-page-framework-loader' ) |
|
78 | 78 | ), |
79 | 79 | 'position' => array( 'edge' => 'left', 'align' => 'middle' ) |
80 | 80 | ) |
@@ -232,6 +232,8 @@ discard block |
||
232 | 232 | * @remark The meta box class may be instantiated multiple times so prevent echoing the same styles multiple times. |
233 | 233 | * @parameter string $sIDPrefix The id selector embedded in the script tag. |
234 | 234 | * @parameter string $sClassName The class name that identify the call group. This is important for the meta-box class because it can be instantiated multiple times in one particular page. |
235 | + * @param string $sIDPrefix |
|
236 | + * @param string $sClassName |
|
235 | 237 | */ |
236 | 238 | protected function _printCommonStyles( $sIDPrefix, $sClassName ) { |
237 | 239 | |
@@ -315,6 +317,8 @@ discard block |
||
315 | 317 | * @remark The meta box class may be instantiated multiple times so prevent echoing the same styles multiple times. |
316 | 318 | * @parametr string $sIDPrefix The id selector embedded in the script tag. |
317 | 319 | * @parametr string $sClassName The class name that identify the call group. This is important for the meta-box class because it can be instantiated multiple times in one particular page. |
320 | + * @param string $sIDPrefix |
|
321 | + * @param string $sClassName |
|
318 | 322 | */ |
319 | 323 | protected function _printCommonScripts( $sIDPrefix, $sClassName ) { |
320 | 324 |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | |
37 | 37 | /* The system internal keys. */ |
38 | 38 | 'sSRC' => null, |
39 | - 'aPostTypes' => array(), // for meta box class |
|
39 | + 'aPostTypes' => array(), // for meta box class |
|
40 | 40 | 'sPageSlug' => null, |
41 | 41 | 'sTabSlug' => null, |
42 | - 'sType' => null, // script or style |
|
42 | + 'sType' => null, // script or style |
|
43 | 43 | |
44 | 44 | /* The below keys are for users. */ |
45 | 45 | 'handle_id' => null, |
46 | 46 | 'dependencies' => array(), |
47 | - 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
48 | - 'translation' => array(), // only for scripts |
|
49 | - 'in_footer' => false, // only for scripts |
|
50 | - 'media' => 'all', // only for styles |
|
51 | - 'attributes' => array(), // 3.3.0+ - the attribute array |
|
47 | + 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
48 | + 'translation' => array(), // only for scripts |
|
49 | + 'in_footer' => false, // only for scripts |
|
50 | + 'media' => 'all', // only for styles |
|
51 | + 'attributes' => array(), // 3.3.0+ - the attribute array |
|
52 | 52 | |
53 | 53 | ); |
54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @remark This value should be overridden in an extended class. |
60 | 60 | * @internal |
61 | 61 | */ |
62 | - protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
62 | + protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Stores the class selector used to the class-specific script. |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @remark This value should be overridden in an extended class. |
69 | 69 | * @internal |
70 | 70 | */ |
71 | - protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
71 | + protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Stores hand IDs by resource url to look up handle id and add custom arguments. |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | * @internal |
143 | 143 | */ |
144 | 144 | |
145 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) {} |
|
146 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) {} |
|
145 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) {} |
|
146 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) {} |
|
147 | 147 | |
148 | 148 | /** |
149 | 149 | * A helper function for the _replyToEnqueueScripts() and the `_replyToEnqueueStyle()` methods. |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | $_sAttributes = $this->getAttributes( $_aAttributes ); |
207 | - $_sModifiedURL = $sSanitizedURL . "' " . rtrim( $_sAttributes, "'\"" ); // '" |
|
207 | + $_sModifiedURL = $sSanitizedURL."' ".rtrim( $_sAttributes, "'\"" ); // '" |
|
208 | 208 | |
209 | 209 | return $_sModifiedURL; |
210 | 210 | |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function _getStyleTag( $oCaller, $sIDPrefix ) { |
254 | 254 | |
255 | - $_sStyle = $this->addAndApplyFilters( |
|
255 | + $_sStyle = $this->addAndApplyFilters( |
|
256 | 256 | $oCaller, |
257 | 257 | array( |
258 | - "style_common_admin_page_framework", // 3.2.1+ |
|
258 | + "style_common_admin_page_framework", // 3.2.1+ |
|
259 | 259 | "style_common_{$this->oProp->sClassName}", |
260 | 260 | ), |
261 | 261 | AdminPageFramework_CSS::getDefaultCSS() |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | // : $this->getCSSMinified( $_sStyle ); |
269 | 269 | |
270 | 270 | if ( $_sStyle ) { |
271 | - echo "<style type='text/css' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
271 | + echo "<style type='text/css' id='".esc_attr( $sIDPrefix )."'>" |
|
272 | 272 | . $_sStyle |
273 | 273 | . "</style>"; |
274 | 274 | } |
@@ -282,10 +282,10 @@ discard block |
||
282 | 282 | */ |
283 | 283 | private function _getIEStyleTag( $oCaller, $sIDPrefix ) { |
284 | 284 | |
285 | - $_sStyleIE = $this->addAndApplyFilters( |
|
285 | + $_sStyleIE = $this->addAndApplyFilters( |
|
286 | 286 | $oCaller, |
287 | 287 | array( |
288 | - "style_ie_common_admin_page_framework", // 3.2.1+ |
|
288 | + "style_ie_common_admin_page_framework", // 3.2.1+ |
|
289 | 289 | "style_ie_common_{$this->oProp->sClassName}", |
290 | 290 | ), |
291 | 291 | AdminPageFramework_CSS::getDefaultCSSIE() |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | // ? trim( $_sStyleIE ) |
297 | 297 | // : $this->getCSSMinified( $_sStyleIE ); |
298 | 298 | return $_sStyleIE |
299 | - ? "<!--[if IE]><style type='text/css' id='" . esc_attr( $sIDPrefix . "-ie" ) . "'>" |
|
299 | + ? "<!--[if IE]><style type='text/css' id='".esc_attr( $sIDPrefix."-ie" )."'>" |
|
300 | 300 | . $_sStyleIE |
301 | 301 | . "</style><![endif]-->" |
302 | 302 | : ''; |
@@ -329,14 +329,14 @@ discard block |
||
329 | 329 | $_sScript = $this->addAndApplyFilters( |
330 | 330 | $this->oProp->oCaller, |
331 | 331 | array( |
332 | - "script_common_admin_page_framework", // 3.2.1+ |
|
332 | + "script_common_admin_page_framework", // 3.2.1+ |
|
333 | 333 | "script_common_{$this->oProp->sClassName}", |
334 | 334 | ), |
335 | 335 | AdminPageFramework_Property_Base::$_sDefaultScript |
336 | 336 | ); |
337 | 337 | $_sScript = trim( $_sScript ); |
338 | 338 | if ( $_sScript ) { |
339 | - echo "<script type='text/javascript' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
339 | + echo "<script type='text/javascript' id='".esc_attr( $sIDPrefix )."'>" |
|
340 | 340 | . '/* <![CDATA[ */' |
341 | 341 | . $_sScript |
342 | 342 | . '/* ]]> */' |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | protected function _printClassSpecificStyles( $sIDPrefix ) { |
357 | 357 | |
358 | - $_oCaller = $this->oProp->oCaller; |
|
358 | + $_oCaller = $this->oProp->oCaller; |
|
359 | 359 | echo $this->_getClassSpecificStyleTag( $_oCaller, $sIDPrefix ); |
360 | 360 | echo $this->_getClassSpecificIEStyleTag( $_oCaller, $sIDPrefix ); |
361 | 361 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | // : $this->getCSSMinified( $_sStyle ); |
387 | 387 | if ( $_sStyle ) { |
388 | 388 | $_iCallCount++; |
389 | - return "<style type='text/css' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
389 | + return "<style type='text/css' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
390 | 390 | . $_sStyle |
391 | 391 | . "</style>"; |
392 | 392 | } |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | // : $this->getCSSMinified( $_sStyleIE ); |
415 | 415 | if ( $_sStyleIE ) { |
416 | 416 | $_iCallCountIE++; |
417 | - return "<!--[if IE]><style type='text/css' id='" . esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ) . "'>" |
|
417 | + return "<!--[if IE]><style type='text/css' id='".esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" )."'>" |
|
418 | 418 | . $_sStyleIE |
419 | 419 | . "</style><![endif]-->"; |
420 | 420 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $_sScript = trim( $_sScript ); |
443 | 443 | if ( $_sScript ) { |
444 | 444 | $_iCallCount++; |
445 | - echo "<script type='text/javascript' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
445 | + echo "<script type='text/javascript' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
446 | 446 | . '/* <![CDATA[ */' |
447 | 447 | . $_sScript |
448 | 448 | . '/* ]]> */' |
@@ -467,12 +467,12 @@ discard block |
||
467 | 467 | public function _replyToAddStyle() { |
468 | 468 | |
469 | 469 | $_oCaller = $this->oProp->oCaller; |
470 | - if ( ! $_oCaller->isInThePage() ) { |
|
470 | + if ( !$_oCaller->isInThePage() ) { |
|
471 | 471 | return; |
472 | 472 | } |
473 | 473 | |
474 | 474 | $this->_printCommonStyles( 'admin-page-framework-style-common', get_class() ); |
475 | - $this->_printClassSpecificStyles( $this->_sClassSelector_Style . '-' . $this->oProp->sStructureType ); |
|
475 | + $this->_printClassSpecificStyles( $this->_sClassSelector_Style.'-'.$this->oProp->sStructureType ); |
|
476 | 476 | |
477 | 477 | } |
478 | 478 | /** |
@@ -487,12 +487,12 @@ discard block |
||
487 | 487 | public function _replyToAddScript() { |
488 | 488 | |
489 | 489 | $_oCaller = $this->oProp->oCaller; |
490 | - if ( ! $_oCaller->isInThePage() ) { |
|
490 | + if ( !$_oCaller->isInThePage() ) { |
|
491 | 491 | return; |
492 | 492 | } |
493 | 493 | |
494 | 494 | $this->_printCommonScripts( 'admin-page-framework-script-common', get_class() ); |
495 | - $this->_printClassSpecificScripts( $this->_sClassSelector_Script . '-' . $this->oProp->sStructureType ); |
|
495 | + $this->_printClassSpecificScripts( $this->_sClassSelector_Script.'-'.$this->oProp->sStructureType ); |
|
496 | 496 | |
497 | 497 | } |
498 | 498 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | * @internal |
545 | 545 | */ |
546 | 546 | public function _replyToEnqueueStyles() { |
547 | - foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
547 | + foreach ( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
548 | 548 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
549 | 549 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
550 | 550 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | * @internal |
562 | 562 | */ |
563 | 563 | public function _replyToEnqueueScripts() { |
564 | - foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
564 | + foreach ( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
565 | 565 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
566 | 566 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
567 | 567 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | protected function _printCommonStyles( $sIDPrefix, $sClassName ) { |
237 | 237 | |
238 | - if ( self::$_bCommonStyleLoaded ) { |
|
238 | + if ( self::$_bCommonStyleLoaded ) { |
|
239 | 239 | return; |
240 | 240 | } |
241 | 241 | self::$_bCommonStyleLoaded = true; |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | * @since 3.2.0 Changed it unset the enqueued item so that the method can be called multiple times. |
544 | 544 | * @internal |
545 | 545 | */ |
546 | - public function _replyToEnqueueStyles() { |
|
546 | + public function _replyToEnqueueStyles() { |
|
547 | 547 | foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
548 | 548 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
549 | 549 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | * @since 3.2.0 Changed it unset the enqueued item so that the method can be called multiple times. |
561 | 561 | * @internal |
562 | 562 | */ |
563 | - public function _replyToEnqueueScripts() { |
|
563 | + public function _replyToEnqueueScripts() { |
|
564 | 564 | foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
565 | 565 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
566 | 566 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
@@ -370,6 +370,8 @@ |
||
370 | 370 | * Sets up necessary property values. |
371 | 371 | * |
372 | 372 | * @remark This class gets instantiated in every factory class so the constructor should be lightest as possible. |
373 | + * @param string $sCapability |
|
374 | + * @param string $sTextDomain |
|
373 | 375 | */ |
374 | 376 | public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability, $sTextDomain, $sStructureType ) { |
375 | 377 |
@@ -321,14 +321,14 @@ discard block |
||
321 | 321 | * @since 3.7.0 |
322 | 322 | */ |
323 | 323 | public $aFormCallbacks = array( |
324 | - 'hfID' => null, // the input id attribute |
|
325 | - 'hfTagID' => null, // the field container id attribute |
|
326 | - 'hfName' => null, // the field name attribute |
|
327 | - 'hfNameFlat' => null, // the flat field name attribute |
|
324 | + 'hfID' => null, // the input id attribute |
|
325 | + 'hfTagID' => null, // the field container id attribute |
|
326 | + 'hfName' => null, // the field name attribute |
|
327 | + 'hfNameFlat' => null, // the flat field name attribute |
|
328 | 328 | // @todo Document the differences between `hfName` and `hfInputName` |
329 | - 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
330 | - 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
331 | - 'hfClass' => null, // the class attribute |
|
329 | + 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
330 | + 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
331 | + 'hfClass' => null, // the class attribute |
|
332 | 332 | ); |
333 | 333 | |
334 | 334 | /** |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | private function ___getURLQuery() { |
439 | 439 | |
440 | - if ( ! $this->bIsAdminAjax ) { |
|
440 | + if ( !$this->bIsAdminAjax ) { |
|
441 | 441 | return $_GET; |
442 | 442 | } |
443 | 443 | parse_str( |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | * @since 3.7.9 |
454 | 454 | */ |
455 | 455 | private function ___setGlobals() { |
456 | - if ( ! isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
456 | + if ( !isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
457 | 457 | $GLOBALS[ 'aAdminPageFramework' ] = array( |
458 | 458 | 'aFieldFlags' => array() |
459 | 459 | ); |
@@ -524,8 +524,8 @@ discard block |
||
524 | 524 | 'hfTagID' => array( $this->oCaller, '_replyToGetInputTagIDAttribute' ), // the fields & fieldset & field row container id attribute |
525 | 525 | 'hfName' => array( $this->oCaller, '_replyToGetFieldNameAttribute' ), // the input name attribute |
526 | 526 | 'hfNameFlat' => array( $this->oCaller, '_replyToGetFlatFieldName' ), // the flat input name attribute |
527 | - 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
528 | - 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
527 | + 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
528 | + 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
529 | 529 | 'hfClass' => array( $this->oCaller, '_replyToGetInputClassAttribute' ), // the class attribute |
530 | 530 | 'hfSectionName' => array( $this->oCaller, '_replyToGetSectionName' ), // 3.6.0+ |
531 | 531 | ) + $this->aFormCallbacks; |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | * @remark The information can be used to embed into the footer etc. |
600 | 600 | * @return array The information of the script. |
601 | 601 | */ |
602 | - protected function getCallerInfo( $sCallerPath='' ) { |
|
602 | + protected function getCallerInfo( $sCallerPath = '' ) { |
|
603 | 603 | |
604 | 604 | if ( isset( self::$_aScriptDataCaches[ $sCallerPath ] ) ) { |
605 | 605 | return self::$_aScriptDataCaches[ $sCallerPath ]; |
@@ -717,11 +717,11 @@ discard block |
||
717 | 717 | |
718 | 718 | // 3.7.9 Moved from the constructor to make it lighter. |
719 | 719 | if ( 'sClassHash' === $sName ) { |
720 | - $this->sClassHash = md5( $this->sClassName ); |
|
720 | + $this->sClassHash = md5( $this->sClassName ); |
|
721 | 721 | return $this->sClassHash; |
722 | 722 | } |
723 | 723 | if ( 'sScriptType' === $sName ) { |
724 | - $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
724 | + $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
725 | 725 | return $this->sScriptType; |
726 | 726 | } |
727 | 727 | if ( 'oUtil' === $sName ) { |
@@ -109,7 +109,7 @@ |
||
109 | 109 | * Converts bytes to HR. |
110 | 110 | * |
111 | 111 | * @access private |
112 | - * @param mixed $bytes |
|
112 | + * @param mixed $nBytes |
|
113 | 113 | * @remark This is influenced by the work of Mike Jolley. |
114 | 114 | * @see http://mikejolley.com/projects/wp-page-load-stats/ |
115 | 115 | */ |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct( $oProp, $oMsg ) { |
30 | 30 | |
31 | - if ( ! $this->_shouldProceed( $oProp ) ) { |
|
31 | + if ( !$this->_shouldProceed( $oProp ) ) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | private function _shouldProceed( $oProp ) { |
47 | 47 | |
48 | - if ( $oProp->bIsAdminAjax || ! $oProp->bIsAdmin ) { |
|
48 | + if ( $oProp->bIsAdminAjax || !$oProp->bIsAdmin ) { |
|
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | return ( boolean ) $oProp->bShowDebugInfo; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function _replyToGetPageLoadInfo( $sFooterHTML ) { |
73 | 73 | |
74 | 74 | // 3.8.8+ The `bShowDebugInfo` property may be updated by the user during the page load. |
75 | - if ( ! $this->oProp->bShowDebugInfo ) { |
|
75 | + if ( !$this->oProp->bShowDebugInfo ) { |
|
76 | 76 | return $sFooterHTML; |
77 | 77 | } |
78 | 78 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | $_sInitialMemoryUsage = round( $this->_convertBytesToHR( $this->_nInitialMemoryUsage ), 2 ); |
101 | 101 | return "<div id='admin-page-framework-page-load-stats'>" |
102 | 102 | . "<ul>" |
103 | - . "<li>" . sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds ) . "</li>" |
|
104 | - . "<li>" . sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100 . '%' ) . "</li>" |
|
105 | - . "<li>" . sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage ) . "</li>" |
|
106 | - . "<li>" . sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage ) . "</li>" |
|
103 | + . "<li>".sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds )."</li>" |
|
104 | + . "<li>".sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100.'%' )."</li>" |
|
105 | + . "<li>".sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage )."</li>" |
|
106 | + . "<li>".sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage )."</li>" |
|
107 | 107 | . "</ul>" |
108 | 108 | . "</div>"; |
109 | 109 | |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | */ |
122 | 122 | private function _convertToNumber( $nSize ) { |
123 | 123 | |
124 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
125 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
124 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
125 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
126 | 126 | case 'P': |
127 | 127 | $_nReturn *= 1024; |
128 | 128 | case 'T': |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $_nLog = log( $nBytes, 1024 ); |
152 | 152 | $_iPower = ( int ) $_nLog; |
153 | 153 | $_iSize = pow( 1024, $_nLog - $_iPower ); |
154 | - return $_iSize . $_aUnits[ $_iPower ]; |
|
154 | + return $_iSize.$_aUnits[ $_iPower ]; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | return $sFooterHTML; |
76 | 76 | } |
77 | 77 | |
78 | - if ( self::$_bLoadedPageLoadInfo ) { |
|
78 | + if ( self::$_bLoadedPageLoadInfo ) { |
|
79 | 79 | return $sFooterHTML; |
80 | 80 | } |
81 | 81 | self::$_bLoadedPageLoadInfo = true; |
@@ -110,7 +110,6 @@ |
||
110 | 110 | * Retrieves the settings error array set by the user in the validation callback. |
111 | 111 | * |
112 | 112 | * @since 3.7.8 |
113 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
114 | 113 | * @return array |
115 | 114 | */ |
116 | 115 | public function get() { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $_sPageSlug = $this->getElement( $_GET, 'page', '' ); |
57 | 57 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
58 | 58 | $_sUserID = get_current_user_id(); |
59 | - return "apf_li_" . md5( |
|
59 | + return "apf_li_".md5( |
|
60 | 60 | $_sPageNow |
61 | 61 | . $_sPageSlug |
62 | 62 | . $_sTabSlug |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | * @return void |
95 | 95 | */ |
96 | 96 | public function _replyToSave() { |
97 | - if ( ! isset( self::$_aLastInputs ) ) { |
|
97 | + if ( !isset( self::$_aLastInputs ) ) { |
|
98 | 98 | return; |
99 | 99 | } |
100 | 100 | $this->setTransient( |
101 | 101 | $this->sTransientKey, |
102 | 102 | self::$_aLastInputs, |
103 | - 60*60 // store it for 1 hour |
|
103 | + 60 * 60 // store it for 1 hour |
|
104 | 104 | ); |
105 | 105 | } |
106 | 106 | |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | $_aLastInputs = self::$_aCaches[ $this->sTransientKey ]; |
121 | 121 | } else { |
122 | 122 | $_aLastInputs = $this->getTransient( $this->sTransientKey ); |
123 | - self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
123 | + self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
124 | 124 | if ( false !== $_aLastInputs ) { |
125 | - $this->delete(); // deletes at the end of the script. |
|
125 | + $this->delete(); // deletes at the end of the script. |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 |
@@ -94,7 +94,7 @@ |
||
94 | 94 | * @return void |
95 | 95 | */ |
96 | 96 | public function _replyToSave() { |
97 | - if ( ! isset( self::$_aLastInputs ) ) { |
|
97 | + if ( ! isset( self::$_aLastInputs ) ) { |
|
98 | 98 | return; |
99 | 99 | } |
100 | 100 | $this->setTransient( |
@@ -77,6 +77,8 @@ |
||
77 | 77 | } |
78 | 78 | /** |
79 | 79 | * @since 3.6.0 |
80 | + * @param boolean $abCollapsible |
|
81 | + * @param string $sTitle |
|
80 | 82 | * @return array |
81 | 83 | */ |
82 | 84 | private function _getArguments( $abCollapsible, $sTitle, array $aSection ) { |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
24 | 24 | */ |
25 | 25 | static public $aStructure = array( |
26 | - 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
27 | - 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
28 | - 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
29 | - 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
30 | - 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
31 | - 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
26 | + 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
27 | + 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
28 | + 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
29 | + 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
30 | + 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
31 | + 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
32 | 32 | ); |
33 | 33 | |
34 | 34 | public $abCollapsible = false; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @remark The framework will not pass this parameter when formatting a section definition array. |
42 | 42 | * It will be passed when the framework is rendering a form table to generate collapsible elements. |
43 | 43 | */ |
44 | - public $aSection = array(); |
|
44 | + public $aSection = array(); |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Sets up properties. |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | |
85 | 85 | $_aCollapsible = $this->getAsArray( $this->abCollapsible ) + array( |
86 | 86 | 'title' => $sTitle, |
87 | - ) + self::$aStructure; |
|
87 | + ) + self::$aStructure; |
|
88 | 88 | |
89 | 89 | $_aCollapsible[ 'toggle_all_button' ] = implode( |
90 | 90 | ',', |
91 | 91 | $this->getAsArray( $_aCollapsible[ 'toggle_all_button' ] ) |
92 | 92 | ); |
93 | 93 | |
94 | - if ( ! empty( $aSection ) ) { |
|
94 | + if ( !empty( $aSection ) ) { |
|
95 | 95 | $_aCollapsible[ 'toggle_all_button' ] = $this->_getToggleAllButtonArgument( |
96 | 96 | $_aCollapsible[ 'toggle_all_button' ], |
97 | 97 | $aSection |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | private function _getToggleAllButtonArgument( $sToggleAll, array $aSection ) { |
117 | 117 | |
118 | - if ( ! $aSection[ 'repeatable' ] ) { |
|
118 | + if ( !$aSection[ 'repeatable' ] ) { |
|
119 | 119 | return $sToggleAll; |
120 | 120 | } |
121 | 121 | |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | // Disable the toggle all button for middle sub-sections in repeatable sections. |
128 | - if ( ! $aSection[ '_is_first_index' ] && ! $aSection[ '_is_last_index' ] ) { |
|
128 | + if ( !$aSection[ '_is_first_index' ] && !$aSection[ '_is_last_index' ] ) { |
|
129 | 129 | return 0; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $_aToggleAll = $this->getAOrB( |
133 | - true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
134 | - array( 'top-right', 'bottom-right' ), // if true |
|
133 | + true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
134 | + array( 'top-right', 'bottom-right' ), // if true |
|
135 | 135 | explode( ',', $sToggleAll ) // if false |
136 | 136 | ); |
137 | 137 | $_aToggleAll = $this->getAOrB( |
@@ -114,7 +114,7 @@ |
||
114 | 114 | */ |
115 | 115 | private function _getToggleAllButtonArgument( $sToggleAll, array $aSection ) { |
116 | 116 | |
117 | - if ( ! $aSection[ 'repeatable' ] ) { |
|
117 | + if ( ! $aSection[ 'repeatable' ] ) { |
|
118 | 118 | return $sToggleAll; |
119 | 119 | } |
120 | 120 |
@@ -23,7 +23,6 @@ |
||
23 | 23 | * @internal |
24 | 24 | * @since 3.5.3 |
25 | 25 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
26 | - * @param array $aFieldset a field definition array. |
|
27 | 26 | * @return boolean |
28 | 27 | */ |
29 | 28 | protected function _isSectionSet() { |
@@ -60,6 +60,7 @@ |
||
60 | 60 | /** |
61 | 61 | * Applies the subject string to the set callback filter function. |
62 | 62 | * @since 3.6.0 |
63 | + * @param string $sSubject |
|
63 | 64 | */ |
64 | 65 | protected function _getFiltered( $sSubject ) { |
65 | 66 | return is_callable( $this->hfCallback ) |
@@ -51,9 +51,9 @@ |
||
51 | 51 | $_sIndex = $this->getAOrB( |
52 | 52 | '0' !== $this->sIndex && empty( $this->sIndex ), |
53 | 53 | '', |
54 | - "[" . $this->sIndex . "]" |
|
54 | + "[".$this->sIndex."]" |
|
55 | 55 | ); |
56 | - return $this->_getFiltered( $this->_getFieldName() . $_sIndex ); |
|
56 | + return $this->_getFiltered( $this->_getFieldName().$_sIndex ); |
|
57 | 57 | |
58 | 58 | } |
59 | 59 |