@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | * @since 3.5.4 Added the `$aHeader` parameter. Deprecated the `$sFileName` parameter as it is included in the $aHeader definition. |
100 | 100 | * @since 2.0.0 |
101 | 101 | */ |
102 | - public function doExport( $vData, $sFormatType=null, array $aHeader=array() ) { |
|
102 | + public function doExport( $vData, $sFormatType = null, array $aHeader = array() ) { |
|
103 | 103 | |
104 | - $sFormatType = isset( $sFormatType ) |
|
104 | + $sFormatType = isset( $sFormatType ) |
|
105 | 105 | ? $sFormatType |
106 | 106 | : $this->sFormatType; |
107 | 107 | |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * @param string $sKey |
130 | 130 | * @return void |
131 | 131 | */ |
132 | - private function _outputHTTPHeader( array $aHeader, $sKey='' ) { |
|
132 | + private function _outputHTTPHeader( array $aHeader, $sKey = '' ) { |
|
133 | 133 | |
134 | - foreach( $aHeader as $_sKey => $_asValue ) { |
|
134 | + foreach ( $aHeader as $_sKey => $_asValue ) { |
|
135 | 135 | |
136 | 136 | // Nested items. Set the key to overrider array keys. |
137 | 137 | if ( is_array( $_asValue ) ) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return; |
174 | 174 | case 'json': // for json. |
175 | 175 | echo json_encode( ( array ) $vData ); |
176 | - return ; |
|
176 | + return; |
|
177 | 177 | case 'array': // for serialized PHP array. |
178 | 178 | default: // for anything else, |
179 | 179 | echo serialize( ( array ) $vData ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * Stores method names of the `WP_Widget` class, referred when the class is assumed as a WP_Widget subclass. |
116 | 116 | * @since 3.8.17 |
117 | 117 | */ |
118 | - public $aWPWidgetMethods = array(); |
|
118 | + public $aWPWidgetMethods = array(); |
|
119 | 119 | /** |
120 | 120 | * Stores property names of the `WP_Widget` class, , referred when the class is assumed as a WP_Widget subclass. |
121 | 121 | * @since 3.8.17 |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | * Sets up properties. |
127 | 127 | * @since 3.7.0 |
128 | 128 | */ |
129 | - public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='' ) { |
|
129 | + public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType = '' ) { |
|
130 | 130 | |
131 | 131 | // 3.7.0+ |
132 | - $this->_sFormRegistrationHook = 'load_' . $sClassName; |
|
132 | + $this->_sFormRegistrationHook = 'load_'.$sClassName; |
|
133 | 133 | |
134 | 134 | // 3.7.9+ - setting a custom action hook for admin notices prevents the form object from being instantiated unnecessarily. |
135 | - $this->sSettingNoticeActionHook = 'load_' . $sClassName; |
|
135 | + $this->sSettingNoticeActionHook = 'load_'.$sClassName; |
|
136 | 136 | |
137 | 137 | parent::__construct( |
138 | 138 | $oCaller, |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | * @since 3.8.4 When non-true value is passed, `0px` will be returned. |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - static public function getLengthSanitized( $sLength, $sUnit='px' ) { |
|
38 | + static public function getLengthSanitized( $sLength, $sUnit = 'px' ) { |
|
39 | 39 | $sLength = $sLength ? $sLength : 0; |
40 | 40 | return is_numeric( $sLength ) |
41 | - ? $sLength . $sUnit |
|
41 | + ? $sLength.$sUnit |
|
42 | 42 | : $sLength; |
43 | 43 | } |
44 | 44 | |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | * @since 3.8.11 Renamed from `fixNumber()`. |
81 | 81 | * @return string|integer A numeric value will be returned. |
82 | 82 | */ |
83 | - static public function getNumberFixed( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
83 | + static public function getNumberFixed( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
84 | 84 | |
85 | - if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
85 | + if ( !is_numeric( trim( $nToFix ) ) ) { |
|
86 | 86 | return $nDefault; |
87 | 87 | } |
88 | 88 | if ( $nMin !== '' && $nToFix < $nMin ) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @return string|integer A numeric value will be returned. |
101 | 101 | * @deprecated 3.8.11 |
102 | 102 | */ |
103 | - static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
103 | + static public function fixNumber( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
104 | 104 | return self::getNumberFixed( $nToFix, $nDefault, $nMin, $nMax ); |
105 | 105 | } |
106 | 106 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | static public function getCSSMinified( $sCSSRules ) { |
115 | 115 | return str_replace( |
116 | - array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' '), // remove line breaks, tab, and white sspaces. |
|
116 | + array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), // remove line breaks, tab, and white sspaces. |
|
117 | 117 | '', |
118 | 118 | preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $sCSSRules ) // remove comments |
119 | 119 | ); |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | */ |
151 | 151 | static public function getNumberOfReadableSize( $nSize ) { |
152 | 152 | |
153 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
154 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
153 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
154 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
155 | 155 | case 'P': |
156 | 156 | $_nReturn *= 1024; |
157 | 157 | case 'T': |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | * @since 3.8.26 Added the `$iRoundPrecision` parameter. |
176 | 176 | * @return string |
177 | 177 | */ |
178 | - static public function getReadableBytes( $nBytes, $iRoundPrecision=2 ) { |
|
178 | + static public function getReadableBytes( $nBytes, $iRoundPrecision = 2 ) { |
|
179 | 179 | $_aUnits = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); |
180 | 180 | $_nLog = log( $nBytes, 1024 ); |
181 | 181 | $_iPower = ( int ) $_nLog; |
182 | 182 | $_ifSize = pow( 1024, $_nLog - $_iPower ); |
183 | 183 | $_ifSize = round( $_ifSize, $iRoundPrecision ); |
184 | - return $_ifSize . $_aUnits[ $_iPower ]; |
|
184 | + return $_ifSize.$_aUnits[ $_iPower ]; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct( $oProp, $oMsg ) { |
29 | 29 | |
30 | - if ( ! $this->_shouldProceed( $oProp ) ) { |
|
30 | + if ( !$this->_shouldProceed( $oProp ) ) { |
|
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | private function _shouldProceed( $oProp ) { |
46 | 46 | |
47 | - if ( $oProp->bIsAdminAjax || ! $oProp->bIsAdmin ) { |
|
47 | + if ( $oProp->bIsAdminAjax || !$oProp->bIsAdmin ) { |
|
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | return ( boolean ) $oProp->bShowDebugInfo; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function _replyToGetPageLoadInfo( $sFooterHTML ) { |
72 | 72 | |
73 | 73 | // 3.8.8+ The `bShowDebugInfo` property may be updated by the user during the page load. |
74 | - if ( ! $this->oProp->bShowDebugInfo ) { |
|
74 | + if ( !$this->oProp->bShowDebugInfo ) { |
|
75 | 75 | return $sFooterHTML; |
76 | 76 | } |
77 | 77 | |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | $_sInitialMemoryUsage = $this->getReadableBytes( $_nInitialMemoryUsage ); |
106 | 106 | return "<div id='admin-page-framework-page-load-stats'>" |
107 | 107 | . "<ul>" |
108 | - . "<li>" . sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds ) . "</li>" |
|
109 | - . "<li>" . sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_sMemoryUsage, $_sMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100 . '%' ) . "</li>" |
|
110 | - . "<li>" . sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_sMemoryPeakUsage ) . "</li>" |
|
111 | - . "<li>" . sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage ) . "</li>" |
|
108 | + . "<li>".sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds )."</li>" |
|
109 | + . "<li>".sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_sMemoryUsage, $_sMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100.'%' )."</li>" |
|
110 | + . "<li>".sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_sMemoryPeakUsage )."</li>" |
|
111 | + . "<li>".sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage )."</li>" |
|
112 | 112 | . "</ul>" |
113 | 113 | . "</div>"; |
114 | 114 |
@@ -180,24 +180,24 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | - * Removes the given section(s) by section ID. |
|
184 | - * |
|
185 | - * This accesses the property storing the added section arrays and removes the specified ones. |
|
186 | - * |
|
187 | - * <h4>Example</h4> |
|
188 | - * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
189 | - * </code> |
|
190 | - * |
|
191 | - * @since 2.0.0 |
|
192 | - * @since 3.0.0 Changed the scope to public from protected. |
|
193 | - * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
194 | - * @access public |
|
195 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
196 | - * @param string $sSectionID1 the section ID to remove. |
|
197 | - * @param string $sSectionID2 (optional) another section ID to remove. |
|
198 | - * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
199 | - * @return void |
|
200 | - */ |
|
183 | + * Removes the given section(s) by section ID. |
|
184 | + * |
|
185 | + * This accesses the property storing the added section arrays and removes the specified ones. |
|
186 | + * |
|
187 | + * <h4>Example</h4> |
|
188 | + * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
189 | + * </code> |
|
190 | + * |
|
191 | + * @since 2.0.0 |
|
192 | + * @since 3.0.0 Changed the scope to public from protected. |
|
193 | + * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
194 | + * @access public |
|
195 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
196 | + * @param string $sSectionID1 the section ID to remove. |
|
197 | + * @param string $sSectionID2 (optional) another section ID to remove. |
|
198 | + * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
199 | + * @return void |
|
200 | + */ |
|
201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
202 | 202 | foreach( func_get_args() as $_sSectionID ) { |
203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
@@ -262,38 +262,38 @@ discard block |
||
262 | 262 | } |
263 | 263 | } |
264 | 264 | /** |
265 | - * Adds the given field array items into the field array property. |
|
266 | - * |
|
267 | - * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
268 | - * |
|
269 | - * @since 2.1.2 |
|
270 | - * @since 3.0.0 Changed the scope to public from protected. |
|
271 | - * @access public |
|
272 | - * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
273 | - * @return void |
|
274 | - */ |
|
265 | + * Adds the given field array items into the field array property. |
|
266 | + * |
|
267 | + * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
268 | + * |
|
269 | + * @since 2.1.2 |
|
270 | + * @since 3.0.0 Changed the scope to public from protected. |
|
271 | + * @access public |
|
272 | + * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
273 | + * @return void |
|
274 | + */ |
|
275 | 275 | public function addSettingField( $asField ) { |
276 | 276 | $this->oForm->addField( $asField ); |
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
280 | - * Removes the given field(s) by field ID. |
|
281 | - * |
|
282 | - * This accesses the property storing the added field arrays and removes the specified ones. |
|
283 | - * |
|
284 | - * <h4>Example</h4> |
|
285 | - * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
286 | - * </code> |
|
287 | - * |
|
288 | - * @since 2.0.0 |
|
289 | - * @since 3.0.0 Changed the scope to public from protected. |
|
290 | - * @access public |
|
291 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
292 | - * @param string $sFieldID1 the field ID to remove. |
|
293 | - * @param string $sFieldID2 (optional) another field ID to remove. |
|
294 | - * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
295 | - * @return void |
|
296 | - */ |
|
280 | + * Removes the given field(s) by field ID. |
|
281 | + * |
|
282 | + * This accesses the property storing the added field arrays and removes the specified ones. |
|
283 | + * |
|
284 | + * <h4>Example</h4> |
|
285 | + * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
286 | + * </code> |
|
287 | + * |
|
288 | + * @since 2.0.0 |
|
289 | + * @since 3.0.0 Changed the scope to public from protected. |
|
290 | + * @access public |
|
291 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
292 | + * @param string $sFieldID1 the field ID to remove. |
|
293 | + * @param string $sFieldID2 (optional) another field ID to remove. |
|
294 | + * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
295 | + * @return void |
|
296 | + */ |
|
297 | 297 | public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more=null ) { |
298 | 298 | foreach( func_get_args() as $_sFieldID ) { |
299 | 299 | $this->oForm->removeField( $_sFieldID ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
86 | 86 | |
87 | - foreach( func_get_args() as $asSection ) { |
|
87 | + foreach ( func_get_args() as $asSection ) { |
|
88 | 88 | $this->addSettingSection( $asSection ); |
89 | 89 | } |
90 | 90 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function addSettingSection( $asSection ) { |
109 | 109 | |
110 | - if ( ! is_array( $asSection ) ) { |
|
110 | + if ( !is_array( $asSection ) ) { |
|
111 | 111 | $this->_sTargetPageSlug = is_string( $asSection ) |
112 | 112 | ? $asSection |
113 | 113 | : $this->_sTargetPageSlug; |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | ) |
130 | 130 | ); |
131 | 131 | |
132 | - $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
132 | + $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
133 | 133 | |
134 | 134 | // A page slug is required. |
135 | - if ( ! $aSection[ 'page_slug' ] ) { |
|
135 | + if ( !$aSection[ 'page_slug' ] ) { |
|
136 | 136 | return; |
137 | 137 | } |
138 | 138 | $this->oForm->addSection( $aSection ); |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | private function _getTargetPageSlug( $aSection ) { |
149 | 149 | |
150 | 150 | $_sTargetPageSlug = $this->oUtil->getElement( |
151 | - $aSection, // subject |
|
152 | - 'page_slug', // key |
|
151 | + $aSection, // subject |
|
152 | + 'page_slug', // key |
|
153 | 153 | $this->_sTargetPageSlug // default |
154 | 154 | ); |
155 | 155 | |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | */ |
170 | 170 | private function _getTargetTabSlug( $aSection ) { |
171 | 171 | $_sTargetTabSlug = $this->oUtil->getElement( |
172 | - $aSection, // subject |
|
173 | - 'tab_slug', // key |
|
172 | + $aSection, // subject |
|
173 | + 'tab_slug', // key |
|
174 | 174 | $this->_sTargetTabSlug // default |
175 | 175 | ); |
176 | 176 | $_sTargetTabSlug = $_sTargetTabSlug |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @return void |
200 | 200 | */ |
201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
202 | - foreach( func_get_args() as $_sSectionID ) { |
|
202 | + foreach ( func_get_args() as $_sSectionID ) { |
|
203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
204 | 204 | } |
205 | 205 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * @remark The actual registration will be performed in the <em>_replyToRegisterSettings()</em> method with the <em>admin_menu</em> hook. |
258 | 258 | */ |
259 | 259 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
260 | - foreach( func_get_args() as $aField ) { |
|
260 | + foreach ( func_get_args() as $aField ) { |
|
261 | 261 | $this->addSettingField( $aField ); |
262 | 262 | } |
263 | 263 | } |
@@ -294,8 +294,8 @@ discard block |
||
294 | 294 | * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
295 | 295 | * @return void |
296 | 296 | */ |
297 | - public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more=null ) { |
|
298 | - foreach( func_get_args() as $_sFieldID ) { |
|
297 | + public function removeSettingFields( $sFieldID1, $sFieldID2 = null, $_and_more = null ) { |
|
298 | + foreach ( func_get_args() as $_sFieldID ) { |
|
299 | 299 | $this->oForm->removeField( $_sFieldID ); |
300 | 300 | } |
301 | 301 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $this->oProp->sOptionKey, |
343 | 343 | empty( $_aParams ) |
344 | 344 | ? null // will return the entire options array |
345 | - : $_aDimensionalKeys, // dimensional keys |
|
345 | + : $_aDimensionalKeys, // dimensional keys |
|
346 | 346 | $_mDefault, // default |
347 | 347 | $this->getSavedOptions() + $this->oForm->getDefaultFormValues() |
348 | 348 | ); |
@@ -361,21 +361,21 @@ discard block |
||
361 | 361 | * If the user has not submitted the form, the framework will try to return the default value set in the field definition array. |
362 | 362 | * @deprecated 3.3.0 |
363 | 363 | */ |
364 | - public function getFieldValue( $sFieldID, $sSectionID='' ) { |
|
364 | + public function getFieldValue( $sFieldID, $sSectionID = '' ) { |
|
365 | 365 | |
366 | 366 | $this->oUtil->showDeprecationNotice( |
367 | - 'The method,' . __METHOD__ . ',', // deprecated item |
|
367 | + 'The method,'.__METHOD__.',', // deprecated item |
|
368 | 368 | 'getValue()' // alternative |
369 | 369 | ); |
370 | 370 | |
371 | 371 | $_aOptions = $this->oUtil->uniteArrays( $this->oProp->aOptions, $this->oForm->getDefaultFormValues() ); |
372 | 372 | /* If it's saved, return it */ |
373 | - if ( ! $sSectionID ) { |
|
373 | + if ( !$sSectionID ) { |
|
374 | 374 | if ( array_key_exists( $sFieldID, $_aOptions ) ) { |
375 | 375 | return $_aOptions[ $sFieldID ]; |
376 | 376 | } |
377 | 377 | // loop through section elements |
378 | - foreach( $_aOptions as $aOptions ) { |
|
378 | + foreach ( $_aOptions as $aOptions ) { |
|
379 | 379 | if ( array_key_exists( $sFieldID, $aOptions ) ) { |
380 | 380 | return $aOptions[ $sFieldID ]; |
381 | 381 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFramework_Form_Model___DefaultValues extends AdminPageFramework_Form_Base { |
18 | 18 | |
19 | - public $aFieldsets = array(); |
|
19 | + public $aFieldsets = array(); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Sets up hooks. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $_aParameters = func_get_args() + array( |
28 | 28 | $this->aFieldsets, |
29 | 29 | ); |
30 | - $this->aFieldsets = $_aParameters[ 0 ]; |
|
30 | + $this->aFieldsets = $_aParameters[ 0 ]; |
|
31 | 31 | |
32 | 32 | } |
33 | 33 | |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | * @return array |
81 | 81 | */ |
82 | 82 | private function ___getDefaultValues( $aFieldsets, $aDefaultOptions ) { |
83 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
83 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
84 | 84 | $_aSectionPath = explode( '|', $_sSectionPath ); |
85 | - foreach( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
85 | + foreach ( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
86 | 86 | $_aFieldPath = explode( '|', $_sFieldPath ); |
87 | 87 | $this->setMultiDimensionalArray( |
88 | - $aDefaultOptions, // by reference |
|
88 | + $aDefaultOptions, // by reference |
|
89 | 89 | '_default' === $_sSectionPath |
90 | 90 | ? array( $_sFieldPath ) |
91 | 91 | : array_merge( $_aSectionPath, $_aFieldPath ), // key address |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | // If there are no sub-fields |
115 | 115 | if ( count( $_aSubFields ) === 0 ) { |
116 | 116 | return $this->getElement( |
117 | - $aFieldset, // subject |
|
118 | - 'value', // key |
|
117 | + $aFieldset, // subject |
|
118 | + 'value', // key |
|
119 | 119 | $this->getElement( // default value |
120 | - $aFieldset, // subject |
|
121 | - 'default', // key |
|
120 | + $aFieldset, // subject |
|
121 | + 'default', // key |
|
122 | 122 | null // default value |
123 | 123 | ) |
124 | 124 | ); |
@@ -127,13 +127,13 @@ discard block |
||
127 | 127 | // Otherwise, there are sub-fields |
128 | 128 | $_aDefault = array(); |
129 | 129 | array_unshift( $_aSubFields, $aFieldset ); // insert the main field into the very first index. |
130 | - foreach( $_aSubFields as $_iIndex => $_aField ) { |
|
130 | + foreach ( $_aSubFields as $_iIndex => $_aField ) { |
|
131 | 131 | $_aDefault[ $_iIndex ] = $this->getElement( |
132 | - $_aField, // subject |
|
133 | - 'value', // key |
|
132 | + $_aField, // subject |
|
133 | + 'value', // key |
|
134 | 134 | $this->getElement( // default value |
135 | - $_aField, // subject |
|
136 | - 'default', // key |
|
135 | + $_aField, // subject |
|
136 | + 'default', // key |
|
137 | 137 | null // default value |
138 | 138 | ) |
139 | 139 | ); |
@@ -93,18 +93,18 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | // If the section ID is not registered, return false. |
96 | - if ( ! array_key_exists( $sID, $this->aSectionsets ) ) { |
|
96 | + if ( !array_key_exists( $sID, $this->aSectionsets ) ) { |
|
97 | 97 | return false; |
98 | 98 | } |
99 | 99 | |
100 | 100 | // the fields array's first dimension is also filled with the keys of section ids. |
101 | - if ( ! array_key_exists( $sID, $this->aFieldsets ) ) { |
|
101 | + if ( !array_key_exists( $sID, $this->aFieldsets ) ) { |
|
102 | 102 | return false; |
103 | 103 | } |
104 | 104 | |
105 | 105 | // Since numeric IDs are denied at the beginning of the method, the elements will not be sub-sections. |
106 | 106 | $_bIsSection = false; |
107 | - foreach( $this->aFieldsets as $_sSectionID => $_aFields ) { |
|
107 | + foreach ( $this->aFieldsets as $_sSectionID => $_aFields ) { |
|
108 | 108 | |
109 | 109 | if ( $_sSectionID == $sID ) { |
110 | 110 | $_bIsSection = true; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return boolean |
131 | 131 | */ |
132 | 132 | public function canUserView( $sCapability ) { |
133 | - if ( ! $sCapability ) { |
|
133 | + if ( !$sCapability ) { |
|
134 | 134 | return true; |
135 | 135 | } |
136 | 136 | return ( boolean ) current_user_can( $sCapability ); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return string |
59 | 59 | * @since 3.7.0 |
60 | 60 | */ |
61 | - public function get( $bTableRow=true ) { |
|
61 | + public function get( $bTableRow = true ) { |
|
62 | 62 | |
63 | 63 | $_sMethodName = $this->getAOrB( |
64 | 64 | $bTableRow, |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ); |
68 | 68 | |
69 | 69 | $_sOutput = ''; |
70 | - foreach( $this->aFieldsetsPerSection as $_aFieldset ) { |
|
70 | + foreach ( $this->aFieldsetsPerSection as $_aFieldset ) { |
|
71 | 71 | |
72 | 72 | $_oFieldsetOutputFormatter = new AdminPageFramework_Form_Model___Format_FieldsetOutput( |
73 | 73 | $_aFieldset, |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ); |
77 | 77 | |
78 | 78 | $_aFieldset = $_oFieldsetOutputFormatter->get(); |
79 | - if ( ! $this->callBack( $this->aCallbacks[ 'is_fieldset_visible' ], array( true, $_aFieldset ) ) ) { |
|
79 | + if ( !$this->callBack( $this->aCallbacks[ 'is_fieldset_visible' ], array( true, $_aFieldset ) ) ) { |
|
80 | 80 | continue; |
81 | 81 | } |
82 | 82 |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | */ |
45 | 45 | protected function _isInThePage() { |
46 | 46 | |
47 | - if ( ! $this->oProp->bIsAdmin ) { |
|
47 | + if ( !$this->oProp->bIsAdmin ) { |
|
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | |
51 | 51 | // Foe admin-ajax.php, aQuery holds the referer's GET URL parameters so the check covers the cases of ajax calls. |
52 | 52 | $_sPageSlug = $this->oUtil->getElement( $this->oProp->aQuery, array( 'page' ), '' ); |
53 | - if ( ! $this->___isAddedPage( $_sPageSlug ) ) { |
|
53 | + if ( !$this->___isAddedPage( $_sPageSlug ) ) { |
|
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | return true; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | private function ___isAddedPage( $sPageSlug ) { |
64 | 64 | |
65 | 65 | // Case: page slugs are stored with numeric index |
66 | - if ( ! $this->oUtil->isAssociative( $this->oProp->aPageSlugs ) ) { |
|
66 | + if ( !$this->oUtil->isAssociative( $this->oProp->aPageSlugs ) ) { |
|
67 | 67 | return in_array( $sPageSlug, $this->oProp->aPageSlugs, true ); |
68 | 68 | } |
69 | 69 |