@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $this->oFactory = $oFactory; |
30 | 30 | |
31 | 31 | add_filter( |
32 | - "validation_pre_" . $this->oFactory->oProp->sClassName, |
|
32 | + "validation_pre_".$this->oFactory->oProp->sClassName, |
|
33 | 33 | array( $this, '_replyToValidateUserFormInputs' ), |
34 | 34 | 10, |
35 | 35 | 4 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $_sSubmitSectionID = $this->_getPressedSubmitButtonData( $_aSubmits, 'section_id' ); |
61 | 61 | |
62 | 62 | // Submit Information - [3.5.0+] this will be passed to validation callback methods. |
63 | - $_aSubmitsInformation = array( |
|
63 | + $_aSubmitsInformation = array( |
|
64 | 64 | 'page_slug' => $_sPageSlug, |
65 | 65 | 'tab_slug' => $_sTabSlug, |
66 | 66 | 'input_id' => $this->_getPressedSubmitButtonData( $_aSubmits, 'input_id' ), |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | 'AdminPageFramework_Model__FormSubmission__Validator__Export', |
81 | 81 | 'AdminPageFramework_Model__FormSubmission__Validator__Reset', |
82 | 82 | 'AdminPageFramework_Model__FormSubmission__Validator__ResetConfirm', // 3.7.6+ Moved to after validation from before validation |
83 | - 'AdminPageFramework_Model__FormSubmission__Validator__ContactForm', // 3.7.6+ Moved to after validation from before validation |
|
83 | + 'AdminPageFramework_Model__FormSubmission__Validator__ContactForm', // 3.7.6+ Moved to after validation from before validation |
|
84 | 84 | 'AdminPageFramework_Model__FormSubmission__Validator__ContactFormConfirm', |
85 | 85 | |
86 | 86 | ); |
87 | - foreach( $_aClassNames as $_sClassName ) { |
|
87 | + foreach ( $_aClassNames as $_sClassName ) { |
|
88 | 88 | new $_sClassName( $this->oFactory ); |
89 | 89 | } |
90 | 90 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $this->addAndDoActions( |
95 | 95 | $this->oFactory, |
96 | - 'try_validation_before_' . $this->oFactory->oProp->sClassName, |
|
96 | + 'try_validation_before_'.$this->oFactory->oProp->sClassName, |
|
97 | 97 | $aInputs, |
98 | 98 | $aRawInputs, |
99 | 99 | $_aSubmits, |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | $this->addAndDoActions( |
114 | 114 | $this->oFactory, |
115 | - 'try_validation_after_' . $this->oFactory->oProp->sClassName, |
|
115 | + 'try_validation_after_'.$this->oFactory->oProp->sClassName, |
|
116 | 116 | $aInputs, |
117 | 117 | $aRawInputs, |
118 | 118 | $_aSubmits, |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
36 | 36 | $_sLinkURL = $this->_getPressedSubmitButtonData( $aSubmits, 'href' ); |
37 | - if ( ! $_sLinkURL ) { |
|
37 | + if ( !$_sLinkURL ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | $this->goToURL( $_sLinkURL ); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
33 | 33 | |
34 | 34 | // if the 'reset' key in the field definition array is set, this value will be set. |
35 | - if ( ! $this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
35 | + if ( !$this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ); |
43 | 43 | |
44 | 44 | // Go to the catch clause. |
45 | - $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue. |
|
45 | + $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue. |
|
46 | 46 | $_oException->aReturn = $this->_confirmSubmitButtonAction( |
47 | 47 | $this->getElement( $aSubmitInformation, 'input_name' ), |
48 | 48 | $this->getElement( $aSubmitInformation, 'section_id' ), |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
34 | 34 | |
35 | - if ( ! $this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
35 | + if ( !$this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | ); |
46 | 46 | |
47 | 47 | // Go to the catch clause. |
48 | - $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue. |
|
48 | + $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue. |
|
49 | 49 | $_oException->aReturn = $this->_confirmSubmitButtonAction( |
50 | 50 | $this->getElement( $aSubmitInformation, 'input_name' ), |
51 | 51 | $this->getElement( $aSubmitInformation, 'section_id' ), |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | : 'add_filter'; |
36 | 36 | |
37 | 37 | $_sFunctionName( |
38 | - $this->sActionHookPrefix . $this->oFactory->oProp->sClassName, |
|
38 | + $this->sActionHookPrefix.$this->oFactory->oProp->sClassName, |
|
39 | 39 | array( $this, $this->sCallbackName ), |
40 | 40 | $this->iHookPriority, |
41 | 41 | $this->iCallbackParameters |
@@ -55,17 +55,17 @@ discard block |
||
55 | 55 | * @since 3.6.3 Moved from `AdminPageFramework_Validation`. |
56 | 56 | * @return array The intact stored options. |
57 | 57 | */ |
58 | - protected function _confirmSubmitButtonAction( $sPressedInputName, $sSectionID, $sType='reset' ) { |
|
58 | + protected function _confirmSubmitButtonAction( $sPressedInputName, $sSectionID, $sType = 'reset' ) { |
|
59 | 59 | |
60 | - switch( $sType ) { |
|
60 | + switch ( $sType ) { |
|
61 | 61 | default: |
62 | 62 | case 'reset': |
63 | 63 | $_sFieldErrorMessage = $this->oFactory->oMsg->get( 'reset_options' ); |
64 | - $_sTransientKey = 'apf_rc_' . md5( $sPressedInputName . get_current_user_id() ); |
|
64 | + $_sTransientKey = 'apf_rc_'.md5( $sPressedInputName.get_current_user_id() ); |
|
65 | 65 | break; |
66 | 66 | case 'email': |
67 | 67 | $_sFieldErrorMessage = $this->oFactory->oMsg->get( 'send_email' ); |
68 | - $_sTransientKey = 'apf_ec_' . md5( $sPressedInputName . get_current_user_id() ); |
|
68 | + $_sTransientKey = 'apf_ec_'.md5( $sPressedInputName.get_current_user_id() ); |
|
69 | 69 | break; |
70 | 70 | } |
71 | 71 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->oFactory->setFieldErrors( $_aErrors ); |
88 | 88 | |
89 | 89 | // Set a flag that the confirmation is displayed |
90 | - $this->setTransient( $_sTransientKey, $sPressedInputName, 60*2 ); |
|
90 | + $this->setTransient( $_sTransientKey, $sPressedInputName, 60 * 2 ); |
|
91 | 91 | |
92 | 92 | // Set the admin notice |
93 | 93 | $this->oFactory->setSettingNotice( $this->oFactory->oMsg->get( 'confirm_perform_task' ), 'error confirmation' ); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
36 | 36 | |
37 | - if ( ! $this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
37 | + if ( !$this->_shouldProceed( $oFactory, $aSubmits ) ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | 'reset_key' |
45 | 45 | ); |
46 | 46 | $_sKeyToReset = trim( $_sKeyToReset ); |
47 | - if ( ! $_sKeyToReset ) { |
|
47 | + if ( !$_sKeyToReset ) { |
|
48 | 48 | return; |
49 | 49 | } |
50 | 50 | $_oException = new Exception( 'aReturn' ); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @return boolean |
62 | 62 | */ |
63 | 63 | protected function _shouldProceed( $oFactory, $aSubmits ) { |
64 | - return ! $oFactory->hasFieldError(); |
|
64 | + return !$oFactory->hasFieldError(); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | $this->_doResetActions( $sKeyToReset, $aInputs, $aSubmitInformation ); |
80 | 80 | |
81 | 81 | // As of 3.1.0, an empty value is accepted for the option key. |
82 | - if ( ! $this->oFactory->oProp->sOptionKey ) { |
|
82 | + if ( !$this->oFactory->oProp->sOptionKey ) { |
|
83 | 83 | return array(); |
84 | 84 | } |
85 | 85 | |
86 | 86 | // The key to delete is not specified, 1 is sent from the form input. |
87 | - if ( in_array( $sKeyToReset, array( '1', ), true ) ) { |
|
87 | + if ( in_array( $sKeyToReset, array( '1',), true ) ) { |
|
88 | 88 | delete_option( $this->oFactory->oProp->sOptionKey ); |
89 | 89 | return array(); |
90 | 90 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $aSubmits, |
35 | 35 | 'redirect_url' |
36 | 36 | ); |
37 | - if ( ! $_sRedirectURL ) { |
|
37 | + if ( !$_sRedirectURL ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | if ( empty( $sURL ) ) { |
71 | 71 | return; |
72 | 72 | } |
73 | - $_sTransient = 'apf_rurl' . md5( trim( "redirect_{$this->oFactory->oProp->sClassName}_{$sPageSlug}" ) ); |
|
74 | - return $this->setTransient( $_sTransient, $sURL , 60*2 ); |
|
73 | + $_sTransient = 'apf_rurl'.md5( trim( "redirect_{$this->oFactory->oProp->sClassName}_{$sPageSlug}" ) ); |
|
74 | + return $this->setTransient( $_sTransient, $sURL, 60 * 2 ); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | } |
@@ -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 | } |
@@ -80,7 +80,8 @@ |
||
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 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | ) |
64 | 64 | ); |
65 | 65 | |
66 | - if ( ! $this->_isEnabled( $_aTab ) ) { |
|
66 | + if ( !$this->_isEnabled( $_aTab ) ) { |
|
67 | 67 | return array(); |
68 | 68 | } |
69 | 69 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | : esc_url( |
78 | 78 | $this->getElement( |
79 | 79 | $_aTab, |
80 | - 'url', // if the 'url' argument is set, use it. Otherwise, use the below gnerated url. |
|
80 | + 'url', // if the 'url' argument is set, use it. Otherwise, use the below gnerated url. |
|
81 | 81 | $this->getQueryAdminURL( |
82 | 82 | array( |
83 | 83 | 'page' => $this->aArguments[ 'page_slug' ], |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @return boolean |
107 | 107 | */ |
108 | 108 | private function _isEnabled( $aTab ) { |
109 | - return ! in_array( |
|
109 | + return !in_array( |
|
110 | 110 | false, |
111 | 111 | array( |
112 | 112 | ( bool ) current_user_can( $aTab[ 'capability' ] ), // whether the user has the sufficient capability level |