@@ -219,24 +219,24 @@ discard block |
||
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
222 | - * Adds the given link(s) into the description cell of the plugin listing table. |
|
223 | - * |
|
224 | - * <h4>Example</h4> |
|
225 | - * <code>$this->addLinkToPluginDescription( |
|
226 | - * "<a href='http://www.google.com'>Google</a>", |
|
227 | - * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
228 | - * );</code> |
|
229 | - * |
|
230 | - * @since 2.0.0 |
|
231 | - * @since 3.0.0 Changed the scope to public from protected. |
|
232 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
233 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
234 | - * @param string the tagged HTML link text. |
|
235 | - * @param string (optional) another tagged HTML link text. |
|
236 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
237 | - * @access public |
|
238 | - * @return void |
|
239 | - */ |
|
222 | + * Adds the given link(s) into the description cell of the plugin listing table. |
|
223 | + * |
|
224 | + * <h4>Example</h4> |
|
225 | + * <code>$this->addLinkToPluginDescription( |
|
226 | + * "<a href='http://www.google.com'>Google</a>", |
|
227 | + * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
228 | + * );</code> |
|
229 | + * |
|
230 | + * @since 2.0.0 |
|
231 | + * @since 3.0.0 Changed the scope to public from protected. |
|
232 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
233 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
234 | + * @param string the tagged HTML link text. |
|
235 | + * @param string (optional) another tagged HTML link text. |
|
236 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
237 | + * @access public |
|
238 | + * @return void |
|
239 | + */ |
|
240 | 240 | public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
241 | 241 | if ( method_exists( $this->oLink, '_addLinkToPluginDescription' ) ) { |
242 | 242 | $this->oLink->_addLinkToPluginDescription( func_get_args() ); |
@@ -244,23 +244,23 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * Adds the given link(s) into the title cell of the plugin listing table. |
|
248 | - * |
|
249 | - * <h4>Example</h4> |
|
250 | - * <code>$this->addLinkToPluginTitle( |
|
251 | - * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
252 | - * );</code> |
|
253 | - * |
|
254 | - * @since 2.0.0 |
|
255 | - * @since 3.0.0 Changed the scope to public from protected. |
|
256 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
257 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
258 | - * @param string the tagged HTML link text. |
|
259 | - * @param string (optional) another tagged HTML link text. |
|
260 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
261 | - * @access public |
|
262 | - * @return void |
|
263 | - */ |
|
247 | + * Adds the given link(s) into the title cell of the plugin listing table. |
|
248 | + * |
|
249 | + * <h4>Example</h4> |
|
250 | + * <code>$this->addLinkToPluginTitle( |
|
251 | + * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
252 | + * );</code> |
|
253 | + * |
|
254 | + * @since 2.0.0 |
|
255 | + * @since 3.0.0 Changed the scope to public from protected. |
|
256 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
257 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
258 | + * @param string the tagged HTML link text. |
|
259 | + * @param string (optional) another tagged HTML link text. |
|
260 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
261 | + * @access public |
|
262 | + * @return void |
|
263 | + */ |
|
264 | 264 | public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
265 | 265 | if ( method_exists( $this->oLink, '_addLinkToPluginTitle' ) ) { |
266 | 266 | $this->oLink->_addLinkToPluginTitle( func_get_args() ); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param array $aCustomArgs (optional) The argument array for more advanced parameters. |
108 | 108 | * @return array The array holing the queued items. |
109 | 109 | */ |
110 | - public function enqueueStyles( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
110 | + public function enqueueStyles( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
111 | 111 | if ( method_exists( $this->oResource, '_enqueueStyles' ) ) { |
112 | 112 | return $this->oResource->_enqueueStyles( $aSRCs, $sPageSlug, $sTabSlug, $aCustomArgs ); |
113 | 113 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * </ul> |
145 | 145 | * @return string The style handle ID. If the passed url is not a valid url string, an empty string will be returned. |
146 | 146 | */ |
147 | - public function enqueueStyle( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
147 | + public function enqueueStyle( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
148 | 148 | if ( method_exists( $this->oResource, '_enqueueStyle' ) ) { |
149 | 149 | return $this->oResource->_enqueueStyle( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
150 | 150 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param array (optional) The argument array for more advanced parameters. |
172 | 172 | * @return array The array holding the queued items. |
173 | 173 | */ |
174 | - public function enqueueScripts( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
174 | + public function enqueueScripts( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
175 | 175 | if ( method_exists( $this->oResource, '_enqueueScripts' ) ) { |
176 | 176 | return $this->oResource->_enqueueScripts( $aSRCs, $sPageSlug, $sTabSlug, $aCustomArgs ); |
177 | 177 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * </ul> |
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 | */ |
215 | - public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
215 | + public function enqueueScript( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
216 | 216 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
217 | 217 | return $this->oResource->_enqueueScript( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
218 | 218 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @access public |
238 | 238 | * @return void |
239 | 239 | */ |
240 | - public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
240 | + public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2 = null, $_and_more = null ) { |
|
241 | 241 | if ( method_exists( $this->oLink, '_addLinkToPluginDescription' ) ) { |
242 | 242 | $this->oLink->_addLinkToPluginDescription( func_get_args() ); |
243 | 243 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * @access public |
262 | 262 | * @return void |
263 | 263 | */ |
264 | - public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
264 | + public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2 = null, $_and_more = null ) { |
|
265 | 265 | if ( method_exists( $this->oLink, '_addLinkToPluginTitle' ) ) { |
266 | 266 | $this->oLink->_addLinkToPluginTitle( func_get_args() ); |
267 | 267 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @param string (optional) The class selector used in the message HTML element. 'error' and 'updated' are prepared by WordPress but it's not limited to them and can pass a custom name. Default: 'error'. |
318 | 318 | * @param string (optional) The ID of the message. If not set, the hash of the message will be used. |
319 | 319 | */ |
320 | - public function setAdminNotice( $sMessage, $sClassSelector='error', $sID='' ) { |
|
320 | + public function setAdminNotice( $sMessage, $sClassSelector = 'error', $sID = '' ) { |
|
321 | 321 | |
322 | 322 | $sID = $sID ? $sID : md5( $sMessage ); |
323 | 323 | |
@@ -354,9 +354,9 @@ discard block |
||
354 | 354 | * @param boolean If true, the passed key(s) will be appended to the property; otherwise, it will override the property. |
355 | 355 | * @return void |
356 | 356 | */ |
357 | - public function setDisallowedQueryKeys( $asQueryKeys, $bAppend=true ) { |
|
357 | + public function setDisallowedQueryKeys( $asQueryKeys, $bAppend = true ) { |
|
358 | 358 | |
359 | - if ( ! $bAppend ) { |
|
359 | + if ( !$bAppend ) { |
|
360 | 360 | $this->oProp->aDisallowedQueryKeys = ( array ) $asQueryKeys; |
361 | 361 | return; |
362 | 362 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | * @param mixed $vDefault the default value that will be returned if nothing is stored. |
400 | 400 | * @return mixed If the field ID is not specified |
401 | 401 | */ |
402 | - static public function getOption( $sOptionKey, $asKey=null, $vDefault=null ) { |
|
402 | + static public function getOption( $sOptionKey, $asKey = null, $vDefault = null ) { |
|
403 | 403 | return AdminPageFramework_WPUtility::getOption( $sOptionKey, $asKey, $vDefault ); |
404 | 404 | } |
405 | 405 |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * </ul> |
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 | */ |
215 | - public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
215 | + public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
216 | 216 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
217 | 217 | return $this->oResource->_enqueueScript( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
218 | 218 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * @access public |
262 | 262 | * @return void |
263 | 263 | */ |
264 | - public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
264 | + public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
265 | 265 | if ( method_exists( $this->oLink, '_addLinkToPluginTitle' ) ) { |
266 | 266 | $this->oLink->_addLinkToPluginTitle( func_get_args() ); |
267 | 267 | } |
@@ -224,6 +224,7 @@ discard block |
||
224 | 224 | * @param string the tagged HTML link text. |
225 | 225 | * @param string (optional) another tagged HTML link text. |
226 | 226 | * @param string (optional) add more as many as want by adding items to the next parameters. |
227 | + * @param string $sTaggedLinkHTML1 |
|
227 | 228 | * @access public |
228 | 229 | * @return void |
229 | 230 | */ |
@@ -249,6 +250,9 @@ discard block |
||
249 | 250 | * @param string the tagged HTML link text. |
250 | 251 | * @param string (optional) another tagged HTML link text. |
251 | 252 | * @param string (optional) add more as many as want by adding items to the next parameters. |
253 | + * @param null|string $sTaggedLinkHTML1 |
|
254 | + * @param string $sTaggedLinkHTML2 |
|
255 | + * @param string $_and_more |
|
252 | 256 | * @access public |
253 | 257 | * @return void |
254 | 258 | */ |
@@ -268,6 +272,7 @@ discard block |
||
268 | 272 | * |
269 | 273 | * @since 3.1.0 |
270 | 274 | * @since 3.3.1 Moved from `AdminPageFramework`. |
275 | + * @param string $sLabel |
|
271 | 276 | */ |
272 | 277 | public function setPluginSettingsLinkLabel( $sLabel ) { |
273 | 278 | $this->oProp->sLabelPluginSettingsLink = $sLabel; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @return void |
94 | 94 | */ |
95 | 95 | public function addInPageTabs( /* $aTab1, $aTab2=null, $_and_more=null */ ) { |
96 | - foreach( func_get_args() as $asTab ) { |
|
96 | + foreach ( func_get_args() as $asTab ) { |
|
97 | 97 | $this->addInPageTab( $asTab ); |
98 | 98 | } |
99 | 99 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // Target page slug - will be applied when no page slug is specified. |
117 | 117 | static $__sTargetPageSlug; |
118 | - if ( ! is_array( $asInPageTab ) ) { |
|
118 | + if ( !is_array( $asInPageTab ) ) { |
|
119 | 119 | $__sTargetPageSlug = is_string( $asInPageTab ) |
120 | 120 | ? $asInPageTab |
121 | 121 | : $__sTargetPageSlug; // set the target page slug |
@@ -130,23 +130,23 @@ discard block |
||
130 | 130 | ); |
131 | 131 | |
132 | 132 | // Set the target page slug for next calls |
133 | - $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
|
133 | + $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
|
134 | 134 | |
135 | 135 | // Required keys |
136 | - if ( ! isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
136 | + if ( !isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
140 | 140 | // Count - the number of added in-page tabs. |
141 | - $_aElements = $this->oUtil->getElement( |
|
141 | + $_aElements = $this->oUtil->getElement( |
|
142 | 142 | $this->oProp->aInPageTabs, |
143 | 143 | $aInPageTab[ 'page_slug' ], |
144 | 144 | array() |
145 | 145 | ); |
146 | - $_iCountElement = count( $_aElements ); |
|
146 | + $_iCountElement = count( $_aElements ); |
|
147 | 147 | |
148 | 148 | // Pre-format |
149 | - $aInPageTab = array( |
|
149 | + $aInPageTab = array( |
|
150 | 150 | 'page_slug' => $this->oUtil->sanitizeSlug( $aInPageTab[ 'page_slug' ] ), |
151 | 151 | 'tab_slug' => $this->oUtil->sanitizeSlug( $aInPageTab[ 'tab_slug' ] ), |
152 | 152 | 'order' => $this->oUtil->getAOrB( |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @param boolean $bShow If false, the page title will not be displayed. |
175 | 175 | * @return void |
176 | 176 | */ |
177 | - public function setPageTitleVisibility( $bShow=true, $sPageSlug='' ) { |
|
177 | + public function setPageTitleVisibility( $bShow = true, $sPageSlug = '' ) { |
|
178 | 178 | $this->_setPageProperty( |
179 | 179 | 'bShowPageTitle', |
180 | 180 | 'show_page_title', |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @remark Page-heading tabs and in-page tabs are different. The former displays page titles and the latter displays tab titles. |
199 | 199 | * @remark If the second parameter is omitted, it sets the default value. |
200 | 200 | */ |
201 | - public function setPageHeadingTabsVisibility( $bShow=true, $sPageSlug='' ) { |
|
201 | + public function setPageHeadingTabsVisibility( $bShow = true, $sPageSlug = '' ) { |
|
202 | 202 | $this->_setPageProperty( |
203 | 203 | 'bShowPageHeadingTabs', |
204 | 204 | 'show_page_heading_tabs', |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @param string $sPageSlug The page to apply the visibility setting. If not set, it applies to all the pages. |
220 | 220 | * @remark If the second parameter is omitted, it sets the default value. |
221 | 221 | */ |
222 | - public function setInPageTabsVisibility( $bShow=true, $sPageSlug='' ) { |
|
222 | + public function setInPageTabsVisibility( $bShow = true, $sPageSlug = '' ) { |
|
223 | 223 | $this->_setPageProperty( |
224 | 224 | 'bShowInPageTabs', |
225 | 225 | 'show_in_page_tabs', |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param string $sPageSlug The page slug that applies the setting. |
243 | 243 | * @remark If the second parameter is omitted, it sets the default value. |
244 | 244 | */ |
245 | - public function setInPageTabTag( $sTag='h3', $sPageSlug='' ) { |
|
245 | + public function setInPageTabTag( $sTag = 'h3', $sPageSlug = '' ) { |
|
246 | 246 | $this->_setPageProperty( |
247 | 247 | 'sInPageTabTag', |
248 | 248 | 'in_page_tab_tag', |
@@ -265,9 +265,9 @@ discard block |
||
265 | 265 | * @param string $sPageSlug The page slug that applies the setting. |
266 | 266 | * @remark If the second parameter is omitted, it sets the default value. |
267 | 267 | */ |
268 | - public function setPageHeadingTabTag( $sTag='h2', $sPageSlug='' ) { |
|
268 | + public function setPageHeadingTabTag( $sTag = 'h2', $sPageSlug = '' ) { |
|
269 | 269 | $this->_setPageProperty( |
270 | - 'sPageHeadingTabTag', // property name |
|
270 | + 'sPageHeadingTabTag', // property name |
|
271 | 271 | 'page_heading_tab_tag', // property key |
272 | 272 | $sTag, // value |
273 | 273 | $sPageSlug // page slug |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | $this->oProp->{$sPropertyName} = $mValue; |
291 | 291 | |
292 | - foreach( $this->oProp->aPages as &$_aPage ) { |
|
292 | + foreach ( $this->oProp->aPages as &$_aPage ) { |
|
293 | 293 | $_aPage[ $sPropertyKey ] = $mValue; |
294 | 294 | |
295 | 295 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @return void |
94 | 94 | */ |
95 | 95 | public function addInPageTabs( /* $aTab1, $aTab2=null, $_and_more=null */ ) { |
96 | - foreach( func_get_args() as $asTab ) { |
|
96 | + foreach( func_get_args() as $asTab ) { |
|
97 | 97 | $this->addInPageTab( $asTab ); |
98 | 98 | } |
99 | 99 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @remark In-page tabs are different from page-heading tabs which are automatically added with page titles. |
112 | 112 | * @return void |
113 | 113 | */ |
114 | - public function addInPageTab( $asInPageTab ) { |
|
114 | + public function addInPageTab( $asInPageTab ) { |
|
115 | 115 | |
116 | 116 | // Target page slug - will be applied when no page slug is specified. |
117 | 117 | static $__sTargetPageSlug; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $__sTargetPageSlug = $aInPageTab[ 'page_slug' ]; |
134 | 134 | |
135 | 135 | // Required keys |
136 | - if ( ! isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
136 | + if ( ! isset( $aInPageTab[ 'page_slug' ], $aInPageTab[ 'tab_slug' ] ) ) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param string $sPageSlug The page slug that applies the setting. |
243 | 243 | * @remark If the second parameter is omitted, it sets the default value. |
244 | 244 | */ |
245 | - public function setInPageTabTag( $sTag='h3', $sPageSlug='' ) { |
|
245 | + public function setInPageTabTag( $sTag='h3', $sPageSlug='' ) { |
|
246 | 246 | $this->_setPageProperty( |
247 | 247 | 'sInPageTabTag', |
248 | 248 | 'in_page_tab_tag', |
@@ -52,43 +52,6 @@ discard block |
||
52 | 52 | * @since 2.0.0 |
53 | 53 | * @since 3.0.0 Changed the scope to public. Added page slug target support. |
54 | 54 | * @since 3.3.1 Moved from `AdminPageFramework_Page`. |
55 | - * @param array $aTab1 The in-page tab array. |
|
56 | - * <h4>In-Page Tab Array</h4> |
|
57 | - * <ul> |
|
58 | - * <li>**page_slug** - (string) the page slug that the tab belongs to.</li> |
|
59 | - * <li>**tab_slug** - (string) the tab slug. Non-alphabetical characters should not be used including dots(.) and hyphens(-).</li> |
|
60 | - * <li>**title** - (string) the title of the tab.</li> |
|
61 | - * <li>**order** - (optional, integer) the order number of the tab. The lager the number is, the lower the position it is placed in the menu.</li> |
|
62 | - * <li>**show_in_page_tab** - (optional, boolean) default: `true`. If this is set to `false`, the tab title will not be displayed in the tab navigation menu; however, it is still accessible from the direct URL.</li> |
|
63 | - * <li>**parent_tab_slug** - (optional, string) this needs to be set if the above `show_in_page_tab` argument is `false` so that the parent tab will be emphasized as active when the hidden page is accessed.</li> |
|
64 | - * <li>**url** - [3.5.0+] (optional, string) If this is set, the link url of the navigation tab will be this url. Use this to create link only tab.</li> |
|
65 | - * <li>**capability** - [3.6.0+] (optional, string) The capability level.</li> |
|
66 | - * <li>**if** - [3.6.0+] (optional, boolean) Whether the tab should be displayed or not.</li> |
|
67 | - * <li>style - [3.6.3+] (optional) (string|array) The path or url of a stylesheet which gets loaded in the head tag. Or inline CSS rules. |
|
68 | - * When custom arguments need to be set such as whether it should be inserted in the footer, set an array holding the following arguments. |
|
69 | - * <ul> |
|
70 | - * <li>src - (required, string) the source url or path.</li> |
|
71 | - * <li>handle_id - (optional, string) The handle ID of the stylesheet.</li> |
|
72 | - * <li>dependencies - (optional, array) The dependency array.</li> |
|
73 | - * <li>version - (optional, string) The stylesheet version number.</li> |
|
74 | - * <li>media - (optional, string) the description of the field which is inserted into the after the input field tag.</li> |
|
75 | - * </ul> |
|
76 | - * </li> |
|
77 | - * <li>script - [3.6.3+] (optional) (string|array) The path or url of a JavaScript script which gets loaded in the head tag. Or an inline JavaScript script. |
|
78 | - * When custom arguments need to be set such as whether it should be inserted in the footer, set an array holding the following arguments. |
|
79 | - * <ul> |
|
80 | - * <li>src - (required, string) the source url or path.</li> |
|
81 | - * <li>handle_id - (optional, string) The handle ID of the stylesheet.</li> |
|
82 | - * <li>dependencies - (optional, array) The dependency array.</li> |
|
83 | - * <li>version - (optional, string) The stylesheet version number.</li> |
|
84 | - * <li>translation - (optional, array) an array holding translation key-value pairs.</li> |
|
85 | - * </ul> |
|
86 | - * </li> |
|
87 | - * <li>show_debug_info - [3.8.8+] (optional, boolean) Whether to show debug information. If `WP_DEBUG` is false, the debug output will not be displayed. Default: `true`.</li> |
|
88 | - * </ul> |
|
89 | - * @param array $aTab2 Another in-page tab array. |
|
90 | - * @param array $_and_more (optional) Add in-page tab arrays as many as necessary to the next parameters. |
|
91 | - * @param string $sPageSlug (optional) If the passed parameter item is a string, it will be stored as the target page slug so that it will be applied to the next passed tab arrays as the page_slug element. |
|
92 | 55 | * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
93 | 56 | * @remark In-page tabs are different from page-heading tabs which is automatically added with page titles. |
94 | 57 | * @return void |
@@ -278,6 +241,10 @@ discard block |
||
278 | 241 | /** |
279 | 242 | * Sets a page property. |
280 | 243 | * @since 3.6.0 |
244 | + * @param string $sPropertyName |
|
245 | + * @param string $sPropertyKey |
|
246 | + * @param boolean|string $mValue |
|
247 | + * @param string $sPageSlug |
|
281 | 248 | * @return void |
282 | 249 | */ |
283 | 250 | private function _setPageProperty( $sPropertyName, $sPropertyKey, $mValue, $sPageSlug ) { |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | * @since 3.3.0 |
71 | 71 | * @since 3.3.1 Moved from `AdminPageFramework_Setting_Base`. |
72 | 72 | */ |
73 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
73 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
74 | 74 | |
75 | 75 | parent::__construct( $sOptionKey, $sCallerPath, $sCapability, $sTextDomain ); |
76 | 76 | |
77 | 77 | if ( $this->oProp->bIsAdminAjax ) { |
78 | 78 | return; |
79 | 79 | } |
80 | - if ( ! $this->oProp->bIsAdmin ) { |
|
80 | + if ( !$this->oProp->bIsAdmin ) { |
|
81 | 81 | return; |
82 | 82 | } |
83 | 83 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | 'section_title' => null, |
128 | 128 | 'section_id' => null, |
129 | 129 | ); |
130 | - if ( ! $aFieldset[ 'help' ] ) { |
|
130 | + if ( !$aFieldset[ 'help' ] ) { |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | 'help_tab_id' => $_sRootSectionID, |
146 | 146 | 'help_tab_content' => "<span class='contextual-help-tab-title'>" |
147 | 147 | . $aFieldset[ 'title' ] |
148 | - . "</span> - " . PHP_EOL |
|
148 | + . "</span> - ".PHP_EOL |
|
149 | 149 | . $aFieldset[ 'help' ], |
150 | 150 | 'help_tab_sidebar_content' => $aFieldset[ 'help_aside' ] |
151 | 151 | ? $aFieldset[ 'help_aside' ] |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | public function _registerHelpPaneItemsOfFormSections( $aSectionsets ) { |
180 | 180 | // @todo Test if help pane item gets displayed |
181 | 181 | |
182 | - foreach( $aSectionsets as $_aSectionset ) { |
|
182 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
183 | 183 | // @todo check capability and conditions |
184 | 184 | $_aSectionset = $_aSectionset + array( |
185 | 185 | 'help' => null, |
@@ -213,13 +213,13 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function _replyToDetermineSectionsetVisibility( $bVisible, $aSectionset ) { |
215 | 215 | |
216 | - if ( ! current_user_can( $aSectionset[ 'capability' ] ) ) { |
|
216 | + if ( !current_user_can( $aSectionset[ 'capability' ] ) ) { |
|
217 | 217 | return false; |
218 | 218 | } |
219 | - if ( ! $aSectionset[ 'if' ] ) { |
|
219 | + if ( !$aSectionset[ 'if' ] ) { |
|
220 | 220 | return false; |
221 | 221 | } |
222 | - if ( ! $this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
222 | + if ( !$this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
223 | 223 | return false; |
224 | 224 | } |
225 | 225 | return $bVisible; |
@@ -237,15 +237,15 @@ discard block |
||
237 | 237 | private function _isSectionOfCurrentPage( array $aSectionset ) { |
238 | 238 | |
239 | 239 | // Make sure the value type is string so that when the page_slug is not set, it won't match. |
240 | - $_sCurrentPageSlug = ( string ) $this->oProp->getCurrentPageSlug(); |
|
240 | + $_sCurrentPageSlug = ( string ) $this->oProp->getCurrentPageSlug(); |
|
241 | 241 | |
242 | 242 | // Make sure if it's in the loading page. |
243 | - if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
243 | + if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
244 | 244 | return false; |
245 | 245 | } |
246 | 246 | |
247 | 247 | // If no tag is specified, the user wants to display the section regardless of the tab. |
248 | - if ( ! $aSectionset[ 'tab_slug' ] ) { |
|
248 | + if ( !$aSectionset[ 'tab_slug' ] ) { |
|
249 | 249 | return true; |
250 | 250 | } |
251 | 251 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function _replyToDetermineFieldsetVisibility( $bVisible, $aFieldset ) { |
263 | 263 | |
264 | - $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
|
264 | + $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
|
265 | 265 | |
266 | 266 | // If the specified field does not exist, do nothing. |
267 | 267 | if ( $aFieldset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | array( $_sSectionPath, 'page_slug' ), |
292 | 292 | null |
293 | 293 | ); |
294 | - $aFieldset[ 'tab_slug' ] = $this->oUtil->getElement( |
|
294 | + $aFieldset[ 'tab_slug' ] = $this->oUtil->getElement( |
|
295 | 295 | $aSectionsets, |
296 | 296 | array( $_sSectionPath, 'tab_slug' ), |
297 | 297 | null |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | $aSectionsets, |
303 | 303 | $_sSectionPath |
304 | 304 | ); |
305 | - $aFieldset[ 'section_title' ] = $this->oUtil->getElement( |
|
305 | + $aFieldset[ 'section_title' ] = $this->oUtil->getElement( |
|
306 | 306 | $_aSectionset, |
307 | 307 | 'title' |
308 | 308 | ); |
309 | - $aFieldset[ 'capability' ] = $aFieldset[ 'capability' ] |
|
309 | + $aFieldset[ 'capability' ] = $aFieldset[ 'capability' ] |
|
310 | 310 | ? $aFieldset[ 'capability' ] |
311 | 311 | : $this->_replyToGetCapabilityForForm( |
312 | 312 | $this->oUtil->getElement( $_aSectionset, 'capability' ), |
@@ -355,13 +355,13 @@ discard block |
||
355 | 355 | |
356 | 356 | // Find the capability of the parent section if nested. |
357 | 357 | if ( 0 < $aSectionset[ '_nested_depth' ] ) { |
358 | - $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
|
358 | + $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
|
359 | 359 | array_pop( $_aSectionPath ); // remove the last element |
360 | 360 | $_sParentCapability = $this->oUtil->getElement( |
361 | 361 | $this->oForm->aSectionsets, |
362 | 362 | array_merge( $_aSectionPath, array( 'capability' ) ) |
363 | 363 | ); |
364 | - if( $_sParentCapability ) { |
|
364 | + if ( $_sParentCapability ) { |
|
365 | 365 | return $_sParentCapability; |
366 | 366 | } |
367 | 367 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @return void |
177 | 177 | * @since DEVVER |
178 | 178 | */ |
179 | - public function _registerHelpPaneItemsOfFormSections( $aSectionsets ) { |
|
179 | + public function _registerHelpPaneItemsOfFormSections( $aSectionsets ) { |
|
180 | 180 | // @todo Test if help pane item gets displayed |
181 | 181 | |
182 | 182 | foreach( $aSectionsets as $_aSectionset ) { |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | if ( ! current_user_can( $aSectionset[ 'capability' ] ) ) { |
217 | 217 | return false; |
218 | 218 | } |
219 | - if ( ! $aSectionset[ 'if' ] ) { |
|
219 | + if ( ! $aSectionset[ 'if' ] ) { |
|
220 | 220 | return false; |
221 | 221 | } |
222 | - if ( ! $this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
222 | + if ( ! $this->_isSectionOfCurrentPage( $aSectionset ) ) { |
|
223 | 223 | return false; |
224 | 224 | } |
225 | 225 | return $bVisible; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $_sCurrentPageSlug = ( string ) $this->oProp->getCurrentPageSlug(); |
241 | 241 | |
242 | 242 | // Make sure if it's in the loading page. |
243 | - if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
243 | + if ( $aSectionset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
244 | 244 | return false; |
245 | 245 | } |
246 | 246 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $_sCurrentPageSlug = $this->oProp->getCurrentPageSlug(); |
265 | 265 | |
266 | 266 | // If the specified field does not exist, do nothing. |
267 | - if ( $aFieldset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
267 | + if ( $aFieldset[ 'page_slug' ] !== $_sCurrentPageSlug ) { |
|
268 | 268 | return false; |
269 | 269 | } |
270 | 270 | return parent::_replyToDetermineFieldsetVisibility( $bVisible, $aFieldset ); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | */ |
278 | 278 | public function _replyToFormatFieldsetDefinition( $aFieldset, $aSectionsets ) { |
279 | 279 | |
280 | - if ( empty( $aFieldset ) ) { |
|
280 | + if ( empty( $aFieldset ) ) { |
|
281 | 281 | return $aFieldset; |
282 | 282 | } |
283 | 283 |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function _replyToFinalizeInPageTabs() { |
39 | 39 | |
40 | - if ( ! $this->oProp->isPageAdded() ) { |
|
40 | + if ( !$this->oProp->isPageAdded() ) { |
|
41 | 41 | return; |
42 | 42 | } |
43 | 43 | |
44 | - foreach( $this->oProp->aPages as $_sPageSlug => $_aPage ) { |
|
44 | + foreach ( $this->oProp->aPages as $_sPageSlug => $_aPage ) { |
|
45 | 45 | |
46 | - if ( ! isset( $this->oProp->aInPageTabs[ $_sPageSlug ] ) ) { |
|
46 | + if ( !isset( $this->oProp->aInPageTabs[ $_sPageSlug ] ) ) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | * @since 3.6.0 |
81 | 81 | */ |
82 | 82 | private function _getDefaultInPageTab( $sPageSlug, $aInPageTabs ) { |
83 | - foreach( $aInPageTabs as $_aInPageTab ) { |
|
84 | - if ( ! isset( $_aInPageTab[ 'tab_slug' ] ) ) { |
|
83 | + foreach ( $aInPageTabs as $_aInPageTab ) { |
|
84 | + if ( !isset( $_aInPageTab[ 'tab_slug' ] ) ) { |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | // Regardless of whether it's a hidden tab, it is stored as the default in-page tab. |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function _replyToFinalizeInPageTabs() { |
39 | 39 | |
40 | - if ( ! $this->oProp->isPageAdded() ) { |
|
40 | + if ( ! $this->oProp->isPageAdded() ) { |
|
41 | 41 | return; |
42 | 42 | } |
43 | 43 | |
44 | 44 | foreach( $this->oProp->aPages as $_sPageSlug => $_aPage ) { |
45 | 45 | |
46 | - if ( ! isset( $this->oProp->aInPageTabs[ $_sPageSlug ] ) ) { |
|
46 | + if ( ! isset( $this->oProp->aInPageTabs[ $_sPageSlug ] ) ) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | * @since 3.6.0 |
81 | 81 | */ |
82 | 82 | private function _getDefaultInPageTab( $sPageSlug, $aInPageTabs ) { |
83 | - foreach( $aInPageTabs as $_aInPageTab ) { |
|
84 | - if ( ! isset( $_aInPageTab[ 'tab_slug' ] ) ) { |
|
83 | + foreach( $aInPageTabs as $_aInPageTab ) { |
|
84 | + if ( ! isset( $_aInPageTab[ 'tab_slug' ] ) ) { |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | // Regardless of whether it's a hidden tab, it is stored as the default in-page tab. |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function __construct( array $aPostElement ) { |
36 | 36 | |
37 | 37 | $this->aPost = $aPostElement; |
38 | - $this->sInputID = $this->getInputID( $aPostElement['submit'] ); // the submit element must be set by the field type. |
|
38 | + $this->sInputID = $this->getInputID( $aPostElement[ 'submit' ] ); // the submit element must be set by the field type. |
|
39 | 39 | |
40 | 40 | } |
41 | 41 | |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | * @since 2.0.0 |
48 | 48 | * @since 3.4.0 Changed the name from `getElement()`. |
49 | 49 | */ |
50 | - protected function getSubmitValueByType( $aElement, $sInputID, $sElementKey='format' ) { |
|
50 | + protected function getSubmitValueByType( $aElement, $sInputID, $sElementKey = 'format' ) { |
|
51 | 51 | |
52 | 52 | return $this->getElement( |
53 | - $aElement, // subject array |
|
53 | + $aElement, // subject array |
|
54 | 54 | array( $sInputID, $sElementKey ), // dimensional keys |
55 | 55 | null // default |
56 | 56 | ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // Only the pressed element will be stored in the array. |
81 | 81 | // The input tag: name="__import[submit][my_section_my_import_field_the_index]" value="Import Button" |
82 | 82 | // The array structure: array( 'my_section_my_import_field_the_index' => 'Import Button' ) |
83 | - foreach( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor. |
|
83 | + foreach ( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor. |
|
84 | 84 | $this->sInputID = $sInputID; |
85 | 85 | return $this->sInputID; |
86 | 86 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @since 2.1.5 |
64 | 64 | */ |
65 | - public function getSiblingValue( $sKey ) { |
|
65 | + public function getSiblingValue( $sKey ) { |
|
66 | 66 | return $this->getSubmitValueByType( $this->aPost, $this->sInputID, $sKey ); |
67 | 67 | } |
68 | 68 | |
@@ -80,7 +80,8 @@ discard block |
||
80 | 80 | // Only the pressed element will be stored in the array. |
81 | 81 | // The input tag: name="__import[submit][my_section_my_import_field_the_index]" value="Import Button" |
82 | 82 | // The array structure: array( 'my_section_my_import_field_the_index' => 'Import Button' ) |
83 | - foreach( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor. |
|
83 | + foreach( $aSubmitElement as $sInputID => $v ) { |
|
84 | +// $aSubmitElement should have been set in the constructor. |
|
84 | 85 | $this->sInputID = $sInputID; |
85 | 86 | return $this->sInputID; |
86 | 87 | } |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | * @since 2.0.0 |
95 | 95 | * @since 3.5.4 Added the `$aHeader` parameter. Deprecated the `$sFileName` parameter as it is included in the $aHeader definition. |
96 | 96 | */ |
97 | - public function doExport( $vData, $sFormatType=null, array $aHeader=array() ) { |
|
97 | + public function doExport( $vData, $sFormatType = null, array $aHeader = array() ) { |
|
98 | 98 | |
99 | - $sFormatType = isset( $sFormatType ) |
|
99 | + $sFormatType = isset( $sFormatType ) |
|
100 | 100 | ? $sFormatType |
101 | 101 | : $this->sFormatType; |
102 | 102 | |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | * @since 3.5.4 |
123 | 123 | * @return void |
124 | 124 | */ |
125 | - private function _outputHTTPHeader( array $aHeader, $sKey='' ) { |
|
125 | + private function _outputHTTPHeader( array $aHeader, $sKey = '' ) { |
|
126 | 126 | |
127 | - foreach( $aHeader as $_sKey => $_asValue ) { |
|
127 | + foreach ( $aHeader as $_sKey => $_asValue ) { |
|
128 | 128 | |
129 | 129 | // Nested items. Set the key to overrider array keys. |
130 | 130 | if ( is_array( $_asValue ) ) { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | return; |
165 | 165 | case 'json': // for json. |
166 | 166 | echo json_encode( ( array ) $vData ); |
167 | - return ; |
|
167 | + return; |
|
168 | 168 | case 'array': // for serialized PHP array. |
169 | 169 | default: // for anything else, |
170 | 170 | echo serialize( ( array ) $vData ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | : 'add_filter'; |
37 | 37 | |
38 | 38 | $_sFunctionName( |
39 | - $this->sActionHookPrefix . $this->oFactory->oProp->sClassName, |
|
39 | + $this->sActionHookPrefix.$this->oFactory->oProp->sClassName, |
|
40 | 40 | array( $this, $this->sCallbackName ), |
41 | 41 | $this->iHookPriority, |
42 | 42 | $this->iCallbackParameters |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | * @since 3.6.3 Moved from `AdminPageFramework_Validation`. |
57 | 57 | * @return array The intact stored options. |
58 | 58 | */ |
59 | - protected function _confirmSubmitButtonAction( $sPressedInputName, $sSectionID, $sType='reset' ) { |
|
59 | + protected function _confirmSubmitButtonAction( $sPressedInputName, $sSectionID, $sType = 'reset' ) { |
|
60 | 60 | |
61 | - switch( $sType ) { |
|
61 | + switch ( $sType ) { |
|
62 | 62 | default: |
63 | 63 | case 'reset': |
64 | 64 | $_sFieldErrorMessage = $this->oFactory->oMsg->get( 'reset_options' ); |
65 | - $_sTransientKey = 'apf_rc_' . md5( $sPressedInputName . get_current_user_id() ); |
|
65 | + $_sTransientKey = 'apf_rc_'.md5( $sPressedInputName.get_current_user_id() ); |
|
66 | 66 | break; |
67 | 67 | case 'email': |
68 | 68 | $_sFieldErrorMessage = $this->oFactory->oMsg->get( 'send_email' ); |
69 | - $_sTransientKey = 'apf_ec_' . md5( $sPressedInputName . get_current_user_id() ); |
|
69 | + $_sTransientKey = 'apf_ec_'.md5( $sPressedInputName.get_current_user_id() ); |
|
70 | 70 | break; |
71 | 71 | } |
72 | 72 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->oFactory->setFieldErrors( $_aErrors ); |
89 | 89 | |
90 | 90 | // Set a flag that the confirmation is displayed |
91 | - $this->setTransient( $_sTransientKey, $sPressedInputName, 60*2 ); |
|
91 | + $this->setTransient( $_sTransientKey, $sPressedInputName, 60 * 2 ); |
|
92 | 92 | |
93 | 93 | // Set the admin notice |
94 | 94 | $this->oFactory->setSettingNotice( $this->oFactory->oMsg->get( 'confirm_perform_task' ), 'error confirmation' ); |
@@ -181,7 +181,8 @@ discard block |
||
181 | 181 | */ |
182 | 182 | private function _validateEachField( array $aData, array $aInputsToParse ) { |
183 | 183 | |
184 | - foreach( $aInputsToParse as $_sID => $_aSectionOrFields ) { // $_sID is either a section id or a field id |
|
184 | + foreach( $aInputsToParse as $_sID => $_aSectionOrFields ) { |
|
185 | +// $_sID is either a section id or a field id |
|
185 | 186 | |
186 | 187 | // For each section |
187 | 188 | if ( $this->oFactory->oForm->isSection( $_sID ) ) { |
@@ -192,7 +193,8 @@ discard block |
||
192 | 193 | } |
193 | 194 | |
194 | 195 | // Call the validation callback method. |
195 | - foreach( $_aSectionOrFields as $_sFieldID => $_aFields ) { // For fields |
|
196 | + foreach( $_aSectionOrFields as $_sFieldID => $_aFields ) { |
|
197 | +// For fields |
|
196 | 198 | $aData[ 'aInput' ][ $_sID ][ $_sFieldID ] = $this->_getValidatedData( |
197 | 199 | "validation_{$this->oFactory->oProp->sClassName}_{$_sID}_{$_sFieldID}", |
198 | 200 | $aData[ 'aInput' ][ $_sID ][ $_sFieldID ], |
@@ -276,7 +278,7 @@ discard block |
||
276 | 278 | */ |
277 | 279 | private function _validateTabFields( array $aData ) { |
278 | 280 | |
279 | - if ( ! $aData[ 'sTabSlug' ] || ! $aData[ 'sPageSlug' ] ) { |
|
281 | + if ( ! $aData[ 'sTabSlug' ] || ! $aData[ 'sPageSlug' ] ) { |
|
280 | 282 | return $aData; |
281 | 283 | } |
282 | 284 | |
@@ -337,7 +339,7 @@ discard block |
||
337 | 339 | */ |
338 | 340 | private function _validatePageFields( array $aData ) { |
339 | 341 | |
340 | - if ( ! $aData[ 'sPageSlug' ] ) { |
|
342 | + if ( ! $aData[ 'sPageSlug' ] ) { |
|
341 | 343 | return $aData[ 'aInput' ]; |
342 | 344 | } |
343 | 345 |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->oFactory |
90 | 90 | ), |
91 | 91 | 'aStoredTabDataWODynamicElements' => array(), |
92 | - 'aEmbeddedDataWODynamicElements' => array(), // stores page meta box field options. This will be updated inside the validation methods. |
|
92 | + 'aEmbeddedDataWODynamicElements' => array(), // stores page meta box field options. This will be updated inside the validation methods. |
|
93 | 93 | 'aSubmitInformation' => $aSubmitInformation, // 3.5.0+ |
94 | 94 | ); |
95 | 95 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | call_user_func_array( |
105 | 105 | array( $this->oFactory, 'validate' ), // triggers __call() |
106 | 106 | array( $_aData[ 'aInput' ], $_aData[ 'aStoredData' ], $this->oFactory, $_aData[ 'aSubmitInformation' ] ) |
107 | - ), // 3.5.3+ |
|
107 | + ), // 3.5.3+ |
|
108 | 108 | $_aData[ 'aStoredData' ], |
109 | 109 | $_aData[ 'aSubmitInformation' ] // 3.5.0+ |
110 | 110 | ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // If everything fine, return the filtered input data. |
117 | 117 | $this->_bHasFieldErrors = $this->oFactory->hasFieldError(); |
118 | - if ( ! $this->_bHasFieldErrors ) { |
|
118 | + if ( !$this->_bHasFieldErrors ) { |
|
119 | 119 | return $_aInput; |
120 | 120 | } |
121 | 121 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ); |
130 | 130 | |
131 | 131 | // Go to the catch clause. |
132 | - $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clause. |
|
132 | + $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clause. |
|
133 | 133 | $_oException->aReturn = $_aInput; |
134 | 134 | throw $_oException; |
135 | 135 | |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | */ |
153 | 153 | private function _getInputByUnset( array $aInputs ) { |
154 | 154 | |
155 | - $_sUnsetKey = '__unset_' . $this->oFactory->oProp->sStructureType; |
|
156 | - if ( ! isset( $_POST[ $_sUnsetKey ] ) ) { |
|
155 | + $_sUnsetKey = '__unset_'.$this->oFactory->oProp->sStructureType; |
|
156 | + if ( !isset( $_POST[ $_sUnsetKey ] ) ) { |
|
157 | 157 | return $aInputs; |
158 | 158 | } |
159 | 159 | |
160 | 160 | $_aUnsetElements = array_unique( $_POST[ $_sUnsetKey ] ); |
161 | - foreach( $_aUnsetElements as $_sFlatInputName ) { |
|
161 | + foreach ( $_aUnsetElements as $_sFlatInputName ) { |
|
162 | 162 | $_aDimensionalKeys = explode( '|', $_sFlatInputName ); |
163 | 163 | |
164 | 164 | // The first element is the option key; the section or field dimensional keys follow. |
@@ -181,22 +181,22 @@ discard block |
||
181 | 181 | */ |
182 | 182 | private function _validateEachField( array $aData, array $aInputsToParse ) { |
183 | 183 | |
184 | - foreach( $aInputsToParse as $_sID => $_aSectionOrFields ) { // $_sID is either a section id or a field id |
|
184 | + foreach ( $aInputsToParse as $_sID => $_aSectionOrFields ) { // $_sID is either a section id or a field id |
|
185 | 185 | |
186 | 186 | // For each section |
187 | 187 | if ( $this->oFactory->oForm->isSection( $_sID ) ) { |
188 | 188 | |
189 | 189 | // If the parsing item does not belong to the current page, do not call the validation callback method. |
190 | - if ( ! $this->_isValidSection( $_sID, $aData[ 'sPageSlug' ], $aData[ 'sTabSlug' ] ) ) { |
|
190 | + if ( !$this->_isValidSection( $_sID, $aData[ 'sPageSlug' ], $aData[ 'sTabSlug' ] ) ) { |
|
191 | 191 | continue; |
192 | 192 | } |
193 | 193 | |
194 | 194 | // Call the validation callback method. |
195 | - foreach( $_aSectionOrFields as $_sFieldID => $_aFields ) { // For fields |
|
195 | + foreach ( $_aSectionOrFields as $_sFieldID => $_aFields ) { // For fields |
|
196 | 196 | $aData[ 'aInput' ][ $_sID ][ $_sFieldID ] = $this->_getValidatedData( |
197 | 197 | "validation_{$this->oFactory->oProp->sClassName}_{$_sID}_{$_sFieldID}", |
198 | 198 | $aData[ 'aInput' ][ $_sID ][ $_sFieldID ], |
199 | - $this->getElement( $aData, array( 'aStoredData', $_sID, $_sFieldID ), null ), // isset( $aData[ 'aStoredData' ][ $_sID ][ $_sFieldID ] ) ? $aData[ 'aStoredData' ][ $_sID ][ $_sFieldID ] : null, |
|
199 | + $this->getElement( $aData, array( 'aStoredData', $_sID, $_sFieldID ), null ), // isset( $aData[ 'aStoredData' ][ $_sID ][ $_sFieldID ] ) ? $aData[ 'aStoredData' ][ $_sID ][ $_sFieldID ] : null, |
|
200 | 200 | $aData[ 'aSubmitInformation' ] // 3.5.0+ |
201 | 201 | ); |
202 | 202 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $aData[ 'aInput' ][ $_sID ] = $this->_getValidatedData( |
218 | 218 | "validation_{$this->oFactory->oProp->sClassName}_{$_sID}", |
219 | 219 | $_aSectionInput, |
220 | - $this->getElement( $aData, array( 'aStoredData', $_sID ), null ), // isset( $aData[ 'aStoredData' ][ $_sID ] ) ? $aData[ 'aStoredData' ][ $_sID ] : null, |
|
220 | + $this->getElement( $aData, array( 'aStoredData', $_sID ), null ), // isset( $aData[ 'aStoredData' ][ $_sID ] ) ? $aData[ 'aStoredData' ][ $_sID ] : null, |
|
221 | 221 | $aData[ 'aSubmitInformation' ] |
222 | 222 | ); |
223 | 223 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | // Check if the parsing item (the default section) belongs to the current page; if not, do not call the validation callback method. |
229 | - if ( ! $this->_isValidSection( '_default', $aData[ 'sPageSlug' ], $aData[ 'sTabSlug' ] ) ) { |
|
229 | + if ( !$this->_isValidSection( '_default', $aData[ 'sPageSlug' ], $aData[ 'sTabSlug' ] ) ) { |
|
230 | 230 | continue; |
231 | 231 | } |
232 | 232 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $aData[ 'aInput' ][ $_sID ] = $this->_getValidatedData( |
235 | 235 | "validation_{$this->oFactory->oProp->sClassName}_{$_sID}", |
236 | 236 | $aData[ 'aInput' ][ $_sID ], |
237 | - $this->getElement( $aData, array( 'aStoredData', $_sID ), null ), // isset( $aData[ 'aStoredData' ][ $_sID ] ) ? $aData[ 'aStoredData' ][ $_sID ] : null, |
|
237 | + $this->getElement( $aData, array( 'aStoredData', $_sID ), null ), // isset( $aData[ 'aStoredData' ][ $_sID ] ) ? $aData[ 'aStoredData' ][ $_sID ] : null, |
|
238 | 238 | $aData[ 'aSubmitInformation' ] |
239 | 239 | ); |
240 | 240 | |
@@ -276,22 +276,22 @@ discard block |
||
276 | 276 | */ |
277 | 277 | private function _validateTabFields( array $aData ) { |
278 | 278 | |
279 | - if ( ! $aData[ 'sTabSlug' ] || ! $aData[ 'sPageSlug' ] ) { |
|
279 | + if ( !$aData[ 'sTabSlug' ] || !$aData[ 'sPageSlug' ] ) { |
|
280 | 280 | return $aData; |
281 | 281 | } |
282 | 282 | |
283 | - $aData[ 'aStoredTabData' ] = $this->oFactory->oForm->getTabOptions( |
|
283 | + $aData[ 'aStoredTabData' ] = $this->oFactory->oForm->getTabOptions( |
|
284 | 284 | $aData[ 'aStoredData' ], |
285 | 285 | $aData[ 'sPageSlug' ], |
286 | 286 | $aData[ 'sTabSlug' ] |
287 | 287 | ); // respects page meta box fields |
288 | - $aData[ 'aStoredTabData' ] = $this->addAndApplyFilter( |
|
288 | + $aData[ 'aStoredTabData' ] = $this->addAndApplyFilter( |
|
289 | 289 | $this->oFactory, |
290 | 290 | "validation_saved_options_{$aData[ 'sPageSlug' ]}_{$aData[ 'sTabSlug' ]}", |
291 | 291 | $aData[ 'aStoredTabData' ], |
292 | 292 | $this->oFactory |
293 | 293 | ); |
294 | - $_aOtherTabOptions = $this->oFactory->oForm->getOtherTabOptions( |
|
294 | + $_aOtherTabOptions = $this->oFactory->oForm->getOtherTabOptions( |
|
295 | 295 | $aData[ 'aStoredData' ], |
296 | 296 | $aData[ 'sPageSlug' ], |
297 | 297 | $aData[ 'sTabSlug' ] |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | */ |
346 | 346 | private function _validatePageFields( array $aData ) { |
347 | 347 | |
348 | - if ( ! $aData[ 'sPageSlug' ] ) { |
|
348 | + if ( !$aData[ 'sPageSlug' ] ) { |
|
349 | 349 | return $aData[ 'aInput' ]; |
350 | 350 | } |
351 | 351 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $_aPageOptionsWODynamicElements = $this->addAndApplyFilter( |
358 | 358 | $this->oFactory, |
359 | 359 | "validation_saved_options_without_dynamic_elements_{$aData[ 'sPageSlug' ]}", |
360 | - $this->oFactory->oForm->getPageOptions( $aData[ 'aStoredDataWODynamicElements' ], $aData[ 'sPageSlug' ] ), // united with the in-page tab specific data in order to override the page-specific dynamic elements. |
|
360 | + $this->oFactory->oForm->getPageOptions( $aData[ 'aStoredDataWODynamicElements' ], $aData[ 'sPageSlug' ] ), // united with the in-page tab specific data in order to override the page-specific dynamic elements. |
|
361 | 361 | $this->oFactory |
362 | 362 | ); |
363 | 363 | |
@@ -370,15 +370,15 @@ discard block |
||
370 | 370 | // Validate the input data. |
371 | 371 | $aData[ 'aInput' ] = $this->_getValidatedData( |
372 | 372 | "validation_{$aData[ 'sPageSlug' ]}", |
373 | - $aData[ 'aInput' ], // new values |
|
374 | - $_aPageOptions, // stored page options |
|
373 | + $aData[ 'aInput' ], // new values |
|
374 | + $_aPageOptions, // stored page options |
|
375 | 375 | $aData[ 'aSubmitInformation' ] // submit information 3.5.0+ |
376 | 376 | ); |
377 | 377 | |
378 | 378 | // If it's in a tab-page, drop the elements which belong to the tab so that arrayed-options will not be merged such as multiple select options. |
379 | - $_aPageOptions = $aData[ 'sTabSlug' ] && ! empty( $aData[ 'aStoredTabData' ] ) |
|
379 | + $_aPageOptions = $aData[ 'sTabSlug' ] && !empty( $aData[ 'aStoredTabData' ] ) |
|
380 | 380 | ? $this->invertCastArrayContents( $_aPageOptions, $aData[ 'aStoredTabData' ] ) |
381 | - : ( ! $aData[ 'sTabSlug' ] // if the tab is not specified, do not merge the input array with the page options as the input array already includes the page options. This is for dynamic elements(repeatable sections). |
|
381 | + : ( !$aData[ 'sTabSlug' ] // if the tab is not specified, do not merge the input array with the page options as the input array already includes the page options. This is for dynamic elements(repeatable sections). |
|
382 | 382 | ? array() |
383 | 383 | : $_aPageOptions |
384 | 384 | ); |
@@ -433,13 +433,13 @@ discard block |
||
433 | 433 | * @param array $aStoredData The stored option. |
434 | 434 | * @param array $aSubmitInfo [3.5.0+] The form submit information such as the field ID of the pressed submit field. |
435 | 435 | */ |
436 | - private function _getValidatedData( $sFilterName, $aInputs, $aStoredData, $aSubmitInfo=array() ) { |
|
436 | + private function _getValidatedData( $sFilterName, $aInputs, $aStoredData, $aSubmitInfo = array() ) { |
|
437 | 437 | return $this->addAndApplyFilter( |
438 | - $this->oFactory, // caller |
|
439 | - $sFilterName, // hook name |
|
440 | - $aInputs, // 1st argument |
|
441 | - $aStoredData, // 2nd argument |
|
442 | - $this->oFactory, // 3rd argument |
|
438 | + $this->oFactory, // caller |
|
439 | + $sFilterName, // hook name |
|
440 | + $aInputs, // 1st argument |
|
441 | + $aStoredData, // 2nd argument |
|
442 | + $this->oFactory, // 3rd argument |
|
443 | 443 | $aSubmitInfo // 4th argument 3.5.0+ |
444 | 444 | ); |
445 | 445 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
37 | 37 | $_sLinkURL = $this->_getPressedSubmitButtonData( $aSubmits, 'href' ); |
38 | - if ( ! $_sLinkURL ) { |
|
38 | + if ( !$_sLinkURL ) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | $this->goToURL( $_sLinkURL ); |