| @@ -89,6 +89,11 @@ | ||
| 89 | 89 | return $vData; | 
| 90 | 90 | |
| 91 | 91 | } | 
| 92 | + | |
| 93 | + /** | |
| 94 | + * @param string $vData | |
| 95 | + * @param string $sFormatType | |
| 96 | + */ | |
| 92 | 97 |      public function formatImportData( &$vData, $sFormatType=null ) { | 
| 93 | 98 | |
| 94 | 99 | $sFormatType = isset( $sFormatType ) ? $sFormatType : $this->getFormatType(); | 
| @@ -56,11 +56,11 @@ discard block | ||
| 56 | 56 | |
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | -    private function getElementInFilesArray( array $aFilesImport, $sInputID, $sElementKey='error' ) { | |
| 59 | +    private function getElementInFilesArray( array $aFilesImport, $sInputID, $sElementKey = 'error' ) { | |
| 60 | 60 | |
| 61 | 61 | $sElementKey = strtolower( $sElementKey ); | 
| 62 | 62 | return $this->getElement( | 
| 63 | - $aFilesImport, // subject array | |
| 63 | + $aFilesImport, // subject array | |
| 64 | 64 | array( $sElementKey, $sInputID ), // dimensional keys | 
| 65 | 65 | null // default | 
| 66 | 66 | ); | 
| @@ -88,7 +88,7 @@ discard block | ||
| 88 | 88 | return $vData; | 
| 89 | 89 | |
| 90 | 90 | } | 
| 91 | -    public function formatImportData( &$vData, $sFormatType=null ) { | |
| 91 | +    public function formatImportData( &$vData, $sFormatType = null ) { | |
| 92 | 92 | |
| 93 | 93 | $sFormatType = isset( $sFormatType ) ? $sFormatType : $this->getFormatType(); | 
| 94 | 94 |          switch ( strtolower( $sFormatType ) ) { | 
| @@ -25,6 +25,7 @@ | ||
| 25 | 25 | /** | 
| 26 | 26 | * Sets up properties. | 
| 27 | 27 | * @since 3.6.3 | 
| 28 | + * @param AdminPageFramework_Model_Form $oFactory | |
| 28 | 29 | */ | 
| 29 | 30 |      public function __construct( $oFactory ) { | 
| 30 | 31 | |
| @@ -28,10 +28,10 @@ discard block | ||
| 28 | 28 | */ | 
| 29 | 29 |      public function __construct( $oFactory ) { | 
| 30 | 30 | |
| 31 | - $this->oFactory = $oFactory; | |
| 31 | + $this->oFactory = $oFactory; | |
| 32 | 32 | |
| 33 | 33 | // Form emails. | 
| 34 | -        if ( ! isset( $_GET[ 'apf_action' ], $_GET[ 'transient' ] ) ) { | |
| 34 | +        if ( !isset( $_GET[ 'apf_action' ], $_GET[ 'transient' ] ) ) { | |
| 35 | 35 | return; | 
| 36 | 36 | } | 
| 37 | 37 |          if ( 'email' !== $_GET[ 'apf_action' ] ) { | 
| @@ -73,13 +73,13 @@ discard block | ||
| 73 | 73 | self::$_bDoneEmail = true; | 
| 74 | 74 | |
| 75 | 75 | $_sTransient = $this->getElement( $_GET, 'transient', '' ); | 
| 76 | -            if ( ! $_sTransient ) { | |
| 76 | +            if ( !$_sTransient ) { | |
| 77 | 77 | return; | 
| 78 | 78 | } | 
| 79 | 79 | $_sTransient = sanitize_text_field( $_sTransient ); | 
| 80 | 80 | $_aFormEmail = $this->getTransient( $_sTransient ); | 
| 81 | 81 | $this->deleteTransient( $_sTransient ); | 
| 82 | -            if ( ! is_array( $_aFormEmail ) ) { | |
| 82 | +            if ( !is_array( $_aFormEmail ) ) { | |
| 83 | 83 | return; | 
| 84 | 84 | } | 
| 85 | 85 | |
| @@ -26,6 +26,7 @@ discard block | ||
| 26 | 26 | /** | 
| 27 | 27 | * Sets up hooks and properties. | 
| 28 | 28 | * @since 3.6.3 | 
| 29 | + * @param AdminPageFramework_Model_Form $oFactory | |
| 29 | 30 | */ | 
| 30 | 31 |      public function __construct( $oFactory, $aSavedData, $aArguments, $aSectionsets, $aFieldsets ) { | 
| 31 | 32 | |
| @@ -250,6 +251,9 @@ discard block | ||
| 250 | 251 | * Do the 'submit_...' actions. | 
| 251 | 252 | * | 
| 252 | 253 | * @internal | 
| 254 | + * @param null|string $_sSubmitSectionID | |
| 255 | + * @param null|string $_sPressedFieldID | |
| 256 | + * @param null|string $_sPressedInputID | |
| 253 | 257 | * @return void | 
| 254 | 258 | * @since 3.5.3 | 
| 255 | 259 | * @since 3.6.3 Moved from `AdminPageFramework_Validation`. | 
| @@ -296,6 +300,8 @@ discard block | ||
| 296 | 300 | * Do the 'submit_after_...' actions. | 
| 297 | 301 | * | 
| 298 | 302 | * @internal | 
| 303 | + * @param null|string $_sSubmitSectionID | |
| 304 | + * @param null|string $_sPressedFieldID | |
| 299 | 305 | * @return void | 
| 300 | 306 | * @since 3.5.3 | 
| 301 | 307 | * @since 3.6.3 Moved from `AdminPageFramework_Validation`. | 
| @@ -137,7 +137,7 @@ discard block | ||
| 137 | 137 | |
| 138 | 138 | // Save the data. | 
| 139 | 139 | $_bUpdated = false; | 
| 140 | -        if ( ! $this->oFactory->oProp->_bDisableSavingOptions ) {   | |
| 140 | +        if ( ! $this->oFactory->oProp->_bDisableSavingOptions ) { | |
| 141 | 141 | $_bUpdated = $this->oFactory->oProp->updateOption( $_aInputs ); | 
| 142 | 142 | } | 
| 143 | 143 | |
| @@ -180,14 +180,15 @@ discard block | ||
| 180 | 180 | $_POST[ 'admin_page_framework_start' ], // indicates the framework form is started | 
| 181 | 181 | $_POST[ '_wp_http_referer' ] | 
| 182 | 182 | ) | 
| 183 | -            ) {      | |
| 183 | +            ) { | |
| 184 | 184 | return false; | 
| 185 | 185 | } | 
| 186 | 186 | |
| 187 | 187 | // Referrer | 
| 188 | 188 | $_sRequestURI = remove_query_arg( array( 'settings-updated', 'confirmation', 'field_errors' ), wp_unslash( $_SERVER[ 'REQUEST_URI' ] ) ); | 
| 189 | 189 | $_sRefererURI = remove_query_arg( array( 'settings-updated', 'confirmation', 'field_errors' ), $_POST[ '_wp_http_referer' ] ); | 
| 190 | -            if ( $_sRequestURI != $_sRefererURI ) { // see the function definition of wp_referer_field() in functions.php. | |
| 190 | +            if ( $_sRequestURI != $_sRefererURI ) { | |
| 191 | +// see the function definition of wp_referer_field() in functions.php. | |
| 191 | 192 | return false; | 
| 192 | 193 | } | 
| 193 | 194 | |
| @@ -28,7 +28,7 @@ discard block | ||
| 28 | 28 | */ | 
| 29 | 29 |      public function __construct( $oFactory, $aSavedData, $aArguments, $aSectionsets, $aFieldsets ) { | 
| 30 | 30 | |
| 31 | - $this->oFactory = $oFactory; | |
| 31 | + $this->oFactory = $oFactory; | |
| 32 | 32 | |
| 33 | 33 | // add_action | 
| 34 | 34 | // @deprecated 3.7.0 | 
| @@ -71,7 +71,7 @@ discard block | ||
| 71 | 71 | */ | 
| 72 | 72 |      public function _handleFormData() { | 
| 73 | 73 | |
| 74 | -        if ( ! $this->_shouldProceed() ) { | |
| 74 | +        if ( !$this->_shouldProceed() ) { | |
| 75 | 75 | return; | 
| 76 | 76 | } | 
| 77 | 77 | |
| @@ -127,7 +127,7 @@ discard block | ||
| 127 | 127 | new AdminPageFramework_Model__FormSubmission__Validator( $this->oFactory ); | 
| 128 | 128 | |
| 129 | 129 | // [3.6.3+] Apply filters. All the sub-routines of handling form submit data use this filter hook. | 
| 130 | - $_aInputs = $this->addAndApplyFilters( | |
| 130 | + $_aInputs = $this->addAndApplyFilters( | |
| 131 | 131 | $this->oFactory, | 
| 132 | 132 |              "validation_pre_{$this->oFactory->oProp->sClassName}",  | 
| 133 | 133 | $_aInputs, | 
| @@ -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 | |
| @@ -177,7 +177,7 @@ discard block | ||
| 177 | 177 |          private function _shouldProceed() { | 
| 178 | 178 | |
| 179 | 179 | if ( | 
| 180 | - ! isset( | |
| 180 | + !isset( | |
| 181 | 181 | $_POST[ 'admin_page_framework_start' ], // indicates the framework form is started | 
| 182 | 182 | $_POST[ '_wp_http_referer' ] | 
| 183 | 183 | ) | 
| @@ -194,7 +194,7 @@ discard block | ||
| 194 | 194 | |
| 195 | 195 | // Check if all the form fields are sent. | 
| 196 | 196 | if ( | 
| 197 | - ! isset( | |
| 197 | + !isset( | |
| 198 | 198 | // these keys are supposed to be embedded at the end of the form. | 
| 199 | 199 | // if the server truncates the form input values for `max_input_vars`, these will be lost in PHP 5.3.9 or above. | 
| 200 | 200 | $_POST[ '_is_admin_page_framework' ], // holds the form nonce | 
| @@ -214,11 +214,11 @@ discard block | ||
| 214 | 214 | return false; | 
| 215 | 215 | } | 
| 216 | 216 | |
| 217 | - $_bVerifyNonce = wp_verify_nonce( | |
| 217 | + $_bVerifyNonce = wp_verify_nonce( | |
| 218 | 218 | $_POST[ '_is_admin_page_framework' ], | 
| 219 | - 'form_' . md5( $this->oFactory->oProp->sClassName . get_current_user_id() ) | |
| 219 | + 'form_'.md5( $this->oFactory->oProp->sClassName.get_current_user_id() ) | |
| 220 | 220 | ); | 
| 221 | -            if ( ! $_bVerifyNonce ) { | |
| 221 | +            if ( !$_bVerifyNonce ) { | |
| 222 | 222 | $this->oFactory->setAdminNotice( $this->oFactory->oMsg->get( 'nonce_verification_failed' ) ); | 
| 223 | 223 | return false; | 
| 224 | 224 | } | 
| @@ -232,7 +232,7 @@ discard block | ||
| 232 | 232 | */ | 
| 233 | 233 |          private function _getUserInputsFromPOST() { | 
| 234 | 234 | |
| 235 | - $_aInputs = $this->getElementAsArray( | |
| 235 | + $_aInputs = $this->getElementAsArray( | |
| 236 | 236 | $_POST, // will be sanitized in the getSubmittedData() method. | 
| 237 | 237 | $this->oFactory->oProp->sOptionKey, | 
| 238 | 238 | array() | 
| @@ -265,7 +265,7 @@ discard block | ||
| 265 | 265 | $this->oFactory, | 
| 266 | 266 | array( | 
| 267 | 267 | // @todo deprecate the hook with the input ID | 
| 268 | -                    "submit_{$this->oFactory->oProp->sClassName}_{$_sPressedInputID}",  // will be deprecated in near future release | |
| 268 | +                    "submit_{$this->oFactory->oProp->sClassName}_{$_sPressedInputID}", // will be deprecated in near future release | |
| 269 | 269 | $_sSubmitSectionID | 
| 270 | 270 |                          ? "submit_{$this->oFactory->oProp->sClassName}_{$_sSubmitSectionID}_{$_sPressedFieldID}"  | 
| 271 | 271 |                          : "submit_{$this->oFactory->oProp->sClassName}_{$_sPressedFieldID}", | 
| @@ -348,9 +348,9 @@ discard block | ||
| 348 | 348 | |
| 349 | 349 | // Drop the 'field_errors' key. | 
| 350 | 350 | $_aRemoveQueries = array(); | 
| 351 | -            if ( ! isset( $aStatus[ 'field_errors' ] ) || ! $aStatus[ 'field_errors' ] ) { | |
| 351 | +            if ( !isset( $aStatus[ 'field_errors' ] ) || !$aStatus[ 'field_errors' ] ) { | |
| 352 | 352 | unset( $aStatus[ 'field_errors' ] ); | 
| 353 | - $_aRemoveQueries[] = 'field_errors'; | |
| 353 | + $_aRemoveQueries[ ] = 'field_errors'; | |
| 354 | 354 | } | 
| 355 | 355 | |
| 356 | 356 | return $this->addAndApplyFilters( // 3.4.4+ | 
| @@ -375,7 +375,7 @@ discard block | ||
| 375 | 375 | */ | 
| 376 | 376 |          private function _removePageElements( $aOptions, $sPageSlug, $sTabSlug ) { | 
| 377 | 377 | |
| 378 | -            if ( ! $sPageSlug && ! $sTabSlug ) { | |
| 378 | +            if ( !$sPageSlug && !$sTabSlug ) { | |
| 379 | 379 | return $aOptions; | 
| 380 | 380 | } | 
| 381 | 381 | |
| @@ -79,6 +79,7 @@ | ||
| 79 | 79 | * @since 3.5.3 | 
| 80 | 80 | * @since 3.6.3 Moved from `AdminPageFramework_Form_Model_Validation_Option`. | 
| 81 | 81 | * @internal | 
| 82 | + * @param boolean $bIsInputEmtpy | |
| 82 | 83 | * @return void | 
| 83 | 84 | * @remark Accessed from some of the parent/child classes. | 
| 84 | 85 | */ | 
| @@ -46,12 +46,12 @@ | ||
| 46 | 46 | * @return null|string Returns `null` if no value is found and the associated link url if found. | 
| 47 | 47 | * Otherwise, the found value. | 
| 48 | 48 | */ | 
| 49 | -    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) {     | |
| 49 | +    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey = 'field_id' ) {     | |
| 50 | 50 | |
| 51 | -        foreach( $aPostElements as $_sInputID => $_aSubElements ) { | |
| 51 | +        foreach ( $aPostElements as $_sInputID => $_aSubElements ) { | |
| 52 | 52 | |
| 53 | 53 | // The 'name' key must be set. | 
| 54 | -            if ( ! isset( $_aSubElements[ 'name' ] ) ) { | |
| 54 | +            if ( !isset( $_aSubElements[ 'name' ] ) ) { | |
| 55 | 55 | continue; | 
| 56 | 56 | } | 
| 57 | 57 | $_aNameKeys = explode( '|', $_aSubElements[ 'name' ] ); | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | * @return null|string Returns `null` if no value is found and the associated link url if found. | 
| 47 | 47 | * Otherwise, the found value. | 
| 48 | 48 | */ | 
| 49 | -    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) {     | |
| 49 | +    protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) { | |
| 50 | 50 | |
| 51 | 51 |          foreach( $aPostElements as $_sInputID => $_aSubElements ) { | 
| 52 | 52 | |
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | */ | 
| 85 | 85 |      protected function _setSettingNoticeAfterValidation( $bIsInputEmtpy ) { | 
| 86 | 86 | |
| 87 | -        if ( $this->oFactory->hasSettingNotice() ) {      | |
| 87 | +        if ( $this->oFactory->hasSettingNotice() ) { | |
| 88 | 88 | return; | 
| 89 | 89 | } | 
| 90 | 90 | $this->oFactory->setSettingNotice( | 
| @@ -28,6 +28,7 @@ | ||
| 28 | 28 | /** | 
| 29 | 29 | * Sets up properties. | 
| 30 | 30 | * @since 3.6.3 | 
| 31 | + * @param AdminPageFramework_View_Page $oFactory | |
| 31 | 32 | */ | 
| 32 | 33 |      public function __construct( $oFactory, $sPageSlug, $sTabSlug ) { | 
| 33 | 34 | |
| @@ -47,7 +47,7 @@ discard block | ||
| 47 | 47 | |
| 48 | 48 | // Do actions before rendering the page. In this order, global -> page -> in-page tab | 
| 49 | 49 | $this->addAndDoActions( | 
| 50 | - $this->oFactory, // the caller object | |
| 50 | + $this->oFactory, // the caller object | |
| 51 | 51 | $this->getFilterArrayByPrefix( 'do_before_', $this->oFactory->oProp->sClassName, $_sPageSlug, $_sTabSlug, true ), // the action hooks | 
| 52 | 52 | $this->oFactory // the argument 1 | 
| 53 | 53 | ); | 
| @@ -72,7 +72,7 @@ discard block | ||
| 72 | 72 | </div><!-- #post-body --> | 
| 73 | 73 | </div><!-- #poststuff --> | 
| 74 | 74 | |
| 75 | - <?php echo $this->_printFormClosingTag( $_sPageSlug, $_sTabSlug, $this->oFactory->oProp->bEnableForm ); // </form> ?> | |
| 75 | + <?php echo $this->_printFormClosingTag( $_sPageSlug, $_sTabSlug, $this->oFactory->oProp->bEnableForm ); // </form> ?> | |
| 76 | 76 | </div><!-- .admin-page-framework-container --> | 
| 77 | 77 | |
| 78 | 78 | <?php | 
| @@ -83,7 +83,7 @@ discard block | ||
| 83 | 83 | <?php | 
| 84 | 84 | // Do actions after rendering the page. | 
| 85 | 85 | $this->addAndDoActions( | 
| 86 | - $this->oFactory, // the caller object | |
| 86 | + $this->oFactory, // the caller object | |
| 87 | 87 | $this->getFilterArrayByPrefix( 'do_after_', $this->oFactory->oProp->sClassName, $_sPageSlug, $_sTabSlug, true ), // the action hooks | 
| 88 | 88 | $this->oFactory // the argument 1 | 
| 89 | 89 | ); | 
| @@ -100,14 +100,14 @@ discard block | ||
| 100 | 100 | */ | 
| 101 | 101 |          private function _getNumberOfColumns() { | 
| 102 | 102 | |
| 103 | -            if ( ! $this->doesMetaBoxExist( 'side' ) ) { | |
| 103 | +            if ( !$this->doesMetaBoxExist( 'side' ) ) { | |
| 104 | 104 | return 1; | 
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | 107 | $_iColumns = $this->getNumberOfScreenColumns(); | 
| 108 | 108 | return $_iColumns | 
| 109 | 109 | ? $_iColumns | 
| 110 | - : 1; // default - this is because generic pages do not have meta boxes. | |
| 110 | + : 1; // default - this is because generic pages do not have meta boxes. | |
| 111 | 111 | } | 
| 112 | 112 | // @deprecated | 
| 113 | 113 | // Make sure if no side meta box exists, set it 1. | 
| @@ -126,7 +126,7 @@ discard block | ||
| 126 | 126 |          private function _getContentTop() { | 
| 127 | 127 | |
| 128 | 128 | // Screen icon, page heading tabs(page title), and in-page tabs. | 
| 129 | - $_oScreenIcon = new AdminPageFramework_View__PageRenderer__ScreenIcon( | |
| 129 | + $_oScreenIcon = new AdminPageFramework_View__PageRenderer__ScreenIcon( | |
| 130 | 130 | $this->oFactory, | 
| 131 | 131 | $this->sPageSlug, | 
| 132 | 132 | $this->sTabSlug | 
| @@ -142,7 +142,7 @@ discard block | ||
| 142 | 142 | $this->oFactory, | 
| 143 | 143 | $this->sPageSlug | 
| 144 | 144 | ); | 
| 145 | - $_sContentTop .= $_oInPageTabs->get(); | |
| 145 | + $_sContentTop .= $_oInPageTabs->get(); | |
| 146 | 146 | |
| 147 | 147 | // Apply filters in this order, in-page tab -> page -> global. | 
| 148 | 148 | return $this->addAndApplyFilters( | 
| @@ -214,7 +214,7 @@ discard block | ||
| 214 | 214 | */ | 
| 215 | 215 |              private function _getFormOutput( $sPageSlug ) { | 
| 216 | 216 | |
| 217 | -                if ( ! $this->oFactory->oProp->bEnableForm ) { | |
| 217 | +                if ( !$this->oFactory->oProp->bEnableForm ) { | |
| 218 | 218 | return ''; | 
| 219 | 219 | } | 
| 220 | 220 | return $this->oFactory->oForm->get(); | 
| @@ -244,9 +244,9 @@ discard block | ||
| 244 | 244 | * @internal | 
| 245 | 245 | * @return void | 
| 246 | 246 | */ | 
| 247 | -        private function _printFormOpeningTag( $fEnableForm=true ) { | |
| 247 | +        private function _printFormOpeningTag( $fEnableForm = true ) { | |
| 248 | 248 | |
| 249 | -            if ( ! $fEnableForm ) { | |
| 249 | +            if ( !$fEnableForm ) { | |
| 250 | 250 | return; | 
| 251 | 251 | } | 
| 252 | 252 | |
| @@ -259,12 +259,12 @@ discard block | ||
| 259 | 259 | 'action' => wp_unslash( remove_query_arg( 'settings-updated', $this->oFactory->oProp->sTargetFormPage ) ), | 
| 260 | 260 | ) | 
| 261 | 261 | ) | 
| 262 | - . " >" . PHP_EOL; | |
| 262 | + . " >".PHP_EOL; | |
| 263 | 263 | |
| 264 | 264 | // [3.5.11+] Insert a mark that indicates the framework form has started. | 
| 265 | 265 | // This will be checked in the validation method with the `is_admin_page_framework` input value which gets inserted at the end of the form | 
| 266 | 266 | // in order to determine all the fields are sent for the PHP max_input_vars limitation set in the server configuration. | 
| 267 | - echo "<input type='hidden' name='admin_page_framework_start' value='1' />" . PHP_EOL; | |
| 267 | + echo "<input type='hidden' name='admin_page_framework_start' value='1' />".PHP_EOL; | |
| 268 | 268 | |
| 269 | 269 | // Embed the '_wp_http_referer' hidden field that is checked in the submit data processing method. | 
| 270 | 270 | settings_fields( $this->oFactory->oProp->sOptionKey ); | 
| @@ -280,16 +280,16 @@ discard block | ||
| 280 | 280 | * @internal | 
| 281 | 281 | * @return void | 
| 282 | 282 | */ | 
| 283 | -        private function _printFormClosingTag( $sPageSlug, $sTabSlug, $fEnableForm=true ) { | |
| 283 | +        private function _printFormClosingTag( $sPageSlug, $sTabSlug, $fEnableForm = true ) { | |
| 284 | 284 | |
| 285 | -            if ( ! $fEnableForm ) { | |
| 285 | +            if ( !$fEnableForm ) { | |
| 286 | 286 | return; | 
| 287 | 287 | } | 
| 288 | - $_sNonce = wp_create_nonce( 'form_' . md5( $this->oFactory->oProp->sClassName . get_current_user_id() ) ); | |
| 289 | -            echo "<input type='hidden' name='page_slug' value='{$sPageSlug}' />" . PHP_EOL | |
| 290 | -                . "<input type='hidden' name='tab_slug' value='{$sTabSlug}' />" . PHP_EOL | |
| 291 | -                . "<input type='hidden' name='_is_admin_page_framework' value='{$_sNonce}' />" . PHP_EOL | |
| 292 | - . "</form><!-- End Form -->" . PHP_EOL; | |
| 288 | + $_sNonce = wp_create_nonce( 'form_'.md5( $this->oFactory->oProp->sClassName.get_current_user_id() ) ); | |
| 289 | +            echo "<input type='hidden' name='page_slug' value='{$sPageSlug}' />".PHP_EOL | |
| 290 | +                . "<input type='hidden' name='tab_slug' value='{$sTabSlug}' />".PHP_EOL | |
| 291 | +                . "<input type='hidden' name='_is_admin_page_framework' value='{$_sNonce}' />".PHP_EOL | |
| 292 | + . "</form><!-- End Form -->".PHP_EOL; | |
| 293 | 293 | |
| 294 | 294 | } | 
| 295 | 295 | |
| @@ -60,6 +60,7 @@ discard block | ||
| 60 | 60 | * @since 3.3.1 Moved from `AdminPageFramework_Page`. | 
| 61 | 61 | * @since 3.5.3 Deprecated the `$aOutput` parameter. | 
| 62 | 62 | * @since 3.6.3 Moved from `AdminPageFramework_Page_View`. Changed the name from `_getPageHeadingTabs()`. | 
| 63 | + * @param string $sTag | |
| 63 | 64 | * @return string the output of page heading tabs. | 
| 64 | 65 | */ | 
| 65 | 66 |          private function _getOutput( $aPage, $sTag ) { | 
| @@ -100,6 +101,7 @@ discard block | ||
| 100 | 101 | * @internal | 
| 101 | 102 | * @since 3.5.3 | 
| 102 | 103 | * @since 3.6.3 Moved from `AdminPageFramework_Page_View`. | 
| 104 | + * @param string $sTag | |
| 103 | 105 | * @return string the HTML page heading tab navigation bar output. | 
| 104 | 106 | */ | 
| 105 | 107 |              private function _getPageHeadingtabNavigationBar( array $aPages, $sTag, $sCurrentPageSlug ) { | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | $_aPage = $this->oFactory->oProp->aPages[ $this->sPageSlug ]; | 
| 46 | 46 | |
| 47 | 47 | // If the page title is disabled, return an empty string. | 
| 48 | -        if ( ! $_aPage[ 'show_page_title' ] ) { | |
| 48 | +        if ( !$_aPage[ 'show_page_title' ] ) { | |
| 49 | 49 | return ""; | 
| 50 | 50 | } | 
| 51 | 51 | |
| @@ -64,10 +64,10 @@ discard block | ||
| 64 | 64 | */ | 
| 65 | 65 |          private function _getOutput( $aPage, $sTag ) { | 
| 66 | 66 | |
| 67 | - $sTag = $this->_getPageHeadingTabTag( $sTag, $aPage ); | |
| 67 | + $sTag = $this->_getPageHeadingTabTag( $sTag, $aPage ); | |
| 68 | 68 | |
| 69 | 69 | // If the page heading tab visibility is disabled, or only one page is registered, return the title. | 
| 70 | -            if ( ! $aPage[ 'show_page_heading_tabs' ] || count( $this->oFactory->oProp->aPages ) == 1 ) { | |
| 70 | +            if ( !$aPage[ 'show_page_heading_tabs' ] || count( $this->oFactory->oProp->aPages ) == 1 ) { | |
| 71 | 71 |                  return "<{$sTag}>" | 
| 72 | 72 | . $aPage[ 'title' ] | 
| 73 | 73 |                      . "</{$sTag}>"; | 
| @@ -105,9 +105,9 @@ discard block | ||
| 105 | 105 |              private function _getPageHeadingtabNavigationBar( array $aPages, $sTag, $sCurrentPageSlug ) { | 
| 106 | 106 | |
| 107 | 107 | $_oTabBar = new AdminPageFramework_TabNavigationBar( | 
| 108 | - $aPages, // tab items | |
| 108 | + $aPages, // tab items | |
| 109 | 109 | $sCurrentPageSlug, // active tab slug | 
| 110 | - $sTag, // container tag | |
| 110 | + $sTag, // container tag | |
| 111 | 111 | array( // container attributes | 
| 112 | 112 | // 'class' => '...', | 
| 113 | 113 | ), | 
| @@ -130,8 +130,8 @@ discard block | ||
| 130 | 130 | * @since 3.5.10 | 
| 131 | 131 | * @since 3.6.3 Moved from `AdminPageFramework_Page_View`. | 
| 132 | 132 | */ | 
| 133 | -                public function _replyToFormatNavigationTabItem_PageHeadingTab( $aSubPage, $aStructure, $aPages, $aArguments=array() ) { | |
| 134 | -                    switch( $aSubPage['type'] ) { | |
| 133 | +                public function _replyToFormatNavigationTabItem_PageHeadingTab( $aSubPage, $aStructure, $aPages, $aArguments = array() ) { | |
| 134 | +                    switch ( $aSubPage[ 'type' ] ) { | |
| 135 | 135 | case 'link': | 
| 136 | 136 | return $this->_getFormattedPageHeadingtabNavigationBarLinkItem( $aSubPage, $aStructure ); | 
| 137 | 137 | default: | 
| @@ -148,10 +148,10 @@ discard block | ||
| 148 | 148 | */ | 
| 149 | 149 |                      private function _getFormattedPageHeadingtabNavigationBarPageItem( array $aSubPage, $aStructure ) { | 
| 150 | 150 | |
| 151 | -                        if ( ! isset( $aSubPage[ 'page_slug' ] ) ) { | |
| 151 | +                        if ( !isset( $aSubPage[ 'page_slug' ] ) ) { | |
| 152 | 152 | return array(); | 
| 153 | 153 | } | 
| 154 | -                        if ( ! $aSubPage[ 'show_page_heading_tab' ] ) { | |
| 154 | +                        if ( !$aSubPage[ 'show_page_heading_tab' ] ) { | |
| 155 | 155 | return array(); | 
| 156 | 156 | } | 
| 157 | 157 | return array( | 
| @@ -182,10 +182,10 @@ discard block | ||
| 182 | 182 | */ | 
| 183 | 183 |                      private function _getFormattedPageHeadingtabNavigationBarLinkItem( array $aSubPage, $aStructure ) { | 
| 184 | 184 | |
| 185 | -                        if ( ! isset( $aSubPage[ 'href' ] ) ) { | |
| 185 | +                        if ( !isset( $aSubPage[ 'href' ] ) ) { | |
| 186 | 186 | return array(); | 
| 187 | 187 | } | 
| 188 | -                        if ( ! $aSubPage[ 'show_page_heading_tab' ] ) { | |
| 188 | +                        if ( !$aSubPage[ 'show_page_heading_tab' ] ) { | |
| 189 | 189 | return array(); | 
| 190 | 190 | } | 
| 191 | 191 | $aSubPage = array( | 
| @@ -197,7 +197,7 @@ discard block | ||
| 197 | 197 | + array( 'class' => null ) | 
| 198 | 198 | + $aStructure; | 
| 199 | 199 | |
| 200 | - $aSubPage[ 'class' ] = trim( $aSubPage[ 'class' ] . ' link' ); | |
| 200 | + $aSubPage[ 'class' ] = trim( $aSubPage[ 'class' ].' link' ); | |
| 201 | 201 | return $aSubPage; | 
| 202 | 202 | } | 
| 203 | 203 | |
| @@ -48,7 +48,7 @@ | ||
| 48 | 48 | } | 
| 49 | 49 | /** | 
| 50 | 50 | * @since 3.6.3 | 
| 51 | - * @return boolean | |
| 51 | + * @return boolean|null | |
| 52 | 52 | */ | 
| 53 | 53 |          private function _isScreenIconVisible() { | 
| 54 | 54 | |
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | */ | 
| 41 | 41 |      public function get() { | 
| 42 | 42 | |
| 43 | -        if ( ! $this->_isScreenIconVisible() ) { | |
| 43 | +        if ( !$this->_isScreenIconVisible() ) { | |
| 44 | 44 | return ''; | 
| 45 | 45 | } | 
| 46 | 46 | return $this->_getScreenIcon( $this->sPageSlug ); | 
| @@ -52,7 +52,7 @@ discard block | ||
| 52 | 52 | */ | 
| 53 | 53 |          private function _isScreenIconVisible() { | 
| 54 | 54 | |
| 55 | - $_bShowPageTitle = $this->getElement( | |
| 55 | + $_bShowPageTitle = $this->getElement( | |
| 56 | 56 | $this->oFactory->oProp->aPages, | 
| 57 | 57 | array( $this->sPageSlug, 'show_page_title' ) | 
| 58 | 58 | ); | 
| @@ -130,7 +130,7 @@ discard block | ||
| 130 | 130 | array( $sPageSlug, 'href_icon_32x32' ), | 
| 131 | 131 | '' | 
| 132 | 132 | ); | 
| 133 | -            if ( ! $_sScreenIconPath ) { | |
| 133 | +            if ( !$_sScreenIconPath ) { | |
| 134 | 134 | return; | 
| 135 | 135 | } | 
| 136 | 136 | $_sScreenIconPath = $this->getResolvedSRC( | 
| @@ -140,7 +140,7 @@ discard block | ||
| 140 | 140 | $_aAttributes = array( | 
| 141 | 141 | 'style' => $this->getInlineCSS( | 
| 142 | 142 | array( | 
| 143 | -                        'background-image' => "url('" . esc_url( $_sScreenIconPath ) . "')" | |
| 143 | +                        'background-image' => "url('".esc_url( $_sScreenIconPath )."')" | |
| 144 | 144 | ) | 
| 145 | 145 | ) | 
| 146 | 146 | ); | 
| @@ -164,12 +164,12 @@ discard block | ||
| 164 | 164 | array( $sPageSlug, 'screen_icon_id' ), | 
| 165 | 165 | '' | 
| 166 | 166 | ); | 
| 167 | -            if ( ! $_sScreenIconID ) { | |
| 167 | +            if ( !$_sScreenIconID ) { | |
| 168 | 168 | return; | 
| 169 | 169 | } | 
| 170 | 170 | |
| 171 | 171 | $_aAttributes = array( | 
| 172 | - 'id' => "icon-" . $_sScreenIconID, | |
| 172 | + 'id' => "icon-".$_sScreenIconID, | |
| 173 | 173 | ); | 
| 174 | 174 | |
| 175 | 175 | // Go to the catch clause. | 
| @@ -192,16 +192,16 @@ discard block | ||
| 192 | 192 | 'class' => $this->getClassAttribute( | 
| 193 | 193 | $this->getAOrB( | 
| 194 | 194 | empty( $_sIconIDAttribute ) && $_oScreen->post_type, | 
| 195 | - sanitize_html_class( 'icon32-posts-' . $_oScreen->post_type ), | |
| 195 | + sanitize_html_class( 'icon32-posts-'.$_oScreen->post_type ), | |
| 196 | 196 | '' | 
| 197 | 197 | ), | 
| 198 | 198 | $this->getAOrB( | 
| 199 | 199 | empty( $_sIconIDAttribute ) || $_sIconIDAttribute == $this->oFactory->oProp->sClassName, | 
| 200 | - 'generic', // the default value | |
| 200 | + 'generic', // the default value | |
| 201 | 201 | '' | 
| 202 | 202 | ) | 
| 203 | 203 | ), | 
| 204 | - 'id' => "icon-" . $_sIconIDAttribute, | |
| 204 | + 'id' => "icon-".$_sIconIDAttribute, | |
| 205 | 205 | ); | 
| 206 | 206 | return $this->_getScreenIconByAttributes( $_aAttributes ); | 
| 207 | 207 | |
| @@ -215,7 +215,7 @@ discard block | ||
| 215 | 215 | */ | 
| 216 | 216 |              private function _getScreenIDAttribute( $oScreen ) { | 
| 217 | 217 | |
| 218 | -                if ( ! empty( $oScreen->parent_base ) ) { | |
| 218 | +                if ( !empty( $oScreen->parent_base ) ) { | |
| 219 | 219 | return $oScreen->parent_base; | 
| 220 | 220 | } | 
| 221 | 221 |                  if ( 'page' === $oScreen->post_type ) { | 
| @@ -236,10 +236,10 @@ discard block | ||
| 236 | 236 |              private function _getScreenIconByAttributes( array $aAttributes ) { | 
| 237 | 237 | |
| 238 | 238 | $aAttributes[ 'class' ] = $this->getClassAttribute( | 
| 239 | - 'icon32', // required for a screen icon container element. | |
| 239 | + 'icon32', // required for a screen icon container element. | |
| 240 | 240 | $this->getElement( $aAttributes, 'class' ) | 
| 241 | 241 | ); | 
| 242 | - return "<div " . $this->getAttributes( $aAttributes ) . ">" | |
| 242 | + return "<div ".$this->getAttributes( $aAttributes ).">" | |
| 243 | 243 | . "<br />" | 
| 244 | 244 | . "</div>"; | 
| 245 | 245 | |
| @@ -23,6 +23,7 @@ | ||
| 23 | 23 | * Sets up internal properties. | 
| 24 | 24 | * | 
| 25 | 25 | * @since 3.2.0 | 
| 26 | + * @param AdminPageFramework_Widget_Model $oCaller | |
| 26 | 27 | * @return void | 
| 27 | 28 | */ | 
| 28 | 29 |  	public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) { | 
| @@ -26,7 +26,7 @@ discard block | ||
| 26 | 26 | * @since 3.2.0 | 
| 27 | 27 | * @return void | 
| 28 | 28 | */ | 
| 29 | -	public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) { | |
| 29 | +    public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) { | |
| 30 | 30 | |
| 31 | 31 | $aArguments = $aArguments | 
| 32 | 32 | + array( | 
| @@ -34,14 +34,14 @@ discard block | ||
| 34 | 34 | 'description' => '', | 
| 35 | 35 | ); | 
| 36 | 36 | |
| 37 | - parent::__construct( | |
| 37 | + parent::__construct( | |
| 38 | 38 | $oCaller->oProp->sClassName, // base id | 
| 39 | 39 | $sWidgetTitle, // widget title | 
| 40 | 40 | $aArguments // widget arguments | 
| 41 | 41 | ); | 
| 42 | 42 | $this->oCaller = $oCaller; | 
| 43 | 43 | |
| 44 | - } | |
| 44 | + } | |
| 45 | 45 | |
| 46 | 46 | /** | 
| 47 | 47 | * Displays the widget contents in the front end. | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 | * whether the title should be visible or not depending on the content. | 
| 52 | 52 | * @return void | 
| 53 | 53 | */ | 
| 54 | -	public function widget( $aArguments, $aFormData ) { | |
| 54 | +    public function widget( $aArguments, $aFormData ) { | |
| 55 | 55 | |
| 56 | 56 | echo $aArguments[ 'before_widget' ]; | 
| 57 | 57 | |
| @@ -74,9 +74,9 @@ discard block | ||
| 74 | 74 | |
| 75 | 75 | echo $_sContent; | 
| 76 | 76 | |
| 77 | - echo $aArguments[ 'after_widget' ]; | |
| 77 | + echo $aArguments[ 'after_widget' ]; | |
| 78 | 78 | |
| 79 | - } | |
| 79 | + } | |
| 80 | 80 | /** | 
| 81 | 81 | * Returns the widget title. | 
| 82 | 82 | * | 
| @@ -105,7 +105,7 @@ discard block | ||
| 105 | 105 |              if ( ! $_sTitle ) { | 
| 106 | 106 | return ''; | 
| 107 | 107 | } | 
| 108 | - return $aArguments['before_title'] | |
| 108 | + return $aArguments['before_title'] | |
| 109 | 109 | . $_sTitle | 
| 110 | 110 | . $aArguments['after_title']; | 
| 111 | 111 | |
| @@ -117,7 +117,7 @@ discard block | ||
| 117 | 117 | * @since 3.2.0 | 
| 118 | 118 | * @return mixed The validated form data. The type should be an array but it is dealt by the framework user it will be unknown. | 
| 119 | 119 | */ | 
| 120 | -	public function update( $aSubmittedFormData, $aSavedFormData ) { | |
| 120 | +    public function update( $aSubmittedFormData, $aSavedFormData ) { | |
| 121 | 121 | |
| 122 | 122 | $aSubmittedFormData = $this->oCaller->oUtil->addAndApplyFilters( | 
| 123 | 123 | $this->oCaller, | 
| @@ -131,7 +131,7 @@ discard block | ||
| 131 | 131 | ); | 
| 132 | 132 | return $this->oCaller->oForm->getInputsUnset( $aSubmittedFormData, $this->oCaller->oForm->sStructureType ); // 3.8.17+ | 
| 133 | 133 | |
| 134 | - } | |
| 134 | + } | |
| 135 | 135 | |
| 136 | 136 | /** | 
| 137 | 137 | * Constructs the widget form with the given saved form data. | 
| @@ -142,7 +142,7 @@ discard block | ||
| 142 | 142 | * | 
| 143 | 143 | * @return void | 
| 144 | 144 | */ | 
| 145 | -	public function form( $aSavedFormData ) { | |
| 145 | +    public function form( $aSavedFormData ) { | |
| 146 | 146 | |
| 147 | 147 | $this->oCaller->oForm->aCallbacks = $this->_getFormCallbacks() + $this->oCaller->oForm->aCallbacks; | 
| 148 | 148 | |
| @@ -181,7 +181,7 @@ discard block | ||
| 181 | 181 | $this->oCaller->oForm->aSectionsets = $_aSectionsets; | 
| 182 | 182 | $this->oCaller->oForm->aFieldsets = $_aFieldsets; | 
| 183 | 183 | |
| 184 | - } | |
| 184 | + } | |
| 185 | 185 | /** | 
| 186 | 186 | * Calls the load() method of the caller factory object. | 
| 187 | 187 | * | 
| @@ -26,7 +26,7 @@ discard block | ||
| 26 | 26 | * @since 3.2.0 | 
| 27 | 27 | * @return void | 
| 28 | 28 | */ | 
| 29 | -	public function __construct( $oCaller, $sWidgetTitle, array $aArguments=array() ) { | |
| 29 | +	public function __construct( $oCaller, $sWidgetTitle, array $aArguments = array() ) { | |
| 30 | 30 | |
| 31 | 31 | $aArguments = $aArguments | 
| 32 | 32 | + array( | 
| @@ -35,8 +35,8 @@ discard block | ||
| 35 | 35 | ); | 
| 36 | 36 | |
| 37 | 37 | parent::__construct( | 
| 38 | - $oCaller->oProp->sClassName, // base id | |
| 39 | - $sWidgetTitle, // widget title | |
| 38 | + $oCaller->oProp->sClassName, // base id | |
| 39 | + $sWidgetTitle, // widget title | |
| 40 | 40 | $aArguments // widget arguments | 
| 41 | 41 | ); | 
| 42 | 42 | $this->oCaller = $oCaller; | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | |
| 58 | 58 | $this->oCaller->oUtil->addAndDoActions( | 
| 59 | 59 | $this->oCaller, | 
| 60 | - 'do_' . $this->oCaller->oProp->sClassName, | |
| 60 | + 'do_'.$this->oCaller->oProp->sClassName, | |
| 61 | 61 | $this->oCaller | 
| 62 | 62 | ); | 
| 63 | 63 | |
| @@ -88,7 +88,7 @@ discard block | ||
| 88 | 88 | */ | 
| 89 | 89 |          private function _getTitle( array $aArguments, array $aFormData ) { | 
| 90 | 90 | |
| 91 | -            if ( ! $this->oCaller->oProp->bShowWidgetTitle ) { | |
| 91 | +            if ( !$this->oCaller->oProp->bShowWidgetTitle ) { | |
| 92 | 92 | return ''; | 
| 93 | 93 | } | 
| 94 | 94 | |
| @@ -102,12 +102,12 @@ discard block | ||
| 102 | 102 | $aFormData, | 
| 103 | 103 | $this->id_base | 
| 104 | 104 | ); | 
| 105 | -            if ( ! $_sTitle ) { | |
| 105 | +            if ( !$_sTitle ) { | |
| 106 | 106 | return ''; | 
| 107 | 107 | } | 
| 108 | - return $aArguments['before_title'] | |
| 108 | + return $aArguments[ 'before_title' ] | |
| 109 | 109 | . $_sTitle | 
| 110 | - . $aArguments['after_title']; | |
| 110 | + . $aArguments[ 'after_title' ]; | |
| 111 | 111 | |
| 112 | 112 | } | 
| 113 | 113 | |
| @@ -123,7 +123,7 @@ discard block | ||
| 123 | 123 | $this->oCaller, | 
| 124 | 124 |              "validation_{$this->oCaller->oProp->sClassName}",  | 
| 125 | 125 | call_user_func_array( | 
| 126 | - array( $this->oCaller, 'validate' ), // triggers __call() | |
| 126 | + array( $this->oCaller, 'validate' ), // triggers __call() | |
| 127 | 127 | array( $aSubmittedFormData, $aSavedFormData, $this->oCaller ) // parameters | 
| 128 | 128 | ), // 3.5.3+ | 
| 129 | 129 | $aSavedFormData, | 
| @@ -172,8 +172,8 @@ discard block | ||
| 172 | 172 | $this->oCaller->oForm = new AdminPageFramework_Form_widget( | 
| 173 | 173 | array( | 
| 174 | 174 | 'register_if_action_already_done' => false, // do not register fields right away | 
| 175 | - ) + $this->oCaller->oProp->aFormArguments, // form arguments | |
| 176 | - $this->oCaller->oForm->aCallbacks, // callbacks | |
| 175 | + ) + $this->oCaller->oProp->aFormArguments, // form arguments | |
| 176 | + $this->oCaller->oForm->aCallbacks, // callbacks | |
| 177 | 177 | $this->oCaller->oMsg | 
| 178 | 178 | ); | 
| 179 | 179 | // Reuse the data of the previous widget instance. | 
| @@ -199,7 +199,7 @@ discard block | ||
| 199 | 199 | * Call the load method only once per class. Also the added field registrations in the class also done once. | 
| 200 | 200 | * @since 3.7.9 | 
| 201 | 201 | */ | 
| 202 | -            if ( $this->oCaller->oUtil->hasBeenCalled( '_widget_load_' . $this->oCaller->oProp->sClassName ) ) { | |
| 202 | +            if ( $this->oCaller->oUtil->hasBeenCalled( '_widget_load_'.$this->oCaller->oProp->sClassName ) ) { | |
| 203 | 203 | |
| 204 | 204 | /** | 
| 205 | 205 | * The saved option callback is done with the below load_... callback so for widget form instances called from the second time | 
| @@ -217,7 +217,7 @@ discard block | ||
| 217 | 217 | $this->oCaller->oUtil->addAndDoActions( | 
| 218 | 218 | $this->oCaller, | 
| 219 | 219 | array( | 
| 220 | - 'load_' . $this->oCaller->oProp->sClassName, | |
| 220 | + 'load_'.$this->oCaller->oProp->sClassName, | |
| 221 | 221 | ), | 
| 222 | 222 | $this->oCaller | 
| 223 | 223 | ); | 
| @@ -231,9 +231,9 @@ discard block | ||
| 231 | 231 | */ | 
| 232 | 232 |          private function _getFormCallbacks() { | 
| 233 | 233 | return array( | 
| 234 | - 'hfID' => array( $this, 'get_field_id' ), // defined in the WP_Widget class. | |
| 235 | - 'hfTagID' => array( $this, 'get_field_id' ), // defined in the WP_Widget class. | |
| 236 | - 'hfName' => array( $this, '_replyToGetFieldName' ), // defined in the WP_Widget class. | |
| 234 | + 'hfID' => array( $this, 'get_field_id' ), // defined in the WP_Widget class. | |
| 235 | + 'hfTagID' => array( $this, 'get_field_id' ), // defined in the WP_Widget class. | |
| 236 | + 'hfName' => array( $this, '_replyToGetFieldName' ), // defined in the WP_Widget class. | |
| 237 | 237 | 'hfInputName' => array( $this, '_replyToGetFieldInputName' ), | 
| 238 | 238 | |
| 239 | 239 | 'saved_data' => array( $this, '_replyToGetSavedFormData' ), | 
| @@ -249,8 +249,8 @@ discard block | ||
| 249 | 249 |      public function  _replyToGetSavedFormData() { | 
| 250 | 250 | return $this->oCaller->oUtil->addAndApplyFilter( | 
| 251 | 251 | $this->oCaller, // the caller factory object | 
| 252 | - 'options_' . $this->oCaller->oProp->sClassName, | |
| 253 | - $this->oCaller->oProp->aOptions, // subject value to be filtered | |
| 252 | + 'options_'.$this->oCaller->oProp->sClassName, | |
| 253 | + $this->oCaller->oProp->aOptions, // subject value to be filtered | |
| 254 | 254 | $this->id // 3.7.9+ | 
| 255 | 255 | ); | 
| 256 | 256 | } | 
| @@ -280,25 +280,25 @@ discard block | ||
| 280 | 280 | */ | 
| 281 | 281 |          private function _getNameAttributeDimensions( $aFieldset ) { | 
| 282 | 282 | |
| 283 | - $_sNamePrefix = 'widget-' . $this->id_base . '[' . $this->number . ']'; | |
| 283 | + $_sNamePrefix = 'widget-'.$this->id_base.'['.$this->number.']'; | |
| 284 | 284 | |
| 285 | 285 | $_sDimensions = ''; | 
| 286 | 286 |              if ( $this->oCaller->isSectionSet( $aFieldset ) ) { | 
| 287 | - $_aSectionPath = $aFieldset[ '_section_path_array' ]; | |
| 288 | -                foreach( $_aSectionPath as $_sDimension ) { | |
| 289 | - $_sDimensions .= '[' . $_sDimension . ']'; | |
| 287 | + $_aSectionPath = $aFieldset[ '_section_path_array' ]; | |
| 288 | +                foreach ( $_aSectionPath as $_sDimension ) { | |
| 289 | + $_sDimensions .= '['.$_sDimension.']'; | |
| 290 | 290 | } | 
| 291 | 291 |                  if ( isset( $aFieldset[ '_section_index' ] ) ) { | 
| 292 | - $_sDimensions .= '[' . $aFieldset[ '_section_index' ] . ']'; | |
| 292 | + $_sDimensions .= '['.$aFieldset[ '_section_index' ].']'; | |
| 293 | 293 | } | 
| 294 | 294 | } | 
| 295 | 295 | |
| 296 | 296 | // 3.8.18+ Support for nested fields. @see https://github.com/michaeluno/admin-page-framework/issues/274 | 
| 297 | -            foreach( $aFieldset[ '_field_path_array' ] as $_sPathPart ) { | |
| 298 | - $_sDimensions .= '[' . $_sPathPart . ']'; | |
| 297 | +            foreach ( $aFieldset[ '_field_path_array' ] as $_sPathPart ) { | |
| 298 | + $_sDimensions .= '['.$_sPathPart.']'; | |
| 299 | 299 | } | 
| 300 | 300 | |
| 301 | - return $_sNamePrefix . $_sDimensions; | |
| 301 | + return $_sNamePrefix.$_sDimensions; | |
| 302 | 302 | } | 
| 303 | 303 | |
| 304 | 304 | /** | 
| @@ -315,10 +315,10 @@ discard block | ||
| 315 | 315 | $_sIndex = $this->oCaller->oUtil->getAOrB( | 
| 316 | 316 | '0' !== $sIndex && empty( $sIndex ), | 
| 317 | 317 | '', | 
| 318 | - "[" . $sIndex . "]" | |
| 318 | + "[".$sIndex."]" | |
| 319 | 319 | ); | 
| 320 | - $_sNamePrefix = $this->_replyToGetFieldName( '', $aFieldset ); | |
| 321 | - return $_sNamePrefix . $_sIndex; | |
| 320 | + $_sNamePrefix = $this->_replyToGetFieldName( '', $aFieldset ); | |
| 321 | + return $_sNamePrefix.$_sIndex; | |
| 322 | 322 | |
| 323 | 323 | } | 
| 324 | 324 | |
| @@ -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; | 
| @@ -68,9 +68,9 @@ discard block | ||
| 68 | 68 | * @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` | 
| 69 | 69 | * @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. | 
| 70 | 70 | */ | 
| 71 | -    public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ){ | |
| 71 | +    public function __construct( $isOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { | |
| 72 | 72 | |
| 73 | -        if ( ! $this->_isInstantiatable() ) { | |
| 73 | +        if ( !$this->_isInstantiatable() ) { | |
| 74 | 74 | return; | 
| 75 | 75 | } | 
| 76 | 76 | |
| @@ -90,19 +90,19 @@ discard block | ||
| 90 | 90 | */ | 
| 91 | 91 |          private function _getCallerPath( $sCallerPath ) { | 
| 92 | 92 | |
| 93 | -            if ( $sCallerPath  ) { | |
| 93 | +            if ( $sCallerPath ) { | |
| 94 | 94 | return trim( $sCallerPath ); | 
| 95 | 95 | } | 
| 96 | 96 | |
| 97 | -            if ( ! is_admin() ) { | |
| 97 | +            if ( !is_admin() ) { | |
| 98 | 98 | return null; | 
| 99 | 99 | } | 
| 100 | 100 | |
| 101 | -            if ( ! isset( $GLOBALS[ 'pagenow' ] ) ) { | |
| 101 | +            if ( !isset( $GLOBALS[ 'pagenow' ] ) ) { | |
| 102 | 102 | return null; | 
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | - $_sCalllerPath = in_array( $GLOBALS[ 'pagenow' ], array( 'plugins.php', ) ) || isset( $_GET[ 'page' ] ) | |
| 105 | + $_sCalllerPath = in_array( $GLOBALS[ 'pagenow' ], array( 'plugins.php',) ) || isset( $_GET[ 'page' ] ) | |
| 106 | 106 | ? AdminPageFramework_Utility::getCallerScriptPath( __FILE__ ) // not using $oUtil as this method is caller earlier than the base constructor. | 
| 107 | 107 | : null; | 
| 108 | 108 | |
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | * @since 2.0.0 | 
| 46 | 46 | * @see http://codex.wordpress.org/Roles_and_Capabilities | 
| 47 | 47 | * @see http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains | 
| 48 | - * @param array|integer|string $aisOptionKey (optional) specifies the option key name to store in the options table. If this is not set, the instantiated class name will be used as default. | |
| 48 | + * @param array|integer|string $isOptionKey (optional) specifies the option key name to store in the options table. If this is not set, the instantiated class name will be used as default. | |
| 49 | 49 | * [3.5.9+] If an integer is given, a transient will be used. If an array of option key arguments is given, the argument values will be set to the framework properties. | 
| 50 | 50 | * - type - either `options_table` or `transient`. | 
| 51 | 51 | * - key - the option key or the transient key | 
| @@ -84,6 +84,7 @@ discard block | ||
| 84 | 84 | /** | 
| 85 | 85 | * Returns the script caller path. | 
| 86 | 86 | * @remark It is important to find the caller script path here when separating the library into multiple files. | 
| 87 | + * @param string|null $sCallerPath | |
| 87 | 88 | * @return null|string | 
| 88 | 89 | * @since 3.8.2 | 
| 89 | 90 | */ |