@@ -80,7 +80,7 @@ |
||
80 | 80 | return $_aNestedSections; |
81 | 81 | |
82 | 82 | } |
83 | - private function getFAQContents() { |
|
83 | + private function getFAQContents() { |
|
84 | 84 | |
85 | 85 | $_aReplacements = array( |
86 | 86 | '%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function replyToLoadTab( $oAdminPage ) { |
23 | 23 | |
24 | - $_aSections = $this->getContentsByHeader( $this->getFAQContents(), 4 ); |
|
25 | - foreach( $_aSections as $_iIndex => $_aContent ) { |
|
24 | + $_aSections = $this->getContentsByHeader( $this->getFAQContents(), 4 ); |
|
25 | + foreach ( $_aSections as $_iIndex => $_aContent ) { |
|
26 | 26 | |
27 | 27 | $_sTitle = $_aContent[ 0 ]; |
28 | 28 | $_sContent = $this->_getFAQSubSections( $_aContent[ 1 ] ); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $oAdminPage->addSettingSections( |
33 | 33 | $this->sPageSlug, // the target page slug |
34 | 34 | array( |
35 | - 'section_id' => 'faq_sections_' . $_iIndex, |
|
35 | + 'section_id' => 'faq_sections_'.$_iIndex, |
|
36 | 36 | 'tab_slug' => $this->sTabSlug, |
37 | 37 | 'section_tab_slug' => 'apf_faq', |
38 | 38 | 'title' => $_sTitle, |
@@ -54,17 +54,17 @@ discard block |
||
54 | 54 | |
55 | 55 | $_aNestedSections = array(); |
56 | 56 | $_iLastIndex = count( $aItems ) - 1; |
57 | - foreach( $aItems as $_iIndex => $_aContent ) { |
|
57 | + foreach ( $aItems as $_iIndex => $_aContent ) { |
|
58 | 58 | |
59 | - $_oParser = new AdminPageFramework_WPReadmeParser( $_aContent[ 1 ] ); |
|
59 | + $_oParser = new AdminPageFramework_WPReadmeParser( $_aContent[ 1 ] ); |
|
60 | 60 | |
61 | 61 | // If no sections, return the contents of the first item. |
62 | - if ( ! $_aContent[ 0 ] ) { |
|
62 | + if ( !$_aContent[ 0 ] ) { |
|
63 | 63 | return $_oParser->get(); |
64 | 64 | } |
65 | 65 | |
66 | - $_aNestedSections[] = array( |
|
67 | - 'section_id' => 'faq_item_' . $_iIndex, |
|
66 | + $_aNestedSections[ ] = array( |
|
67 | + 'section_id' => 'faq_item_'.$_iIndex, |
|
68 | 68 | 'title' => $_aContent[ 0 ], |
69 | 69 | 'collapsible' => array( |
70 | 70 | 'toggle_all_button' => $_iLastIndex === $_iIndex |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | return $_aNestedSections; |
81 | 81 | |
82 | 82 | } |
83 | - private function getFAQContents() { |
|
83 | + private function getFAQContents() { |
|
84 | 84 | |
85 | - $_aReplacements = array( |
|
85 | + $_aReplacements = array( |
|
86 | 86 | '%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), |
87 | 87 | '%WP_ADMIN_URL%' => admin_url(), |
88 | 88 | ); |
89 | 89 | $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( |
90 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', |
|
90 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/readme.txt', |
|
91 | 91 | $_aReplacements |
92 | 92 | ); |
93 | 93 | return $_oWPReadmeParser->getRawSection( 'Frequently asked questions' ); |
@@ -163,7 +163,7 @@ |
||
163 | 163 | */ |
164 | 164 | public function validate( $aInput, $aOldInput, $oFactory, $aSubmit ) { |
165 | 165 | |
166 | - // Local variables |
|
166 | + // Local variables |
|
167 | 167 | $_bIsValid = true; |
168 | 168 | $_aErrors = array(); |
169 | 169 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'title' => __( 'Your Name', 'admin-page-framework-loader' ), |
30 | 30 | 'type' => 'text', |
31 | 31 | 'default' => $_oCurrentUser->user_lastname || $_oCurrentUser->user_firstname |
32 | - ? $_oCurrentUser->user_lastname . ' ' . $_oCurrentUser->user_lastname |
|
32 | + ? $_oCurrentUser->user_lastname.' '.$_oCurrentUser->user_lastname |
|
33 | 33 | : '', |
34 | 34 | 'attributes' => array( |
35 | 35 | 'required' => 'required', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | array( |
113 | 113 | 'field_id' => 'allow_sending_system_information', |
114 | 114 | 'title' => __( 'Confirmation', 'admin-page-framework-loader' ) |
115 | - . ' (' . __( 'required', 'admin-page-framework-loader' ) . ')', |
|
115 | + . ' ('.__( 'required', 'admin-page-framework-loader' ).')', |
|
116 | 116 | 'type' => 'checkbox', |
117 | 117 | 'label' => __( 'I understand that the system information including a PHP version and WordPress version etc. will be sent along with the messages to help developer trouble-shoot the problem.', 'admin-page-framework-loader' ), |
118 | 118 | 'attributes' => array( |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | $_bIsValid = true; |
168 | 168 | $_aErrors = array(); |
169 | 169 | |
170 | - if ( ! $aInput[ 'allow_sending_system_information' ] ) { |
|
170 | + if ( !$aInput[ 'allow_sending_system_information' ] ) { |
|
171 | 171 | $_bIsValid = false; |
172 | 172 | $_aErrors[ 'allow_sending_system_information' ] = __( 'We need necessary information to help you.', 'admin-page-framework-loader' ); |
173 | 173 | } |
174 | 174 | |
175 | - if ( ! $_bIsValid ) { |
|
175 | + if ( !$_bIsValid ) { |
|
176 | 176 | |
177 | 177 | $oFactory->setFieldErrors( $_aErrors ); |
178 | 178 | $oFactory->setSettingNotice( __( 'Please help us to help you.', 'admin-page-framework-loader' ) ); |
@@ -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 | } |
@@ -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 | */ |
@@ -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 | |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | $_sInitialMemoryUsage = round( $this->_convertBytesToHR( $this->_nInitialMemoryUsage ), 2 ); |
100 | 100 | return "<div id='admin-page-framework-page-load-stats'>" |
101 | 101 | . "<ul>" |
102 | - . "<li>" . sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds ) . "</li>" |
|
103 | - . "<li>" . sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100 . '%' ) . "</li>" |
|
104 | - . "<li>" . sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage ) . "</li>" |
|
105 | - . "<li>" . sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage ) . "</li>" |
|
102 | + . "<li>".sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds )."</li>" |
|
103 | + . "<li>".sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100.'%' )."</li>" |
|
104 | + . "<li>".sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage )."</li>" |
|
105 | + . "<li>".sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage )."</li>" |
|
106 | 106 | . "</ul>" |
107 | 107 | . "</div>"; |
108 | 108 | |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | */ |
121 | 121 | private function _convertToNumber( $nSize ) { |
122 | 122 | |
123 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
124 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
123 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
124 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
125 | 125 | case 'P': |
126 | 126 | $_nReturn *= 1024; |
127 | 127 | case 'T': |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $_nLog = log( $nBytes, 1024 ); |
151 | 151 | $_iPower = ( int ) $_nLog; |
152 | 152 | $_iSize = pow( 1024, $_nLog - $_iPower ); |
153 | - return $_iSize . $_aUnits[ $_iPower ]; |
|
153 | + return $_iSize.$_aUnits[ $_iPower ]; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | } |
@@ -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 ) { |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
25 | 25 | */ |
26 | 26 | static public $aStructure = array( |
27 | - 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
28 | - 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
29 | - '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`. |
|
30 | - 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
31 | - 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
32 | - 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
27 | + 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
28 | + 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
29 | + '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`. |
|
30 | + 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
31 | + 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
32 | + 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | public $abCollapsible = false; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @remark The framework will not pass this parameter when formatting a section definition array. |
43 | 43 | * It will be passed when the framework is rendering a form table to generate collapsible elements. |
44 | 44 | */ |
45 | - public $aSection = array(); |
|
45 | + public $aSection = array(); |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Sets up properties. |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | |
86 | 86 | $_aCollapsible = $this->getAsArray( $this->abCollapsible ) + array( |
87 | 87 | 'title' => $sTitle, |
88 | - ) + self::$aStructure; |
|
88 | + ) + self::$aStructure; |
|
89 | 89 | |
90 | 90 | $_aCollapsible[ 'toggle_all_button' ] = implode( |
91 | 91 | ',', |
92 | 92 | $this->getAsArray( $_aCollapsible[ 'toggle_all_button' ] ) |
93 | 93 | ); |
94 | 94 | |
95 | - if ( ! empty( $aSection ) ) { |
|
95 | + if ( !empty( $aSection ) ) { |
|
96 | 96 | $_aCollapsible[ 'toggle_all_button' ] = $this->_getToggleAllButtonArgument( |
97 | 97 | $_aCollapsible[ 'toggle_all_button' ], |
98 | 98 | $aSection |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | private function _getToggleAllButtonArgument( $sToggleAll, array $aSection ) { |
118 | 118 | |
119 | - if ( ! $aSection[ 'repeatable' ] ) { |
|
119 | + if ( !$aSection[ 'repeatable' ] ) { |
|
120 | 120 | return $sToggleAll; |
121 | 121 | } |
122 | 122 | |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | // Disable the toggle all button for middle sub-sections in repeatable sections. |
129 | - if ( ! $aSection[ '_is_first_index' ] && ! $aSection[ '_is_last_index' ] ) { |
|
129 | + if ( !$aSection[ '_is_first_index' ] && !$aSection[ '_is_last_index' ] ) { |
|
130 | 130 | return 0; |
131 | 131 | } |
132 | 132 | |
133 | 133 | $_aToggleAll = $this->getAOrB( |
134 | - true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
135 | - array( 'top-right', 'bottom-right' ), // if true |
|
134 | + true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
135 | + array( 'top-right', 'bottom-right' ), // if true |
|
136 | 136 | explode( ',', $sToggleAll ) // if false |
137 | 137 | ); |
138 | 138 | $_aToggleAll = $this->getAOrB( |
@@ -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 ) |
@@ -54,9 +54,9 @@ |
||
54 | 54 | $_sIndex = $this->getAOrB( |
55 | 55 | '0' !== $this->sIndex && empty( $this->sIndex ), |
56 | 56 | '', |
57 | - "[" . $this->sIndex . "]" |
|
57 | + "[".$this->sIndex."]" |
|
58 | 58 | ); |
59 | - return $this->_getFiltered( $this->_getFieldName() . $_sIndex ); |
|
59 | + return $this->_getFiltered( $this->_getFieldName().$_sIndex ); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 |
@@ -51,6 +51,7 @@ |
||
51 | 51 | /** |
52 | 52 | * Applies the subject string to the set callback filter function. |
53 | 53 | * @since 3.6.0 |
54 | + * @param string $sSubject |
|
54 | 55 | */ |
55 | 56 | protected function _getFiltered( $sSubject ) { |
56 | 57 | return is_callable( $this->hfCallback ) |
@@ -93,8 +93,8 @@ |
||
93 | 93 | |
94 | 94 | // Extract the first part as it does not have braces |
95 | 95 | $_sName = array_shift( $aParts ); |
96 | - foreach( $aParts as $_sPart ) { |
|
97 | - $_sName .= '[' . $_sPart . ']'; |
|
96 | + foreach ( $aParts as $_sPart ) { |
|
97 | + $_sName .= '['.$_sPart.']'; |
|
98 | 98 | } |
99 | 99 | return $_sName; |
100 | 100 |