@@ -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 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param string (optional) the position number that is passed to the <var>$position</var> parameter of the <a href="http://codex.wordpress.org/Function_Reference/add_menu_page">add_menu_page()</a> function. |
| 51 | 51 | * @return void |
| 52 | 52 | */ |
| 53 | - public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16=null, $iMenuPosition=null ) { |
|
| 53 | + public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16 = null, $iMenuPosition = null ) { |
|
| 54 | 54 | |
| 55 | 55 | $sRootMenuLabel = trim( $sRootMenuLabel ); |
| 56 | 56 | $_sSlug = $this->_isBuiltInMenuItem( $sRootMenuLabel ); // if true, this method returns the slug |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function setRootMenuPageBySlug( $sRootMenuSlug ) { |
| 100 | 100 | |
| 101 | - $this->oProp->aRootMenu['sPageSlug'] = $sRootMenuSlug; // do not sanitize the slug here because post types includes a question mark. |
|
| 102 | - $this->oProp->aRootMenu['fCreateRoot'] = false; // indicates to use an existing menu item. |
|
| 101 | + $this->oProp->aRootMenu[ 'sPageSlug' ] = $sRootMenuSlug; // do not sanitize the slug here because post types includes a question mark. |
|
| 102 | + $this->oProp->aRootMenu[ 'fCreateRoot' ] = false; // indicates to use an existing menu item. |
|
| 103 | 103 | |
| 104 | 104 | } |
| 105 | 105 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @access public |
| 138 | 138 | * @return void |
| 139 | 139 | */ |
| 140 | - public function addSubMenuItems( $aSubMenuItem1, $aSubMenuItem2=null, $_and_more=null ) { |
|
| 140 | + public function addSubMenuItems( $aSubMenuItem1, $aSubMenuItem2 = null, $_and_more = null ) { |
|
| 141 | 141 | foreach ( func_get_args() as $_aSubMenuItem ) { |
| 142 | 142 | $this->addSubMenuItem( $_aSubMenuItem ); |
| 143 | 143 | } |
@@ -214,16 +214,16 @@ discard block |
||
| 214 | 214 | public function addSubMenuLink( array $aSubMenuLink ) { |
| 215 | 215 | |
| 216 | 216 | // If required keys are not set, return. |
| 217 | - if ( ! isset( $aSubMenuLink['href'], $aSubMenuLink['title'] ) ) { |
|
| 217 | + if ( !isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
| 218 | 218 | return; |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | // If the set URL is not valid, return. |
| 222 | - if ( ! filter_var( $aSubMenuLink['href'], FILTER_VALIDATE_URL ) ) { |
|
| 222 | + if ( !filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
| 223 | 223 | return; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
| 226 | + $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
| 227 | 227 | $aSubMenuLink, |
| 228 | 228 | $this |
| 229 | 229 | ); |
@@ -312,11 +312,11 @@ discard block |
||
| 312 | 312 | */ |
| 313 | 313 | public function addSubMenuPage( array $aSubMenuPage ) { |
| 314 | 314 | |
| 315 | - if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
| 315 | + if ( !isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
| 316 | 316 | return; |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | - $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
| 319 | + $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
| 320 | 320 | $aSubMenuPage, |
| 321 | 321 | $this |
| 322 | 322 | ); |
@@ -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 | } |
@@ -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 | } |
@@ -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. |
@@ -28,19 +28,19 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function _replyToGetSectionName( /* $sAttribute, $aSectionset */ ) { |
| 30 | 30 | |
| 31 | - $_aParams = func_get_args() + array( null, null, ); |
|
| 31 | + $_aParams = func_get_args() + array( null, null,); |
|
| 32 | 32 | $sNameAttribute = $_aParams[ 0 ]; |
| 33 | 33 | $aSectionset = $_aParams[ 1 ]; |
| 34 | 34 | |
| 35 | 35 | $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
| 36 | 36 | |
| 37 | 37 | $_aDimensionalKeys = array( $this->oProp->sOptionKey ); |
| 38 | - foreach( $_aSectionPath as $_sDimension ) { |
|
| 39 | - $_aDimensionalKeys[] = '[' . $_sDimension . ']'; |
|
| 38 | + foreach ( $_aSectionPath as $_sDimension ) { |
|
| 39 | + $_aDimensionalKeys[ ] = '['.$_sDimension.']'; |
|
| 40 | 40 | } |
| 41 | 41 | // $_aDimensionalKeys[] = '[' . $aSectionset[ 'section_id' ] . ']'; |
| 42 | 42 | if ( isset( $aSectionset[ '_index' ] ) ) { |
| 43 | - $_aDimensionalKeys[] = '[' . $aSectionset[ '_index' ] . ']'; |
|
| 43 | + $_aDimensionalKeys[ ] = '['.$aSectionset[ '_index' ].']'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return implode( '', $_aDimensionalKeys ); |
@@ -53,23 +53,23 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function _replyToGetFieldNameAttribute( /* $sAttribute, $aFieldset */ ) { |
| 55 | 55 | |
| 56 | - $_aParams = func_get_args() + array( null, null, ); |
|
| 56 | + $_aParams = func_get_args() + array( null, null,); |
|
| 57 | 57 | $sNameAttribute = $_aParams[ 0 ]; |
| 58 | 58 | $aFieldset = $_aParams[ 1 ]; |
| 59 | 59 | |
| 60 | 60 | $_aDimensionalKeys = array( $aFieldset[ 'option_key' ] ); |
| 61 | 61 | if ( $this->isSectionSet( $aFieldset ) ) { |
| 62 | - $_aSectionPath = $aFieldset[ '_section_path_array' ]; |
|
| 63 | - foreach( $_aSectionPath as $_sDimension ) { |
|
| 64 | - $_aDimensionalKeys[] = '[' . $_sDimension . ']'; |
|
| 62 | + $_aSectionPath = $aFieldset[ '_section_path_array' ]; |
|
| 63 | + foreach ( $_aSectionPath as $_sDimension ) { |
|
| 64 | + $_aDimensionalKeys[ ] = '['.$_sDimension.']'; |
|
| 65 | 65 | } |
| 66 | 66 | // $_aDimensionalKeys[] = '[' . $aFieldset[ 'section_id' ] . ']'; |
| 67 | 67 | if ( isset( $aFieldset[ '_section_index' ] ) ) { |
| 68 | - $_aDimensionalKeys[] = '[' . $aFieldset[ '_section_index' ] . ']'; |
|
| 68 | + $_aDimensionalKeys[ ] = '['.$aFieldset[ '_section_index' ].']'; |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $_aDimensionalKeys[] = '[' . $aFieldset[ 'field_id' ] . ']'; |
|
| 72 | + $_aDimensionalKeys[ ] = '['.$aFieldset[ 'field_id' ].']'; |
|
| 73 | 73 | |
| 74 | 74 | return implode( '', $_aDimensionalKeys ); |
| 75 | 75 | |
@@ -81,20 +81,20 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function _replyToGetFlatFieldName( /* $sAttribute, $aFieldset */ ) { |
| 83 | 83 | |
| 84 | - $_aParams = func_get_args() + array( null, null, ); |
|
| 84 | + $_aParams = func_get_args() + array( null, null,); |
|
| 85 | 85 | $sNameAttribute = $_aParams[ 0 ]; |
| 86 | 86 | $aFieldset = $_aParams[ 1 ]; |
| 87 | 87 | |
| 88 | 88 | $_aDimensionalKeys = array( $aFieldset[ 'option_key' ] ); |
| 89 | 89 | if ( $this->isSectionSet( $aFieldset ) ) { |
| 90 | - foreach( $aFieldset[ '_section_path_array' ] as $_sDimension ) { |
|
| 91 | - $_aDimensionalKeys[] = $_sDimension; // $aFieldset[ 'section_id' ]; |
|
| 90 | + foreach ( $aFieldset[ '_section_path_array' ] as $_sDimension ) { |
|
| 91 | + $_aDimensionalKeys[ ] = $_sDimension; // $aFieldset[ 'section_id' ]; |
|
| 92 | 92 | } |
| 93 | 93 | if ( isset( $aFieldset[ '_section_index' ] ) ) { |
| 94 | - $_aDimensionalKeys[] = $aFieldset[ '_section_index' ]; |
|
| 94 | + $_aDimensionalKeys[ ] = $aFieldset[ '_section_index' ]; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | - $_aDimensionalKeys[] = $aFieldset[ 'field_id' ]; |
|
| 97 | + $_aDimensionalKeys[ ] = $aFieldset[ 'field_id' ]; |
|
| 98 | 98 | return implode( '|', $_aDimensionalKeys ); |
| 99 | 99 | |
| 100 | 100 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | "[{$sKey}]" |
| 118 | 118 | ); |
| 119 | 119 | |
| 120 | - return $this->_replyToGetFieldNameAttribute( '', $aField ) . $sKey; |
|
| 120 | + return $this->_replyToGetFieldNameAttribute( '', $aField ).$sKey; |
|
| 121 | 121 | |
| 122 | 122 | } |
| 123 | 123 | /** |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | $_sKey = $this->oUtil->getAOrB( |
| 136 | 136 | '0' !== $_sKey && empty( $_sKey ), |
| 137 | 137 | '', |
| 138 | - "|" . $_sKey |
|
| 138 | + "|".$_sKey |
|
| 139 | 139 | ); |
| 140 | 140 | |
| 141 | - return $this->_replyToGetFlatFieldName( '', $aField ) . $_sKey; |
|
| 141 | + return $this->_replyToGetFlatFieldName( '', $aField ).$_sKey; |
|
| 142 | 142 | |
| 143 | 143 | } |
| 144 | 144 | |
@@ -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 | } |
@@ -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 ); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // Send mail. |
| 88 | - $_bSent = wp_mail( |
|
| 88 | + $_bSent = wp_mail( |
|
| 89 | 89 | $this->_getEmailArgument( $aInput, $aEmailOptions, 'to', $sSubmitSectionID ), |
| 90 | 90 | $this->_getEmailArgument( $aInput, $aEmailOptions, 'subject', $sSubmitSectionID ), |
| 91 | 91 | $_bIsHTML |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | remove_filter( 'wp_mail_from_name', array( $this, '_replyToSetEmailSenderAddress' ) ); |
| 101 | 101 | |
| 102 | 102 | // Clean up. |
| 103 | - foreach( $this->_aPathsToDelete as $_sPath ) { |
|
| 103 | + foreach ( $this->_aPathsToDelete as $_sPath ) { |
|
| 104 | 104 | unlink( $_sPath ); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | $_aAttachments = $this->getAsArray( $asAttachments ); |
| 124 | - foreach( $_aAttachments as $_iIndex => $_sPathORURL ) { |
|
| 124 | + foreach ( $_aAttachments as $_iIndex => $_sPathORURL ) { |
|
| 125 | 125 | |
| 126 | 126 | // If it is a file path, fine. |
| 127 | 127 | if ( is_file( $_sPathORURL ) ) { |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | // If the key element is empty, search the corresponding item in the same section. |
| 214 | - if ( ! $aEmailOptions[ $sKey ] ) { |
|
| 214 | + if ( !$aEmailOptions[ $sKey ] ) { |
|
| 215 | 215 | return $this->getArrayValueByArrayKeys( $aInput, array( $sSectionID, $sKey ) ); |
| 216 | 216 | } |
| 217 | 217 | |