@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @since 3.3.0 |
29 | 29 | */ |
30 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
30 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
31 | 31 | |
32 | 32 | $_sProprtyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
33 | 33 | ? $this->aSubClassNames[ 'oProp' ] |
34 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
34 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
35 | 35 | |
36 | 36 | $this->oProp = new $_sProprtyClassName( |
37 | 37 | $this, |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ( $this->oProp->bIsAdminAjax ) { |
48 | 48 | return; |
49 | 49 | } |
50 | - if ( ! $this->oProp->bIsAdmin ) { |
|
50 | + if ( !$this->oProp->bIsAdmin ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
94 | 94 | * @internal |
95 | 95 | */ |
96 | - public function __call( $sMethodName, $aArgs=null ) { |
|
96 | + public function __call( $sMethodName, $aArgs = null ) { |
|
97 | 97 | |
98 | 98 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
99 | 99 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | 'load_pre_', |
105 | 105 | ); |
106 | 106 | |
107 | - switch( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
107 | + switch ( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
108 | 108 | |
109 | 109 | // add_settings_section() callback |
110 | 110 | case 'section_pre_': |
111 | - return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
111 | + return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
112 | 112 | |
113 | 113 | // add_settings_field() callback |
114 | 114 | case 'field_pre_': |
115 | - return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
115 | + return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
116 | 116 | |
117 | 117 | // load-{page} callback |
118 | 118 | case 'load_pre_': |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | * @return string The found callback method name or the prefix of a known callback method name. An empty string if not found. |
131 | 131 | * @internal |
132 | 132 | */ |
133 | - private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes=array() ) { |
|
133 | + private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes = array() ) { |
|
134 | 134 | |
135 | - foreach( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
135 | + foreach ( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
136 | 136 | if ( $this->oUtil->hasPrefix( $_sMethodPrefix, $sMethodName ) ) { |
137 | 137 | return $_sMethodPrefix; |
138 | 138 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | protected function _doPageLoadCall( $sMethodName, $sPageSlug, $sTabSlug, $oScreen ) { |
158 | 158 | |
159 | - if ( ! $this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen->id ) ) { |
|
159 | + if ( !$this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen->id ) ) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $this->_setShowDebugInfoProperty( $sPageSlug ); // 3.8.8+ |
167 | 167 | |
168 | 168 | // Do actions in this order, class -> page -> in-page tab. This order is important as some methods rely on it. |
169 | - $this->load(); // 3.7.12+ |
|
169 | + $this->load(); // 3.7.12+ |
|
170 | 170 | $this->oUtil->addAndDoActions( |
171 | 171 | $this, // the caller object |
172 | 172 | array( |
@@ -183,10 +183,10 @@ discard block |
||
183 | 183 | $sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
184 | 184 | |
185 | 185 | if ( strlen( $sTabSlug ) ) { |
186 | - $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
186 | + $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
187 | 187 | $this->oUtil->addAndDoActions( |
188 | 188 | $this, // the caller object |
189 | - array( "load_{$sPageSlug}_" . $sTabSlug ), |
|
189 | + array( "load_{$sPageSlug}_".$sTabSlug ), |
|
190 | 190 | $this // the admin page object - this lets third-party scripts use the framework methods. |
191 | 191 | ); |
192 | 192 | } |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | * @since 3.8.8 |
212 | 212 | * @return void |
213 | 213 | */ |
214 | - private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug='' ) { |
|
214 | + private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug = '' ) { |
|
215 | 215 | |
216 | 216 | // For the page, |
217 | - if ( ! strlen( $sTabSlug ) ) { |
|
217 | + if ( !strlen( $sTabSlug ) ) { |
|
218 | 218 | $this->oProp->bShowDebugInfo = $this->oUtil->getElement( |
219 | 219 | $this->oProp->aPages, |
220 | 220 | array( $sPageSlug, 'show_debug_info' ), |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) { |
260 | 260 | return false; |
261 | 261 | } |
262 | - if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
262 | + if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
263 | 263 | return false; |
264 | 264 | } |
265 | 265 | if ( $sScreenID !== $this->oProp->aPageHooks[ $sPageSlug ] ) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | // Nothing to do in the network admin area. |
289 | - return ! is_network_admin(); |
|
289 | + return !is_network_admin(); |
|
290 | 290 | |
291 | 291 | } |
292 | 292 | |
@@ -301,11 +301,11 @@ discard block |
||
301 | 301 | public function _isInThePage() { |
302 | 302 | |
303 | 303 | // If the setUp method is not loaded yet, |
304 | - if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) { |
|
304 | + if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) { |
|
305 | 305 | return true; |
306 | 306 | } |
307 | 307 | |
308 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
308 | + if ( !isset( $_GET[ 'page' ] ) ) { |
|
309 | 309 | return false; |
310 | 310 | } |
311 | 311 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
94 | 94 | * @internal |
95 | 95 | */ |
96 | - public function __call( $sMethodName, $aArgs=null ) { |
|
96 | + public function __call( $sMethodName, $aArgs=null ) { |
|
97 | 97 | |
98 | 98 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
99 | 99 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | // Note that the if the tab is the first item, and the user arrives the page by clicking on the sidebar menu, the tab slug will be empty unless an in-page tab is added. |
183 | 183 | $sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
184 | 184 | |
185 | - if ( strlen( $sTabSlug ) ) { |
|
185 | + if ( strlen( $sTabSlug ) ) { |
|
186 | 186 | $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
187 | 187 | $this->oUtil->addAndDoActions( |
188 | 188 | $this, // the caller object |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | return true; |
306 | 306 | } |
307 | 307 | |
308 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
308 | + if ( ! isset( $_GET[ 'page' ] ) ) { |
|
309 | 309 | return false; |
310 | 310 | } |
311 | 311 |
@@ -31,15 +31,15 @@ |
||
31 | 31 | 'page_slug' => null, |
32 | 32 | 'tab_slug' => null, |
33 | 33 | 'title' => null, |
34 | - 'order' => 10, // (integer) |
|
35 | - 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
36 | - 'parent_tab_slug' => null, // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed. |
|
37 | - 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
38 | - 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
39 | - 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
40 | - 'capability' => null, // 3.6.0+ (string) |
|
41 | - 'if' => true, // 3.6.0+ (boolean) |
|
42 | - 'show_debug_info' => null, // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method. |
|
34 | + 'order' => 10, // (integer) |
|
35 | + 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
36 | + 'parent_tab_slug' => null, // this needs to be set if the above show_in_page_tab is false so that the framework can mark the parent tab to be active when the hidden page is accessed. |
|
37 | + 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
38 | + 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
39 | + 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
40 | + 'capability' => null, // 3.6.0+ (string) |
|
41 | + 'if' => true, // 3.6.0+ (boolean) |
|
42 | + 'show_debug_info' => null, // 3.8.8+ (boolean, optional) Whether to show debug information. If not set, the existent `bShowDebugInfo` property value will be used. The initial value here is `null` as the default value will be assigned in the formatting method. |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | /** |
@@ -24,12 +24,12 @@ |
||
24 | 24 | * @since 3.0.0 |
25 | 25 | * @deprecated 3.7.0 Use `AdminPageFramework_PageMetaBox` instead. |
26 | 26 | */ |
27 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
27 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
28 | 28 | |
29 | 29 | parent::__construct( $sMetaBoxID, $sTitle, $asPageSlugs, $sContext, $sPriority, $sCapability, $sTextDomain ); |
30 | 30 | |
31 | 31 | $this->oUtil->showDeprecationNotice( |
32 | - 'The class, ' . __CLASS__ . ',', // deprecated item |
|
32 | + 'The class, '.__CLASS__.',', // deprecated item |
|
33 | 33 | 'AdminPageFramework_PageMetaBox' // alternative |
34 | 34 | ); |
35 | 35 |