@@ -30,15 +30,15 @@ |
||
30 | 30 | 'page_slug' => null, |
31 | 31 | 'tab_slug' => null, |
32 | 32 | 'title' => null, |
33 | - 'order' => 10, // (integer) |
|
34 | - 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
35 | - '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. |
|
36 | - 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
37 | - 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
38 | - 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
39 | - 'capability' => null, // 3.6.0+ (string) |
|
40 | - 'if' => true, // 3.6.0+ (boolean) |
|
41 | - '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. |
|
33 | + 'order' => 10, // (integer) |
|
34 | + 'show_in_page_tab' => true, // 3.6.0+ (boolean) |
|
35 | + '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. |
|
36 | + 'url' => null, // 3.5.0+ This allows the user set custom link. |
|
37 | + 'disabled' => null, // 3.5.10+ (boolean) If true, the link will be unlinked. |
|
38 | + 'attributes' => null, // 3.5.10+ (array) Applies to the navigation tab bar element. |
|
39 | + 'capability' => null, // 3.6.0+ (string) |
|
40 | + 'if' => true, // 3.6.0+ (boolean) |
|
41 | + '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. |
|
42 | 42 | ); |
43 | 43 | |
44 | 44 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | // Send mail. |
88 | - $_bSent = wp_mail( |
|
88 | + $_bSent = wp_mail( |
|
89 | 89 | $this->_getEmailArgument( $aInput, $aEmailOptions, 'to', $sSubmitSectionID ), |
90 | 90 | $this->_getEmailArgument( $aInput, $aEmailOptions, 'subject', $sSubmitSectionID ), |
91 | 91 | $_bIsHTML |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | remove_filter( 'wp_mail_from_name', array( $this, '_replyToSetEmailSenderAddress' ) ); |
101 | 101 | |
102 | 102 | // Clean up. |
103 | - foreach( $this->_aPathsToDelete as $_sPath ) { |
|
103 | + foreach ( $this->_aPathsToDelete as $_sPath ) { |
|
104 | 104 | unlink( $_sPath ); |
105 | 105 | } |
106 | 106 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | $_aAttachments = $this->getAsArray( $asAttachments ); |
124 | - foreach( $_aAttachments as $_iIndex => $_sPathORURL ) { |
|
124 | + foreach ( $_aAttachments as $_iIndex => $_sPathORURL ) { |
|
125 | 125 | |
126 | 126 | // If it is a file path, fine. |
127 | 127 | if ( is_file( $_sPathORURL ) ) { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | // If the key element is empty, search the corresponding item in the same section. |
214 | - if ( ! $aEmailOptions[ $sKey ] ) { |
|
214 | + if ( !$aEmailOptions[ $sKey ] ) { |
|
215 | 215 | return $this->getArrayValueByArrayKeys( $aInput, array( $sSectionID, $sKey ) ); |
216 | 216 | } |
217 | 217 |
@@ -186,7 +186,7 @@ |
||
186 | 186 | $sURL |
187 | 187 | ) ); |
188 | 188 | } |
189 | - /** |
|
189 | + /** |
|
190 | 190 | * Sets the mail content type to HTML. |
191 | 191 | * @since 3.3.0 |
192 | 192 | * @since 3.4.2 Moved from the validation class. |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | |
57 | 57 | } |
58 | 58 | |
59 | - private function getElementInFilesArray( array $aFilesImport, $sInputID, $sElementKey='error' ) { |
|
59 | + private function getElementInFilesArray( array $aFilesImport, $sInputID, $sElementKey = 'error' ) { |
|
60 | 60 | |
61 | 61 | $sElementKey = strtolower( $sElementKey ); |
62 | 62 | return $this->getElement( |
63 | - $aFilesImport, // subject array |
|
63 | + $aFilesImport, // subject array |
|
64 | 64 | array( $sElementKey, $sInputID ), // dimensional keys |
65 | 65 | null // default |
66 | 66 | ); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return $vData; |
89 | 89 | |
90 | 90 | } |
91 | - public function formatImportData( &$vData, $sFormatType=null ) { |
|
91 | + public function formatImportData( &$vData, $sFormatType = null ) { |
|
92 | 92 | |
93 | 93 | $sFormatType = isset( $sFormatType ) ? $sFormatType : $this->getFormatType(); |
94 | 94 | switch ( strtolower( $sFormatType ) ) { |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | public function getPageOnlyOptions( $aOptions, $sPageSlug ) { |
52 | 52 | |
53 | 53 | $_aStoredOptionsOfThePage = array(); |
54 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
54 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
55 | 55 | |
56 | 56 | // Check the section |
57 | - if ( ! $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
57 | + if ( !$this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
58 | 58 | continue; |
59 | 59 | } |
60 | 60 | |
61 | 61 | // At this point, the element belongs the given page slug as the section is of the given page slug's. |
62 | 62 | $this->_setPageOnlyOptions( |
63 | - $_aStoredOptionsOfThePage, // by reference - gets updated in the method. |
|
63 | + $_aStoredOptionsOfThePage, // by reference - gets updated in the method. |
|
64 | 64 | $aOptions, |
65 | 65 | $_aSubSectionsOrFields, |
66 | 66 | $sPageSlug, |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @internal |
81 | 81 | */ |
82 | 82 | private function _setPageOnlyOptions( array &$_aStoredOptionsOfThePage, array $aOptions, array $_aSubSectionsOrFields, $sPageSlug, $_sSectionID ) { |
83 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
83 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
84 | 84 | |
85 | 85 | // If it's a sub-section array, |
86 | 86 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | public function getOtherPageOptions( $aOptions, $sPageSlug ) { |
153 | 153 | |
154 | 154 | $_aStoredOptionsNotOfThePage = array(); |
155 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
155 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
156 | 156 | |
157 | 157 | // Check the section |
158 | 158 | if ( $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * @internal |
182 | 182 | */ |
183 | 183 | private function _setOtherPageOptions( array &$_aStoredOptionsNotOfThePage, array $aOptions, array $_aSubSectionsOrFields, $sPageSlug ) { |
184 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
184 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
185 | 185 | |
186 | 186 | // It's a sub-section array. |
187 | 187 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | public function getOtherTabOptions( $aOptions, $sPageSlug, $sTabSlug ) { |
245 | 245 | |
246 | 246 | $_aStoredOptionsNotOfTheTab = array(); |
247 | - foreach( $this->aFieldsets as $_sSectionPath => $_aSubSectionsOrFields ) { |
|
247 | + foreach ( $this->aFieldsets as $_sSectionPath => $_aSubSectionsOrFields ) { |
|
248 | 248 | |
249 | 249 | // If the section is of the given page and the given tab, skip. |
250 | 250 | if ( $this->_isThisSectionSetToThisTab( $_sSectionPath, $sPageSlug, $sTabSlug ) ) { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | private function _setOtherTabOptions( array &$_aStoredOptionsNotOfTheTab, array $aOptions, array $_aSubSectionsOrFields, $sSectionPath ) { |
276 | 276 | |
277 | 277 | // At this point, the passed element belongs to the other tabs since the section of the given tab is skipped. |
278 | - foreach ( $_aSubSectionsOrFields as $_isSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
278 | + foreach ( $_aSubSectionsOrFields as $_isSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
279 | 279 | |
280 | 280 | // If it's a sub section |
281 | 281 | if ( $this->isNumericInteger( $_isSubSectionIndexOrFieldID ) ) { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition_Page`. |
334 | 334 | * @return array |
335 | 335 | */ |
336 | - public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
336 | + public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug = '' ) { |
|
337 | 337 | |
338 | 338 | $_aOtherTabOptions = $this->getOtherTabOptions( $aOptions, $sPageSlug, $sTabSlug ); |
339 | 339 | $_aTabOptions = $this->invertCastArrayContents( $aOptions, $_aOtherTabOptions ); |
@@ -351,17 +351,17 @@ discard block |
||
351 | 351 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition_Page`. |
352 | 352 | * @return array |
353 | 353 | */ |
354 | - public function getTabOnlyOptions( array $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
354 | + public function getTabOnlyOptions( array $aOptions, $sPageSlug, $sTabSlug = '' ) { |
|
355 | 355 | |
356 | 356 | $_aStoredOptionsOfTheTab = array(); |
357 | - if ( ! $sTabSlug ) { |
|
357 | + if ( !$sTabSlug ) { |
|
358 | 358 | return $_aStoredOptionsOfTheTab; |
359 | 359 | } |
360 | 360 | |
361 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
361 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
362 | 362 | |
363 | 363 | // Check the section |
364 | - if ( ! $this->_isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) ) { |
|
364 | + if ( !$this->_isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) ) { |
|
365 | 365 | continue; |
366 | 366 | } |
367 | 367 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | */ |
388 | 388 | private function _setTabOnlyOptions( array &$_aStoredOptionsOfTheTab, array $aOptions, array $_aSubSectionsOrFields, $_sSectionID ) { |
389 | 389 | |
390 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
390 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
391 | 391 | |
392 | 392 | // if it's a sub-section array. |
393 | 393 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | */ |
445 | 445 | private function _isThisSectionSetToThisPage( $sSectionPath, $sPageSlug ) { |
446 | 446 | |
447 | - if ( ! isset( $this->aSectionsets[ $sSectionPath ][ 'page_slug' ] ) ) { |
|
447 | + if ( !isset( $this->aSectionsets[ $sSectionPath ][ 'page_slug' ] ) ) { |
|
448 | 448 | return false; |
449 | 449 | } |
450 | 450 | return ( |
@@ -462,10 +462,10 @@ discard block |
||
462 | 462 | */ |
463 | 463 | private function _isThisSectionSetToThisTab( $sSectionPath, $sPageSlug, $sTabSlug ) { |
464 | 464 | |
465 | - if ( ! $this->_isThisSectionSetToThisPage( $sSectionPath, $sPageSlug ) ) { |
|
465 | + if ( !$this->_isThisSectionSetToThisPage( $sSectionPath, $sPageSlug ) ) { |
|
466 | 466 | return false; |
467 | 467 | } |
468 | - if ( ! isset( $this->aSectionsets[ $sSectionPath ][ 'tab_slug' ] ) ) { |
|
468 | + if ( !isset( $this->aSectionsets[ $sSectionPath ][ 'tab_slug' ] ) ) { |
|
469 | 469 | return false; |
470 | 470 | } |
471 | 471 | return ( |
@@ -482,9 +482,9 @@ discard block |
||
482 | 482 | */ |
483 | 483 | private function _setOptionValue( &$aSubject, $asDimensionalPath, $aOptions ) { |
484 | 484 | $_aDimensionalPath = $this->getAsArray( $asDimensionalPath ); |
485 | - $_mValue = $this->getElement( |
|
485 | + $_mValue = $this->getElement( |
|
486 | 486 | $aOptions, |
487 | - $_aDimensionalPath, // as of 3.7.0, it can be an array or string |
|
487 | + $_aDimensionalPath, // as of 3.7.0, it can be an array or string |
|
488 | 488 | null |
489 | 489 | ); |
490 | 490 | if ( isset( $_mValue ) ) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @since 3.3.0 |
59 | 59 | * @since 3.3.1 Moved from `AdminPageFramework_Setting_Base`. |
60 | 60 | */ |
61 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
61 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
62 | 62 | |
63 | 63 | parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain ); |
64 | 64 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // if ( $this->oProp->bIsAdminAjax ) { |
67 | 67 | // return; |
68 | 68 | // } |
69 | - if ( ! $this->oProp->bIsAdmin ) { |
|
69 | + if ( !$this->oProp->bIsAdmin ) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | 'section_title' => null, |
117 | 117 | 'section_id' => null, |
118 | 118 | ); |
119 | - if ( ! $aFieldset[ 'help' ] ) { |
|
119 | + if ( !$aFieldset[ 'help' ] ) { |
|
120 | 120 | return; |
121 | 121 | } |
122 | 122 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'help_tab_id' => $_sRootSectionID, |
135 | 135 | 'help_tab_content' => "<span class='contextual-help-tab-title'>" |
136 | 136 | . $aFieldset[ 'title' ] |
137 | - . "</span> - " . PHP_EOL |
|
137 | + . "</span> - ".PHP_EOL |
|
138 | 138 | . $aFieldset[ 'help' ], |
139 | 139 | 'help_tab_sidebar_content' => $aFieldset[ 'help_aside' ] |
140 | 140 | ? $aFieldset[ 'help_aside' ] |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | public function _registerHelpPaneItemsOfFormSections( $aSectionsets ) { |
169 | 169 | // @todo Test if help pane item gets displayed |
170 | 170 | |
171 | - foreach( $aSectionsets as $_aSectionset ) { |
|
171 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
172 | 172 | // @todo check capability and conditions |
173 | 173 | $_aSectionset = $_aSectionset + array( |
174 | 174 | 'help' => null, |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function _replyToDetermineSectionsetVisibility( $bVisible, $aSectionset ) { |
204 | 204 | |
205 | - if ( ! current_user_can( $aSectionset[ 'capability' ] ) ) { |
|
205 | + if ( !current_user_can( $aSectionset[ 'capability' ] ) ) { |
|
206 | 206 | return false; |
207 | 207 | } |
208 | - if ( ! $aSectionset[ 'if' ] ) { |
|
208 | + if ( !$aSectionset[ 'if' ] ) { |
|
209 | 209 | return false; |
210 | 210 | } |
211 | - if ( ! $this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
211 | + if ( !$this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
212 | 212 | return false; |
213 | 213 | } |
214 | 214 | return $bVisible; |
@@ -226,15 +226,15 @@ discard block |
||
226 | 226 | private function _isSectionOfCurrentPage( array $aSectionset ) { |
227 | 227 | |
228 | 228 | // Make sure the value type is string so that when the page_slug is not set, it won't match. |
229 | - $_sCurrentPageSlug = ( string ) $this->oProp->getCurrentPageSlug(); |
|
229 | + $_sCurrentPageSlug = ( string ) $this->oProp->getCurrentPageSlug(); |
|
230 | 230 | |
231 | 231 | // Make sure if it's in the loading page. |
232 | - if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
232 | + if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
233 | 233 | return false; |
234 | 234 | } |
235 | 235 | |
236 | 236 | // If no tag is specified, the user wants to display the section regardless of the tab. |
237 | - if ( ! $aSectionset[ 'tab_slug' ] ) { |
|
237 | + if ( !$aSectionset[ 'tab_slug' ] ) { |
|
238 | 238 | return true; |
239 | 239 | } |
240 | 240 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function _replyToDetermineFieldsetVisibility( $bVisible, $aFieldset ) { |
252 | 252 | |
253 | - $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
|
253 | + $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
|
254 | 254 | |
255 | 255 | // If the specified field does not exist, do nothing. |
256 | 256 | if ( $aFieldset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | array( $_sSectionPath, 'page_slug' ), |
281 | 281 | $this->oProp->getCurrentPageSlugIfAdded() |
282 | 282 | ); |
283 | - $aFieldset[ 'tab_slug' ] = $this->oUtil->getElement( |
|
283 | + $aFieldset[ 'tab_slug' ] = $this->oUtil->getElement( |
|
284 | 284 | $aSectionsets, |
285 | 285 | array( $_sSectionPath, 'tab_slug' ), |
286 | 286 | $this->oProp->getCurrentInPageTabSlugIfAdded() |
@@ -291,11 +291,11 @@ discard block |
||
291 | 291 | $aSectionsets, |
292 | 292 | $_sSectionPath |
293 | 293 | ); |
294 | - $aFieldset[ 'section_title' ] = $this->oUtil->getElement( |
|
294 | + $aFieldset[ 'section_title' ] = $this->oUtil->getElement( |
|
295 | 295 | $_aSectionset, |
296 | 296 | 'title' |
297 | 297 | ); |
298 | - $aFieldset[ 'capability' ] = $aFieldset[ 'capability' ] |
|
298 | + $aFieldset[ 'capability' ] = $aFieldset[ 'capability' ] |
|
299 | 299 | ? $aFieldset[ 'capability' ] |
300 | 300 | : $this->_replyToGetCapabilityForForm( |
301 | 301 | $this->oUtil->getElement( $_aSectionset, 'capability' ), |
@@ -345,13 +345,13 @@ discard block |
||
345 | 345 | |
346 | 346 | // Find the capability of the parent section if nested. |
347 | 347 | if ( 0 < $aSectionset[ '_nested_depth' ] ) { |
348 | - $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
|
348 | + $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
|
349 | 349 | array_pop( $_aSectionPath ); // remove the last element |
350 | 350 | $_sParentCapability = $this->oUtil->getElement( |
351 | 351 | $this->oForm->aSectionsets, |
352 | 352 | array_merge( $_aSectionPath, array( 'capability' ) ) |
353 | 353 | ); |
354 | - if( $_sParentCapability ) { |
|
354 | + if ( $_sParentCapability ) { |
|
355 | 355 | return $_sParentCapability; |
356 | 356 | } |
357 | 357 | } |
@@ -74,7 +74,8 @@ |
||
74 | 74 | // new AdminPageFramework_Model__FormEmailHandler( $this ); |
75 | 75 | |
76 | 76 | // Checking the GET and POST methods. |
77 | - if ( isset( $_REQUEST[ 'apf_remote_request_test' ] ) && '_testing' === $_REQUEST[ 'apf_remote_request_test' ] ) { // sanitization unnecessary |
|
77 | + if ( isset( $_REQUEST[ 'apf_remote_request_test' ] ) && '_testing' === $_REQUEST[ 'apf_remote_request_test' ] ) { |
|
78 | +// sanitization unnecessary |
|
78 | 79 | exit( 'OK' ); |
79 | 80 | } |
80 | 81 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @internal |
26 | 26 | */ |
27 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
27 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
28 | 28 | |
29 | 29 | parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain ); |
30 | 30 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $_aPage = $this->oFactory->oProp->aPages[ $this->sPageSlug ]; |
46 | 46 | |
47 | 47 | // If the page title is disabled, return an empty string. |
48 | - if ( ! $_aPage[ 'show_page_title' ] ) { |
|
48 | + if ( !$_aPage[ 'show_page_title' ] ) { |
|
49 | 49 | return ""; |
50 | 50 | } |
51 | 51 | |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | */ |
65 | 65 | private function _getOutput( $aPage, $sTag ) { |
66 | 66 | |
67 | - $sTag = $this->_getPageHeadingTabTag( $sTag, $aPage ); |
|
67 | + $sTag = $this->_getPageHeadingTabTag( $sTag, $aPage ); |
|
68 | 68 | |
69 | 69 | // If the page heading tab visibility is disabled, or only one page is registered, return the title. |
70 | - if ( ! $aPage[ 'show_page_heading_tabs' ] || count( $this->oFactory->oProp->aPages ) == 1 ) { |
|
70 | + if ( !$aPage[ 'show_page_heading_tabs' ] || count( $this->oFactory->oProp->aPages ) == 1 ) { |
|
71 | 71 | return "<{$sTag}>" |
72 | 72 | . $aPage[ 'title' ] |
73 | 73 | . "</{$sTag}>"; |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | private function _getPageHeadingtabNavigationBar( array $aPages, $sTag, $sCurrentPageSlug ) { |
106 | 106 | |
107 | 107 | $_oTabBar = new AdminPageFramework_TabNavigationBar( |
108 | - $aPages, // tab items |
|
108 | + $aPages, // tab items |
|
109 | 109 | $sCurrentPageSlug, // active tab slug |
110 | - $sTag, // container tag |
|
110 | + $sTag, // container tag |
|
111 | 111 | array( // container attributes |
112 | 112 | // 'class' => '...', |
113 | 113 | ), |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | * @since 3.5.10 |
131 | 131 | * @since 3.6.3 Moved from `AdminPageFramework_Page_View`. |
132 | 132 | */ |
133 | - public function _replyToFormatNavigationTabItem_PageHeadingTab( $aSubPage, $aStructure, $aPages, $aArguments=array() ) { |
|
134 | - switch( $aSubPage['type'] ) { |
|
133 | + public function _replyToFormatNavigationTabItem_PageHeadingTab( $aSubPage, $aStructure, $aPages, $aArguments = array() ) { |
|
134 | + switch ( $aSubPage[ 'type' ] ) { |
|
135 | 135 | case 'link': |
136 | 136 | return $this->_getFormattedPageHeadingtabNavigationBarLinkItem( $aSubPage, $aStructure ); |
137 | 137 | default: |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | */ |
149 | 149 | private function _getFormattedPageHeadingtabNavigationBarPageItem( array $aSubPage, $aStructure ) { |
150 | 150 | |
151 | - if ( ! isset( $aSubPage[ 'page_slug' ] ) ) { |
|
151 | + if ( !isset( $aSubPage[ 'page_slug' ] ) ) { |
|
152 | 152 | return array(); |
153 | 153 | } |
154 | - if ( ! $aSubPage[ 'show_page_heading_tab' ] ) { |
|
154 | + if ( !$aSubPage[ 'show_page_heading_tab' ] ) { |
|
155 | 155 | return array(); |
156 | 156 | } |
157 | 157 | return array( |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | */ |
183 | 183 | private function _getFormattedPageHeadingtabNavigationBarLinkItem( array $aSubPage, $aStructure ) { |
184 | 184 | |
185 | - if ( ! isset( $aSubPage[ 'href' ] ) ) { |
|
185 | + if ( !isset( $aSubPage[ 'href' ] ) ) { |
|
186 | 186 | return array(); |
187 | 187 | } |
188 | - if ( ! $aSubPage[ 'show_page_heading_tab' ] ) { |
|
188 | + if ( !$aSubPage[ 'show_page_heading_tab' ] ) { |
|
189 | 189 | return array(); |
190 | 190 | } |
191 | 191 | $aSubPage = array( |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | + array( 'class' => null ) |
198 | 198 | + $aStructure; |
199 | 199 | |
200 | - $aSubPage[ 'class' ] = trim( $aSubPage[ 'class' ] . ' link' ); |
|
200 | + $aSubPage[ 'class' ] = trim( $aSubPage[ 'class' ].' link' ); |
|
201 | 201 | return $aSubPage; |
202 | 202 | } |
203 | 203 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function get() { |
42 | 42 | |
43 | - if ( ! $this->_isScreenIconVisible() ) { |
|
43 | + if ( !$this->_isScreenIconVisible() ) { |
|
44 | 44 | return ''; |
45 | 45 | } |
46 | 46 | return $this->_getScreenIcon( $this->sPageSlug ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | private function _isScreenIconVisible() { |
54 | 54 | |
55 | - $_bShowPageTitle = $this->getElement( |
|
55 | + $_bShowPageTitle = $this->getElement( |
|
56 | 56 | $this->oFactory->oProp->aPages, |
57 | 57 | array( $this->sPageSlug, 'show_page_title' ) |
58 | 58 | ); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | array( $sPageSlug, 'href_icon_32x32' ), |
131 | 131 | '' |
132 | 132 | ); |
133 | - if ( ! $_sScreenIconPath ) { |
|
133 | + if ( !$_sScreenIconPath ) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 | $_sScreenIconPath = $this->getResolvedSRC( |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $_aAttributes = array( |
141 | 141 | 'style' => $this->getInlineCSS( |
142 | 142 | array( |
143 | - 'background-image' => "url('" . esc_url( $_sScreenIconPath ) . "')" |
|
143 | + 'background-image' => "url('".esc_url( $_sScreenIconPath )."')" |
|
144 | 144 | ) |
145 | 145 | ) |
146 | 146 | ); |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | array( $sPageSlug, 'screen_icon_id' ), |
165 | 165 | '' |
166 | 166 | ); |
167 | - if ( ! $_sScreenIconID ) { |
|
167 | + if ( !$_sScreenIconID ) { |
|
168 | 168 | return; |
169 | 169 | } |
170 | 170 | |
171 | 171 | $_aAttributes = array( |
172 | - 'id' => "icon-" . $_sScreenIconID, |
|
172 | + 'id' => "icon-".$_sScreenIconID, |
|
173 | 173 | ); |
174 | 174 | |
175 | 175 | // Go to the catch clause. |
@@ -192,16 +192,16 @@ discard block |
||
192 | 192 | 'class' => $this->getClassAttribute( |
193 | 193 | $this->getAOrB( |
194 | 194 | empty( $_sIconIDAttribute ) && $_oScreen->post_type, |
195 | - sanitize_html_class( 'icon32-posts-' . $_oScreen->post_type ), |
|
195 | + sanitize_html_class( 'icon32-posts-'.$_oScreen->post_type ), |
|
196 | 196 | '' |
197 | 197 | ), |
198 | 198 | $this->getAOrB( |
199 | 199 | empty( $_sIconIDAttribute ) || $_sIconIDAttribute == $this->oFactory->oProp->sClassName, |
200 | - 'generic', // the default value |
|
200 | + 'generic', // the default value |
|
201 | 201 | '' |
202 | 202 | ) |
203 | 203 | ), |
204 | - 'id' => "icon-" . $_sIconIDAttribute, |
|
204 | + 'id' => "icon-".$_sIconIDAttribute, |
|
205 | 205 | ); |
206 | 206 | return $this->_getScreenIconByAttributes( $_aAttributes ); |
207 | 207 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | private function _getScreenIDAttribute( $oScreen ) { |
217 | 217 | |
218 | - if ( ! empty( $oScreen->parent_base ) ) { |
|
218 | + if ( !empty( $oScreen->parent_base ) ) { |
|
219 | 219 | return $oScreen->parent_base; |
220 | 220 | } |
221 | 221 | if ( 'page' === $oScreen->post_type ) { |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | private function _getScreenIconByAttributes( array $aAttributes ) { |
237 | 237 | |
238 | 238 | $aAttributes[ 'class' ] = $this->getClassAttribute( |
239 | - 'icon32', // required for a screen icon container element. |
|
239 | + 'icon32', // required for a screen icon container element. |
|
240 | 240 | $this->getElement( $aAttributes, 'class' ) |
241 | 241 | ); |
242 | - return "<div " . $this->getAttributes( $aAttributes ) . ">" |
|
242 | + return "<div ".$this->getAttributes( $aAttributes ).">" |
|
243 | 243 | . "<br />" |
244 | 244 | . "</div>"; |
245 | 245 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function construct() { |
30 | 30 | |
31 | 31 | add_filter( |
32 | - 'options_' . $this->aArguments[ 'caller_id' ], |
|
32 | + 'options_'.$this->aArguments[ 'caller_id' ], |
|
33 | 33 | array( $this, '_replyToSanitizeSavedFormData' ), |
34 | 34 | 5 // high priority as it must be done earlier |
35 | 35 | ); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | // Extract the meta box field form data (options) from the page form data (options). |
55 | 55 | return $this->castArrayContents( |
56 | - $this->getDataStructureFromAddedFieldsets(), // form data structure generate from fieldsets |
|
56 | + $this->getDataStructureFromAddedFieldsets(), // form data structure generate from fieldsets |
|
57 | 57 | $aSavedFormData |
58 | 58 | ); |
59 | 59 |