@@ -56,7 +56,7 @@ |
||
| 56 | 56 | * @param string $sCapability (optional) sets the overall access level to the admin pages created by the framework. The used capabilities are listed <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. The capability can be set per page, tab, setting section, setting field. Default: `manage_options` |
| 57 | 57 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: admin-page-framework. |
| 58 | 58 | */ |
| 59 | - public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ){ |
|
| 59 | + public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
| 60 | 60 | |
| 61 | 61 | if ( ! $this->_isInstantiatable() ) { |
| 62 | 62 | return; |
@@ -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 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
| 74 | 74 | |
| 75 | - foreach( func_get_args() as $asSection ) { |
|
| 75 | + foreach( func_get_args() as $asSection ) { |
|
| 76 | 76 | $this->addSettingSection( $asSection ); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
| 159 | 159 | * @return void |
| 160 | 160 | */ |
| 161 | - public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
|
| 161 | + public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
|
| 162 | 162 | |
| 163 | 163 | foreach( func_get_args() as $_sSectionID ) { |
| 164 | 164 | $this->oForm->removeSection( $_sSectionID ); |
@@ -218,8 +218,8 @@ discard block |
||
| 218 | 218 | * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
| 219 | 219 | * @remark The actual registration will be performed in the <em>_replyToRegisterSettings()</em> method with the <em>admin_menu</em> hook. |
| 220 | 220 | */ |
| 221 | - public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
|
| 222 | - foreach( func_get_args() as $aField ) { |
|
| 221 | + public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
|
| 222 | + foreach( func_get_args() as $aField ) { |
|
| 223 | 223 | $this->addSettingField( $aField ); |
| 224 | 224 | } |
| 225 | 225 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * @return void |
| 258 | 258 | */ |
| 259 | 259 | public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more ) { |
| 260 | - foreach( func_get_args() as $_sFieldID ) { |
|
| 260 | + foreach( func_get_args() as $_sFieldID ) { |
|
| 261 | 261 | $this->oForm->removeField( $_sFieldID ); |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -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', |
@@ -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 | 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. |
@@ -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 | } |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | |
| 160 | 160 | // Download the file. It returns a string value on success. WP Error object on failure. |
| 161 | 161 | $_sPath = $this->download( $sURL, 10 ); |
| 162 | - if ( is_string( $_sPath ) ) { |
|
| 162 | + if ( is_string( $_sPath ) ) { |
|
| 163 | 163 | $this->_aPathsToDelete[ $_sPath ] = $_sPath; |
| 164 | 164 | return $_sPath; |
| 165 | 165 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | // Save the data. |
| 140 | 140 | $_bUpdated = false; |
| 141 | - if ( ! $this->oFactory->oProp->_bDisableSavingOptions ) { |
|
| 141 | + if ( ! $this->oFactory->oProp->_bDisableSavingOptions ) { |
|
| 142 | 142 | $_bUpdated = $this->oFactory->oProp->updateOption( $_aInputs ); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -181,14 +181,15 @@ discard block |
||
| 181 | 181 | $_POST[ 'admin_page_framework_start' ], // indicates the framework form is started |
| 182 | 182 | $_POST[ '_wp_http_referer' ] |
| 183 | 183 | ) |
| 184 | - ) { |
|
| 184 | + ) { |
|
| 185 | 185 | return false; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // Referrer |
| 189 | 189 | $_sRequestURI = remove_query_arg( array( 'settings-updated', 'confirmation', 'field_errors' ), wp_unslash( $_SERVER[ 'REQUEST_URI' ] ) ); |
| 190 | 190 | $_sReffererURI = remove_query_arg( array( 'settings-updated', 'confirmation', 'field_errors' ), $_POST[ '_wp_http_referer' ] ); |
| 191 | - if ( $_sRequestURI != $_sReffererURI ) { // see the function definition of wp_referer_field() in functions.php. |
|
| 191 | + if ( $_sRequestURI != $_sReffererURI ) { |
|
| 192 | +// see the function definition of wp_referer_field() in functions.php. |
|
| 192 | 193 | return false; |
| 193 | 194 | } |
| 194 | 195 | |