@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function _appendInternalAssets( $sInternal, &$aContainer ) { |
69 | 69 | $_aInternals = array_unique( $aContainer ); |
70 | - $sInternal = PHP_EOL . $sInternal; |
|
71 | - foreach( $_aInternals as $_iIndex => $_sInternal ) { |
|
72 | - $sInternal .= $_sInternal . PHP_EOL; |
|
70 | + $sInternal = PHP_EOL.$sInternal; |
|
71 | + foreach ( $_aInternals as $_iIndex => $_sInternal ) { |
|
72 | + $sInternal .= $_sInternal.PHP_EOL; |
|
73 | 73 | unset( $_aInternals[ $_iIndex ] ); |
74 | 74 | } |
75 | 75 | $aContainer = $_aInternals; // update the container array. |
@@ -83,23 +83,23 @@ discard block |
||
83 | 83 | private function _parseAssets( $oFactory ) { |
84 | 84 | |
85 | 85 | // page |
86 | - $_aPageStyles = $this->getElementAsArray( |
|
86 | + $_aPageStyles = $this->getElementAsArray( |
|
87 | 87 | $oFactory->oProp->aPages, |
88 | 88 | array( $this->sCurrentPageSlug, 'style' ) |
89 | 89 | ); |
90 | 90 | $this->_enqueuePageAssets( $_aPageStyles, 'style' ); |
91 | 91 | |
92 | - $_aPageScripts = $this->getElementAsArray( |
|
92 | + $_aPageScripts = $this->getElementAsArray( |
|
93 | 93 | $oFactory->oProp->aPages, |
94 | 94 | array( $this->sCurrentPageSlug, 'script' ) |
95 | 95 | ); |
96 | 96 | $this->_enqueuePageAssets( $_aPageScripts, 'script' ); |
97 | 97 | |
98 | 98 | // In-page tabs |
99 | - if ( ! $this->sCurrentTabSlug ) { |
|
99 | + if ( !$this->sCurrentTabSlug ) { |
|
100 | 100 | return; |
101 | 101 | } |
102 | - $_aInPageTabStyles = $this->getElementAsArray( |
|
102 | + $_aInPageTabStyles = $this->getElementAsArray( |
|
103 | 103 | $oFactory->oProp->aInPageTabs, |
104 | 104 | array( $this->sCurrentPageSlug, $this->sCurrentTabSlug, 'style' ) |
105 | 105 | ); |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | * @since 3.6.3 |
117 | 117 | * @return void |
118 | 118 | */ |
119 | - private function _enqueuePageAssets( array $aPageAssets, $sType='style' ) { |
|
120 | - $_sMethodName = "_enqueueAsset_" . $sType; |
|
121 | - foreach( $aPageAssets as $_asPageAsset ) { |
|
122 | - $this->{$_sMethodName}( $_asPageAsset); |
|
119 | + private function _enqueuePageAssets( array $aPageAssets, $sType = 'style' ) { |
|
120 | + $_sMethodName = "_enqueueAsset_".$sType; |
|
121 | + foreach ( $aPageAssets as $_asPageAsset ) { |
|
122 | + $this->{$_sMethodName}( $_asPageAsset ); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | // Insert the CSS rule in the head tag. |
147 | - $this->aCSSRules[] = $_sSRC; |
|
147 | + $this->aCSSRules[ ] = $_sSRC; |
|
148 | 148 | |
149 | 149 | } |
150 | 150 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | // Insert the scripts in the head tag. |
172 | - $this->aScripts[] = $_sSRC; |
|
172 | + $this->aScripts[ ] = $_sSRC; |
|
173 | 173 | |
174 | 174 | } |
175 | 175 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | /* |
163 | 163 | * Shared methods |
164 | 164 | */ |
165 | - /** |
|
165 | + /** |
|
166 | 166 | * Checks the src url of the enqueued script/style to determine whether or not to set up a attribute modification callback. |
167 | 167 | * |
168 | 168 | * If it is one of the framework added item, the method sets up a hook to modify the url to add custom attributes. |
@@ -352,7 +352,8 @@ discard block |
||
352 | 352 | static $_iCallCount = 0; |
353 | 353 | |
354 | 354 | $_sFilterName = "style_{$this->oProp->sClassName}"; |
355 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
355 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
356 | +// 3.8.22 |
|
356 | 357 | return ''; |
357 | 358 | } |
358 | 359 | $_sStyle = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyle ); |
@@ -379,7 +380,8 @@ discard block |
||
379 | 380 | static $_iCallCountIE = 1; |
380 | 381 | |
381 | 382 | $_sFilterName = "style_ie_{$this->oProp->sClassName}"; |
382 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
383 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
384 | +// 3.8.22 |
|
383 | 385 | return ''; |
384 | 386 | } |
385 | 387 | $_sStyleIE = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyleIE ); |
@@ -407,7 +409,8 @@ discard block |
||
407 | 409 | |
408 | 410 | static $_iCallCount = 1; |
409 | 411 | $_sFilterName = "script_{$this->oProp->sClassName}"; |
410 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
412 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
413 | +// 3.8.22 |
|
411 | 414 | return ''; |
412 | 415 | } |
413 | 416 | $_sScript = $this->addAndApplyFilters( $this->oProp->oCaller, $_sFilterName, $this->oProp->sScript ); |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | /* The system internal keys. */ |
38 | 38 | 'sSRC' => null, |
39 | 39 | 'sSRCRaw' => null, |
40 | - 'aPostTypes' => array(), // for meta box class |
|
40 | + 'aPostTypes' => array(), // for meta box class |
|
41 | 41 | 'sPageSlug' => null, |
42 | 42 | 'sTabSlug' => null, |
43 | - 'sType' => null, // script or style |
|
43 | + 'sType' => null, // script or style |
|
44 | 44 | |
45 | 45 | /* The below keys are for users. */ |
46 | 46 | 'handle_id' => null, |
47 | 47 | 'dependencies' => array(), |
48 | - 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
49 | - 'translation' => array(), // only for scripts |
|
50 | - 'in_footer' => false, // only for scripts |
|
51 | - 'media' => 'all', // only for styles |
|
52 | - 'attributes' => array(), // 3.3.0+ - the attribute array |
|
48 | + 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
49 | + 'translation' => array(), // only for scripts |
|
50 | + 'in_footer' => false, // only for scripts |
|
51 | + 'media' => 'all', // only for styles |
|
52 | + 'attributes' => array(), // 3.3.0+ - the attribute array |
|
53 | 53 | |
54 | 54 | ); |
55 | 55 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @remark This value should be overridden in an extended class. |
61 | 61 | * @internal |
62 | 62 | */ |
63 | - protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
63 | + protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Stores the class selector used to the class-specific script. |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @remark This value should be overridden in an extended class. |
70 | 70 | * @internal |
71 | 71 | */ |
72 | - protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
72 | + protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Stores hand IDs by resource url to look up handle id and add custom arguments. |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | return $sSanitizedURL; |
207 | 207 | } |
208 | 208 | |
209 | - $_sAttributes = $this->getAttributes( $_aAttributes ); |
|
210 | - return $sSanitizedURL . "' " . rtrim( $_sAttributes, "'\"" ); |
|
209 | + $_sAttributes = $this->getAttributes( $_aAttributes ); |
|
210 | + return $sSanitizedURL."' ".rtrim( $_sAttributes, "'\"" ); |
|
211 | 211 | |
212 | 212 | } |
213 | 213 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | protected function _printCommonStyles( $sIDPrefix, $sClassName ) { |
229 | 229 | |
230 | - if ( $this->hasBeenCalled( 'COMMON_STYLES: ' . get_class( $this ) . '::' . __METHOD__ ) ) { |
|
230 | + if ( $this->hasBeenCalled( 'COMMON_STYLES: '.get_class( $this ).'::'.__METHOD__ ) ) { |
|
231 | 231 | return; |
232 | 232 | } |
233 | 233 | $_oCaller = $this->oProp->oCaller; |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | */ |
244 | 244 | private function ___getCommonStyleTag( $oCaller, $sIDPrefix ) { |
245 | 245 | |
246 | - $_sStyle = $this->addAndApplyFilters( |
|
246 | + $_sStyle = $this->addAndApplyFilters( |
|
247 | 247 | $oCaller, |
248 | 248 | array( |
249 | - "style_common_admin_page_framework", // 3.2.1+ |
|
249 | + "style_common_admin_page_framework", // 3.2.1+ |
|
250 | 250 | "style_common_{$this->oProp->sClassName}", |
251 | 251 | ), |
252 | 252 | AdminPageFramework_CSS::getDefaultCSS() |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $_sStyle = $this->isDebugMode() ? $_sStyle : $this->getCSSMinified( $_sStyle ); |
255 | 255 | $_sStyle = trim( $_sStyle ); |
256 | 256 | if ( $_sStyle ) { |
257 | - echo "<style type='text/css' id='" . esc_attr( strtolower( $sIDPrefix ) ) . "'>" |
|
257 | + echo "<style type='text/css' id='".esc_attr( strtolower( $sIDPrefix ) )."'>" |
|
258 | 258 | . $_sStyle |
259 | 259 | . "</style>"; |
260 | 260 | } |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | */ |
270 | 270 | private function ___getCommonIEStyleTag( $oCaller, $sIDPrefix ) { |
271 | 271 | |
272 | - $_sStyleIE = $this->addAndApplyFilters( |
|
272 | + $_sStyleIE = $this->addAndApplyFilters( |
|
273 | 273 | $oCaller, |
274 | 274 | array( |
275 | - "style_ie_common_admin_page_framework", // 3.2.1+ |
|
275 | + "style_ie_common_admin_page_framework", // 3.2.1+ |
|
276 | 276 | "style_ie_common_{$this->oProp->sClassName}", |
277 | 277 | ), |
278 | 278 | AdminPageFramework_CSS::getDefaultCSSIE() |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $_sStyleIE = $this->isDebugMode() ? $_sStyleIE : $this->getCSSMinified( $_sStyleIE ); |
281 | 281 | $_sStyleIE = trim( $_sStyleIE ); |
282 | 282 | return $_sStyleIE |
283 | - ? "<!--[if IE]><style type='text/css' id='" . esc_attr( strtolower( $sIDPrefix . "-ie" ) ) . "'>" |
|
283 | + ? "<!--[if IE]><style type='text/css' id='".esc_attr( strtolower( $sIDPrefix."-ie" ) )."'>" |
|
284 | 284 | . $_sStyleIE |
285 | 285 | . "</style><![endif]-->" |
286 | 286 | : ''; |
@@ -299,23 +299,23 @@ discard block |
||
299 | 299 | */ |
300 | 300 | protected function _printCommonScripts( $sIDPrefix, $sClassName ) { |
301 | 301 | |
302 | - if ( $this->hasBeenCalled( 'COMMON_SCRIPT: ' . get_class( $this ) . '::' . __METHOD__ ) ) { |
|
302 | + if ( $this->hasBeenCalled( 'COMMON_SCRIPT: '.get_class( $this ).'::'.__METHOD__ ) ) { |
|
303 | 303 | return; |
304 | 304 | } |
305 | 305 | |
306 | 306 | $_sScript = $this->addAndApplyFilters( |
307 | 307 | $this->oProp->oCaller, |
308 | 308 | array( |
309 | - "script_common_admin_page_framework", // 3.2.1+ |
|
309 | + "script_common_admin_page_framework", // 3.2.1+ |
|
310 | 310 | "script_common_{$this->oProp->sClassName}", |
311 | 311 | ), |
312 | 312 | AdminPageFramework_Property_Base::$_sDefaultScript |
313 | 313 | ); |
314 | 314 | $_sScript = trim( $_sScript ); |
315 | - if ( ! $_sScript ) { |
|
315 | + if ( !$_sScript ) { |
|
316 | 316 | return; |
317 | 317 | } |
318 | - echo "<script type='text/javascript' id='" . esc_attr( strtolower( $sIDPrefix ) ) . "'>" |
|
318 | + echo "<script type='text/javascript' id='".esc_attr( strtolower( $sIDPrefix ) )."'>" |
|
319 | 319 | . '/* <![CDATA[ */' |
320 | 320 | . $_sScript |
321 | 321 | . '/* ]]> */' |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | */ |
334 | 334 | protected function _printClassSpecificStyles( $sIDPrefix ) { |
335 | 335 | |
336 | - $_oCaller = $this->oProp->oCaller; |
|
336 | + $_oCaller = $this->oProp->oCaller; |
|
337 | 337 | echo $this->_getClassSpecificStyleTag( $_oCaller, $sIDPrefix ); |
338 | 338 | echo $this->_getClassSpecificIEStyleTag( $_oCaller, $sIDPrefix ); |
339 | 339 | |
@@ -354,18 +354,18 @@ discard block |
||
354 | 354 | static $_iCallCount = 0; |
355 | 355 | |
356 | 356 | $_sFilterName = "style_{$this->oProp->sClassName}"; |
357 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
357 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
358 | 358 | return ''; |
359 | 359 | } |
360 | 360 | $_sStyle = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyle ); |
361 | 361 | $_sStyle = $this->isDebugMode() ? $_sStyle : $this->getCSSMinified( $_sStyle ); |
362 | 362 | $_sStyle = trim( $_sStyle ); |
363 | - if ( ! $_sStyle ) { |
|
363 | + if ( !$_sStyle ) { |
|
364 | 364 | return ''; |
365 | 365 | } |
366 | 366 | $_iCallCount++; |
367 | - $_sID = strtolower( "{$sIDPrefix}-" . $this->oProp->sClassName . "_{$_iCallCount}" ); |
|
368 | - return "<style type='text/css' id='" . esc_attr( $_sID ) . "'>" |
|
367 | + $_sID = strtolower( "{$sIDPrefix}-".$this->oProp->sClassName."_{$_iCallCount}" ); |
|
368 | + return "<style type='text/css' id='".esc_attr( $_sID )."'>" |
|
369 | 369 | . $_sStyle |
370 | 370 | . "</style>"; |
371 | 371 | |
@@ -381,18 +381,18 @@ discard block |
||
381 | 381 | static $_iCallCountIE = 1; |
382 | 382 | |
383 | 383 | $_sFilterName = "style_ie_{$this->oProp->sClassName}"; |
384 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
384 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
385 | 385 | return ''; |
386 | 386 | } |
387 | 387 | $_sStyleIE = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyleIE ); |
388 | 388 | $_sStyleIE = $this->isDebugMode() ? $_sStyleIE : $this->getCSSMinified( $_sStyleIE ); |
389 | 389 | $_sStyleIE = trim( $_sStyleIE ); |
390 | - if ( ! $_sStyleIE ) { |
|
390 | + if ( !$_sStyleIE ) { |
|
391 | 391 | return ''; |
392 | 392 | } |
393 | 393 | $_iCallCountIE++; |
394 | - $_sID = strtolower( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ); |
|
395 | - return "<!--[if IE]><style type='text/css' id='" . esc_attr( $_sID ) . "'>" |
|
394 | + $_sID = strtolower( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ); |
|
395 | + return "<!--[if IE]><style type='text/css' id='".esc_attr( $_sID )."'>" |
|
396 | 396 | . $_sStyleIE |
397 | 397 | . "</style><![endif]-->"; |
398 | 398 | |
@@ -409,18 +409,18 @@ discard block |
||
409 | 409 | |
410 | 410 | static $_iCallCount = 1; |
411 | 411 | $_sFilterName = "script_{$this->oProp->sClassName}"; |
412 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
412 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
413 | 413 | return ''; |
414 | 414 | } |
415 | 415 | $_sScript = $this->addAndApplyFilters( $this->oProp->oCaller, $_sFilterName, $this->oProp->sScript ); |
416 | 416 | $_sScript = trim( $_sScript ); |
417 | - if ( ! $_sScript ) { |
|
417 | + if ( !$_sScript ) { |
|
418 | 418 | return ''; |
419 | 419 | } |
420 | 420 | |
421 | 421 | $_iCallCount++; |
422 | 422 | $_sID = strtolower( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ); |
423 | - echo "<script type='text/javascript' id='" . esc_attr( $_sID ) . "'>" |
|
423 | + echo "<script type='text/javascript' id='".esc_attr( $_sID )."'>" |
|
424 | 424 | . '/* <![CDATA[ */' |
425 | 425 | . $_sScript |
426 | 426 | . '/* ]]> */' |
@@ -443,12 +443,12 @@ discard block |
||
443 | 443 | public function _replyToAddStyle() { |
444 | 444 | |
445 | 445 | $_oCaller = $this->oProp->oCaller; |
446 | - if ( ! $_oCaller->isInThePage() ) { |
|
446 | + if ( !$_oCaller->isInThePage() ) { |
|
447 | 447 | return; |
448 | 448 | } |
449 | 449 | |
450 | 450 | $this->_printCommonStyles( 'admin-page-framework-style-common', get_class() ); |
451 | - $this->_printClassSpecificStyles( $this->_sClassSelector_Style . '-' . $this->oProp->sStructureType ); |
|
451 | + $this->_printClassSpecificStyles( $this->_sClassSelector_Style.'-'.$this->oProp->sStructureType ); |
|
452 | 452 | |
453 | 453 | } |
454 | 454 | /** |
@@ -463,12 +463,12 @@ discard block |
||
463 | 463 | public function _replyToAddScript() { |
464 | 464 | |
465 | 465 | $_oCaller = $this->oProp->oCaller; |
466 | - if ( ! $_oCaller->isInThePage() ) { |
|
466 | + if ( !$_oCaller->isInThePage() ) { |
|
467 | 467 | return; |
468 | 468 | } |
469 | 469 | |
470 | 470 | $this->_printCommonScripts( 'admin-page-framework-script-common', get_class() ); |
471 | - $this->_printClassSpecificScripts( $this->_sClassSelector_Script . '-' . $this->oProp->sStructureType ); |
|
471 | + $this->_printClassSpecificScripts( $this->_sClassSelector_Script.'-'.$this->oProp->sStructureType ); |
|
472 | 472 | |
473 | 473 | } |
474 | 474 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | */ |
520 | 520 | private function ___getSRCFormatted( array $aEnqueueItem ) { |
521 | 521 | |
522 | - if ( ! $this->oProp->bAutoloadMinifiedResource ) { |
|
522 | + if ( !$this->oProp->bAutoloadMinifiedResource ) { |
|
523 | 523 | return $aEnqueueItem[ 'sSRC' ]; |
524 | 524 | } |
525 | 525 | |
@@ -546,16 +546,16 @@ discard block |
||
546 | 546 | + array( 'dirname' => '', 'filename' => '', 'basename' => '', 'extension' => '' ); // avoid undefined index warnings |
547 | 547 | |
548 | 548 | // If there is no extension, avoid using a minified version. |
549 | - if ( ! $_aPathParts[ 'extension' ] ) { |
|
549 | + if ( !$_aPathParts[ 'extension' ] ) { |
|
550 | 550 | return $aEnqueueItem[ 'sSRC' ]; |
551 | 551 | } |
552 | 552 | |
553 | 553 | $_aPathPartsURL = pathinfo( $aEnqueueItem[ 'sSRC' ] ) |
554 | 554 | + array( 'dirname' => '', 'filename' => '', 'basename' => '', 'extension' => '' ); // avoid undefined index warnings |
555 | 555 | |
556 | - $_sPathMinifiedVersion = $_aPathParts[ 'dirname' ] . '/' . $_aPathParts[ 'filename' ] . $_sMinPrefix . '.' . $_aPathParts[ 'extension' ]; |
|
556 | + $_sPathMinifiedVersion = $_aPathParts[ 'dirname' ].'/'.$_aPathParts[ 'filename' ].$_sMinPrefix.'.'.$_aPathParts[ 'extension' ]; |
|
557 | 557 | return file_exists( $_sPathMinifiedVersion ) |
558 | - ? $_aPathPartsURL[ 'dirname' ] . '/' . $_aPathPartsURL[ 'filename' ] . $_sMinPrefix . '.' . $_aPathPartsURL[ 'extension' ] |
|
558 | + ? $_aPathPartsURL[ 'dirname' ].'/'.$_aPathPartsURL[ 'filename' ].$_sMinPrefix.'.'.$_aPathPartsURL[ 'extension' ] |
|
559 | 559 | : $aEnqueueItem[ 'sSRC' ]; |
560 | 560 | |
561 | 561 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | * @internal |
572 | 572 | */ |
573 | 573 | public function _replyToEnqueueStyles() { |
574 | - foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
574 | + foreach ( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
575 | 575 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
576 | 576 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
577 | 577 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | * @internal |
589 | 589 | */ |
590 | 590 | public function _replyToEnqueueScripts() { |
591 | - foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
591 | + foreach ( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
592 | 592 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
593 | 593 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
594 | 594 | } |
@@ -602,10 +602,10 @@ discard block |
||
602 | 602 | * @param string $sType Accepts 'style' or 'script' |
603 | 603 | * @return string[] Added resource handle IDs. |
604 | 604 | */ |
605 | - public function _enqueueResourcesByType( $aSRCs, array $aCustomArgs=array(), $sType='style' ) { |
|
605 | + public function _enqueueResourcesByType( $aSRCs, array $aCustomArgs = array(), $sType = 'style' ) { |
|
606 | 606 | $_aHandleIDs = array(); |
607 | - foreach( $aSRCs as $_sSRC ) { |
|
608 | - $_aHandleIDs[] = call_user_func_array( array( $this, '_addEnqueuingResourceByType' ), array( $_sSRC, $aCustomArgs, $sType ) ); |
|
607 | + foreach ( $aSRCs as $_sSRC ) { |
|
608 | + $_aHandleIDs[ ] = call_user_func_array( array( $this, '_addEnqueuingResourceByType' ), array( $_sSRC, $aCustomArgs, $sType ) ); |
|
609 | 609 | } |
610 | 610 | return $_aHandleIDs; |
611 | 611 | } |
@@ -622,9 +622,9 @@ discard block |
||
622 | 622 | * @return string The script handle ID if added. If the passed url is not a valid url string, an empty string will be returned. |
623 | 623 | * @internal |
624 | 624 | */ |
625 | - public function _addEnqueuingResourceByType( $sSRC, array $aCustomArgs=array(), $sType='style' ) { |
|
625 | + public function _addEnqueuingResourceByType( $sSRC, array $aCustomArgs = array(), $sType = 'style' ) { |
|
626 | 626 | |
627 | - $sSRC = trim( $sSRC ); |
|
627 | + $sSRC = trim( $sSRC ); |
|
628 | 628 | if ( empty( $sSRC ) ) { |
629 | 629 | return ''; |
630 | 630 | } |
@@ -640,12 +640,12 @@ discard block |
||
640 | 640 | 'sSRCRaw' => $_sRawSRC, |
641 | 641 | 'sSRC' => $_sSRC, |
642 | 642 | 'sType' => $sType, |
643 | - 'handle_id' => $sType . '_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
643 | + 'handle_id' => $sType.'_'.$this->oProp->sClassName.'_'.( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
644 | 644 | ) |
645 | 645 | + self::$_aStructure_EnqueuingResources; |
646 | 646 | |
647 | 647 | // Store the attributes in another container by url. |
648 | - $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRC ]['handle_id'] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRC ]['attributes']; |
|
648 | + $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRC ][ 'handle_id' ] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRC ][ 'attributes' ]; |
|
649 | 649 | |
650 | 650 | return $this->oProp->{$_sContainerPropertyName}[ $_sSRC ][ 'handle_id' ]; |
651 | 651 |
@@ -266,7 +266,7 @@ |
||
266 | 266 | * @since 3.8.22 |
267 | 267 | */ |
268 | 268 | static public function getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
269 | - return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
|
269 | + return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | * @return string |
38 | 38 | * @since 3.8.9 |
39 | 39 | */ |
40 | - static protected function _getLegibleDetails( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
40 | + static protected function _getLegibleDetails( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
41 | 41 | if ( is_array( $mValue ) ) { |
42 | - return '(array, length: ' . count( $mValue ).') ' |
|
43 | - . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) , true ); |
|
42 | + return '(array, length: '.count( $mValue ).') ' |
|
43 | + . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ), true ); |
|
44 | 44 | } |
45 | 45 | return print_r( self::___getLegibleDetailedValue( $mValue, $iStringLengthLimit ), true ); |
46 | 46 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @since 3.8.9 |
56 | 56 | * @since 3.8.22 Added the `$sStringLengthLimit` and `$iArrayDepthLimit` parameters. |
57 | 57 | */ |
58 | - static protected function _getLegible( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
58 | + static protected function _getLegible( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
59 | 59 | |
60 | 60 | $iArrayDepthLimit = $iArrayDepthLimit ? $iArrayDepthLimit : self::$iLegibleArrayDepthLimit; |
61 | 61 | $mValue = is_object( $mValue ) |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ) |
73 | 73 | : $mValue; |
74 | 74 | $mValue = is_string( $mValue ) |
75 | - ? self::___getLegibleString( $mValue, $iStringLengthLimit, false ) |
|
75 | + ? self::___getLegibleString( $mValue, $iStringLengthLimit, false ) |
|
76 | 76 | : $mValue; |
77 | 77 | return self::_getArrayRepresentationSanitized( print_r( $mValue, true ) ); |
78 | 78 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | static private function ___getObjectName( $mItem ) { |
90 | 90 | if ( is_object( $mItem ) ) { |
91 | - return '(object) ' . get_class( $mItem ); |
|
91 | + return '(object) '.get_class( $mItem ); |
|
92 | 92 | } |
93 | 93 | return $mItem; |
94 | 94 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return string |
100 | 100 | */ |
101 | 101 | static private function ___getLegibleDetailedCallable( $asoCallable ) { |
102 | - return '(callable) ' . self::___getCallableName( $asoCallable ); |
|
102 | + return '(callable) '.self::___getCallableName( $asoCallable ); |
|
103 | 103 | } |
104 | 104 | /** |
105 | 105 | * @since 3.8.9 |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $_sSubject = is_object( $asoCallable[ 0 ] ) |
118 | 118 | ? get_class( $asoCallable[ 0 ] ) |
119 | 119 | : ( string ) $asoCallable[ 0 ]; |
120 | - return $_sSubject . '::' . ( string ) $asoCallable[ 1 ]; |
|
120 | + return $_sSubject.'::'.( string ) $asoCallable[ 1 ]; |
|
121 | 121 | |
122 | 122 | } |
123 | 123 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ( method_exists( $oObject, '__toString' ) ) { |
132 | 132 | return ( string ) $oObject; |
133 | 133 | } |
134 | - return '(object) ' . get_class( $oObject ) . ' ' . count( get_object_vars( $oObject ) ) . ' properties.'; |
|
134 | + return '(object) '.get_class( $oObject ).' '.count( get_object_vars( $oObject ) ).' properties.'; |
|
135 | 135 | |
136 | 136 | } |
137 | 137 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @since 3.8.22 Changed the scope to private from public. |
148 | 148 | * @since 3.8.22 Renamed from `_getLegibleArray()`. |
149 | 149 | */ |
150 | - static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit=0, $iDepthLimit=0 ) { |
|
150 | + static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit = 0, $iDepthLimit = 0 ) { |
|
151 | 151 | $_iDepthLimit = $iDepthLimit ? $iDepthLimit : self::$iLegibleArrayDepthLimit; |
152 | 152 | return self::___getArrayMappedRecursive( |
153 | 153 | self::_getSlicedByDepth( $aArray, $_iDepthLimit ), |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | return self::___getLegibleDetailedObject( $mNonScalar ); |
188 | 188 | } |
189 | 189 | if ( is_array( $mNonScalar ) ) { |
190 | - return '(' . $_sType . ') ' . count( $mNonScalar ) . ' elements'; |
|
190 | + return '('.$_sType.') '.count( $mNonScalar ).' elements'; |
|
191 | 191 | } |
192 | - return '(' . $_sType . ') ' . ( string ) $mNonScalar; |
|
192 | + return '('.$_sType.') '.( string ) $mNonScalar; |
|
193 | 193 | |
194 | 194 | } |
195 | 195 | /** |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | */ |
202 | 202 | static private function ___getLegibleDetailedScalar( $sScalar, $iStringLengthLimit ) { |
203 | 203 | if ( is_bool( $sScalar ) ) { |
204 | - return '(boolean) ' . ( $sScalar ? 'true' : 'false' ); |
|
204 | + return '(boolean) '.( $sScalar ? 'true' : 'false' ); |
|
205 | 205 | } |
206 | 206 | return is_string( $sScalar ) |
207 | 207 | ? self::___getLegibleString( $sScalar, $iStringLengthLimit, true ) |
208 | - : '(' . gettype( $sScalar ) . ', length: ' . self::___getValueLength( $sScalar ) . ') ' . $sScalar; |
|
208 | + : '('.gettype( $sScalar ).', length: '.self::___getValueLength( $sScalar ).') '.$sScalar; |
|
209 | 209 | } |
210 | 210 | /** |
211 | 211 | * Returns a length of a value. |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @param boolean $bShowDetails |
231 | 231 | * @return string |
232 | 232 | */ |
233 | - static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails=true ) { |
|
233 | + static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails = true ) { |
|
234 | 234 | |
235 | 235 | static $_iMBSupport; |
236 | 236 | $_iMBSupport = isset( $_iMBSupport ) ? $_iMBSupport : ( integer ) function_exists( 'mb_strlen' ); |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | |
242 | 242 | if ( $bShowDetails ) { |
243 | 243 | return $_iCharLength <= $iCharLimit |
244 | - ? '(string, length: ' . $_iCharLength . ') ' . $sString |
|
245 | - : '(string, length: ' . $_iCharLength . ') ' . call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
244 | + ? '(string, length: '.$_iCharLength.') '.$sString |
|
245 | + : '(string, length: '.$_iCharLength.') '.call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
246 | 246 | . '...'; |
247 | 247 | } |
248 | 248 | return $_iCharLength <= $iCharLimit |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @return array |
284 | 284 | * @since 3.8.22 |
285 | 285 | */ |
286 | - static public function getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
286 | + static public function getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
287 | 287 | return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
288 | 288 | } |
289 | 289 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * @since 3.8.22 Added the `$sMore` parameter. |
304 | 304 | * @internal |
305 | 305 | */ |
306 | - static private function _getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
306 | + static private function _getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
307 | 307 | |
308 | 308 | foreach ( $aSubject as $_sKey => $_vValue ) { |
309 | 309 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @return array |
339 | 339 | * @since 3.8.9 |
340 | 340 | */ |
341 | - static private function ___getArrayMappedRecursive( array $aArray, $oCallable, array $aArguments=array() ) { |
|
341 | + static private function ___getArrayMappedRecursive( array $aArray, $oCallable, array $aArguments = array() ) { |
|
342 | 342 | |
343 | 343 | self::$___oCurrentCallableForArrayMapRecursive = $oCallable; |
344 | 344 | self::$___aArgumentsForArrayMapRecursive = $aArguments; |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | * @since 3.8.22 |
373 | 373 | * @since 3.8.23 Deprecated the `$oException` parameter. |
374 | 374 | */ |
375 | - static public function getStackTrace( $iSkip=0, $_deprecated=null ) { |
|
375 | + static public function getStackTrace( $iSkip = 0, $_deprecated = null ) { |
|
376 | 376 | |
377 | - $_iSkip = 1; // need to skip this method trace itself |
|
377 | + $_iSkip = 1; // need to skip this method trace itself |
|
378 | 378 | $_oException = new Exception(); |
379 | 379 | |
380 | 380 | // Backward compatibility. |
@@ -390,22 +390,22 @@ discard block |
||
390 | 390 | $_aFrames = array_slice( $_aFrames, $_iSkip ); |
391 | 391 | foreach ( array_reverse( $_aFrames ) as $_iIndex => $_aFrame ) { |
392 | 392 | |
393 | - $_aFrame = $_aFrame + array( |
|
393 | + $_aFrame = $_aFrame + array( |
|
394 | 394 | 'file' => null, 'line' => null, 'function' => null, |
395 | 395 | 'class' => null, 'args' => array(), |
396 | 396 | ); |
397 | 397 | $_sArguments = self::___getArgumentsOfEachStackTrace( $_aFrame[ 'args' ] ); |
398 | - $_aTraces[] = sprintf( |
|
398 | + $_aTraces[ ] = sprintf( |
|
399 | 399 | "#%s %s(%s): %s(%s)", |
400 | 400 | $_iIndex + 1, |
401 | 401 | $_aFrame[ 'file' ], |
402 | 402 | $_aFrame[ 'line' ], |
403 | - isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ] . '->' . $_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
403 | + isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ].'->'.$_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
404 | 404 | $_sArguments |
405 | 405 | ); |
406 | 406 | |
407 | 407 | } |
408 | - return implode( PHP_EOL, $_aTraces ) . PHP_EOL; |
|
408 | + return implode( PHP_EOL, $_aTraces ).PHP_EOL; |
|
409 | 409 | |
410 | 410 | } |
411 | 411 | /** |
@@ -420,16 +420,16 @@ discard block |
||
420 | 420 | foreach ( $aTraceArguments as $_mArgument ) { |
421 | 421 | $_sType = gettype( $_mArgument ); |
422 | 422 | $_sType = str_replace( |
423 | - array( 'resource (closed)', 'unknown type', 'integer', 'double', ), |
|
424 | - array( 'resource', 'unknown', 'scalar', 'scalar', ), |
|
423 | + array( 'resource (closed)', 'unknown type', 'integer', 'double',), |
|
424 | + array( 'resource', 'unknown', 'scalar', 'scalar',), |
|
425 | 425 | $_sType |
426 | 426 | ); |
427 | 427 | $_sMethodName = "___getStackTraceArgument_{$_sType}"; |
428 | - $_aArguments[] = method_exists( __CLASS__, $_sMethodName ) |
|
428 | + $_aArguments[ ] = method_exists( __CLASS__, $_sMethodName ) |
|
429 | 429 | ? self::{$_sMethodName}( $_mArgument ) |
430 | 430 | : $_sType; |
431 | 431 | } |
432 | - return join(", ", $_aArguments ); |
|
432 | + return join( ", ", $_aArguments ); |
|
433 | 433 | } |
434 | 434 | /** |
435 | 435 | * @since 3.8.22 |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | */ |
440 | 440 | static private function ___getStackTraceArgument_string( $mArgument ) { |
441 | 441 | $_sString = self::___getLegibleString( $mArgument, 200, true ); |
442 | - return "'" . $_sString . "'"; |
|
442 | + return "'".$_sString."'"; |
|
443 | 443 | } |
444 | 444 | static private function ___getStackTraceArgument_scalar( $mArgument ) { |
445 | 445 | return $mArgument; |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | return 'NULL'; |
452 | 452 | } |
453 | 453 | static private function ___getStackTraceArgument_object( $mArgument ) { |
454 | - return 'Object(' . get_class( $mArgument ) . ')'; |
|
454 | + return 'Object('.get_class( $mArgument ).')'; |
|
455 | 455 | } |
456 | 456 | static private function ___getStackTraceArgument_resource( $mArgument ) { |
457 | 457 | return get_resource_type( $mArgument ); |
@@ -464,18 +464,18 @@ discard block |
||
464 | 464 | $_iMax = 10; |
465 | 465 | $_iTotal = count( $mArgument ); |
466 | 466 | $_iIndex = 0; |
467 | - foreach( $mArgument as $_sKey => $_mValue ) { |
|
467 | + foreach ( $mArgument as $_sKey => $_mValue ) { |
|
468 | 468 | $_iIndex++; |
469 | - $_mValue = is_scalar( $_mValue ) |
|
469 | + $_mValue = is_scalar( $_mValue ) |
|
470 | 470 | ? self::___getLegibleDetailedScalar( $_mValue, 100 ) |
471 | - : ucfirst( gettype( $_mValue ) ) . ( |
|
471 | + : ucfirst( gettype( $_mValue ) ).( |
|
472 | 472 | is_object( $_mValue ) |
473 | - ? ' (' . get_class( $_mValue ) . ')' |
|
473 | + ? ' ('.get_class( $_mValue ).')' |
|
474 | 474 | : '' |
475 | 475 | ); |
476 | - $_sOutput .= $_sKey . ': ' . $_mValue . ', '; |
|
476 | + $_sOutput .= $_sKey.': '.$_mValue.', '; |
|
477 | 477 | if ( $_iIndex > $_iMax && $_iTotal > $_iMax ) { |
478 | - $_sOutput = rtrim( $_sOutput, ',' ) . '...'; |
|
478 | + $_sOutput = rtrim( $_sOutput, ',' ).'...'; |
|
479 | 479 | break; |
480 | 480 | } |
481 | 481 | } |
@@ -282,7 +282,7 @@ |
||
282 | 282 | CSSRULES; |
283 | 283 | |
284 | 284 | } |
285 | - private function ___getForWP38OrBelow(){ |
|
285 | + private function ___getForWP38OrBelow() { |
|
286 | 286 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
287 | 287 | return ''; |
288 | 288 | } |
@@ -282,7 +282,7 @@ |
||
282 | 282 | CSSRULES; |
283 | 283 | |
284 | 284 | } |
285 | - private function ___getForWP38OrBelow(){ |
|
285 | + private function ___getForWP38OrBelow() { |
|
286 | 286 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
287 | 287 | return ''; |
288 | 288 | } |
@@ -76,21 +76,21 @@ |
||
76 | 76 | * @param string $sPriority The priority, either `high`, `core`, `default` or `low`. |
77 | 77 | * @param string $sCapability The capability. See <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles and Capabilities</a>. |
78 | 78 | */ |
79 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
79 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
80 | 80 | |
81 | 81 | if ( empty( $asPageSlugs ) ) { |
82 | 82 | return; |
83 | 83 | } |
84 | 84 | |
85 | - if ( ! $this->_isInstantiatable() ) { |
|
85 | + if ( !$this->_isInstantiatable() ) { |
|
86 | 86 | return; |
87 | 87 | } |
88 | 88 | |
89 | 89 | // The property object needs to be done first before the parent constructor. |
90 | 90 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
91 | 91 | ? $this->aSubClassNames[ 'oProp' ] |
92 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
93 | - $this->oProp = new $_sPropertyClassName( |
|
92 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
93 | + $this->oProp = new $_sPropertyClassName( |
|
94 | 94 | $this, |
95 | 95 | get_class( $this ), |
96 | 96 | $sCapability, |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string The text domain. Default: `admin-page-framework`. |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - function __construct( $asTaxonomySlug, $sOptionKey='', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
48 | + function __construct( $asTaxonomySlug, $sOptionKey = '', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
49 | 49 | |
50 | 50 | if ( empty( $asTaxonomySlug ) ) { |
51 | 51 | return; |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | // Properties |
55 | 55 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
56 | 56 | ? $this->aSubClassNames[ 'oProp' ] |
57 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
58 | - $this->oProp = new $_sPropertyClassName( |
|
57 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
58 | + $this->oProp = new $_sPropertyClassName( |
|
59 | 59 | $this, |
60 | 60 | get_class( $this ), |
61 | 61 | $sCapability, |
@@ -38,16 +38,16 @@ |
||
38 | 38 | * @since 3.7.4 Changed the default capability value to `read`. |
39 | 39 | * @todo Examine the appropriate default capability level. |
40 | 40 | */ |
41 | - public function __construct( $sCapability='read', $sTextDomain='admin-page-framework' ) { |
|
41 | + public function __construct( $sCapability = 'read', $sTextDomain = 'admin-page-framework' ) { |
|
42 | 42 | |
43 | 43 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
44 | 44 | ? $this->aSubClassNames[ 'oProp' ] |
45 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
45 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
46 | 46 | $this->oProp = new $_sPropertyClassName( |
47 | - $this, // the caller object |
|
48 | - get_class( $this ), // the caller class name |
|
49 | - $sCapability, // the capability level |
|
50 | - $sTextDomain, // the text domain |
|
47 | + $this, // the caller object |
|
48 | + get_class( $this ), // the caller class name |
|
49 | + $sCapability, // the capability level |
|
50 | + $sTextDomain, // the text domain |
|
51 | 51 | $this->_sStructureType // the structure type |
52 | 52 | ); |
53 | 53 |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @since 3.3.0 |
28 | 28 | */ |
29 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
29 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
30 | 30 | |
31 | 31 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
32 | 32 | ? $this->aSubClassNames[ 'oProp' ] |
33 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
33 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
34 | 34 | |
35 | 35 | $this->oProp = new $_sPropertyClassName( |
36 | 36 | $this, |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | // if ( $this->oProp->bIsAdminAjax ) { |
48 | 48 | // return; |
49 | 49 | // } |
50 | - if ( ! $this->oProp->bIsAdmin ) { |
|
50 | + if ( !$this->oProp->bIsAdmin ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | 54 | add_action( 'wp_loaded', array( $this, '_replyToDetermineToLoad' ) ); |
55 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToLoadComponentsForAjax' ), 100 ); |
|
55 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToLoadComponentsForAjax' ), 100 ); |
|
56 | 56 | |
57 | 57 | } |
58 | 58 | |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | * @callback add_action set_up_{extended class name} |
65 | 65 | */ |
66 | 66 | public function _replyToLoadComponentsForAjax() { |
67 | - if ( ! $this->oProp->bIsAdminAjax ) { |
|
67 | + if ( !$this->oProp->bIsAdminAjax ) { |
|
68 | 68 | return; |
69 | 69 | } |
70 | 70 | |
71 | 71 | new AdminPageFramework_Model_Menu__RegisterMenu( $this, 'pseudo_admin_menu' ); |
72 | 72 | do_action( 'pseudo_admin_menu', '' ); |
73 | - do_action( 'pseudo_current_screen' ); // @deprecated 3.8.22 Kept for backward-compatibility |
|
73 | + do_action( 'pseudo_current_screen' ); // @deprecated 3.8.22 Kept for backward-compatibility |
|
74 | 74 | |
75 | 75 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
76 | 76 | if ( $this->oProp->isPageAdded( $_sPageSlug ) ) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
118 | 118 | * @internal |
119 | 119 | */ |
120 | - public function __call( $sMethodName, $aArgs=null ) { |
|
120 | + public function __call( $sMethodName, $aArgs = null ) { |
|
121 | 121 | |
122 | 122 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
123 | 123 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | 'load_pre_', |
129 | 129 | ); |
130 | 130 | |
131 | - switch( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
131 | + switch ( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
132 | 132 | |
133 | 133 | // add_settings_section() callback |
134 | 134 | case 'section_pre_': |
135 | - return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
135 | + return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
136 | 136 | |
137 | 137 | // add_settings_field() callback |
138 | 138 | case 'field_pre_': |
139 | - return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
139 | + return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
140 | 140 | |
141 | 141 | // load-{page} callback |
142 | 142 | case 'load_pre_': |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | * @return string The found callback method name or the prefix of a known callback method name. An empty string if not found. |
155 | 155 | * @internal |
156 | 156 | */ |
157 | - private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes=array() ) { |
|
157 | + private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes = array() ) { |
|
158 | 158 | |
159 | - foreach( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
159 | + foreach ( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
160 | 160 | if ( $this->oUtil->hasPrefix( $_sMethodPrefix, $sMethodName ) ) { |
161 | 161 | return $_sMethodPrefix; |
162 | 162 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | protected function _doPageLoadCall( $sMethodName, $sPageSlug, $sTabSlug, $oScreen ) { |
182 | 182 | |
183 | - if ( ! $this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
183 | + if ( !$this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
184 | 184 | return; |
185 | 185 | } |
186 | 186 | |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | // the tab slug will be empty unless an in-page tab is added. |
205 | 205 | $sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
206 | 206 | if ( strlen( $sTabSlug ) ) { |
207 | - $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
207 | + $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
208 | 208 | $this->oUtil->addAndDoActions( |
209 | 209 | $this, // the caller object |
210 | - array( "load_{$sPageSlug}_" . $sTabSlug ), |
|
210 | + array( "load_{$sPageSlug}_".$sTabSlug ), |
|
211 | 211 | $this // the admin page object - this lets third-party scripts use the framework methods. |
212 | 212 | ); |
213 | 213 | add_filter( 'admin_title', array( $this, '_replyToSetAdminPageTitleForTab' ), 1, 2 ); |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | * @since 3.8.8 |
234 | 234 | * @return void |
235 | 235 | */ |
236 | - private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug='' ) { |
|
236 | + private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug = '' ) { |
|
237 | 237 | |
238 | 238 | // For the page, |
239 | - if ( ! strlen( $sTabSlug ) ) { |
|
239 | + if ( !strlen( $sTabSlug ) ) { |
|
240 | 240 | $this->oProp->bShowDebugInfo = $this->oUtil->getElement( |
241 | 241 | $this->oProp->aPages, |
242 | 242 | array( $sPageSlug, 'show_debug_info' ), |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) { |
282 | 282 | return false; |
283 | 283 | } |
284 | - if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
284 | + if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
285 | 285 | return false; |
286 | 286 | } |
287 | 287 | $_sPageHook = is_object( $osScreenORPageHook ) |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | // Nothing to do in the network admin area. |
310 | - return ! is_network_admin(); |
|
310 | + return !is_network_admin(); |
|
311 | 311 | |
312 | 312 | } |
313 | 313 | |
@@ -322,13 +322,13 @@ discard block |
||
322 | 322 | */ |
323 | 323 | protected function _isInThePage() { |
324 | 324 | |
325 | - if ( ! $this->oProp->bIsAdmin ) { |
|
325 | + if ( !$this->oProp->bIsAdmin ) { |
|
326 | 326 | return false; |
327 | 327 | } |
328 | 328 | |
329 | 329 | // If the `setUp()` method is not loaded yet, nothing can be checked |
330 | 330 | // as there is not page is added. |
331 | - if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) { |
|
331 | + if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) { |
|
332 | 332 | return true; |
333 | 333 | } |
334 | 334 |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $this->oProp->aInPageTabs, |
33 | 33 | array( $this->oProp->getCurrentPageSlug(), $this->oProp->getCurrentTabSlug(), 'title' ) |
34 | 34 | ); |
35 | - if ( ! $_sTabTitle ) { |
|
35 | + if ( !$_sTabTitle ) { |
|
36 | 36 | return $sAdminTitle; |
37 | 37 | } |
38 | - return $_sTabTitle . ' ‹ ' . $sAdminTitle; |
|
38 | + return $_sTabTitle.' ‹ '.$sAdminTitle; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return void |
83 | 83 | * @internal |
84 | 84 | */ |
85 | - protected function _renderPage( $sPageSlug, $sTabSlug=null ) { |
|
85 | + protected function _renderPage( $sPageSlug, $sTabSlug = null ) { |
|
86 | 86 | $_oPageRenderer = new AdminPageFramework_View__PageRenderer( $this, $sPageSlug, $sTabSlug ); |
87 | 87 | $_oPageRenderer->render(); |
88 | 88 | } |