@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @internal |
27 | 27 | */ |
28 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
28 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
29 | 29 | |
30 | 30 | parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain ); |
31 | 31 |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
90 | 90 | * @internal |
91 | 91 | */ |
92 | - public function __call( $sMethodName, $aArgs=null ) { |
|
92 | + public function __call( $sMethodName, $aArgs=null ) { |
|
93 | 93 | |
94 | 94 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
95 | 95 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | return true; |
264 | 264 | } |
265 | 265 | |
266 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
266 | + if ( ! isset( $_GET[ 'page' ] ) ) { |
|
267 | 267 | return false; |
268 | 268 | } |
269 | 269 |
@@ -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 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $this->oForm->aSections[ '_default' ][ 'tab_slug' ] = $sTabSlug ? $sTabSlug : null; |
166 | 166 | |
167 | 167 | // Do actions, class -> page -> in-page tab |
168 | - $this->load(); // 3.7.12+ |
|
168 | + $this->load(); // 3.7.12+ |
|
169 | 169 | $this->oUtil->addAndDoActions( |
170 | 170 | $this, // the caller object |
171 | 171 | array( |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $this->oUtil->addAndDoActions( |
181 | 181 | $this, // the caller object |
182 | - array( "load_{$sPageSlug}_" . $this->oProp->getCurrentTabSlug( $sPageSlug ) ), |
|
182 | + array( "load_{$sPageSlug}_".$this->oProp->getCurrentTabSlug( $sPageSlug ) ), |
|
183 | 183 | $this // the admin page object - this lets third-party scripts use the framework methods. |
184 | 184 | ); |
185 | 185 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) { |
208 | 208 | return false; |
209 | 209 | } |
210 | - if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
210 | + if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
211 | 211 | return false; |
212 | 212 | } |
213 | 213 | if ( $sScreenID !== $this->oProp->aPageHooks[ $sPageSlug ] ) { |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | |
236 | 236 | // Nothing to do in the network admin area. |
237 | - return ! is_network_admin(); |
|
237 | + return !is_network_admin(); |
|
238 | 238 | |
239 | 239 | } |
240 | 240 | |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | public function _isInThePage() { |
250 | 250 | |
251 | 251 | // If the setUp method is not loaded yet, |
252 | - if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) { |
|
252 | + if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) { |
|
253 | 253 | return true; |
254 | 254 | } |
255 | 255 | |
256 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
256 | + if ( !isset( $_GET[ 'page' ] ) ) { |
|
257 | 257 | return false; |
258 | 258 | } |
259 | 259 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | // tab |
47 | 47 | if ( $_sPageSlug && $_sTabSlug ) { |
48 | - $this->oProp->sStyle = $this->addAndApplyFilters( |
|
48 | + $this->oProp->sStyle = $this->addAndApplyFilters( |
|
49 | 49 | $_oCaller, |
50 | 50 | "style_{$_sPageSlug}_{$_sTabSlug}", |
51 | 51 | $this->oProp->sStyle |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | // page |
56 | 56 | if ( $_sPageSlug ) { |
57 | - $this->oProp->sStyle = $this->addAndApplyFilters( |
|
57 | + $this->oProp->sStyle = $this->addAndApplyFilters( |
|
58 | 58 | $_oCaller, |
59 | 59 | "style_{$_sPageSlug}", |
60 | 60 | $this->oProp->sStyle |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return string The tab slug if the tab has been added. |
89 | 89 | */ |
90 | 90 | private function _getCurrentTabSlugForFilter( $sPageSlug ) { |
91 | - $_sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
|
91 | + $_sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
|
92 | 92 | return isset( $this->oProp->aInPageTabs[ $sPageSlug ][ $_sTabSlug ] ) |
93 | 93 | ? $_sTabSlug |
94 | 94 | : ''; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // tab |
118 | 118 | if ( $_sPageSlug && $_sTabSlug ) { |
119 | - $this->oProp->sScript = $this->addAndApplyFilters( |
|
119 | + $this->oProp->sScript = $this->addAndApplyFilters( |
|
120 | 120 | $_oCaller, |
121 | 121 | "script_{$_sPageSlug}_{$_sTabSlug}", |
122 | 122 | $this->oProp->sScript |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | // page |
127 | 127 | if ( $_sPageSlug ) { |
128 | - $this->oProp->sScript = $this->addAndApplyFilters( |
|
128 | + $this->oProp->sScript = $this->addAndApplyFilters( |
|
129 | 129 | $_oCaller, |
130 | 130 | "script_{$_sPageSlug}", |
131 | 131 | $this->oProp->sScript |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | * @since 2.1.5 |
144 | 144 | * @internal |
145 | 145 | */ |
146 | - public function _enqueueStyles( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
146 | + public function _enqueueStyles( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
147 | 147 | |
148 | 148 | $_aHandleIDs = array(); |
149 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
150 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
149 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
150 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
151 | 151 | } |
152 | 152 | return $_aHandleIDs; |
153 | 153 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
174 | 174 | * @internal |
175 | 175 | */ |
176 | - public function _enqueueStyle( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
176 | + public function _enqueueStyle( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
177 | 177 | return $this->_enqueueResourceByType( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs, 'style' ); |
178 | 178 | } |
179 | 179 | |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | * |
183 | 183 | * @since 2.1.5 |
184 | 184 | */ |
185 | - public function _enqueueScripts( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
185 | + public function _enqueueScripts( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
186 | 186 | |
187 | 187 | $_aHandleIDs = array(); |
188 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
189 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
188 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
189 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
|
190 | 190 | } |
191 | 191 | return $_aHandleIDs; |
192 | 192 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
214 | 214 | * @internal |
215 | 215 | */ |
216 | - public function _enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
216 | + public function _enqueueScript( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
217 | 217 | return $this->_enqueueResourceByType( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs, 'script' ); |
218 | 218 | } |
219 | 219 | /** |
@@ -226,20 +226,20 @@ discard block |
||
226 | 226 | * @param array $aCustomArgs A custom argument array. |
227 | 227 | * @param string $sType Accepts 'style' or 'script' |
228 | 228 | */ |
229 | - private function _enqueueResourceByType( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array(), $sType='style' ) { |
|
229 | + private function _enqueueResourceByType( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array(), $sType = 'style' ) { |
|
230 | 230 | |
231 | - $sSRC = trim( $sSRC ); |
|
231 | + $sSRC = trim( $sSRC ); |
|
232 | 232 | if ( empty( $sSRC ) ) { |
233 | 233 | return ''; |
234 | 234 | } |
235 | - $sSRC = $this->getResolvedSRC( $sSRC ); |
|
235 | + $sSRC = $this->getResolvedSRC( $sSRC ); |
|
236 | 236 | |
237 | 237 | // Get the property name for the type |
238 | 238 | $_sContainerPropertyName = $this->_getContainerPropertyNameByType( $sType ); |
239 | 239 | $_sEnqueuedIndexPropertyName = $this->_getEnqueuedIndexPropertyNameByType( $sType ); |
240 | 240 | |
241 | 241 | // setting the key based on the url prevents duplicate items |
242 | - $_sSRCHash = md5( $sSRC ); |
|
242 | + $_sSRCHash = md5( $sSRC ); |
|
243 | 243 | if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { |
244 | 244 | return ''; |
245 | 245 | } |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | 'sTabSlug' => $sTabSlug, |
251 | 251 | 'sSRC' => $sSRC, |
252 | 252 | 'sType' => $sType, |
253 | - 'handle_id' => $sType . '_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
253 | + 'handle_id' => $sType.'_'.$this->oProp->sClassName.'_'.( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ), |
|
254 | 254 | ) |
255 | 255 | + self::$_aStructure_EnqueuingResources |
256 | 256 | ; |
257 | 257 | |
258 | 258 | // Store the attributes in another container by url. |
259 | - $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ]['handle_id'] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ]['attributes']; |
|
259 | + $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'attributes' ]; |
|
260 | 260 | |
261 | 261 | return $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'handle_id' ]; |
262 | 262 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @since 3.0.0 |
297 | 297 | * @internal |
298 | 298 | */ |
299 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
299 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
300 | 300 | return $this->_enqueueStyle( $sSRC, '', '', $aCustomArgs ); |
301 | 301 | } |
302 | 302 | /** |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @since 3.0.0 |
307 | 307 | * @internal |
308 | 308 | */ |
309 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
309 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
310 | 310 | return $this->_enqueueScript( $sSRC, '', '', $aCustomArgs ); |
311 | 311 | } |
312 | 312 | |
@@ -323,11 +323,11 @@ discard block |
||
323 | 323 | |
324 | 324 | $sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
325 | 325 | $sCurrentTabSlug = $this->oProp->getCurrentTabSlug( $sCurrentPageSlug ); |
326 | - $sPageSlug = $aEnqueueItem['sPageSlug']; |
|
327 | - $sTabSlug = $aEnqueueItem['sTabSlug']; |
|
326 | + $sPageSlug = $aEnqueueItem[ 'sPageSlug' ]; |
|
327 | + $sTabSlug = $aEnqueueItem[ 'sTabSlug' ]; |
|
328 | 328 | |
329 | 329 | // If the page slug is not specified and the currently loading page is one of the pages that is added by the framework, |
330 | - if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework) |
|
330 | + if ( !$sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework) |
|
331 | 331 | return $this->_enqueueSRC( $aEnqueueItem ); |
332 | 332 | } |
333 | 333 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | // If the tab slug is not specified and the page slug is specified, |
343 | 343 | // and if the current loading page slug and the specified one matches, |
344 | 344 | if ( |
345 | - ( $sPageSlug && ! $sTabSlug ) |
|
345 | + ( $sPageSlug && !$sTabSlug ) |
|
346 | 346 | && ( $sCurrentPageSlug == $sPageSlug ) |
347 | 347 | ) { |
348 | 348 | return $this->_enqueueSRC( $aEnqueueItem ); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | private function _enqueueResourceByType( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array(), $sType='style' ) { |
230 | 230 | |
231 | 231 | $sSRC = trim( $sSRC ); |
232 | - if ( empty( $sSRC ) ) { |
|
232 | + if ( empty( $sSRC ) ) { |
|
233 | 233 | return ''; |
234 | 234 | } |
235 | 235 | $sSRC = $this->getResolvedSRC( $sSRC ); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | // setting the key based on the url prevents duplicate items |
242 | 242 | $_sSRCHash = md5( $sSRC ); |
243 | - if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { |
|
243 | + if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { |
|
244 | 244 | return ''; |
245 | 245 | } |
246 | 246 | |
@@ -327,7 +327,8 @@ discard block |
||
327 | 327 | $sTabSlug = $aEnqueueItem['sTabSlug']; |
328 | 328 | |
329 | 329 | // If the page slug is not specified and the currently loading page is one of the pages that is added by the framework, |
330 | - if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework) |
|
330 | + if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { |
|
331 | +// means script-global(among pages added by the framework) |
|
331 | 332 | return $this->_enqueueSRC( $aEnqueueItem ); |
332 | 333 | } |
333 | 334 |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function _replyToRegisterHelpTabs() { |
68 | 68 | |
69 | - if ( ! $this->_isInThePage() ) { |
|
69 | + if ( !$this->_isInThePage() ) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
74 | 74 | $_sCurrentTabSlug = $this->oProp->getCurrentTabSlug( $_sCurrentPageSlug ); |
75 | 75 | |
76 | - if ( ! $this->oProp->isPageAdded( $_sCurrentPageSlug ) ) { |
|
76 | + if ( !$this->oProp->isPageAdded( $_sCurrentPageSlug ) ) { |
|
77 | 77 | return; |
78 | 78 | } |
79 | 79 | |
80 | - foreach( $this->oProp->aHelpTabs as $aHelpTab ) { |
|
80 | + foreach ( $this->oProp->aHelpTabs as $aHelpTab ) { |
|
81 | 81 | $this->_registerHelpTab( $aHelpTab, $_sCurrentPageSlug, $_sCurrentTabSlug ); |
82 | 82 | } |
83 | 83 | |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | private function _registerHelpTab( array $aHelpTab, $sCurrentPageSlug, $sCurrentTabSlug ) { |
92 | 92 | |
93 | - if ( $sCurrentPageSlug != $aHelpTab['sPageSlug'] ) { |
|
93 | + if ( $sCurrentPageSlug != $aHelpTab[ 'sPageSlug' ] ) { |
|
94 | 94 | return; |
95 | 95 | } |
96 | - if ( isset( $aHelpTab['sPageTabSlug'] ) && ! empty( $aHelpTab['sPageTabSlug'] ) && $sCurrentTabSlug != $aHelpTab['sPageTabSlug'] ) { |
|
96 | + if ( isset( $aHelpTab[ 'sPageTabSlug' ] ) && !empty( $aHelpTab[ 'sPageTabSlug' ] ) && $sCurrentTabSlug != $aHelpTab[ 'sPageTabSlug' ] ) { |
|
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
@@ -132,24 +132,24 @@ discard block |
||
132 | 132 | $aHelpTab = ( array ) $aHelpTab + self::$_aStructure_HelpTabUserArray; |
133 | 133 | |
134 | 134 | // If the key is not set, that means the help tab array is not created yet. So create it and go back. |
135 | - if ( ! isset( $this->oProp->aHelpTabs[ $aHelpTab['help_tab_id'] ] ) ) { |
|
136 | - $this->oProp->aHelpTabs[ $aHelpTab['help_tab_id'] ] = array( |
|
137 | - 'sID' => $aHelpTab['help_tab_id'], |
|
138 | - 'sTitle' => $aHelpTab['help_tab_title'], |
|
139 | - 'aContent' => ! empty( $aHelpTab['help_tab_content'] ) ? array( $this->_formatHelpDescription( $aHelpTab['help_tab_content'] ) ) : array(), |
|
140 | - 'aSidebar' => ! empty( $aHelpTab['help_tab_sidebar_content'] ) ? array( $this->_formatHelpDescription( $aHelpTab['help_tab_sidebar_content'] ) ) : array(), |
|
141 | - 'sPageSlug' => $aHelpTab['page_slug'], |
|
142 | - 'sPageTabSlug' => $aHelpTab['page_tab_slug'], |
|
135 | + if ( !isset( $this->oProp->aHelpTabs[ $aHelpTab[ 'help_tab_id' ] ] ) ) { |
|
136 | + $this->oProp->aHelpTabs[ $aHelpTab[ 'help_tab_id' ] ] = array( |
|
137 | + 'sID' => $aHelpTab[ 'help_tab_id' ], |
|
138 | + 'sTitle' => $aHelpTab[ 'help_tab_title' ], |
|
139 | + 'aContent' => !empty( $aHelpTab[ 'help_tab_content' ] ) ? array( $this->_formatHelpDescription( $aHelpTab[ 'help_tab_content' ] ) ) : array(), |
|
140 | + 'aSidebar' => !empty( $aHelpTab[ 'help_tab_sidebar_content' ] ) ? array( $this->_formatHelpDescription( $aHelpTab[ 'help_tab_sidebar_content' ] ) ) : array(), |
|
141 | + 'sPageSlug' => $aHelpTab[ 'page_slug' ], |
|
142 | + 'sPageTabSlug' => $aHelpTab[ 'page_tab_slug' ], |
|
143 | 143 | ); |
144 | 144 | return; |
145 | 145 | } |
146 | 146 | |
147 | 147 | // This line will be reached if the help tab array is already set. In this case, just append an array element into the keys. |
148 | - if ( ! empty( $aHelpTab['help_tab_content'] ) ) { |
|
149 | - $this->oProp->aHelpTabs[ $aHelpTab['help_tab_id'] ]['aContent'][] = $this->_formatHelpDescription( $aHelpTab['help_tab_content'] ); |
|
148 | + if ( !empty( $aHelpTab[ 'help_tab_content' ] ) ) { |
|
149 | + $this->oProp->aHelpTabs[ $aHelpTab[ 'help_tab_id' ] ][ 'aContent' ][ ] = $this->_formatHelpDescription( $aHelpTab[ 'help_tab_content' ] ); |
|
150 | 150 | } |
151 | - if ( ! empty( $aHelpTab['help_tab_sidebar_content'] ) ) { |
|
152 | - $this->oProp->aHelpTabs[ $aHelpTab['help_tab_id'] ]['aSidebar'][] = $this->_formatHelpDescription( $aHelpTab['help_tab_sidebar_content'] ); |
|
151 | + if ( !empty( $aHelpTab[ 'help_tab_sidebar_content' ] ) ) { |
|
152 | + $this->oProp->aHelpTabs[ $aHelpTab[ 'help_tab_id' ] ][ 'aSidebar' ][ ] = $this->_formatHelpDescription( $aHelpTab[ 'help_tab_sidebar_content' ] ); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
70 | 70 | $_sCurrentTabSlug = $this->oProp->getCurrentTabSlug( $_sCurrentPageSlug ); |
71 | 71 | |
72 | - if ( ! $this->oProp->isPageAdded( $_sCurrentPageSlug ) ) { |
|
72 | + if ( ! $this->oProp->isPageAdded( $_sCurrentPageSlug ) ) { |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | private function _registerHelpTab( array $aHelpTab, $sCurrentPageSlug, $sCurrentTabSlug ) { |
88 | 88 | |
89 | - if ( $sCurrentPageSlug != $aHelpTab['sPageSlug'] ) { |
|
89 | + if ( $sCurrentPageSlug != $aHelpTab['sPageSlug'] ) { |
|
90 | 90 | return; |
91 | 91 | } |
92 | 92 | if ( isset( $aHelpTab['sPageTabSlug'] ) && ! empty( $aHelpTab['sPageTabSlug'] ) && $sCurrentTabSlug != $aHelpTab['sPageTabSlug'] ) { |
@@ -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-2016 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2016 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides an abstract base class to create meta boxes in generic admin pages created by the framework. |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function _replyToSetFooterInfo() { |
38 | 38 | |
39 | - if ( ! $this->oProp->isPageAdded() ) { |
|
39 | + if ( !$this->oProp->isPageAdded() ) { |
|
40 | 40 | return; |
41 | 41 | } |
42 | 42 | parent::_replyToSetFooterInfo(); |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function _addLinkToPluginDescription( $asLinks ) { |
57 | 57 | |
58 | - if ( ! is_array( $asLinks ) ) { |
|
59 | - $this->oProp->aPluginDescriptionLinks[] = $asLinks; |
|
58 | + if ( !is_array( $asLinks ) ) { |
|
59 | + $this->oProp->aPluginDescriptionLinks[ ] = $asLinks; |
|
60 | 60 | } else { |
61 | 61 | $this->oProp->aPluginDescriptionLinks = array_merge( |
62 | 62 | $this->oProp->aPluginDescriptionLinks, |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function _addLinkToPluginTitle( $asLinks ) { |
83 | 83 | |
84 | - if ( ! is_array( $asLinks ) ) { |
|
85 | - $this->oProp->aPluginTitleLinks[] = $asLinks; |
|
84 | + if ( !is_array( $asLinks ) ) { |
|
85 | + $this->oProp->aPluginTitleLinks[ ] = $asLinks; |
|
86 | 86 | } else { |
87 | 87 | $this->oProp->aPluginTitleLinks = array_merge( |
88 | 88 | $this->oProp->aPluginTitleLinks, |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | $_sPluginBaseName = plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ); |
118 | 118 | add_filter( |
119 | - $this->_sFilterSuffix_PluginActionLinks . $_sPluginBaseName, |
|
119 | + $this->_sFilterSuffix_PluginActionLinks.$_sPluginBaseName, |
|
120 | 120 | array( $this, '_replyToAddPluginActionLinks' ) |
121 | 121 | ); |
122 | 122 | } |
@@ -128,14 +128,14 @@ discard block |
||
128 | 128 | * @callback filter admin_footer_text |
129 | 129 | * @return string |
130 | 130 | */ |
131 | - public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) { |
|
131 | + public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) { |
|
132 | 132 | |
133 | - if ( ! $this->_isPageAdded() ) { |
|
133 | + if ( !$this->_isPageAdded() ) { |
|
134 | 134 | return $sLinkHTML; // $sLinkHTML is given by the hook. |
135 | 135 | } |
136 | - $sLinkHTML = empty( $this->oProp->aScriptInfo['sName'] ) |
|
136 | + $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] ) |
|
137 | 137 | ? $sLinkHTML |
138 | - : $this->oProp->aFooterInfo['sLeft']; |
|
138 | + : $this->oProp->aFooterInfo[ 'sLeft' ]; |
|
139 | 139 | |
140 | 140 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
141 | 141 | $_sTabSlug = $this->oProp->getCurrentTabSlug(); |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | array( |
147 | 147 | $this->getAOrB( |
148 | 148 | $_sTabSlug, |
149 | - 'footer_left_' . $_sPageSlug . '_' . $_sTabSlug, |
|
149 | + 'footer_left_'.$_sPageSlug.'_'.$_sTabSlug, |
|
150 | 150 | null // will be ignored |
151 | 151 | ), |
152 | - 'footer_left_' . $_sPageSlug, |
|
153 | - 'footer_left_' . $this->oProp->sClassName |
|
152 | + 'footer_left_'.$_sPageSlug, |
|
153 | + 'footer_left_'.$this->oProp->sClassName |
|
154 | 154 | ), |
155 | 155 | $sLinkHTML |
156 | 156 | ); |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | * @callback filter update_footer |
164 | 164 | * @return string |
165 | 165 | */ |
166 | - public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) { |
|
166 | + public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) { |
|
167 | 167 | |
168 | - if ( ! $this->_isPageAdded() ) { |
|
168 | + if ( !$this->_isPageAdded() ) { |
|
169 | 169 | return $sLinkHTML; // $sLinkTHML is given by the hook. |
170 | 170 | } |
171 | 171 | |
@@ -178,13 +178,13 @@ discard block |
||
178 | 178 | array( |
179 | 179 | $this->getAOrB( |
180 | 180 | $_sTabSlug, |
181 | - 'footer_right_' . $_sPageSlug . '_' . $_sTabSlug, |
|
181 | + 'footer_right_'.$_sPageSlug.'_'.$_sTabSlug, |
|
182 | 182 | null // will be ignored |
183 | 183 | ), |
184 | - 'footer_right_' . $_sPageSlug, |
|
185 | - 'footer_right_' . $this->oProp->sClassName |
|
184 | + 'footer_right_'.$_sPageSlug, |
|
185 | + 'footer_right_'.$this->oProp->sClassName |
|
186 | 186 | ), |
187 | - $this->oProp->aFooterInfo['sRight'] |
|
187 | + $this->oProp->aFooterInfo[ 'sRight' ] |
|
188 | 188 | ); |
189 | 189 | |
190 | 190 | } |
@@ -196,10 +196,10 @@ discard block |
||
196 | 196 | */ |
197 | 197 | private function _isPageAdded() { |
198 | 198 | |
199 | - if ( ! isset( $_GET['page'] ) ) { |
|
199 | + if ( !isset( $_GET[ 'page' ] ) ) { |
|
200 | 200 | return false; |
201 | 201 | } |
202 | - return ( bool ) $this->oProp->isPageAdded( $_GET['page'] ); |
|
202 | + return ( bool ) $this->oProp->isPageAdded( $_GET[ 'page' ] ); |
|
203 | 203 | |
204 | 204 | } |
205 | 205 | /** |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | : $this->oProp->sLabelPluginSettingsLink; |
221 | 221 | |
222 | 222 | // If the user disables the settings link, the label property is empty. If so, do not add it. |
223 | - if ( ! $this->oProp->sLabelPluginSettingsLink ) { |
|
223 | + if ( !$this->oProp->sLabelPluginSettingsLink ) { |
|
224 | 224 | return $aLinks; |
225 | 225 | } |
226 | 226 | |
@@ -238,13 +238,13 @@ discard block |
||
238 | 238 | array_unshift( |
239 | 239 | $aLinks, |
240 | 240 | // '<a href="' . esc_url( $_sLinkURL ) . '">' |
241 | - '<a ' . $this->getAttributes( |
|
241 | + '<a '.$this->getAttributes( |
|
242 | 242 | array( |
243 | 243 | 'href' => esc_url( $_sLinkURL ), |
244 | 244 | // 3.5.7+ Added for acceptance testing |
245 | 245 | 'class' => 'apf-plugin-title-action-link apf-post-type', |
246 | 246 | ) |
247 | - ) . '>' |
|
247 | + ).'>' |
|
248 | 248 | . $this->oProp->sLabelPluginSettingsLink |
249 | 249 | . '</a>' |
250 | 250 | ); |
@@ -266,16 +266,16 @@ discard block |
||
266 | 266 | |
267 | 267 | // Backward compatibility sanitisation. |
268 | 268 | $_aAddingLinks = array(); |
269 | - foreach( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) { |
|
269 | + foreach ( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) { |
|
270 | 270 | |
271 | - if ( ! $_sLLinkHTML ) { |
|
271 | + if ( !$_sLLinkHTML ) { |
|
272 | 272 | continue; |
273 | 273 | } |
274 | 274 | if ( is_array( $_sLLinkHTML ) ) { // should not be an array |
275 | 275 | $_aAddingLinks = array_merge( $_sLLinkHTML, $_aAddingLinks ); |
276 | 276 | continue; |
277 | 277 | } |
278 | - $_aAddingLinks[] = ( string ) $_sLLinkHTML; |
|
278 | + $_aAddingLinks[ ] = ( string ) $_sLLinkHTML; |
|
279 | 279 | |
280 | 280 | } |
281 | 281 | return array_merge( $aLinks, $_aAddingLinks ); |
@@ -291,13 +291,13 @@ discard block |
||
291 | 291 | public function _replyToAddPluginActionLinks( $aLinks ) { |
292 | 292 | |
293 | 293 | $_aAddingLinks = array(); |
294 | - foreach( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) { |
|
294 | + foreach ( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) { |
|
295 | 295 | |
296 | 296 | if ( is_array( $_sLinkHTML ) ) { |
297 | 297 | $_aAddingLinks = array_merge( $_sLinkHTML, $aAddingLinks ); |
298 | 298 | continue; |
299 | 299 | } |
300 | - $_aAddingLinks[] = ( string ) $_sLinkHTML; |
|
300 | + $_aAddingLinks[ ] = ( string ) $_sLinkHTML; |
|
301 | 301 | |
302 | 302 | } |
303 | 303 | return array_merge( $aLinks, $_aAddingLinks ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function _replyToSetFooterInfo() { |
38 | 38 | |
39 | - if ( ! $this->oProp->isPageAdded() ) { |
|
39 | + if ( ! $this->oProp->isPageAdded() ) { |
|
40 | 40 | return; |
41 | 41 | } |
42 | 42 | parent::_replyToSetFooterInfo(); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | public function _replyToAddSettingsLinkInPluginListingPage( $aLinks ) { |
212 | 212 | |
213 | 213 | // If the sub-pages are not added, do nothing. |
214 | - if ( count( $this->oProp->aPages ) < 1 ) { |
|
214 | + if ( count( $this->oProp->aPages ) < 1 ) { |
|
215 | 215 | return $aLinks; |
216 | 216 | } |
217 | 217 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | */ |
261 | 261 | public function _replyToAddLinkToPluginDescription( $aLinks, $sFile ) { |
262 | 262 | |
263 | - if ( $sFile !== plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ) ) { |
|
263 | + if ( $sFile !== plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ) ) { |
|
264 | 264 | return $aLinks; |
265 | 265 | } |
266 | 266 | |
@@ -271,7 +271,8 @@ discard block |
||
271 | 271 | if ( ! $_sLLinkHTML ) { |
272 | 272 | continue; |
273 | 273 | } |
274 | - if ( is_array( $_sLLinkHTML ) ) { // should not be an array |
|
274 | + if ( is_array( $_sLLinkHTML ) ) { |
|
275 | +// should not be an array |
|
275 | 276 | $_aAddingLinks = array_merge( $_sLLinkHTML, $_aAddingLinks ); |
276 | 277 | continue; |
277 | 278 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2016 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2016 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for HTML link elements to be embedded in admin pages created by the framework. |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->oProp->aPluginTitleLinks = array_merge( |
88 | 88 | $this->oProp->aPluginTitleLinks, |
89 | 89 | $asLinks |
90 | - ); |
|
90 | + ); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $this->_addFilterHook_PluginTitleActionLink(); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Model__FormSubmission__Validator__ContactForm extends AdminPageFramework_Model__FormSubmission__Validator_Base { |
19 | 19 | |
20 | - public $sActionHookPrefix = 'try_validation_after_'; // 3.7.6 Changed it from `try_validation_before_` |
|
20 | + public $sActionHookPrefix = 'try_validation_after_'; // 3.7.6 Changed it from `try_validation_before_` |
|
21 | 21 | public $iHookPriority = 10; |
22 | 22 | public $iCallbackParameters = 5; |
23 | 23 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
35 | 35 | |
36 | 36 | // Check whether sending an email has been confirmed by the user or not. |
37 | - if ( ! $this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
37 | + if ( !$this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | $this->getElement( $aSubmitInformation, 'section_id' ) |
46 | 46 | ); |
47 | 47 | $this->oFactory->oProp->_bDisableSavingOptions = true; |
48 | - $this->deleteTransient( 'apf_tfd' . md5( 'temporary_form_data_' . $this->oFactory->oProp->sClassName . get_current_user_id() ) ); |
|
48 | + $this->deleteTransient( 'apf_tfd'.md5( 'temporary_form_data_'.$this->oFactory->oProp->sClassName.get_current_user_id() ) ); |
|
49 | 49 | |
50 | 50 | // Schedule to remove the confirmation url query key. |
51 | 51 | add_action( "setting_update_url_{$this->oFactory->oProp->sClassName}", array( $this, '_replyToRemoveConfirmationQueryKey' ) ); |
52 | 52 | |
53 | 53 | // Go to the catch clause. |
54 | - $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clause. |
|
54 | + $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clause. |
|
55 | 55 | $_oException->aReturn = $aInputs; |
56 | 56 | throw $_oException; |
57 | 57 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | private function _sendEmailInBackground( $aInputs, $sPressedInputNameFlat, $sSubmitSectionID ) { |
88 | 88 | |
89 | - $_sTranskentKey = 'apf_em_' . md5( $sPressedInputNameFlat . get_current_user_id() ); |
|
89 | + $_sTranskentKey = 'apf_em_'.md5( $sPressedInputNameFlat.get_current_user_id() ); |
|
90 | 90 | $_aEmailOptions = $this->getTransient( $_sTranskentKey ); |
91 | 91 | $this->deleteTransient( $_sTranskentKey ); |
92 | 92 | |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | 'name' => '', |
102 | 102 | ); |
103 | 103 | |
104 | - $_sTransientKey = 'apf_emd_' . md5( $sPressedInputNameFlat . get_current_user_id() ); |
|
104 | + $_sTransientKey = 'apf_emd_'.md5( $sPressedInputNameFlat.get_current_user_id() ); |
|
105 | 105 | $_aFormEmailData = array( |
106 | 106 | 'email_options' => $_aEmailOptions, |
107 | 107 | 'input' => $aInputs, |
108 | 108 | 'section_id' => $sSubmitSectionID, |
109 | 109 | ); |
110 | - $_bIsSet = $this->setTransient( $_sTransientKey, $_aFormEmailData, 100 ); |
|
110 | + $_bIsSet = $this->setTransient( $_sTransientKey, $_aFormEmailData, 100 ); |
|
111 | 111 | |
112 | 112 | // Send the email in the background. |
113 | 113 | wp_remote_get( |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ); |
126 | 126 | |
127 | 127 | // @remark Not possible to tell whether it is sent or not at the moment because it is performed in the background. |
128 | - $_bSent = $_bIsSet; |
|
128 | + $_bSent = $_bIsSet; |
|
129 | 129 | $this->oFactory->setSettingNotice( |
130 | 130 | $this->oFactory->oMsg->get( |
131 | 131 | $this->getAOrB( |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @return string |
148 | 148 | */ |
149 | 149 | public function _replyToRemoveConfirmationQueryKey( $sSettingUpdateURL ) { |
150 | - return remove_query_arg( array( 'confirmation', ), $sSettingUpdateURL ); |
|
150 | + return remove_query_arg( array( 'confirmation',), $sSettingUpdateURL ); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->oFactory = $oFactory; |
31 | 31 | |
32 | 32 | add_filter( |
33 | - "validation_pre_" . $this->oFactory->oProp->sClassName, |
|
33 | + "validation_pre_".$this->oFactory->oProp->sClassName, |
|
34 | 34 | array( $this, '_replyToValiateUserFormInputs' ), |
35 | 35 | 10, |
36 | 36 | 4 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $_sSubmitSectionID = $this->_getPressedSubmitButtonData( $_aSubmits, 'section_id' ); |
62 | 62 | |
63 | 63 | // Submit Information - [3.5.0+] this will be passed to validation callback methods. |
64 | - $_aSubmitsInformation = array( |
|
64 | + $_aSubmitsInformation = array( |
|
65 | 65 | 'page_slug' => $_sPageSlug, |
66 | 66 | 'tab_slug' => $_sTabSlug, |
67 | 67 | 'input_id' => $this->_getPressedSubmitButtonData( $_aSubmits, 'input_id' ), |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | 'AdminPageFramework_Model__FormSubmission__Validator__Export', |
82 | 82 | 'AdminPageFramework_Model__FormSubmission__Validator__Reset', |
83 | 83 | 'AdminPageFramework_Model__FormSubmission__Validator__ResetConfirm', // 3.7.6+ Moved to after validation from before validation |
84 | - 'AdminPageFramework_Model__FormSubmission__Validator__ContactForm', // 3.7.6+ Moved to after validation from before validation |
|
84 | + 'AdminPageFramework_Model__FormSubmission__Validator__ContactForm', // 3.7.6+ Moved to after validation from before validation |
|
85 | 85 | 'AdminPageFramework_Model__FormSubmission__Validator__ContactFormConfirm', |
86 | 86 | |
87 | 87 | ); |
88 | - foreach( $_aClassNames as $_sClassName ) { |
|
88 | + foreach ( $_aClassNames as $_sClassName ) { |
|
89 | 89 | new $_sClassName( $this->oFactory ); |
90 | 90 | } |
91 | 91 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $this->addAndDoActions( |
96 | 96 | $this->oFactory, |
97 | - 'try_validation_before_' . $this->oFactory->oProp->sClassName, |
|
97 | + 'try_validation_before_'.$this->oFactory->oProp->sClassName, |
|
98 | 98 | $aInputs, |
99 | 99 | $aRawInputs, |
100 | 100 | $_aSubmits, |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $this->addAndDoActions( |
115 | 115 | $this->oFactory, |
116 | - 'try_validation_after_' . $this->oFactory->oProp->sClassName, |
|
116 | + 'try_validation_after_'.$this->oFactory->oProp->sClassName, |
|
117 | 117 | $aInputs, |
118 | 118 | $aRawInputs, |
119 | 119 | $_aSubmits, |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
35 | 35 | |
36 | - if ( ! $this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
36 | + if ( !$this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ); |
47 | 47 | |
48 | 48 | // Go to the catch clause. |
49 | - $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue. |
|
49 | + $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue. |
|
50 | 50 | $_oException->aReturn = $this->_confirmSubmitButtonAction( |
51 | 51 | $this->getElement( $aSubmitInformation, 'input_name' ), |
52 | 52 | $this->getElement( $aSubmitInformation, 'section_id' ), |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public $aDisallowedQueryKeys = array( |
220 | 220 | 'settings-updated', |
221 | - 'confirmation', // 3.3.0+ |
|
221 | + 'confirmation', // 3.3.0+ |
|
222 | 222 | 'field_errors' // 3.4.1+ |
223 | 223 | ); |
224 | 224 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | * Stores the cache lifetime of the transient used for the form options when the user passes an integer to the option key parameter. |
265 | 265 | * @since 3.5.9 |
266 | 266 | */ |
267 | - public $iOptionTransientDuration = 0; |
|
267 | + public $iOptionTransientDuration = 0; |
|
268 | 268 | |
269 | 269 | /** |
270 | 270 | * Constructs the instance of AdminPageFramework_Property_admin_page class object. |
@@ -273,10 +273,10 @@ discard block |
||
273 | 273 | * @since 2.0.0 |
274 | 274 | * @since 2.1.5 The $oCaller parameter was added. |
275 | 275 | */ |
276 | - public function __construct( $oCaller, $sCallerPath, $sClassName, $aisOptionKey, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
276 | + public function __construct( $oCaller, $sCallerPath, $sClassName, $aisOptionKey, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
277 | 277 | |
278 | 278 | // 3.7.0+ This must be set before the parent constructor. As the form arguments array uses this value. |
279 | - $this->_sFormRegistrationHook = 'load_after_' . $sClassName; |
|
279 | + $this->_sFormRegistrationHook = 'load_after_'.$sClassName; |
|
280 | 280 | |
281 | 281 | parent::__construct( |
282 | 282 | $oCaller, |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | } |
353 | 353 | // The user want to save options in a transient. |
354 | 354 | if ( in_array( $_sType, array( 'integer' ) ) ) { |
355 | - return 'apf_' . $sClassName . '_' . get_current_user_id(); |
|
355 | + return 'apf_'.$sClassName.'_'.get_current_user_id(); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | // Unknown type - maybe the user is trying to do something advanced. |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | protected function _isAdminPage() { |
381 | 381 | |
382 | - if ( ! is_admin() ) { |
|
382 | + if ( !is_admin() ) { |
|
383 | 383 | return false; |
384 | 384 | } |
385 | 385 | return isset( $_GET[ 'page' ] ); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | case 'transient': |
420 | 420 | return $this->getAsArray( |
421 | 421 | $this->getTransient( |
422 | - $this->sOptionKey, // transient key |
|
422 | + $this->sOptionKey, // transient key |
|
423 | 423 | array() // default |
424 | 424 | ) |
425 | 425 | ); |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | * @since 3.1.1 Made it return a value. |
434 | 434 | * @return boolean True if saved; otherwise, false. |
435 | 435 | */ |
436 | - public function updateOption( $aOptions=null ) { |
|
436 | + public function updateOption( $aOptions = null ) { |
|
437 | 437 | |
438 | 438 | if ( $this->_bDisableSavingOptions ) { |
439 | 439 | return false; |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | ); |
462 | 462 | case 'transient': |
463 | 463 | return $this->setTransient( |
464 | - $this->sOptionKey, // transient key |
|
464 | + $this->sOptionKey, // transient key |
|
465 | 465 | $aOptions, |
466 | 466 | $this->iOptionTransientDuration |
467 | 467 | ); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | * @since 2.1.0 Set the default value to the parameter and if the parameter value is empty, it applies the current $_GET[ 'page' ] value. |
477 | 477 | * @return boolean Returns true if it is of framework's added page; otherwise, false. |
478 | 478 | */ |
479 | - public function isPageAdded( $sPageSlug='' ) { |
|
479 | + public function isPageAdded( $sPageSlug = '' ) { |
|
480 | 480 | |
481 | 481 | $sPageSlug = trim( $sPageSlug ); |
482 | 482 | $sPageSlug = $sPageSlug |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | */ |
496 | 496 | public function getCurrentPageSlug() { |
497 | 497 | return $this->getElement( |
498 | - $_GET, // subject array |
|
498 | + $_GET, // subject array |
|
499 | 499 | 'page', // key |
500 | 500 | '' // default |
501 | 501 | ); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | * @return string The found tab slug. An empty string if not found. |
514 | 514 | * @remark Do not return `null` when not found as some framework methods check the returned value with `isset()` and if null is given, `isset()` yields `false` while it does `true` for an empty string (''). |
515 | 515 | */ |
516 | - public function getCurrentTabSlug( $sCurrentPageSlug='' ) { |
|
516 | + public function getCurrentTabSlug( $sCurrentPageSlug = '' ) { |
|
517 | 517 | |
518 | 518 | // It is possible that the tab slug is not set if it is the default tab. |
519 | 519 | $_sTabSlug = $this->getElement( $_GET, 'tab' ); |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | * |
534 | 534 | * @deprecated 3.5.3 |
535 | 535 | */ |
536 | - public function getCurrentTab( $sCurrentPageSlug='' ) { |
|
536 | + public function getCurrentTab( $sCurrentPageSlug = '' ) { |
|
537 | 537 | return $this->getCurrentTabSlug( $sCurrentPageSlug ); |
538 | 538 | } |
539 | 539 | |
@@ -548,11 +548,11 @@ discard block |
||
548 | 548 | */ |
549 | 549 | public function getDefaultInPageTab( $sPageSlug ) { |
550 | 550 | |
551 | - if ( ! $sPageSlug ) { |
|
551 | + if ( !$sPageSlug ) { |
|
552 | 552 | return ''; |
553 | 553 | } |
554 | 554 | return $this->getElement( |
555 | - $this->aDefaultInPageTabs, // subject array |
|
555 | + $this->aDefaultInPageTabs, // subject array |
|
556 | 556 | $sPageSlug, // key |
557 | 557 | '' // default |
558 | 558 | ); |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * @since 3.5.9 |
323 | 323 | * @return void |
324 | 324 | */ |
325 | - private function _setOptionsProperties( $aisOptionKey, $sClassName ) { |
|
325 | + private function _setOptionsProperties( $aisOptionKey, $sClassName ) { |
|
326 | 326 | |
327 | 327 | $_aArguments = is_array( $aisOptionKey ) |
328 | 328 | ? $aisOptionKey |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | * @since 2.1.0 Set the default value to the parameter and if the parameter value is empty, it applies the current $_GET[ 'page' ] value. |
514 | 514 | * @return boolean Returns true if it is of framework's added page; otherwise, false. |
515 | 515 | */ |
516 | - public function isPageAdded( $sPageSlug='' ) { |
|
516 | + public function isPageAdded( $sPageSlug='' ) { |
|
517 | 517 | |
518 | 518 | $sPageSlug = trim( $sPageSlug ); |
519 | 519 | $sPageSlug = $sPageSlug |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | // It is possible that the tab slug is not set if it is the default tab. |
556 | 556 | $_sTabSlug = $this->getElement( $_GET, 'tab' ); |
557 | - if ( $_sTabSlug ) { |
|
557 | + if ( $_sTabSlug ) { |
|
558 | 558 | return $_sTabSlug; |
559 | 559 | } |
560 | 560 | $sCurrentPageSlug = $sCurrentPageSlug |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | */ |
586 | 586 | public function getDefaultInPageTab( $sPageSlug ) { |
587 | 587 | |
588 | - if ( ! $sPageSlug ) { |
|
588 | + if ( ! $sPageSlug ) { |
|
589 | 589 | return ''; |
590 | 590 | } |
591 | 591 | return $this->getElement( |