@@ -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 ) { |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
84 | 84 | 'check_max_input_vars' => 'Not all form fields could not be sent. ' |
85 | 85 | . 'Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. ' |
86 | - . '<code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ // sanitization unnecessary as it is just a literal string |
|
87 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
88 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated, 3.8.32 Re-added |
|
86 | + . '<code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ // sanitization unnecessary as it is just a literal string |
|
87 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
88 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated, 3.8.32 Re-added |
|
89 | 89 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+, 3.8.32 deprecated |
90 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
90 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
91 | 91 | |
92 | 92 | // AdminPageFramework_PostType |
93 | 93 | 'title' => 'Title', |
@@ -114,14 +114,14 @@ discard block |
||
114 | 114 | 'upload_file' => 'Upload File', |
115 | 115 | 'use_this_file' => 'Use This File', |
116 | 116 | 'select_file' => 'Select File', |
117 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
118 | - 'select_all' => 'Select All', // 3.3.0+ |
|
119 | - 'select_none' => 'Select None', // 3.3.0+ |
|
117 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
118 | + 'select_all' => 'Select All', // 3.3.0+ |
|
119 | + 'select_none' => 'Select None', // 3.3.0+ |
|
120 | 120 | 'no_term_found' => 'No term found.', // 3.3.2+ |
121 | 121 | |
122 | 122 | // AdminPageFramework_Form_View___Script_{...} |
123 | 123 | 'select' => 'Select', // 3.4.2+ |
124 | - 'insert' => 'Insert', // 3.4.2+ |
|
124 | + 'insert' => 'Insert', // 3.4.2+ |
|
125 | 125 | 'use_this' => 'Use This', // 3.4.2+ |
126 | 126 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
127 | 127 | |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | |
134 | 134 | // Repeatable sections & fields |
135 | 135 | 'repeatable_section_is_disabled' => 'The ability to repeat sections is disabled.', // 3.8.13+ |
136 | - 'repeatable_field_is_disabled' => 'The ability to repeat fields is disabled.', // 3.8.13+ |
|
137 | - 'warning_caption' => 'Warning', // 3.8.13+ |
|
136 | + 'repeatable_field_is_disabled' => 'The ability to repeat fields is disabled.', // 3.8.13+ |
|
137 | + 'warning_caption' => 'Warning', // 3.8.13+ |
|
138 | 138 | |
139 | 139 | // AdminPageFramework_FormField |
140 | 140 | 'allowed_maximum_number_of_fields' => 'The allowed maximum number of fields is {0}.', |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @remark This class should be instantiated via this method. |
217 | 217 | * @return AdminPageFramework_Message |
218 | 218 | */ |
219 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
219 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
220 | 220 | |
221 | 221 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
222 | 222 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
230 | 230 | * @deprecated 3.2.0 |
231 | 231 | */ |
232 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
232 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
233 | 233 | return self::getInstance( $sTextDomain ); |
234 | 234 | } |
235 | 235 | |
@@ -237,14 +237,14 @@ discard block |
||
237 | 237 | * Sets up properties. |
238 | 238 | * @param string $sTextDomain |
239 | 239 | */ |
240 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
240 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
241 | 241 | |
242 | 242 | $this->_sTextDomain = $sTextDomain; |
243 | 243 | |
244 | 244 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
245 | 245 | // with the value of null. The null is set to let it trigger the __get() method |
246 | 246 | // so that each translation item gets processed individually. |
247 | - $this->aMessages = array_fill_keys( |
|
247 | + $this->aMessages = array_fill_keys( |
|
248 | 248 | array_keys( $this->aDefaults ), |
249 | 249 | null |
250 | 250 | ); |
@@ -279,13 +279,13 @@ discard block |
||
279 | 279 | * @param string $sKey |
280 | 280 | * @return string|array |
281 | 281 | */ |
282 | - public function get( $sKey='' ) { |
|
283 | - if ( ! $sKey ) { |
|
282 | + public function get( $sKey = '' ) { |
|
283 | + if ( !$sKey ) { |
|
284 | 284 | return $this->_getAllMessages(); |
285 | 285 | } |
286 | 286 | return isset( $this->aMessages[ $sKey ] ) |
287 | 287 | ? __( $this->aMessages[ $sKey ], $this->_sTextDomain ) |
288 | - : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
288 | + : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
289 | 289 | } |
290 | 290 | /** |
291 | 291 | * Returns the all registered messag items. |
@@ -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 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'getPostTypeByTypeNow', |
57 | 57 | 'getPostTypeByScreenObject', |
58 | 58 | 'getPostTypeByREQUEST', |
59 | - 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
59 | + 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
60 | 60 | ); |
61 | 61 | foreach ( $_aMethodsToTry as $_sMethodName ) { |
62 | 62 | $_sPostType = call_user_func( array( __CLASS__, $_sMethodName ) ); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | if ( isset( $_GET[ 'post' ] ) && $_GET[ 'post' ] ) { // sanitization unnecessary |
98 | 98 | // It will perform a database query. |
99 | - return get_post_type( absint( self::getHTTPQueryGET( 'post', 0 ) ) ); // sanitization done |
|
99 | + return get_post_type( absint( self::getHTTPQueryGET( 'post', 0 ) ) ); // sanitization done |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | * @param array|string The post type slug(s) to check. If this is empty, the method just checks the current page is a taxonomy page. |
121 | 121 | * @return boolean |
122 | 122 | */ |
123 | - static public function isCustomTaxonomyPage( $asPostTypes=array() ) { |
|
123 | + static public function isCustomTaxonomyPage( $asPostTypes = array() ) { |
|
124 | 124 | |
125 | - if ( ! in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) { |
|
125 | + if ( !in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) { |
|
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | return self::isCurrentPostTypeIn( $asPostTypes ); |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | * Otherwise, it will check if the page belongs to the given post type(s). |
138 | 138 | * @return boolean |
139 | 139 | */ |
140 | - static public function isPostDefinitionPage( $asPostTypes=array() ) { |
|
140 | + static public function isPostDefinitionPage( $asPostTypes = array() ) { |
|
141 | 141 | |
142 | 142 | // If it's not the post definition page, |
143 | - if ( ! in_array( self::getPageNow(), array( 'post.php', 'post-new.php', ) ) ) { |
|
143 | + if ( !in_array( self::getPageNow(), array( 'post.php', 'post-new.php',) ) ) { |
|
144 | 144 | return false; |
145 | 145 | } |
146 | 146 | return self::isCurrentPostTypeIn( $asPostTypes ); |
@@ -173,17 +173,17 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @since 3.0.0 |
175 | 175 | */ |
176 | - static public function isPostListingPage( $asPostTypes=array() ) { |
|
176 | + static public function isPostListingPage( $asPostTypes = array() ) { |
|
177 | 177 | |
178 | 178 | if ( 'edit.php' != self::getPageNow() ) { |
179 | 179 | return false; |
180 | 180 | } |
181 | 181 | |
182 | 182 | $_aPostTypes = self::getAsArray( $asPostTypes ); |
183 | - if ( ! isset( $_GET[ 'post_type' ] ) ) { // sanitization unnecessary |
|
183 | + if ( !isset( $_GET[ 'post_type' ] ) ) { // sanitization unnecessary |
|
184 | 184 | return in_array( 'post', $_aPostTypes, true ); |
185 | 185 | } |
186 | - return in_array( $_GET[ 'post_type' ], $_aPostTypes, true ); // sanitization unnecessary |
|
186 | + return in_array( $_GET[ 'post_type' ], $_aPostTypes, true ); // sanitization unnecessary |
|
187 | 187 | |
188 | 188 | } |
189 | 189 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | 0 => '_getPageNow_FrontEnd', |
218 | 218 | 1 => '_getPageNow_BackEnd', |
219 | 219 | ); |
220 | - $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
220 | + $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
221 | 221 | self::$_sPageNow = self::$_sMethodName(); |
222 | 222 | return self::$_sPageNow; |
223 | 223 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | if ( isset( $GLBOALS[ 'page_hook' ] ) ) { |
314 | 314 | return is_network_admin() |
315 | - ? $GLBOALS[ 'page_hook' ] . '-network' |
|
315 | + ? $GLBOALS[ 'page_hook' ].'-network' |
|
316 | 316 | : $GLBOALS[ 'page_hook' ]; |
317 | 317 | } |
318 | 318 | |
@@ -326,11 +326,11 @@ discard block |
||
326 | 326 | * @since 3.7.0 |
327 | 327 | * @return boolean |
328 | 328 | */ |
329 | - static public function doesMetaBoxExist( $sContext='' ) { |
|
329 | + static public function doesMetaBoxExist( $sContext = '' ) { |
|
330 | 330 | |
331 | 331 | $_aDimensions = array( 'wp_meta_boxes', $GLOBALS[ 'page_hook' ] ); |
332 | 332 | if ( $sContext ) { |
333 | - $_aDimensions[] = $sContext; |
|
333 | + $_aDimensions[ ] = $sContext; |
|
334 | 334 | } |
335 | 335 | $_aSideMetaBoxes = self::getElementAsArray( |
336 | 336 | $GLOBALS, |
@@ -91,10 +91,12 @@ discard block |
||
91 | 91 | * Tries to find the post type from the URL query for type. |
92 | 92 | */ |
93 | 93 | static public function getPostTypeByREQUEST() { |
94 | - if ( isset( $_REQUEST[ 'post_type' ] ) ) { // sanitization unnecessary |
|
94 | + if ( isset( $_REQUEST[ 'post_type' ] ) ) { |
|
95 | +// sanitization unnecessary |
|
95 | 96 | return sanitize_key( sanitize_text_field( $_REQUEST[ 'post_type' ] ) ); // sanitization done |
96 | 97 | } |
97 | - if ( isset( $_GET[ 'post' ] ) && $_GET[ 'post' ] ) { // sanitization unnecessary |
|
98 | + if ( isset( $_GET[ 'post' ] ) && $_GET[ 'post' ] ) { |
|
99 | +// sanitization unnecessary |
|
98 | 100 | // It will perform a database query. |
99 | 101 | return get_post_type( absint( self::getHTTPQueryGET( 'post', 0 ) ) ); // sanitization done |
100 | 102 | } |
@@ -180,7 +182,8 @@ discard block |
||
180 | 182 | } |
181 | 183 | |
182 | 184 | $_aPostTypes = self::getAsArray( $asPostTypes ); |
183 | - if ( ! isset( $_GET[ 'post_type' ] ) ) { // sanitization unnecessary |
|
185 | + if ( ! isset( $_GET[ 'post_type' ] ) ) { |
|
186 | +// sanitization unnecessary |
|
184 | 187 | return in_array( 'post', $_aPostTypes, true ); |
185 | 188 | } |
186 | 189 | return in_array( $_GET[ 'post_type' ], $_aPostTypes, true ); // sanitization unnecessary |
@@ -270,11 +273,9 @@ discard block |
||
270 | 273 | |
271 | 274 | if ( is_network_admin() ) { |
272 | 275 | $_sNeedle = '#/wp-admin/network/?(.*?)$#i'; |
273 | - } |
|
274 | - else if ( is_user_admin() ) { |
|
276 | + } else if ( is_user_admin() ) { |
|
275 | 277 | $_sNeedle = '#/wp-admin/user/?(.*?)$#i'; |
276 | - } |
|
277 | - else { |
|
278 | + } else { |
|
278 | 279 | $_sNeedle = '#/wp-admin/?(.*?)$#i'; |
279 | 280 | } |
280 | 281 | preg_match( $_sNeedle, $_SERVER[ 'PHP_SELF' ], $_aMatches ); |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | * @return string|array |
30 | 30 | * @since 3.8.32 |
31 | 31 | */ |
32 | - static public function getHTTPQueryGET( $asKeys=array(), $mDefault=null ) { |
|
32 | + static public function getHTTPQueryGET( $asKeys = array(), $mDefault = null ) { |
|
33 | 33 | self::$___aGET = isset( self::$___aGET ) |
34 | 34 | ? self::$___aGET |
35 | - : self::getArrayMappedRecursive( 'sanitize_text_field', $_GET ); // sanitization done |
|
35 | + : self::getArrayMappedRecursive( 'sanitize_text_field', $_GET ); // sanitization done |
|
36 | 36 | if ( empty( $asKeys ) ) { |
37 | 37 | return self::$___aGET; |
38 | 38 | } |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | $sPageURL = 'on' == @$_SERVER[ "HTTPS" ] ? "https://" : "http://"; |
52 | 52 | |
53 | 53 | if ( "80" != $_SERVER[ "SERVER_PORT" ] ) { |
54 | - $sPageURL .= $_SERVER[ "SERVER_NAME" ] . ":" . $_SERVER[ "SERVER_PORT" ] . $sRequestURI; |
|
54 | + $sPageURL .= $_SERVER[ "SERVER_NAME" ].":".$_SERVER[ "SERVER_PORT" ].$sRequestURI; |
|
55 | 55 | } else { |
56 | - $sPageURL .= $_SERVER[ "SERVER_NAME" ] . $sRequestURI; |
|
56 | + $sPageURL .= $_SERVER[ "SERVER_NAME" ].$sRequestURI; |
|
57 | 57 | } |
58 | 58 | return $sPageURL; |
59 | 59 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param string $sSubjectURL ( optional ) The subject url to modify |
71 | 71 | * @return string The modified url. |
72 | 72 | */ |
73 | - static public function getQueryAdminURL( $aAddingQueries=array(), $aRemovingQueryKeys=array(), $sSubjectURL='' ) { |
|
73 | + static public function getQueryAdminURL( $aAddingQueries = array(), $aRemovingQueryKeys = array(), $sSubjectURL = '' ) { |
|
74 | 74 | |
75 | 75 | $_sAdminURL = is_network_admin() |
76 | 76 | ? network_admin_url( AdminPageFramework_WPUtility_Page::getPageNow() ) |
@@ -116,16 +116,16 @@ discard block |
||
116 | 116 | * @remark The parsable path is limited to under the WP_CONTENT_DIR directory. |
117 | 117 | */ |
118 | 118 | static public function getSRCFromPath( $sFilePath ) { |
119 | - $sFilePath = str_replace('\\', '/', $sFilePath ); |
|
120 | - $_sContentDirPath = str_replace('\\', '/', WP_CONTENT_DIR ); |
|
119 | + $sFilePath = str_replace( '\\', '/', $sFilePath ); |
|
120 | + $_sContentDirPath = str_replace( '\\', '/', WP_CONTENT_DIR ); |
|
121 | 121 | if ( false !== strpos( $sFilePath, $_sContentDirPath ) ) { |
122 | - $_sRelativePath = AdminPageFramework_Utility::getRelativePath( WP_CONTENT_DIR , $sFilePath ); |
|
123 | - $_sRelativePath = preg_replace("/^\.[\/\\\]/", '', $_sRelativePath, 1 ); |
|
122 | + $_sRelativePath = AdminPageFramework_Utility::getRelativePath( WP_CONTENT_DIR, $sFilePath ); |
|
123 | + $_sRelativePath = preg_replace( "/^\.[\/\\\]/", '', $_sRelativePath, 1 ); |
|
124 | 124 | return content_url( $_sRelativePath ); |
125 | 125 | } |
126 | - $_sRelativePath = AdminPageFramework_Utility::getRelativePath( ABSPATH , $sFilePath ); |
|
127 | - $_sRelativePath = preg_replace("/^\.[\/\\\]/", '', $_sRelativePath, 1 ); |
|
128 | - return trailingslashit( get_bloginfo( 'url' ) ) . $_sRelativePath; |
|
126 | + $_sRelativePath = AdminPageFramework_Utility::getRelativePath( ABSPATH, $sFilePath ); |
|
127 | + $_sRelativePath = preg_replace( "/^\.[\/\\\]/", '', $_sRelativePath, 1 ); |
|
128 | + return trailingslashit( get_bloginfo( 'url' ) ).$_sRelativePath; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | * @param string $sSRC |
142 | 142 | * @param boolean $bReturnNullIfNotExist |
143 | 143 | */ |
144 | - static public function getResolvedSRC( $sSRC, $bReturnNullIfNotExist=false ) { |
|
144 | + static public function getResolvedSRC( $sSRC, $bReturnNullIfNotExist = false ) { |
|
145 | 145 | |
146 | - if ( ! self::isResourcePath( $sSRC ) ) { |
|
146 | + if ( !self::isResourcePath( $sSRC ) ) { |
|
147 | 147 | return $bReturnNullIfNotExist |
148 | 148 | ? null |
149 | 149 | : $sSRC; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | // If the file exists, it means it is an absolute path. If so, calculate the URL from the path. |
158 | 158 | if ( file_exists( realpath( $sSRC ) ) ) { |
159 | - return self::getSRCFromPath( $sSRC ); // url escaping is done in the method |
|
159 | + return self::getSRCFromPath( $sSRC ); // url escaping is done in the method |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | if ( $bReturnNullIfNotExist ) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @param boolean $bReturnNullIfNotExist |
174 | 174 | * @return string |
175 | 175 | */ |
176 | - static public function resolveSRC( $sSRC, $bReturnNullIfNotExist=false ) { |
|
176 | + static public function resolveSRC( $sSRC, $bReturnNullIfNotExist = false ) { |
|
177 | 177 | return self::getResolvedSRC( $sSRC, $bReturnNullIfNotExist ); |
178 | 178 | } |
179 | 179 |