@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // Property object |
134 | 134 | $this->oProp = $oProp; |
135 | 135 | |
136 | - if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
|
136 | + if ( $this->oProp->bIsAdmin && !$this->oProp->bIsAdminAjax ) { |
|
137 | 137 | add_action( 'current_screen', array( $this, '_replyToLoadComponents' ) ); |
138 | 138 | } |
139 | 139 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $this->oLink = $this->oLink; |
157 | 157 | } |
158 | 158 | |
159 | - if ( ! $this->_isInThePage() ) { |
|
159 | + if ( !$this->_isInThePage() ) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
@@ -239,10 +239,10 @@ discard block |
||
239 | 239 | return null; |
240 | 240 | } |
241 | 241 | return $this->_getInstanceByMap( |
242 | - $this->_aFormElementClassNameMap, // map |
|
243 | - $oProp->sFieldsType, // key |
|
244 | - $oProp->sFieldsType, // parameter 1 |
|
245 | - $oProp->sCapability, // parameter 2 |
|
242 | + $this->_aFormElementClassNameMap, // map |
|
243 | + $oProp->sFieldsType, // key |
|
244 | + $oProp->sFieldsType, // parameter 1 |
|
245 | + $oProp->sCapability, // parameter 2 |
|
246 | 246 | $this // parameter 3 |
247 | 247 | ); |
248 | 248 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | 'network_admin_page' => 'AdminPageFramework_HelpPane_Page', |
282 | 282 | 'post_meta_box' => 'AdminPageFramework_HelpPane_MetaBox', |
283 | 283 | 'page_meta_box' => 'AdminPageFramework_HelpPane_MetaBox_Page', |
284 | - 'post_type' => null, // no help pane class for the post type factory class. |
|
284 | + 'post_type' => null, // no help pane class for the post type factory class. |
|
285 | 285 | 'taxonomy' => 'AdminPageFramework_HelpPane_TaxonomyField', |
286 | 286 | 'widget' => 'AdminPageFramework_HelpPane_Widget', |
287 | 287 | 'user_meta' => 'AdminPageFramework_HelpPane_UserMeta', |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | protected function _getPageLoadInfoInstance( $oProp, $oMsg ) { |
344 | 344 | |
345 | - if ( ! isset( $this->_aPageLoadClassNameMap[ $oProp->sFieldsType ] ) ) { |
|
345 | + if ( !isset( $this->_aPageLoadClassNameMap[ $oProp->sFieldsType ] ) ) { |
|
346 | 346 | return null; |
347 | 347 | } |
348 | 348 | $_sClassName = $this->_aPageLoadClassNameMap[ $oProp->sFieldsType ]; |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $_aClassNameMap = array_shift( $_aParams ); |
365 | 365 | $_sKey = array_shift( $_aParams ); |
366 | 366 | |
367 | - if ( ! isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
367 | + if ( !isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
368 | 368 | return null; |
369 | 369 | } |
370 | 370 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | */ |
429 | 429 | public function __get( $sPropertyName ) { |
430 | 430 | |
431 | - switch( $sPropertyName ) { |
|
431 | + switch ( $sPropertyName ) { |
|
432 | 432 | case 'oHeadTag': // 3.3.0+ for backward compatibility |
433 | 433 | $sPropertyName = 'oResource'; |
434 | 434 | break; |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | // Set and return the sub class object instance. |
438 | 438 | if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
439 | 439 | return call_user_func( |
440 | - array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
440 | + array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
441 | 441 | ); |
442 | 442 | } |
443 | 443 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | * |
519 | 519 | * @internal |
520 | 520 | */ |
521 | - public function __call( $sMethodName, $aArgs=null ) { |
|
521 | + public function __call( $sMethodName, $aArgs = null ) { |
|
522 | 522 | |
523 | 523 | $_mFirstArg = $this->oUtil->getElement( $aArgs, 0 ); |
524 | 524 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | } |
545 | 545 | |
546 | 546 | trigger_error( |
547 | - 'Admin Page Framework: ' . ' : ' . sprintf( |
|
547 | + 'Admin Page Framework: '.' : '.sprintf( |
|
548 | 548 | __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ), |
549 | 549 | $sMethodName |
550 | 550 | ), |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $this->oLink = $this->oLink; |
157 | 157 | } |
158 | 158 | |
159 | - if ( ! $this->_isInThePage() ) { |
|
159 | + if ( ! $this->_isInThePage() ) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | } |
436 | 436 | |
437 | 437 | // Set and return the sub class object instance. |
438 | - if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
|
438 | + if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
|
439 | 439 | return call_user_func( |
440 | 440 | array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
441 | 441 | ); |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | * |
519 | 519 | * @internal |
520 | 520 | */ |
521 | - public function __call( $sMethodName, $aArgs=null ) { |
|
521 | + public function __call( $sMethodName, $aArgs=null ) { |
|
522 | 522 | |
523 | 523 | $_mFirstArg = $this->oUtil->getElement( $aArgs, 0 ); |
524 | 524 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // since meta boxes cannot detect the current post type if it loaded too early. |
33 | 33 | $this->oProp->aFieldCallbacks = $this->_getFormElementCallbacks(); |
34 | 34 | |
35 | - if ( ! $this->_isInThePage() ) { |
|
35 | + if ( !$this->_isInThePage() ) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | if ( $this->oProp->bIsAdminAjax ) { |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | 'hfTagID' => array( $this, '_replyToGetInputTagIDAttribute' ), // the fields & fieldset & field row container id attribute |
64 | 64 | 'hfName' => array( $this, '_replyToGetFieldNameAttribute' ), // the input name attribute |
65 | 65 | 'hfNameFlat' => array( $this, '_replyToGetFlatFieldName' ), // the flat input name attribute |
66 | - 'hfInputName' => array( $this, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
67 | - 'hfInputNameFlat' => array( $this, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
66 | + 'hfInputName' => array( $this, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
67 | + 'hfInputNameFlat' => array( $this, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
68 | 68 | 'hfClass' => array( $this, '_replyToGetInputClassAttribute' ), // the class attribute |
69 | 69 | 'hfSectionName' => array( $this, '_replyToGetSectionName' ), // 3.6.0+ |
70 | 70 | ) + $this->oProp->aFieldCallbacks; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @return string the input id attribute |
78 | 78 | */ |
79 | 79 | public function _replyToGetSectionName( /* $sSectionName, $aSectionset */ ) { |
80 | - $_aParams = func_get_args() + array( null, null, ); |
|
80 | + $_aParams = func_get_args() + array( null, null,); |
|
81 | 81 | return $_aParams[ 0 ]; |
82 | 82 | } |
83 | 83 | |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | * @since 3.6.0 |
106 | 106 | * @return string |
107 | 107 | */ |
108 | - public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
109 | - $_aParams = func_get_args() + array( null, null, ); |
|
108 | + public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
109 | + $_aParams = func_get_args() + array( null, null,); |
|
110 | 110 | return $_aParams[ 0 ]; |
111 | 111 | } |
112 | 112 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @return string |
117 | 117 | */ |
118 | 118 | public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
119 | - $_aParams = func_get_args() + array( null, null, ); |
|
119 | + $_aParams = func_get_args() + array( null, null,); |
|
120 | 120 | return $_aParams[ 0 ]; |
121 | 121 | } |
122 | 122 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @return string the flat input name attribute |
139 | 139 | */ |
140 | 140 | public function _replyToGetFlatInputName( /* $sFlatNameAttribute, $aField, $sKey */ ) { |
141 | - $_aParams = func_get_args() + array( null, null, null ); |
|
141 | + $_aParams = func_get_args() + array( null, null, null ); |
|
142 | 142 | return $_aParams[ 0 ]; |
143 | 143 | } |
144 | 144 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function _replyToPrintSettingNotice() { |
186 | 186 | |
187 | - if ( ! $this->_isInThePage() ) { |
|
187 | + if ( !$this->_isInThePage() ) { |
|
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $this->oUtil->deleteTransient( "apf_notices_{$_iUserID}" ); |
203 | 203 | |
204 | 204 | // By setting false to the 'settings-notice' key, it's possible to disable the notifications set with the framework. |
205 | - if ( isset( $_GET['settings-notice'] ) && ! $_GET['settings-notice'] ) { |
|
205 | + if ( isset( $_GET[ 'settings-notice' ] ) && !$_GET[ 'settings-notice' ] ) { |
|
206 | 206 | return; |
207 | 207 | } |
208 | 208 | |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | */ |
239 | 239 | private function _getSettingNotice( array $aNotice ) { |
240 | 240 | |
241 | - if ( ! isset( $aNotice[ 'aAttributes' ], $aNotice[ 'sMessage' ] ) ) { |
|
241 | + if ( !isset( $aNotice[ 'aAttributes' ], $aNotice[ 'sMessage' ] ) ) { |
|
242 | 242 | return ''; |
243 | 243 | } |
244 | - if ( ! $aNotice[ 'sMessage' ] ) { |
|
244 | + if ( !$aNotice[ 'sMessage' ] ) { |
|
245 | 245 | return ''; |
246 | 246 | } |
247 | 247 | $aNotice[ 'aAttributes' ][ 'class' ] = $this->oUtil->getClassAttribute( |
@@ -253,9 +253,9 @@ discard block |
||
253 | 253 | 'admin-page-framework-settings-notice-container', |
254 | 254 | 'notice is-dismissible' // 3.5.12+ |
255 | 255 | ); |
256 | - return "<div " . $this->oUtil->getAttributes( $aNotice['aAttributes'] ). ">" |
|
256 | + return "<div ".$this->oUtil->getAttributes( $aNotice[ 'aAttributes' ] ).">" |
|
257 | 257 | . "<p class='admin-page-framework-settings-notice-message'>" |
258 | - . $aNotice['sMessage'] |
|
258 | + . $aNotice[ 'sMessage' ] |
|
259 | 259 | . "</p>" |
260 | 260 | . "</div>"; |
261 | 261 | |
@@ -272,18 +272,18 @@ discard block |
||
272 | 272 | public function _replyToGetFieldOutput( $aField ) { |
273 | 273 | |
274 | 274 | $_oField = new AdminPageFramework_FormFieldset( |
275 | - $aField, // the field definition array |
|
275 | + $aField, // the field definition array |
|
276 | 276 | // @todo change it to $this->getSavedOptions() |
277 | - $this->oProp->aOptions, // the stored form data |
|
278 | - $this->_getFieldErrors(), // the field error array. |
|
279 | - $this->oProp->aFieldTypeDefinitions, // the field type definition array. |
|
280 | - $this->oMsg, // the system message object |
|
277 | + $this->oProp->aOptions, // the stored form data |
|
278 | + $this->_getFieldErrors(), // the field error array. |
|
279 | + $this->oProp->aFieldTypeDefinitions, // the field type definition array. |
|
280 | + $this->oMsg, // the system message object |
|
281 | 281 | $this->oProp->aFieldCallbacks // field output element callables. |
282 | 282 | ); |
283 | 283 | |
284 | 284 | $_sOutput = $this->oUtil->addAndApplyFilters( |
285 | 285 | $this, |
286 | - array( 'field_' . $this->oProp->sClassName . '_' . $aField['field_id'] ), // field_ + {extended class name} + _ {field id} |
|
286 | + array( 'field_'.$this->oProp->sClassName.'_'.$aField[ 'field_id' ] ), // field_ + {extended class name} + _ {field id} |
|
287 | 287 | $_oField->get(), // field output |
288 | 288 | $aField // the field array |
289 | 289 | ); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @since 3.6.0 |
106 | 106 | * @return string |
107 | 107 | */ |
108 | - public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
108 | + public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
109 | 109 | $_aParams = func_get_args() + array( null, null, ); |
110 | 110 | return $_aParams[ 0 ]; |
111 | 111 | } |
@@ -184,25 +184,25 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function _replyToPrintSettingNotice() { |
186 | 186 | |
187 | - if ( ! $this->_isInThePage() ) { |
|
187 | + if ( ! $this->_isInThePage() ) { |
|
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
191 | 191 | // Ensure this method is called only once per a page load. |
192 | - if ( self::$_bSettingNoticeLoaded ) { |
|
192 | + if ( self::$_bSettingNoticeLoaded ) { |
|
193 | 193 | return; |
194 | 194 | } |
195 | 195 | self::$_bSettingNoticeLoaded = true; |
196 | 196 | |
197 | 197 | $_iUserID = get_current_user_id(); |
198 | 198 | $_aNotices = $this->oUtil->getTransient( "apf_notices_{$_iUserID}" ); |
199 | - if ( false === $_aNotices ) { |
|
199 | + if ( false === $_aNotices ) { |
|
200 | 200 | return; |
201 | 201 | } |
202 | 202 | $this->oUtil->deleteTransient( "apf_notices_{$_iUserID}" ); |
203 | 203 | |
204 | 204 | // By setting false to the 'settings-notice' key, it's possible to disable the notifications set with the framework. |
205 | - if ( isset( $_GET['settings-notice'] ) && ! $_GET['settings-notice'] ) { |
|
205 | + if ( isset( $_GET['settings-notice'] ) && ! $_GET['settings-notice'] ) { |
|
206 | 206 | return; |
207 | 207 | } |
208 | 208 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @since 2.1.0 |
61 | 61 | * @internal |
62 | 62 | */ |
63 | - protected function _setHelpTab( $sID, $sTitle, $aContents, $aSideBarContents=array() ) { |
|
63 | + protected function _setHelpTab( $sID, $sTitle, $aContents, $aSideBarContents = array() ) { |
|
64 | 64 | |
65 | 65 | if ( empty( $aContents ) ) { |
66 | 66 | return; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ) |
78 | 78 | ); |
79 | 79 | |
80 | - if ( ! empty( $aSideBarContents ) ) { |
|
80 | + if ( !empty( $aSideBarContents ) ) { |
|
81 | 81 | $this->_oScreen->set_help_sidebar( implode( PHP_EOL, $aSideBarContents ) ); |
82 | 82 | } |
83 | 83 | |
@@ -89,6 +89,6 @@ discard block |
||
89 | 89 | * @internal |
90 | 90 | */ |
91 | 91 | protected function _formatHelpDescription( $sHelpDescription ) { |
92 | - return "<div class='contextual-help-description'>" . $sHelpDescription . "</div>"; |
|
92 | + return "<div class='contextual-help-description'>".$sHelpDescription."</div>"; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | \ No newline at end of file |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | protected function _setHelpTab( $sID, $sTitle, $aContents, $aSideBarContents=array() ) { |
64 | 64 | |
65 | - if ( empty( $aContents ) ) { |
|
65 | + if ( empty( $aContents ) ) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for creating fields in the taxonomy page (edit-tags.php). |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Sets up hooks and properties. |
24 | 24 | */ |
25 | - public function __construct( $oProp, $oMsg=null ) { |
|
25 | + public function __construct( $oProp, $oMsg = null ) { |
|
26 | 26 | |
27 | - if ( ! $this->_isLoadable( $oProp ) ) { |
|
27 | + if ( !$this->_isLoadable( $oProp ) ) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | add_action( 'in_admin_footer', array( $this, '_replyToSetFooterInfo' ) ); |
35 | 35 | |
36 | 36 | // Add an action link in the plugin listing page |
37 | - if ( 'plugins.php' === $this->oProp->sPageNow && 'plugin' === $this->oProp->aScriptInfo['sType'] ) { |
|
37 | + if ( 'plugins.php' === $this->oProp->sPageNow && 'plugin' === $this->oProp->aScriptInfo[ 'sType' ] ) { |
|
38 | 38 | add_filter( |
39 | - 'plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo['sPath'] ), |
|
39 | + 'plugin_action_links_'.plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
40 | 40 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ), |
41 | 41 | 20 // set a lower priority so that the link will be embedded at the beginning ( the most left hand side ). |
42 | 42 | ); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @return boolean |
51 | 51 | */ |
52 | 52 | private function _isLoadable( $oProp ) { |
53 | - if ( ! $oProp->bIsAdmin ) { |
|
53 | + if ( !$oProp->bIsAdmin ) { |
|
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | if ( $oProp->bIsAdminAjax ) { |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | */ |
81 | 81 | protected function _setDefaultFooterText() { |
82 | 82 | |
83 | - $this->oProp->aFooterInfo['sLeft'] = str_replace( |
|
83 | + $this->oProp->aFooterInfo[ 'sLeft' ] = str_replace( |
|
84 | 84 | '__SCRIPT_CREDIT__', |
85 | 85 | $this->_getFooterInfoLeft( $this->oProp->aScriptInfo ), |
86 | - $this->oProp->aFooterInfo['sLeft'] |
|
86 | + $this->oProp->aFooterInfo[ 'sLeft' ] |
|
87 | 87 | ); |
88 | - $this->oProp->aFooterInfo['sRight'] = str_replace( |
|
88 | + $this->oProp->aFooterInfo[ 'sRight' ] = str_replace( |
|
89 | 89 | '__FRAMEWORK_CREDIT__', |
90 | 90 | $this->_getFooterInfoRight( $this->oProp->_getLibraryData() ), |
91 | - $this->oProp->aFooterInfo['sRight'] |
|
91 | + $this->oProp->aFooterInfo[ 'sRight' ] |
|
92 | 92 | ); |
93 | 93 | |
94 | 94 | } |
@@ -102,52 +102,52 @@ discard block |
||
102 | 102 | private function _getFooterInfoLeft( $aScriptInfo ) { |
103 | 103 | |
104 | 104 | $_sDescription = $this->getAOrB( |
105 | - empty( $aScriptInfo['sDescription'] ), |
|
105 | + empty( $aScriptInfo[ 'sDescription' ] ), |
|
106 | 106 | '', |
107 | - " {$aScriptInfo['sDescription']}" |
|
107 | + " {$aScriptInfo[ 'sDescription' ]}" |
|
108 | 108 | ); |
109 | 109 | $_sVersion = $this->getAOrB( |
110 | - empty( $aScriptInfo['sVersion'] ), |
|
110 | + empty( $aScriptInfo[ 'sVersion' ] ), |
|
111 | 111 | '', |
112 | - " {$aScriptInfo['sVersion']}" |
|
112 | + " {$aScriptInfo[ 'sVersion' ]}" |
|
113 | 113 | ); |
114 | 114 | $_sPluginInfo = $this->getAOrB( |
115 | - empty( $aScriptInfo['sURI'] ), |
|
116 | - $aScriptInfo['sName'], |
|
115 | + empty( $aScriptInfo[ 'sURI' ] ), |
|
116 | + $aScriptInfo[ 'sName' ], |
|
117 | 117 | $this->getHTMLTag( |
118 | 118 | 'a', |
119 | 119 | array( |
120 | - 'href' => $aScriptInfo['sURI'], |
|
120 | + 'href' => $aScriptInfo[ 'sURI' ], |
|
121 | 121 | 'target' => '_blank', |
122 | - 'title' => $aScriptInfo['sName'] . $_sVersion . $_sDescription |
|
122 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription |
|
123 | 123 | ), |
124 | - $aScriptInfo['sName'] |
|
124 | + $aScriptInfo[ 'sName' ] |
|
125 | 125 | ) |
126 | 126 | ); |
127 | 127 | |
128 | 128 | $_sAuthorInfo = $this->getAOrB( |
129 | - empty( $aScriptInfo['sAuthorURI'] ), |
|
129 | + empty( $aScriptInfo[ 'sAuthorURI' ] ), |
|
130 | 130 | '', |
131 | 131 | $this->getHTMLTag( |
132 | 132 | 'a', |
133 | 133 | array( |
134 | - 'href' => $aScriptInfo['sAuthorURI'], |
|
134 | + 'href' => $aScriptInfo[ 'sAuthorURI' ], |
|
135 | 135 | 'target' => '_blank', |
136 | - 'title' => $aScriptInfo['sAuthor'], |
|
136 | + 'title' => $aScriptInfo[ 'sAuthor' ], |
|
137 | 137 | ), |
138 | - $aScriptInfo['sAuthor'] |
|
138 | + $aScriptInfo[ 'sAuthor' ] |
|
139 | 139 | ) |
140 | 140 | ); |
141 | 141 | $_sAuthorInfo = $this->getAOrB( |
142 | - empty( $aScriptInfo['sAuthor'] ), |
|
142 | + empty( $aScriptInfo[ 'sAuthor' ] ), |
|
143 | 143 | $_sAuthorInfo, |
144 | - ' by ' . $_sAuthorInfo |
|
144 | + ' by '.$_sAuthorInfo |
|
145 | 145 | ); |
146 | 146 | |
147 | 147 | // Enclosing the output in a span tag as the outer element is a '<p>' tag. So this cannot be div. |
148 | 148 | // 3.5.7+ Added the class attribute for acceptance testing |
149 | 149 | return "<span class='apf-script-info'>" |
150 | - . $_sPluginInfo . $_sAuthorInfo |
|
150 | + . $_sPluginInfo.$_sAuthorInfo |
|
151 | 151 | . "</span>"; |
152 | 152 | |
153 | 153 | } |
@@ -161,32 +161,32 @@ discard block |
||
161 | 161 | private function _getFooterInfoRight( $aScriptInfo ) { |
162 | 162 | |
163 | 163 | $_sDescription = $this->getAOrB( |
164 | - empty( $aScriptInfo['sDescription'] ), |
|
164 | + empty( $aScriptInfo[ 'sDescription' ] ), |
|
165 | 165 | '', |
166 | - " {$aScriptInfo['sDescription']}" |
|
166 | + " {$aScriptInfo[ 'sDescription' ]}" |
|
167 | 167 | ); |
168 | 168 | $_sVersion = $this->getAOrB( |
169 | - empty( $aScriptInfo['sVersion'] ), |
|
169 | + empty( $aScriptInfo[ 'sVersion' ] ), |
|
170 | 170 | '', |
171 | - " {$aScriptInfo['sVersion']}" |
|
171 | + " {$aScriptInfo[ 'sVersion' ]}" |
|
172 | 172 | ); |
173 | 173 | $_sLibraryInfo = $this->getAOrB( |
174 | - empty( $aScriptInfo['sURI'] ), |
|
175 | - $aScriptInfo['sName'], |
|
174 | + empty( $aScriptInfo[ 'sURI' ] ), |
|
175 | + $aScriptInfo[ 'sName' ], |
|
176 | 176 | $this->getHTMLTag( |
177 | 177 | 'a', |
178 | 178 | array( |
179 | - 'href' => $aScriptInfo['sURI'], |
|
179 | + 'href' => $aScriptInfo[ 'sURI' ], |
|
180 | 180 | 'target' => '_blank', |
181 | - 'title' => $aScriptInfo['sName'] . $_sVersion . $_sDescription, |
|
181 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription, |
|
182 | 182 | ), |
183 | - $aScriptInfo['sName'] |
|
183 | + $aScriptInfo[ 'sName' ] |
|
184 | 184 | ) |
185 | 185 | ); |
186 | 186 | |
187 | 187 | // Update the variable |
188 | 188 | return "<span class='apf-credit'>" // 3.5.7+ added 'apf-credit' class attribute for acceptance testing |
189 | - . $this->oMsg->get( 'powered_by' ) . ' ' |
|
189 | + . $this->oMsg->get( 'powered_by' ).' ' |
|
190 | 190 | . $_sLibraryInfo |
191 | 191 | . ", " |
192 | 192 | . $this->getHTMLTag( |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | array( |
195 | 195 | 'href' => 'https://wordpress.org', |
196 | 196 | 'target' => '_blank', |
197 | - 'title' => 'WordPress' . $GLOBALS['wp_version'] |
|
197 | + 'title' => 'WordPress'.$GLOBALS[ 'wp_version' ] |
|
198 | 198 | ), |
199 | 199 | 'WordPress' |
200 | 200 | ) |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | protected function _setFooterHooks() { |
212 | 212 | |
213 | - add_filter( 'admin_footer_text' , array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
213 | + add_filter( 'admin_footer_text', array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
214 | 214 | add_filter( 'update_footer', array( $this, '_replyToAddInfoInFooterRight' ), 11 ); |
215 | 215 | |
216 | 216 | } |
@@ -222,15 +222,15 @@ discard block |
||
222 | 222 | * @callback filter admin_footer_text |
223 | 223 | * @internal |
224 | 224 | */ |
225 | - public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) { |
|
225 | + public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) { |
|
226 | 226 | |
227 | - $sLinkHTML = empty( $this->oProp->aScriptInfo['sName'] ) |
|
227 | + $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] ) |
|
228 | 228 | ? $sLinkHTML |
229 | - : $this->oProp->aFooterInfo['sLeft']; |
|
229 | + : $this->oProp->aFooterInfo[ 'sLeft' ]; |
|
230 | 230 | |
231 | 231 | return $this->addAndApplyFilters( |
232 | 232 | $this->oProp->_getCallerObject(), |
233 | - 'footer_left_' . $this->oProp->sClassName, |
|
233 | + 'footer_left_'.$this->oProp->sClassName, |
|
234 | 234 | $sLinkHTML |
235 | 235 | ); |
236 | 236 | |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | * @callback filter admin_footer_text |
244 | 244 | * @internal |
245 | 245 | */ |
246 | - public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) { |
|
246 | + public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) { |
|
247 | 247 | return $this->addAndApplyFilters( |
248 | 248 | $this->oProp->_getCallerObject(), |
249 | - 'footer_right_' . $this->oProp->sClassName, |
|
250 | - $this->oProp->aFooterInfo['sRight'] |
|
249 | + 'footer_right_'.$this->oProp->sClassName, |
|
250 | + $this->oProp->aFooterInfo[ 'sRight' ] |
|
251 | 251 | ); |
252 | 252 | } |
253 | 253 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * @return boolean |
51 | 51 | */ |
52 | 52 | private function _isLoadable( $oProp ) { |
53 | - if ( ! $oProp->bIsAdmin ) { |
|
53 | + if ( ! $oProp->bIsAdmin ) { |
|
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | if ( $oProp->bIsAdminAjax ) { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * If accessed from a console, include the registry class to laod 'AdminPageFramework_Registry_Base'. |
12 | 12 | */ |
13 | 13 | if ( php_sapi_name() === 'cli' ) { |
14 | - $_sFrameworkFilePath = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/admin-page-framework.php'; |
|
14 | + $_sFrameworkFilePath = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ).'/admin-page-framework.php'; |
|
15 | 15 | if ( file_exists( $_sFrameworkFilePath ) ) { |
16 | 16 | include_once( $_sFrameworkFilePath ); |
17 | 17 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * If accessed from a console, include the registry class to laod 'AdminPageFramework_Registry_Base'. |
12 | 12 | */ |
13 | 13 | if ( php_sapi_name() === 'cli' ) { |
14 | - $_sFrameworkFilePath = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/admin-page-framework.php'; |
|
14 | + $_sFrameworkFilePath = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ).'/admin-page-framework.php'; |
|
15 | 15 | if ( file_exists( $_sFrameworkFilePath ) ) { |
16 | 16 | include_once( $_sFrameworkFilePath ); |
17 | 17 | } |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | 'confirm_perform_task' => 'Please confirm your action.', |
83 | 83 | 'specified_option_been_deleted' => 'The specified options have been deleted.', |
84 | 84 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
85 | - 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
85 | + 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
88 | 88 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+ |
89 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
89 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
90 | 90 | |
91 | 91 | // AdminPageFramework_PostType |
92 | 92 | 'title' => 'Title', |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | 'upload_file' => 'Upload File', |
113 | 113 | 'use_this_file' => 'Use This File', |
114 | 114 | 'select_file' => 'Select File', |
115 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | - 'select_all' => 'Select All', // 3.3.0+ |
|
117 | - 'select_none' => 'Select None', // 3.3.0+ |
|
115 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | + 'select_all' => 'Select All', // 3.3.0+ |
|
117 | + 'select_none' => 'Select None', // 3.3.0+ |
|
118 | 118 | 'no_term_found' => 'No term found.', // 3.3.2+ |
119 | 119 | |
120 | 120 | // AdminPageFramework_Form_View___Script_{...} |
121 | 121 | 'select' => 'Select', // 3.4.2+ |
122 | - 'insert' => 'Insert', // 3.4.2+ |
|
122 | + 'insert' => 'Insert', // 3.4.2+ |
|
123 | 123 | 'use_this' => 'Use This', // 3.4.2+ |
124 | 124 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
125 | 125 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @since 3.2.0 Changed it to create an instance per text domain basis. |
191 | 191 | * @remark This class should be instantiated via this method. |
192 | 192 | */ |
193 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
193 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
194 | 194 | |
195 | 195 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
196 | 196 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -203,21 +203,21 @@ discard block |
||
203 | 203 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
204 | 204 | * @deprecated 3.2.0 |
205 | 205 | */ |
206 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
206 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
207 | 207 | return self::getInstance( $sTextDomain ); |
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | 211 | * Sets up properties. |
212 | 212 | */ |
213 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
213 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
214 | 214 | |
215 | 215 | $this->_sTextDomain = $sTextDomain; |
216 | 216 | |
217 | 217 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
218 | 218 | // with the value of null. The null is set to let it trigger the __get() method |
219 | 219 | // so that each translation item gets processed individually. |
220 | - $this->aMessages = array_fill_keys( |
|
220 | + $this->aMessages = array_fill_keys( |
|
221 | 221 | array_keys( $this->aDefaults ), |
222 | 222 | null |
223 | 223 | ); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * If accessed from a console, include the registry class to laod 'AdminPageFramework_Registry_Base'. |
12 | 12 | */ |
13 | 13 | if ( php_sapi_name() === 'cli' ) { |
14 | - $_sFrameworkFilePath = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/admin-page-framework.php'; |
|
14 | + $_sFrameworkFilePath = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ).'/admin-page-framework.php'; |
|
15 | 15 | if ( file_exists( $_sFrameworkFilePath ) ) { |
16 | 16 | include_once( $_sFrameworkFilePath ); |
17 | 17 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @deprecated 3.2.0 |
145 | 145 | * @internal |
146 | 146 | */ |
147 | - public static $_sDefaultStyle =""; |
|
147 | + public static $_sDefaultStyle = ""; |
|
148 | 148 | |
149 | 149 | /** |
150 | 150 | * The default CSS rules for IE loaded in the head tag of the created admin pages. |
@@ -287,14 +287,14 @@ discard block |
||
287 | 287 | * @internal |
288 | 288 | * @since 3.2.0 |
289 | 289 | */ |
290 | - public $aFieldCallbacks = array( |
|
291 | - 'hfID' => null, // the input id attribute |
|
292 | - 'hfTagID' => null, // the field container id attribute |
|
293 | - 'hfName' => null, // the field name attribute |
|
294 | - 'hfNameFlat' => null, // the flat field name attribute |
|
295 | - 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
296 | - 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
297 | - 'hfClass' => null, // the class attribute |
|
290 | + public $aFieldCallbacks = array( |
|
291 | + 'hfID' => null, // the input id attribute |
|
292 | + 'hfTagID' => null, // the field container id attribute |
|
293 | + 'hfName' => null, // the field name attribute |
|
294 | + 'hfNameFlat' => null, // the flat field name attribute |
|
295 | + 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
296 | + 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
297 | + 'hfClass' => null, // the class attribute |
|
298 | 298 | ); |
299 | 299 | |
300 | 300 | /** |
@@ -322,14 +322,14 @@ discard block |
||
322 | 322 | 'manage_options', |
323 | 323 | $sCapability |
324 | 324 | ); |
325 | - $this->sTextDomain = $this->oUtil->getAOrB( |
|
325 | + $this->sTextDomain = $this->oUtil->getAOrB( |
|
326 | 326 | empty( $sTextDomain ), |
327 | 327 | 'admin-page-framework', |
328 | 328 | $sTextDomain |
329 | 329 | ); |
330 | - $this->sFieldsType = $sFieldsType; |
|
331 | - $GLOBALS['aAdminPageFramework'] = isset( $GLOBALS['aAdminPageFramework'] ) && is_array( $GLOBALS['aAdminPageFramework'] ) |
|
332 | - ? $GLOBALS['aAdminPageFramework'] |
|
330 | + $this->sFieldsType = $sFieldsType; |
|
331 | + $GLOBALS[ 'aAdminPageFramework' ] = isset( $GLOBALS[ 'aAdminPageFramework' ] ) && is_array( $GLOBALS[ 'aAdminPageFramework' ] ) |
|
332 | + ? $GLOBALS[ 'aAdminPageFramework' ] |
|
333 | 333 | : array( 'aFieldFlags' => array() ); |
334 | 334 | $this->sPageNow = $this->oUtil->getPageNow(); |
335 | 335 | $this->bIsAdmin = is_admin(); |
@@ -403,19 +403,19 @@ discard block |
||
403 | 403 | * @remark The information can be used to embed into the footer etc. |
404 | 404 | * @return array The information of the script. |
405 | 405 | */ |
406 | - protected function getCallerInfo( $sCallerPath=null ) { |
|
406 | + protected function getCallerInfo( $sCallerPath = null ) { |
|
407 | 407 | |
408 | 408 | $_aCallerInfo = self::$_aStructure_CallerInfo; |
409 | - $_aCallerInfo['sPath'] = $sCallerPath; |
|
410 | - $_aCallerInfo['sType'] = $this->_getCallerType( $_aCallerInfo['sPath'] ); |
|
409 | + $_aCallerInfo[ 'sPath' ] = $sCallerPath; |
|
410 | + $_aCallerInfo[ 'sType' ] = $this->_getCallerType( $_aCallerInfo[ 'sPath' ] ); |
|
411 | 411 | |
412 | - if ( 'unknown' == $_aCallerInfo['sType'] ) { |
|
412 | + if ( 'unknown' == $_aCallerInfo[ 'sType' ] ) { |
|
413 | 413 | return $_aCallerInfo; |
414 | 414 | } |
415 | - if ( 'plugin' == $_aCallerInfo['sType'] ) { |
|
416 | - return $this->oUtil->getScriptData( $_aCallerInfo['sPath'], $_aCallerInfo['sType'] ) + $_aCallerInfo; |
|
415 | + if ( 'plugin' == $_aCallerInfo[ 'sType' ] ) { |
|
416 | + return $this->oUtil->getScriptData( $_aCallerInfo[ 'sPath' ], $_aCallerInfo[ 'sType' ] ) + $_aCallerInfo; |
|
417 | 417 | } |
418 | - if ( 'theme' == $_aCallerInfo['sType'] ) { |
|
418 | + if ( 'theme' == $_aCallerInfo[ 'sType' ] ) { |
|
419 | 419 | $_oTheme = wp_get_theme(); // stores the theme info object |
420 | 420 | return array( |
421 | 421 | 'sName' => $_oTheme->Name, |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | */ |
474 | 474 | protected function _getLastInput() { |
475 | 475 | |
476 | - $_sKey = 'apf_tfd' . md5( 'temporary_form_data_' . $this->sClassName . get_current_user_id() ); |
|
476 | + $_sKey = 'apf_tfd'.md5( 'temporary_form_data_'.$this->sClassName.get_current_user_id() ); |
|
477 | 477 | $_vValue = $this->oUtil->getTransient( $_sKey ); |
478 | 478 | $this->oUtil->deleteTransient( $_sKey ); |
479 | 479 | if ( is_array( $_vValue ) ) { |