@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * Defines the field type slugs used for this field type. |
| 42 | 42 | */ |
| 43 | - public $aFieldTypeSlugs = array( 'import', ); |
|
| 43 | + public $aFieldTypeSlugs = array( 'import',); |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Defines the default key-values of this field type. |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @return string |
| 135 | 135 | */ |
| 136 | 136 | protected function getField( $aField ) { |
| 137 | - $aField[ 'attributes'][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
| 137 | + $aField[ 'attributes' ][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
| 138 | 138 | $aField[ 'label' ] = $aField[ 'label' ] |
| 139 | 139 | ? $aField[ 'label' ] |
| 140 | 140 | : $this->oMsg->get( 'import' ); |
@@ -153,13 +153,13 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | protected function _getExtraFieldsBeforeLabel( &$aField ) { |
| 155 | 155 | return "<label>" |
| 156 | - . "<input " . $this->getAttributes( |
|
| 156 | + . "<input ".$this->getAttributes( |
|
| 157 | 157 | array( |
| 158 | 158 | 'id' => "{$aField[ 'input_id' ]}_file", |
| 159 | 159 | 'type' => 'file', |
| 160 | 160 | 'name' => "__import[{$aField[ 'input_id' ]}]", |
| 161 | 161 | ) + $aField[ 'attributes' ][ 'file' ] |
| 162 | - ) . " />" |
|
| 162 | + )." />" |
|
| 163 | 163 | . "</label>"; |
| 164 | 164 | } |
| 165 | 165 | |
@@ -172,44 +172,44 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | protected function _getExtraInputFields( &$aField ) { |
| 174 | 174 | |
| 175 | - $aHiddenAttributes = array( 'type' => 'hidden', ); |
|
| 175 | + $aHiddenAttributes = array( 'type' => 'hidden',); |
|
| 176 | 176 | return |
| 177 | - "<input " . $this->getAttributes( |
|
| 177 | + "<input ".$this->getAttributes( |
|
| 178 | 178 | array( |
| 179 | - 'name' => "__import[{$aField['input_id']}][input_id]", |
|
| 180 | - 'value' => $aField['input_id'], |
|
| 179 | + 'name' => "__import[{$aField[ 'input_id' ]}][input_id]", |
|
| 180 | + 'value' => $aField[ 'input_id' ], |
|
| 181 | 181 | ) + $aHiddenAttributes |
| 182 | - ) . "/>" |
|
| 183 | - . "<input " . $this->getAttributes( |
|
| 182 | + )."/>" |
|
| 183 | + . "<input ".$this->getAttributes( |
|
| 184 | 184 | array( |
| 185 | - 'name' => "__import[{$aField['input_id']}][field_id]", |
|
| 186 | - 'value' => $aField['field_id'], |
|
| 185 | + 'name' => "__import[{$aField[ 'input_id' ]}][field_id]", |
|
| 186 | + 'value' => $aField[ 'field_id' ], |
|
| 187 | 187 | ) + $aHiddenAttributes |
| 188 | - ) . "/>" |
|
| 189 | - . "<input " . $this->getAttributes( |
|
| 188 | + )."/>" |
|
| 189 | + . "<input ".$this->getAttributes( |
|
| 190 | 190 | array( |
| 191 | - 'name' => "__import[{$aField['input_id']}][section_id]", |
|
| 192 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
| 191 | + 'name' => "__import[{$aField[ 'input_id' ]}][section_id]", |
|
| 192 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
| 193 | 193 | ) + $aHiddenAttributes |
| 194 | - ) . "/>" |
|
| 195 | - . "<input " . $this->getAttributes( |
|
| 194 | + )."/>" |
|
| 195 | + . "<input ".$this->getAttributes( |
|
| 196 | 196 | array( |
| 197 | - 'name' => "__import[{$aField['input_id']}][is_merge]", |
|
| 198 | - 'value' => $aField['is_merge'], |
|
| 197 | + 'name' => "__import[{$aField[ 'input_id' ]}][is_merge]", |
|
| 198 | + 'value' => $aField[ 'is_merge' ], |
|
| 199 | 199 | ) + $aHiddenAttributes |
| 200 | - ) . "/>" |
|
| 201 | - . "<input " . $this->getAttributes( |
|
| 200 | + )."/>" |
|
| 201 | + . "<input ".$this->getAttributes( |
|
| 202 | 202 | array( |
| 203 | - 'name' => "__import[{$aField['input_id']}][option_key]", |
|
| 204 | - 'value' => $aField['option_key'], |
|
| 203 | + 'name' => "__import[{$aField[ 'input_id' ]}][option_key]", |
|
| 204 | + 'value' => $aField[ 'option_key' ], |
|
| 205 | 205 | ) + $aHiddenAttributes |
| 206 | - ) . "/>" |
|
| 207 | - . "<input " . $this->getAttributes( |
|
| 206 | + )."/>" |
|
| 207 | + . "<input ".$this->getAttributes( |
|
| 208 | 208 | array( |
| 209 | - 'name' => "__import[{$aField['input_id']}][format]", |
|
| 210 | - 'value' => $aField['format'], |
|
| 209 | + 'name' => "__import[{$aField[ 'input_id' ]}][format]", |
|
| 210 | + 'value' => $aField[ 'format' ], |
|
| 211 | 211 | ) + $aHiddenAttributes |
| 212 | - ) . "/>" |
|
| 212 | + )."/>" |
|
| 213 | 213 | ; |
| 214 | 214 | } |
| 215 | 215 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
| 49 | 49 | $_sTabSlug = sanitize_text_field( $_sTabSlug ); |
| 50 | 50 | $_sUserID = get_current_user_id(); |
| 51 | - return "apf_fe_" . md5( |
|
| 51 | + return "apf_fe_".md5( |
|
| 52 | 52 | $_sPageNow |
| 53 | 53 | . $_sPageSlug |
| 54 | 54 | . $_sTabSlug |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | public function get() { |
| 137 | 137 | |
| 138 | 138 | // Use a cache if exists. |
| 139 | - self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
| 139 | + self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
| 140 | 140 | ? self::$_aFieldErrorCaches[ $this->sTransientKey ] |
| 141 | 141 | : $this->getTransient( $this->sTransientKey ); |
| 142 | 142 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * @since 3.7.0 |
| 154 | 154 | */ |
| 155 | 155 | public function delete() { |
| 156 | - if ( $this->hasBeenCalled( 'delete_' . $this->sTransientKey ) ) { |
|
| 156 | + if ( $this->hasBeenCalled( 'delete_'.$this->sTransientKey ) ) { |
|
| 157 | 157 | return; |
| 158 | 158 | } |
| 159 | 159 | add_action( 'shutdown', array( $this, '_replyToDelete' ) ); |
@@ -47,16 +47,16 @@ discard block |
||
| 47 | 47 | * @return array |
| 48 | 48 | * @since 3.7.0 |
| 49 | 49 | */ |
| 50 | - public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure=true, $bStripSlashes=true ) { |
|
| 50 | + public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure = true, $bStripSlashes = true ) { |
|
| 51 | 51 | |
| 52 | 52 | // Extracts the form data from the subject data for parsing |
| 53 | - $_aSubmittedFormData = $bExtractFromFieldStructure |
|
| 53 | + $_aSubmittedFormData = $bExtractFromFieldStructure |
|
| 54 | 54 | ? $this->castArrayContents( |
| 55 | 55 | $this->getDataStructureFromAddedFieldsets(), // form data (options) structure |
| 56 | 56 | $aDataToParse // the subject data array, usually $_POST. |
| 57 | 57 | ) |
| 58 | 58 | : $aDataToParse; |
| 59 | - $_aSubmittedFormData = $this->getHTTPRequestSanitized( $_aSubmittedFormData, $bStripSlashes ); |
|
| 59 | + $_aSubmittedFormData = $this->getHTTPRequestSanitized( $_aSubmittedFormData, $bStripSlashes ); |
|
| 60 | 60 | return $this->getSortedInputs( $_aSubmittedFormData ); // [3.6.0] - sorts dynamic elements. |
| 61 | 61 | |
| 62 | 62 | } |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | array_merge( |
| 80 | 80 | $this->getElementAsArray( |
| 81 | 81 | $_POST, |
| 82 | - '__repeatable_elements_' . $this->aArguments[ 'structure_type' ], |
|
| 82 | + '__repeatable_elements_'.$this->aArguments[ 'structure_type' ], |
|
| 83 | 83 | array() |
| 84 | 84 | ), |
| 85 | 85 | $this->getElementAsArray( |
| 86 | 86 | $_POST, |
| 87 | - '__sortable_elements_' . $this->aArguments[ 'structure_type' ], |
|
| 87 | + '__sortable_elements_'.$this->aArguments[ 'structure_type' ], |
|
| 88 | 88 | array() |
| 89 | 89 | ) |
| 90 | 90 | ) |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | * Changed the name from `getFieldsModel()`. |
| 144 | 144 | * @return array |
| 145 | 145 | */ |
| 146 | - public function getDataStructureFromAddedFieldsets() { |
|
| 146 | + public function getDataStructureFromAddedFieldsets() { |
|
| 147 | 147 | |
| 148 | - $_aFormDataStructure = array(); |
|
| 148 | + $_aFormDataStructure = array(); |
|
| 149 | 149 | foreach ( $this->getAsArray( $this->aFieldsets ) as $_sSectionID => $_aFieldsets ) { |
| 150 | 150 | |
| 151 | 151 | if ( $_sSectionID != '_default' ) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // For default field items. |
| 157 | - foreach( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
| 157 | + foreach ( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
| 158 | 158 | $_aFormDataStructure[ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $aSubject, |
| 187 | 187 | $this->getElementAsArray( |
| 188 | 188 | $_POST, |
| 189 | - '__repeatable_elements_' . $this->aArguments[ 'structure_type' ] |
|
| 189 | + '__repeatable_elements_'.$this->aArguments[ 'structure_type' ] |
|
| 190 | 190 | ) |
| 191 | 191 | ); |
| 192 | 192 | return $_oFilterRepeatableElements->get(); |
@@ -199,13 +199,13 @@ discard block |
||
| 199 | 199 | public function _replyToRegisterFormItems() { |
| 200 | 200 | |
| 201 | 201 | // Check if the form should be created or not. |
| 202 | - if ( ! $this->isInThePage() ) { |
|
| 202 | + if ( !$this->isInThePage() ) { |
|
| 203 | 203 | return; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // Load field type definitions. |
| 207 | - $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
| 208 | - $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
| 207 | + $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
| 208 | + $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
| 209 | 209 | |
| 210 | 210 | // Set the options array |
| 211 | 211 | $this->aSavedData = $this->_getSavedData( |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $this->aArguments, |
| 234 | 234 | $this->aFieldsets, |
| 235 | 235 | self::$_aResources, |
| 236 | - $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
| 236 | + $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
| 237 | 237 | $this->aCallbacks |
| 238 | 238 | ); |
| 239 | 239 | self::$_aResources = $_oFieldResources->get(); // updates the property |
@@ -250,10 +250,10 @@ discard block |
||
| 250 | 250 | $this->callBack( |
| 251 | 251 | $this->aCallbacks[ 'handle_form_data' ], |
| 252 | 252 | array( |
| 253 | - $this->aSavedData, // 1st parameter |
|
| 254 | - $this->aArguments, // 2nd parameter |
|
| 255 | - $this->aSectionsets, // 3rd parameter |
|
| 256 | - $this->aFieldsets, // 4th parameter |
|
| 253 | + $this->aSavedData, // 1st parameter |
|
| 254 | + $this->aArguments, // 2nd parameter |
|
| 255 | + $this->aSectionsets, // 3rd parameter |
|
| 256 | + $this->aFieldsets, // 4th parameter |
|
| 257 | 257 | ) |
| 258 | 258 | ); |
| 259 | 259 | |
@@ -267,15 +267,15 @@ discard block |
||
| 267 | 267 | $this->aSectionsets = $this->callBack( |
| 268 | 268 | $this->aCallbacks[ 'secitonsets_before_registration' ], |
| 269 | 269 | array( |
| 270 | - $this->aSectionsets, // 1st parameter |
|
| 270 | + $this->aSectionsets, // 1st parameter |
|
| 271 | 271 | ) |
| 272 | 272 | ); |
| 273 | 273 | // Let the main routine modify the fieldsets definition array. |
| 274 | 274 | $this->aFieldsets = $this->callBack( |
| 275 | 275 | $this->aCallbacks[ 'fieldsets_before_registration' ], |
| 276 | 276 | array( |
| 277 | - $this->aFieldsets, // 1st parameter |
|
| 278 | - $this->aSectionsets, // 2nd parameter |
|
| 277 | + $this->aFieldsets, // 1st parameter |
|
| 278 | + $this->aSectionsets, // 2nd parameter |
|
| 279 | 279 | ) |
| 280 | 280 | ); |
| 281 | 281 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
| 59 | 59 | $_sTabSlug = sanitize_text_field( $_sTabSlug ); |
| 60 | 60 | $_sUserID = get_current_user_id(); |
| 61 | - return "apf_li_" . md5( |
|
| 61 | + return "apf_li_".md5( |
|
| 62 | 62 | $_sPageNow |
| 63 | 63 | . $_sPageSlug |
| 64 | 64 | . $_sTabSlug |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | * @return void |
| 97 | 97 | */ |
| 98 | 98 | public function _replyToSave() { |
| 99 | - if ( ! isset( self::$_aLastInputs ) ) { |
|
| 99 | + if ( !isset( self::$_aLastInputs ) ) { |
|
| 100 | 100 | return; |
| 101 | 101 | } |
| 102 | 102 | $this->setTransient( |
| 103 | 103 | $this->sTransientKey, |
| 104 | 104 | self::$_aLastInputs, |
| 105 | - 60*60 // store it for 1 hour |
|
| 105 | + 60 * 60 // store it for 1 hour |
|
| 106 | 106 | ); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -122,9 +122,9 @@ discard block |
||
| 122 | 122 | $_aLastInputs = self::$_aCaches[ $this->sTransientKey ]; |
| 123 | 123 | } else { |
| 124 | 124 | $_aLastInputs = $this->getTransient( $this->sTransientKey ); |
| 125 | - self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
| 125 | + self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
| 126 | 126 | if ( false !== $_aLastInputs ) { |
| 127 | - $this->delete(); // deletes at the end of the script. |
|
| 127 | + $this->delete(); // deletes at the end of the script. |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function get() { |
| 43 | 43 | |
| 44 | - foreach( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
| 44 | + foreach ( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
| 45 | 45 | |
| 46 | 46 | $_aDimensionalKeys = explode( '|', $_sFlatFieldAddress ); |
| 47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // If the retrieved value does not exist, null will be given. |
| 54 | 54 | // This occurs with page meta boxes. |
| 55 | - if ( ! is_array( $_aDynamicElements ) ) { |
|
| 55 | + if ( !is_array( $_aDynamicElements ) ) { |
|
| 56 | 56 | continue; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | 'confirm_perform_task' => 'Please confirm your action.', |
| 82 | 82 | 'specified_option_been_deleted' => 'The specified options have been deleted.', |
| 83 | 83 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
| 84 | - 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
| 85 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
| 86 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
| 84 | + 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
| 85 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
| 86 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
| 87 | 87 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+ |
| 88 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
| 88 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
| 89 | 89 | |
| 90 | 90 | // AdminPageFramework_PostType |
| 91 | 91 | 'title' => 'Title', |
@@ -112,14 +112,14 @@ discard block |
||
| 112 | 112 | 'upload_file' => 'Upload File', |
| 113 | 113 | 'use_this_file' => 'Use This File', |
| 114 | 114 | 'select_file' => 'Select File', |
| 115 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
| 116 | - 'select_all' => 'Select All', // 3.3.0+ |
|
| 117 | - 'select_none' => 'Select None', // 3.3.0+ |
|
| 115 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
| 116 | + 'select_all' => 'Select All', // 3.3.0+ |
|
| 117 | + 'select_none' => 'Select None', // 3.3.0+ |
|
| 118 | 118 | 'no_term_found' => 'No term found.', // 3.3.2+ |
| 119 | 119 | |
| 120 | 120 | // AdminPageFramework_Form_View___Script_{...} |
| 121 | 121 | 'select' => 'Select', // 3.4.2+ |
| 122 | - 'insert' => 'Insert', // 3.4.2+ |
|
| 122 | + 'insert' => 'Insert', // 3.4.2+ |
|
| 123 | 123 | 'use_this' => 'Use This', // 3.4.2+ |
| 124 | 124 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
| 125 | 125 | |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Repeatable sections & fields |
| 133 | 133 | 'repeatable_section_is_disabled' => 'The ability to repeat sections is disabled.', // 3.8.13+ |
| 134 | - 'repeatable_field_is_disabled' => 'The ability to repeat fields is disabled.', // 3.8.13+ |
|
| 135 | - 'warning_caption' => 'Warning', // 3.8.13+ |
|
| 134 | + 'repeatable_field_is_disabled' => 'The ability to repeat fields is disabled.', // 3.8.13+ |
|
| 135 | + 'warning_caption' => 'Warning', // 3.8.13+ |
|
| 136 | 136 | |
| 137 | 137 | // AdminPageFramework_FormField |
| 138 | 138 | 'allowed_maximum_number_of_fields' => 'The allowed maximum number of fields is {0}.', |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | * @remark This class should be instantiated via this method. |
| 215 | 215 | * @return AdminPageFramework_Message |
| 216 | 216 | */ |
| 217 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
| 217 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
| 218 | 218 | |
| 219 | 219 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
| 220 | 220 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
| 228 | 228 | * @deprecated 3.2.0 |
| 229 | 229 | */ |
| 230 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
| 230 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
| 231 | 231 | return self::getInstance( $sTextDomain ); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -235,14 +235,14 @@ discard block |
||
| 235 | 235 | * Sets up properties. |
| 236 | 236 | * @param string $sTextDomain |
| 237 | 237 | */ |
| 238 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
| 238 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
| 239 | 239 | |
| 240 | 240 | $this->_sTextDomain = $sTextDomain; |
| 241 | 241 | |
| 242 | 242 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
| 243 | 243 | // with the value of null. The null is set to let it trigger the __get() method |
| 244 | 244 | // so that each translation item gets processed individually. |
| 245 | - $this->aMessages = array_fill_keys( |
|
| 245 | + $this->aMessages = array_fill_keys( |
|
| 246 | 246 | array_keys( $this->aDefaults ), |
| 247 | 247 | null |
| 248 | 248 | ); |
@@ -277,13 +277,13 @@ discard block |
||
| 277 | 277 | * @param string $sKey |
| 278 | 278 | * @return string|array |
| 279 | 279 | */ |
| 280 | - public function get( $sKey='' ) { |
|
| 281 | - if ( ! $sKey ) { |
|
| 280 | + public function get( $sKey = '' ) { |
|
| 281 | + if ( !$sKey ) { |
|
| 282 | 282 | return $this->_getAllMessages(); |
| 283 | 283 | } |
| 284 | 284 | return isset( $this->aMessages[ $sKey ] ) |
| 285 | 285 | ? __( $this->aMessages[ $sKey ], $this->_sTextDomain ) |
| 286 | - : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
| 286 | + : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
| 287 | 287 | } |
| 288 | 288 | /** |
| 289 | 289 | * Returns the all registered messag items. |
@@ -330,14 +330,14 @@ discard block |
||
| 330 | 330 | * @since 3.7.0 |
| 331 | 331 | */ |
| 332 | 332 | public $aFormCallbacks = array( |
| 333 | - 'hfID' => null, // the input id attribute |
|
| 334 | - 'hfTagID' => null, // the field container id attribute |
|
| 335 | - 'hfName' => null, // the field name attribute |
|
| 336 | - 'hfNameFlat' => null, // the flat field name attribute |
|
| 333 | + 'hfID' => null, // the input id attribute |
|
| 334 | + 'hfTagID' => null, // the field container id attribute |
|
| 335 | + 'hfName' => null, // the field name attribute |
|
| 336 | + 'hfNameFlat' => null, // the flat field name attribute |
|
| 337 | 337 | // @todo Document the differences between `hfName` and `hfInputName` |
| 338 | - 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
| 339 | - 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
| 340 | - 'hfClass' => null, // the class attribute |
|
| 338 | + 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
| 339 | + 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
| 340 | + 'hfClass' => null, // the class attribute |
|
| 341 | 341 | ); |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | */ |
| 465 | 465 | private function ___getURLQuery() { |
| 466 | 466 | |
| 467 | - if ( ! $this->bIsAdminAjax ) { |
|
| 467 | + if ( !$this->bIsAdminAjax ) { |
|
| 468 | 468 | return $this->getHTTPRequestSanitized( $_GET, true ); |
| 469 | 469 | } |
| 470 | 470 | parse_str( |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | * @since 3.7.9 |
| 481 | 481 | */ |
| 482 | 482 | private function ___setGlobals() { |
| 483 | - if ( ! isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
| 483 | + if ( !isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
| 484 | 484 | $GLOBALS[ 'aAdminPageFramework' ] = array( |
| 485 | 485 | 'aFieldFlags' => array() |
| 486 | 486 | ); |
@@ -551,8 +551,8 @@ discard block |
||
| 551 | 551 | 'hfTagID' => array( $this->oCaller, '_replyToGetInputTagIDAttribute' ), // the fields & fieldset & field row container id attribute |
| 552 | 552 | 'hfName' => array( $this->oCaller, '_replyToGetFieldNameAttribute' ), // the input name attribute |
| 553 | 553 | 'hfNameFlat' => array( $this->oCaller, '_replyToGetFlatFieldName' ), // the flat input name attribute |
| 554 | - 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
| 555 | - 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
| 554 | + 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
| 555 | + 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
| 556 | 556 | 'hfClass' => array( $this->oCaller, '_replyToGetInputClassAttribute' ), // the class attribute |
| 557 | 557 | 'hfSectionName' => array( $this->oCaller, '_replyToGetSectionName' ), // 3.6.0+ |
| 558 | 558 | ) + $this->aFormCallbacks; |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | * @remark The information can be used to embed into the footer etc. |
| 627 | 627 | * @return array The information of the script. |
| 628 | 628 | */ |
| 629 | - protected function getCallerInfo( $sCallerPath='' ) { |
|
| 629 | + protected function getCallerInfo( $sCallerPath = '' ) { |
|
| 630 | 630 | |
| 631 | 631 | if ( isset( self::$_aScriptDataCaches[ $sCallerPath ] ) ) { |
| 632 | 632 | return self::$_aScriptDataCaches[ $sCallerPath ]; |
@@ -744,11 +744,11 @@ discard block |
||
| 744 | 744 | |
| 745 | 745 | // 3.7.9 Moved from the constructor to make it lighter. |
| 746 | 746 | if ( 'sClassHash' === $sName ) { |
| 747 | - $this->sClassHash = md5( $this->sClassName ); |
|
| 747 | + $this->sClassHash = md5( $this->sClassName ); |
|
| 748 | 748 | return $this->sClassHash; |
| 749 | 749 | } |
| 750 | 750 | if ( 'sScriptType' === $sName ) { |
| 751 | - $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
| 751 | + $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
| 752 | 752 | return $this->sScriptType; |
| 753 | 753 | } |
| 754 | 754 | if ( 'oUtil' === $sName ) { |
@@ -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() ) { |
|
| 35 | + if ( !$this->_shouldProceed() ) { |
|
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | $this->_exportOptions( |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected function _exportOptions( $mData, $sPageSlug, $sTabSlug ) { |
| 69 | 69 | |
| 70 | - $_oExport = new AdminPageFramework_ExportOptions( |
|
| 70 | + $_oExport = new AdminPageFramework_ExportOptions( |
|
| 71 | 71 | $this->getHTTPRequestSanitized( $this->getElementAsArray( $_POST, array( '__export' ) ), true ), |
| 72 | 72 | $this->oFactory->oProp->sClassName |
| 73 | 73 | ); |
| 74 | - $_aArguments = array( |
|
| 74 | + $_aArguments = array( |
|
| 75 | 75 | 'class_name' => $this->oFactory->oProp->sClassName, |
| 76 | 76 | 'page_slug' => $sPageSlug, |
| 77 | 77 | 'tab_slug' => $sTabSlug, |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $sExportFileName, |
| 144 | 144 | $aArguments[ 'pressed_field_id' ], |
| 145 | 145 | $aArguments[ 'pressed_input_id' ], |
| 146 | - $mData, // 3.4.6+ |
|
| 146 | + $mData, // 3.4.6+ |
|
| 147 | 147 | $this->oFactory // 3.4.6+ |
| 148 | 148 | ); |
| 149 | 149 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @since 3.6.3 |
| 36 | 36 | */ |
| 37 | 37 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
| 38 | - if ( ! $this->_shouldProceed() ) { |
|
| 38 | + if ( !$this->_shouldProceed() ) { |
|
| 39 | 39 | return; |
| 40 | 40 | } |
| 41 | 41 | $this->_doImportOptions( |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | private function _importOptions( $aStoredOptions, $sPageSlug, $sTabSlug ) { |
| 95 | 95 | |
| 96 | - $_oImport = new AdminPageFramework_ImportOptions( |
|
| 96 | + $_oImport = new AdminPageFramework_ImportOptions( |
|
| 97 | 97 | $this->getHTTPRequestSanitized( $_FILES[ '__import' ], false ), |
| 98 | 98 | $this->getHTTPRequestSanitized( $_POST[ '__import' ], true ) |
| 99 | 99 | ); |
| 100 | - $_aArguments = array( |
|
| 100 | + $_aArguments = array( |
|
| 101 | 101 | 'class_name' => $this->oFactory->oProp->sClassName, |
| 102 | 102 | 'page_slug' => $sPageSlug, |
| 103 | 103 | 'tab_slug' => $sTabSlug, |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | // Check the uploaded file MIME type. |
| 117 | 117 | $_aMIMEType = $this->_getImportMIMEType( $_aArguments ); |
| 118 | 118 | $_sType = $_oImport->getType(); |
| 119 | - if ( ! in_array( $_sType, $_aMIMEType ) ) { |
|
| 119 | + if ( !in_array( $_sType, $_aMIMEType ) ) { |
|
| 120 | 120 | $this->oFactory->setSettingNotice( sprintf( $this->oFactory->oMsg->get( 'uploaded_file_type_not_supported' ), $_sType ) ); |
| 121 | - return $aStoredOptions; // do not change the framework's options. |
|
| 121 | + return $aStoredOptions; // do not change the framework's options. |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | // Retrieve the importing data. |
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | array( |
| 184 | 184 | 'text/plain', |
| 185 | 185 | 'application/octet-stream', // .json file is dealt as a binary file. |
| 186 | - 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
| 187 | - 'text/html', // 3.7.2+ |
|
| 188 | - 'application/txt', // 3.7.2+ |
|
| 186 | + 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
| 187 | + 'text/html', // 3.7.2+ |
|
| 188 | + 'application/txt', // 3.7.2+ |
|
| 189 | 189 | ), |
| 190 | 190 | $aArguments |
| 191 | 191 | ); |
@@ -274,18 +274,18 @@ discard block |
||
| 274 | 274 | protected function _getPortFilterHookNames( $sPrefix, array $aArguments ) { |
| 275 | 275 | |
| 276 | 276 | return array( |
| 277 | - $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_input_id' ], |
|
| 277 | + $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_input_id' ], |
|
| 278 | 278 | $aArguments[ 'section_id' ] |
| 279 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] .'_' . $aArguments[ 'pressed_field_id' ] |
|
| 280 | - : $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_field_id' ], |
|
| 279 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ].'_'.$aArguments[ 'pressed_field_id' ] |
|
| 280 | + : $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_field_id' ], |
|
| 281 | 281 | $aArguments[ 'section_id' ] |
| 282 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] |
|
| 282 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ] |
|
| 283 | 283 | : null, |
| 284 | 284 | $aArguments[ 'tab_slug' ] |
| 285 | - ? $sPrefix . $aArguments[ 'page_slug' ] . '_' . $aArguments[ 'tab_slug' ] |
|
| 285 | + ? $sPrefix.$aArguments[ 'page_slug' ].'_'.$aArguments[ 'tab_slug' ] |
|
| 286 | 286 | : null, |
| 287 | - $sPrefix . $aArguments[ 'page_slug' ], |
|
| 288 | - $sPrefix . $aArguments[ 'class_name' ] |
|
| 287 | + $sPrefix.$aArguments[ 'page_slug' ], |
|
| 288 | + $sPrefix.$aArguments[ 'class_name' ] |
|
| 289 | 289 | ); |
| 290 | 290 | |
| 291 | 291 | } |