@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | if ( $this->oProp->bIsAdmin ) { |
39 | 39 | |
40 | - add_action( 'load_' . $this->oProp->sPostType, array( $this, '_replyToSetUpHooksForModel' ) ); |
|
40 | + add_action( 'load_'.$this->oProp->sPostType, array( $this, '_replyToSetUpHooksForModel' ) ); |
|
41 | 41 | |
42 | 42 | if ( $this->oProp->sCallerPath ) { |
43 | 43 | new AdminPageFramework_PostType_Model__FlushRewriteRules( $this ); |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | |
65 | 65 | // Properties - sets translatable labels. |
66 | 66 | $this->oProp->aColumnHeaders = array( |
67 | - 'cb' => '<input type="checkbox" />', // Checkbox for bulk actions. |
|
68 | - 'title' => $this->oMsg->get( 'title' ), // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from `$_REQUEST`['mode']) is 'excerpt', a post excerpt is included between the title and links. |
|
69 | - 'author' => $this->oMsg->get( 'author' ), // Post author. |
|
67 | + 'cb' => '<input type="checkbox" />', // Checkbox for bulk actions. |
|
68 | + 'title' => $this->oMsg->get( 'title' ), // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from `$_REQUEST`['mode']) is 'excerpt', a post excerpt is included between the title and links. |
|
69 | + 'author' => $this->oMsg->get( 'author' ), // Post author. |
|
70 | 70 | 'comments' => '<div class="comment-grey-bubble"></div>', // Number of pending comments. |
71 | - 'date' => $this->oMsg->get( 'date' ), // The date and publish status of the post. |
|
71 | + 'date' => $this->oMsg->get( 'date' ), // The date and publish status of the post. |
|
72 | 72 | ); |
73 | 73 | |
74 | 74 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | echo $this->oUtil->addAndApplyFilter( |
131 | 131 | $this, |
132 | 132 | "cell_{$this->oProp->sPostType}_{$sColumnKey}", |
133 | - '', // value to be filtered - cell output |
|
133 | + '', // value to be filtered - cell output |
|
134 | 134 | $iPostID |
135 | 135 | ); |
136 | 136 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @internal |
180 | 180 | */ |
181 | 181 | public function _replyToRegisterTaxonomies() { |
182 | - foreach( $this->oProp->aTaxonomies as $_sTaxonomySlug => $_aArguments ) { |
|
182 | + foreach ( $this->oProp->aTaxonomies as $_sTaxonomySlug => $_aArguments ) { |
|
183 | 183 | $this->_registerTaxonomy( |
184 | 184 | $_sTaxonomySlug, |
185 | 185 | $this->oUtil->getAsArray( $this->oProp->aTaxonomyObjectTypes[ $_sTaxonomySlug ] ), // object types |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function _registerTaxonomy( $sTaxonomySlug, array $aObjectTypes, array $aArguments ) { |
197 | 197 | |
198 | - if ( ! in_array( $this->oProp->sPostType, $aObjectTypes ) ) { |
|
199 | - $aObjectTypes[] = $this->oProp->sPostType; |
|
198 | + if ( !in_array( $this->oProp->sPostType, $aObjectTypes ) ) { |
|
199 | + $aObjectTypes[ ] = $this->oProp->sPostType; |
|
200 | 200 | } |
201 | 201 | register_taxonomy( |
202 | 202 | $sTaxonomySlug, |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function _replyToRemoveTexonomySubmenuPages() { |
236 | 236 | |
237 | - foreach( $this->oProp->aTaxonomyRemoveSubmenuPages as $sSubmenuPageSlug => $sTopLevelPageSlug ) { |
|
237 | + foreach ( $this->oProp->aTaxonomyRemoveSubmenuPages as $sSubmenuPageSlug => $sTopLevelPageSlug ) { |
|
238 | 238 | |
239 | 239 | remove_submenu_page( $sTopLevelPageSlug, $sSubmenuPageSlug ); |
240 | 240 |
@@ -73,7 +73,7 @@ |
||
73 | 73 | 'title' => 'Title', // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from `$_REQUEST[ 'mode' ]`) is 'excerpt', a post excerpt is included between the title and links. |
74 | 74 | 'author' => 'Author', // Post author. |
75 | 75 | 'comments' => '<div class="comment-grey-bubble"></div>', // Number of pending comments. |
76 | - 'date' => 'Date', // The date and publish status of the post. |
|
76 | + 'date' => 'Date', // The date and publish status of the post. |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | /** |
@@ -29,7 +29,7 @@ |
||
29 | 29 | if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
30 | 30 | return self::$_oInstance; |
31 | 31 | |
32 | - self::$aClassNames[] = $oProp->sClassName; |
|
32 | + self::$aClassNames[ ] = $oProp->sClassName; |
|
33 | 33 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_post_type( $oProp, $oMsg ); |
34 | 34 | |
35 | 35 | return self::$_oInstance; |
@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public static function instantiate( $oProp, $oMsg ) { |
28 | 28 | |
29 | - if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
|
30 | - return self::$_oInstance; |
|
29 | + if ( in_array( $oProp->sClassName, self::$aClassNames ) ) { |
|
30 | + return self::$_oInstance; |
|
31 | + } |
|
31 | 32 | |
32 | 33 | self::$aClassNames[] = $oProp->sClassName; |
33 | 34 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_post_type( $oProp, $oMsg ); |
@@ -43,7 +44,8 @@ discard block |
||
43 | 44 | public function _replyToSetPageLoadInfoInFooter() { |
44 | 45 | |
45 | 46 | // Some users set `$_GET[ 'post_type' ]` element even in regular admin pages. In that case, do not load the style to avoid duplicates. |
46 | - if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] ) { // sanitization unnecessary |
|
47 | + if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] ) { |
|
48 | +// sanitization unnecessary |
|
47 | 49 | return; |
48 | 50 | } |
49 | 51 |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | // Call the user constructor. |
172 | - $this->start(); // defined in the controller class. |
|
173 | - $this->oUtil->addAndDoAction( $this, 'start_' . $this->oProp->sClassName, $this ); |
|
172 | + $this->start(); // defined in the controller class. |
|
173 | + $this->oUtil->addAndDoAction( $this, 'start_'.$this->oProp->sClassName, $this ); |
|
174 | 174 | |
175 | 175 | } |
176 | 176 | /** |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | * @return array |
180 | 180 | */ |
181 | 181 | private function ___getSubClassNames() { |
182 | - foreach( $this->_aSubClassPrefixes as $_sObjectVariableName => $_sPrefix ) { |
|
183 | - $this->aSubClassNames[ $_sObjectVariableName ] = $_sPrefix . $this->_sStructureType; |
|
182 | + foreach ( $this->_aSubClassPrefixes as $_sObjectVariableName => $_sPrefix ) { |
|
183 | + $this->aSubClassNames[ $_sObjectVariableName ] = $_sPrefix.$this->_sStructureType; |
|
184 | 184 | } |
185 | 185 | return $this->aSubClassNames + $this->_aSubClassNames; |
186 | 186 | } |
@@ -194,15 +194,15 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function _replyToLoadComponents( /* $oScreen */ ) { |
196 | 196 | |
197 | - if ( ! $this->_isInThePage() ) { |
|
197 | + if ( !$this->_isInThePage() ) { |
|
198 | 198 | return; |
199 | 199 | } |
200 | 200 | |
201 | - if ( ! isset( $this->oResource ) ) { |
|
201 | + if ( !isset( $this->oResource ) ) { |
|
202 | 202 | $this->oResource = $this->_replyTpSetAndGetInstance_oResource(); |
203 | 203 | } |
204 | 204 | |
205 | - if ( ! isset( $this->oLink ) ) { |
|
205 | + if ( !isset( $this->oLink ) ) { |
|
206 | 206 | $this->oLink = $this->_replyTpSetAndGetInstance_oLink(); |
207 | 207 | } |
208 | 208 | |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | * Calls the load method and callbacks. |
217 | 217 | * @since 3.8.14 |
218 | 218 | */ |
219 | - protected function _load( $aActions=array() ) { |
|
219 | + protected function _load( $aActions = array() ) { |
|
220 | 220 | $aActions = empty( $aActions ) |
221 | 221 | ? array( |
222 | - 'load_' . $this->oProp->sClassName, |
|
222 | + 'load_'.$this->oProp->sClassName, |
|
223 | 223 | ) |
224 | 224 | : $aActions; |
225 | 225 | $this->load(); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | protected function _setUp() { |
233 | 233 | $aActions = array( |
234 | - 'set_up_' . $this->oProp->sClassName, |
|
234 | + 'set_up_'.$this->oProp->sClassName, |
|
235 | 235 | ); |
236 | 236 | $this->setUp(); |
237 | 237 | $this->oUtil->addAndDoActions( $this, $aActions, $this ); |
@@ -258,14 +258,14 @@ discard block |
||
258 | 258 | * @since 3.8.19 |
259 | 259 | */ |
260 | 260 | protected function _isWordPressCoreAjaxRequest() { |
261 | - if ( ! isset( $GLOBALS[ 'pagenow' ] ) ) { |
|
261 | + if ( !isset( $GLOBALS[ 'pagenow' ] ) ) { |
|
262 | 262 | return false; |
263 | 263 | } |
264 | 264 | if ( 'admin-ajax.php' !== $GLOBALS[ 'pagenow' ] ) { |
265 | 265 | return false; |
266 | 266 | } |
267 | 267 | return in_array( |
268 | - isset( $_POST[ 'action' ] ) ? $_POST[ 'action' ] : '', // sanitization unnecessary as just checking |
|
268 | + isset( $_POST[ 'action' ] ) ? $_POST[ 'action' ] : '', // sanitization unnecessary as just checking |
|
269 | 269 | array( 'heartbeat', 'closed-postboxes', 'meta-box-order' ), |
270 | 270 | true |
271 | 271 | ); |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @return boolean |
294 | 294 | */ |
295 | 295 | protected function _isValidAjaxReferrer() { |
296 | - if ( ! $this->oProp->bIsAdminAjax ) { |
|
296 | + if ( !$this->oProp->bIsAdminAjax ) { |
|
297 | 297 | return false; |
298 | 298 | } |
299 | 299 | return true; |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function _replyToDetermineToLoad() { |
311 | 311 | |
312 | - if ( ! $this->_isInThePage() ) { |
|
312 | + if ( !$this->_isInThePage() ) { |
|
313 | 313 | return; |
314 | 314 | } |
315 | 315 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | // Set and return the sub class object instance. |
376 | 376 | if ( isset( $this->aSubClassNames[ $sPropertyName ] ) ) { |
377 | 377 | return call_user_func( |
378 | - array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
378 | + array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
379 | 379 | ); |
380 | 380 | } |
381 | 381 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | */ |
410 | 410 | public function _replyTpSetAndGetInstance_oMsg() { |
411 | 411 | $this->oMsg = call_user_func_array( |
412 | - array( $this->aSubClassNames[ 'oMsg' ], 'getInstance'), |
|
412 | + array( $this->aSubClassNames[ 'oMsg' ], 'getInstance' ), |
|
413 | 413 | array( $this->oProp->sTextDomain ) // parameters |
414 | 414 | ); |
415 | 415 | return $this->oMsg; |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | * |
475 | 475 | * @internal |
476 | 476 | */ |
477 | - public function __call( $sMethodName, $aArguments=null ) { |
|
477 | + public function __call( $sMethodName, $aArguments = null ) { |
|
478 | 478 | |
479 | 479 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
480 | 480 | |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | |
505 | 505 | // Check if the method name does not contain a backslash. |
506 | 506 | if ( false === strpos( $sMethodName, "\\" ) ) { |
507 | - return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
507 | + return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | // If the method name contains a backslash, the user may be using a name space. |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | array( $this, $_sAutoCallbackMethodName ), |
516 | 516 | $aArguments |
517 | 517 | ) |
518 | - : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
518 | + : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
519 | 519 | |
520 | 520 | } |
521 | 521 | |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | */ |
526 | 526 | private function _triggerUndefinedMethodWarning( $sMethodName ) { |
527 | 527 | trigger_error( |
528 | - AdminPageFramework_Registry::NAME . ': ' |
|
528 | + AdminPageFramework_Registry::NAME.': ' |
|
529 | 529 | . sprintf( |
530 | 530 | __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ), |
531 | 531 | $sMethodName |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | 'caller_id' => '', |
321 | 321 | 'structure_type' => '', |
322 | 322 | 'action_hook_form_registration' => '', |
323 | - 'autoload_min_resource' => true, // will be overridden by the $bAutoloadMinifiedResource property. |
|
323 | + 'autoload_min_resource' => true, // will be overridden by the $bAutoloadMinifiedResource property. |
|
324 | 324 | ); |
325 | 325 | |
326 | 326 | /** |
@@ -328,14 +328,14 @@ discard block |
||
328 | 328 | * @since 3.7.0 |
329 | 329 | */ |
330 | 330 | public $aFormCallbacks = array( |
331 | - 'hfID' => null, // the input id attribute |
|
332 | - 'hfTagID' => null, // the field container id attribute |
|
333 | - 'hfName' => null, // the field name attribute |
|
334 | - 'hfNameFlat' => null, // the flat field name attribute |
|
331 | + 'hfID' => null, // the input id attribute |
|
332 | + 'hfTagID' => null, // the field container id attribute |
|
333 | + 'hfName' => null, // the field name attribute |
|
334 | + 'hfNameFlat' => null, // the flat field name attribute |
|
335 | 335 | // @todo Document the differences between `hfName` and `hfInputName` |
336 | - 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
337 | - 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
338 | - 'hfClass' => null, // the class attribute |
|
336 | + 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
337 | + 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
338 | + 'hfClass' => null, // the class attribute |
|
339 | 339 | ); |
340 | 340 | |
341 | 341 | /** |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | * @internal |
469 | 469 | */ |
470 | 470 | private function ___getURLQuery() { |
471 | - if ( ! $this->bIsAdminAjax ) { |
|
471 | + if ( !$this->bIsAdminAjax ) { |
|
472 | 472 | return $this->getHTTPQueryGET( array(), array() ); |
473 | 473 | } |
474 | 474 | parse_str( |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | * @since 3.7.9 |
484 | 484 | */ |
485 | 485 | private function ___setGlobals() { |
486 | - if ( ! isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
486 | + if ( !isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
487 | 487 | $GLOBALS[ 'aAdminPageFramework' ] = array( |
488 | 488 | 'aFieldFlags' => array() |
489 | 489 | ); |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | 'action_hook_form_registration' => $this->bIsAdminAjax |
512 | 512 | ? 'admin_init' // 3.8.14 |
513 | 513 | : $this->_sFormRegistrationHook, |
514 | - 'autoload_min_resource' => $this->bAutoloadMinifiedResource, // [3.8.31] |
|
514 | + 'autoload_min_resource' => $this->bAutoloadMinifiedResource, // [3.8.31] |
|
515 | 515 | ) + $this->aFormArguments; |
516 | 516 | } |
517 | 517 | /** |
@@ -555,8 +555,8 @@ discard block |
||
555 | 555 | 'hfTagID' => array( $this->oCaller, '_replyToGetInputTagIDAttribute' ), // the fields & fieldset & field row container id attribute |
556 | 556 | 'hfName' => array( $this->oCaller, '_replyToGetFieldNameAttribute' ), // the input name attribute |
557 | 557 | 'hfNameFlat' => array( $this->oCaller, '_replyToGetFlatFieldName' ), // the flat input name attribute |
558 | - 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
559 | - 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
558 | + 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
559 | + 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
560 | 560 | 'hfClass' => array( $this->oCaller, '_replyToGetInputClassAttribute' ), // the class attribute |
561 | 561 | 'hfSectionName' => array( $this->oCaller, '_replyToGetSectionName' ), // 3.6.0+ |
562 | 562 | ) + $this->aFormCallbacks; |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | * @remark The information can be used to embed into the footer etc. |
631 | 631 | * @return array The information of the script. |
632 | 632 | */ |
633 | - protected function getCallerInfo( $sCallerPath='' ) { |
|
633 | + protected function getCallerInfo( $sCallerPath = '' ) { |
|
634 | 634 | |
635 | 635 | if ( isset( self::$_aScriptDataCaches[ $sCallerPath ] ) ) { |
636 | 636 | return self::$_aScriptDataCaches[ $sCallerPath ]; |
@@ -748,11 +748,11 @@ discard block |
||
748 | 748 | |
749 | 749 | // 3.7.9 Moved from the constructor to make it lighter. |
750 | 750 | if ( 'sClassHash' === $sName ) { |
751 | - $this->sClassHash = md5( $this->sClassName ); |
|
751 | + $this->sClassHash = md5( $this->sClassName ); |
|
752 | 752 | return $this->sClassHash; |
753 | 753 | } |
754 | 754 | if ( 'sScriptType' === $sName ) { |
755 | - $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
755 | + $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
756 | 756 | return $this->sScriptType; |
757 | 757 | } |
758 | 758 | if ( 'oUtil' === $sName ) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @return string |
41 | 41 | */ |
42 | 42 | private function _getTransientKey() { |
43 | - return 'apf_ntc_' . get_current_user_id(); |
|
43 | + return 'apf_ntc_'.get_current_user_id(); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | * @param string $sType If empty, the method will check if a message exists in all types. Otherwise, it checks the existence of a message of the specified type. |
53 | 53 | * @return boolean True if a setting notice is set; otherwise, false. |
54 | 54 | */ |
55 | - public function hasNotice( $sType='' ) { |
|
55 | + public function hasNotice( $sType = '' ) { |
|
56 | 56 | |
57 | - if ( ! $sType ) { |
|
57 | + if ( !$sType ) { |
|
58 | 58 | return ( boolean ) count( self::$_aNotices ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | // Check if there is a message of the type. |
62 | - foreach( self::$_aNotices as $_aNotice ) { |
|
62 | + foreach ( self::$_aNotices as $_aNotice ) { |
|
63 | 63 | $_sClassAttribute = $this->getElement( |
64 | 64 | $_aNotice, |
65 | 65 | array( |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
99 | 99 | * @return void |
100 | 100 | */ |
101 | - public function set( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
|
101 | + public function set( $sMessage, $sType = 'error', $asAttributes = array(), $bOverride = true ) { |
|
102 | 102 | |
103 | 103 | // If the array is empty, schedule the task of saving the array at shutdown. |
104 | 104 | if ( empty( self::$_aNotices ) ) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $_sID = md5( trim( $sMessage ) ); |
109 | 109 | |
110 | 110 | // If the override is false and a message is already set, do not add. |
111 | - if ( ! $bOverride && isset( self::$_aNotices[ $_sID ] ) ) { |
|
111 | + if ( !$bOverride && isset( self::$_aNotices[ $_sID ] ) ) { |
|
112 | 112 | return; |
113 | 113 | } |
114 | 114 | |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | $_aAttributes = $this->getAsArray( $asAttributes ); |
121 | - if ( is_string( $asAttributes ) && ! empty( $asAttributes ) ) { |
|
121 | + if ( is_string( $asAttributes ) && !empty( $asAttributes ) ) { |
|
122 | 122 | $_aAttributes[ 'id' ] = $asAttributes; |
123 | 123 | } |
124 | 124 | self::$_aNotices[ $_sID ] = array( |
125 | 125 | 'sMessage' => $sMessage, |
126 | 126 | 'aAttributes' => $_aAttributes + array( |
127 | 127 | 'class' => $sType, |
128 | - 'id' => 'form_submit_notice_' . $_sID, |
|
128 | + 'id' => 'form_submit_notice_'.$_sID, |
|
129 | 129 | ), |
130 | 130 | ); |
131 | 131 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | // By setting false to the 'settings-notice' key, it's possible to disable the notifications set with the framework. |
169 | - if ( isset( $_GET[ 'settings-notice' ] ) && ! $_GET[ 'settings-notice' ] ) { // sanitization unnecessary |
|
169 | + if ( isset( $_GET[ 'settings-notice' ] ) && !$_GET[ 'settings-notice' ] ) { // sanitization unnecessary |
|
170 | 170 | return; |
171 | 171 | } |
172 | 172 |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @return void |
142 | 142 | */ |
143 | 143 | public function _replyToSaveNotices() { |
144 | - if ( empty( self::$_aNotices ) ) { |
|
144 | + if ( empty( self::$_aNotices ) ) { |
|
145 | 145 | return; |
146 | 146 | } |
147 | 147 | $_bResult = $this->setTransient( |
@@ -161,12 +161,13 @@ discard block |
||
161 | 161 | |
162 | 162 | // Retrieve the notifications set in a transient. |
163 | 163 | $_aNotices = $this->_getNotices(); |
164 | - if ( false === $_aNotices ) { |
|
164 | + if ( false === $_aNotices ) { |
|
165 | 165 | return; |
166 | 166 | } |
167 | 167 | |
168 | 168 | // By setting false to the 'settings-notice' key, it's possible to disable the notifications set with the framework. |
169 | - if ( isset( $_GET[ 'settings-notice' ] ) && ! $_GET[ 'settings-notice' ] ) { // sanitization unnecessary |
|
169 | + if ( isset( $_GET[ 'settings-notice' ] ) && ! $_GET[ 'settings-notice' ] ) { |
|
170 | +// sanitization unnecessary |
|
170 | 171 | return; |
171 | 172 | } |
172 | 173 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $_sPageSlug = $this->getHTTPQueryGET( 'page', '' ); |
57 | 57 | $_sTabSlug = $this->getHTTPQueryGET( '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 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $_sPageSlug = $this->getHTTPQueryGET( 'page', '' ); |
46 | 46 | $_sTabSlug = $this->getHTTPQueryGET( 'tab', '' ); |
47 | 47 | $_sUserID = get_current_user_id(); |
48 | - return "apf_fe_" . md5( |
|
48 | + return "apf_fe_".md5( |
|
49 | 49 | $this->getPageNow() |
50 | 50 | . $_sPageSlug |
51 | 51 | . $_sTabSlug |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | public function get() { |
134 | 134 | |
135 | 135 | // Use a cache if exists. |
136 | - self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
136 | + self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
137 | 137 | ? self::$_aFieldErrorCaches[ $this->sTransientKey ] |
138 | 138 | : $this->getTransient( $this->sTransientKey ); |
139 | 139 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @since 3.7.0 |
151 | 151 | */ |
152 | 152 | public function delete() { |
153 | - if ( $this->hasBeenCalled( 'delete_' . $this->sTransientKey ) ) { |
|
153 | + if ( $this->hasBeenCalled( 'delete_'.$this->sTransientKey ) ) { |
|
154 | 154 | return; |
155 | 155 | } |
156 | 156 | add_action( 'shutdown', array( $this, '_replyToDelete' ) ); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | array( $this, '_replyToRegisterFormItems' ), |
47 | 47 | 100 // priority - low value is set as meta boxes use the `current_screen` action hook for `setUp()`. |
48 | 48 | ); |
49 | - } else { |
|
49 | + } else { |
|
50 | 50 | add_action( |
51 | 51 | $this->aArguments[ 'action_hook_form_registration' ], |
52 | 52 | array( $this, '_replyToRegisterFormItems' ) |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * Changed the name from `getFieldsModel()`. |
161 | 161 | * @return array |
162 | 162 | */ |
163 | - public function getDataStructureFromAddedFieldsets() { |
|
163 | + public function getDataStructureFromAddedFieldsets() { |
|
164 | 164 | |
165 | 165 | $_aFormDataStructure = array(); |
166 | 166 | foreach ( $this->getAsArray( $this->aFieldsets ) as $_sSectionID => $_aFieldsets ) { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @param array $aSubject The subject array to modify. Usually the saved option data. |
199 | 199 | * @return array The modified options array. |
200 | 200 | */ |
201 | - public function dropRepeatableElements( array $aSubject ) { |
|
201 | + public function dropRepeatableElements( array $aSubject ) { |
|
202 | 202 | $_oFilterRepeatableElements = new AdminPageFramework_Form_Model___Modifier_FilterRepeatableElements( |
203 | 203 | $aSubject, |
204 | 204 | $this->getHTTPRequestSanitized( $this->getElementAsArray( |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * @return array |
65 | 65 | * @since 3.7.0 |
66 | 66 | */ |
67 | - public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure=true, $bStripSlashes=true ) { |
|
67 | + public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure = true, $bStripSlashes = true ) { |
|
68 | 68 | |
69 | 69 | // Extracts the form data from the subject data for parsing |
70 | - $_aSubmittedFormData = $bExtractFromFieldStructure |
|
70 | + $_aSubmittedFormData = $bExtractFromFieldStructure |
|
71 | 71 | ? $this->castArrayContents( |
72 | 72 | $this->getDataStructureFromAddedFieldsets(), // form data (options) structure |
73 | 73 | $aDataToParse // the subject data array, usually `$_POST`. |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | array_merge( |
96 | 96 | $this->getElementAsArray( |
97 | 97 | $_POST, // sanitization done |
98 | - '__repeatable_elements_' . $this->aArguments[ 'structure_type' ], |
|
98 | + '__repeatable_elements_'.$this->aArguments[ 'structure_type' ], |
|
99 | 99 | array() |
100 | 100 | ), |
101 | 101 | $this->getElementAsArray( |
102 | 102 | $_POST, // sanitization done |
103 | - '__sortable_elements_' . $this->aArguments[ 'structure_type' ], |
|
103 | + '__sortable_elements_'.$this->aArguments[ 'structure_type' ], |
|
104 | 104 | array() |
105 | 105 | ) |
106 | 106 | ) |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | * Changed the name from `getFieldsModel()`. |
161 | 161 | * @return array |
162 | 162 | */ |
163 | - public function getDataStructureFromAddedFieldsets() { |
|
163 | + public function getDataStructureFromAddedFieldsets() { |
|
164 | 164 | |
165 | - $_aFormDataStructure = array(); |
|
165 | + $_aFormDataStructure = array(); |
|
166 | 166 | foreach ( $this->getAsArray( $this->aFieldsets ) as $_sSectionID => $_aFieldsets ) { |
167 | 167 | |
168 | 168 | if ( $_sSectionID !== '_default' ) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | // For default field items. |
174 | - foreach( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
174 | + foreach ( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
175 | 175 | $_aFormDataStructure[ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
176 | 176 | } |
177 | 177 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $aSubject, |
204 | 204 | $this->getHTTPRequestSanitized( $this->getElementAsArray( |
205 | 205 | $_POST, // sanitization done |
206 | - '__repeatable_elements_' . $this->aArguments[ 'structure_type' ] |
|
206 | + '__repeatable_elements_'.$this->aArguments[ 'structure_type' ] |
|
207 | 207 | ) ) |
208 | 208 | ); |
209 | 209 | return $_oFilterRepeatableElements->get(); |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | public function _replyToRegisterFormItems() { |
217 | 217 | |
218 | 218 | // Check if the form should be created or not. |
219 | - if ( ! $this->isInThePage() ) { |
|
219 | + if ( !$this->isInThePage() ) { |
|
220 | 220 | return; |
221 | 221 | } |
222 | 222 | |
223 | 223 | // Load field type definitions. |
224 | - $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
225 | - $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
224 | + $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
225 | + $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
226 | 226 | |
227 | 227 | // Set the options array |
228 | 228 | $this->aSavedData = $this->_getSavedData( |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $this->aArguments, |
251 | 251 | $this->aFieldsets, |
252 | 252 | self::$_aResources, |
253 | - $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
253 | + $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
254 | 254 | $this->aCallbacks, |
255 | 255 | $this->oMsg |
256 | 256 | ); |
@@ -268,10 +268,10 @@ discard block |
||
268 | 268 | $this->callBack( |
269 | 269 | $this->aCallbacks[ 'handle_form_data' ], |
270 | 270 | array( |
271 | - $this->aSavedData, // 1st parameter |
|
272 | - $this->aArguments, // 2nd parameter |
|
273 | - $this->aSectionsets, // 3rd parameter |
|
274 | - $this->aFieldsets, // 4th parameter |
|
271 | + $this->aSavedData, // 1st parameter |
|
272 | + $this->aArguments, // 2nd parameter |
|
273 | + $this->aSectionsets, // 3rd parameter |
|
274 | + $this->aFieldsets, // 4th parameter |
|
275 | 275 | ) |
276 | 276 | ); |
277 | 277 | |
@@ -285,15 +285,15 @@ discard block |
||
285 | 285 | $this->aSectionsets = $this->callBack( |
286 | 286 | $this->aCallbacks[ 'sectionsets_before_registration' ], |
287 | 287 | array( |
288 | - $this->aSectionsets, // 1st parameter |
|
288 | + $this->aSectionsets, // 1st parameter |
|
289 | 289 | ) |
290 | 290 | ); |
291 | 291 | // Let the main routine modify the fieldsets definition array. |
292 | 292 | $this->aFieldsets = $this->callBack( |
293 | 293 | $this->aCallbacks[ 'fieldsets_before_registration' ], |
294 | 294 | array( |
295 | - $this->aFieldsets, // 1st parameter |
|
296 | - $this->aSectionsets, // 2nd parameter |
|
295 | + $this->aFieldsets, // 1st parameter |
|
296 | + $this->aSectionsets, // 2nd parameter |
|
297 | 297 | ) |
298 | 298 | ); |
299 | 299 |