@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @since 3.6.0 |
27 | 27 | */ |
28 | - public $sContext = 'fieldset'; |
|
28 | + public $sContext = 'fieldset'; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Returns an attribute array. |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | */ |
34 | 34 | protected function _getAttributes() { |
35 | 35 | return array( |
36 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
36 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
37 | 37 | 'class' => implode( |
38 | 38 | ' ', |
39 | 39 | array( |
40 | - 'admin-page-framework-' . $this->sContext, |
|
40 | + 'admin-page-framework-'.$this->sContext, |
|
41 | 41 | $this->_getSelectorForChildFieldset() |
42 | 42 | ) |
43 | 43 | ), |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | return ''; |
57 | 57 | } |
58 | 58 | if ( $this->aArguments[ '_nested_depth' ] == 1 ) { |
59 | - return 'child-fieldset nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
59 | + return 'child-fieldset nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
60 | 60 | } |
61 | - return 'child-fieldset multiple-nesting nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
61 | + return 'child-fieldset multiple-nesting nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
62 | 62 | |
63 | 63 | } |
64 | 64 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | // If the first element is a string, it is a inline mixed field definition. |
73 | - return is_array( self::getElement( $aFieldset[ 'content' ], 0 ) ); |
|
73 | + return is_array( self::getElement( $aFieldset[ 'content' ], 0 ) ); |
|
74 | 74 | |
75 | 75 | } |
76 | 76 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | static public function hasNestedFields( $aFieldset ) { |
60 | 60 | |
61 | - if ( ! self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
61 | + if ( !self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | // At this point, the `content` argument contains either the definition of nested fields or inline-mixed fields. |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | static public function hasFieldDefinitionsInContent( $aFieldset ) { |
82 | 82 | |
83 | - if ( ! isset( $aFieldset[ 'content' ] ) ) { |
|
83 | + if ( !isset( $aFieldset[ 'content' ] ) ) { |
|
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | if ( empty( $aFieldset[ 'content' ] ) ) { |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | * @since 3.8.13 |
116 | 116 | */ |
117 | 117 | static public function isDynamicField( $aField ) { |
118 | - if ( ! empty( $aField[ 'repeatable' ] ) ) { |
|
118 | + if ( !empty( $aField[ 'repeatable' ] ) ) { |
|
119 | 119 | return true; |
120 | 120 | } |
121 | - if ( ! empty( $aField[ 'sortable' ] ) ) { |
|
121 | + if ( !empty( $aField[ 'sortable' ] ) ) { |
|
122 | 122 | return true; |
123 | 123 | } |
124 | 124 | return false; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if ( empty( $sString ) ) { |
148 | 148 | return $sString; |
149 | 149 | } |
150 | - return $sString . '|'; |
|
150 | + return $sString.'|'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | */ |
164 | 164 | static public function getFieldsetReformattedBySubFieldIndex( $aFieldset, $iSubFieldIndex, $bHasSubFields, $aParentFieldset ) { |
165 | 165 | |
166 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
166 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
167 | 167 | |
168 | 168 | // Add sub-field index to the parent field path for repeated nested items. |
169 | - $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
169 | + $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
170 | 170 | $bHasSubFields, |
171 | - $aFieldset[ '_parent_field_path' ] . '|' . $iSubFieldIndex, |
|
171 | + $aFieldset[ '_parent_field_path' ].'|'.$iSubFieldIndex, |
|
172 | 172 | $aFieldset[ '_parent_field_path' ] |
173 | 173 | ); |
174 | - $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
174 | + $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
175 | 175 | $bHasSubFields, |
176 | - $aParentFieldset[ 'tag_id' ] . '__' . $iSubFieldIndex, |
|
176 | + $aParentFieldset[ 'tag_id' ].'__'.$iSubFieldIndex, |
|
177 | 177 | $aParentFieldset[ 'tag_id' ] |
178 | 178 | ); |
179 | 179 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $aFieldset, |
183 | 183 | $aFieldset[ '_structure_type' ], |
184 | 184 | $aFieldset[ 'capability' ], |
185 | - ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
185 | + ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
186 | 186 | $aFieldset[ '_subsection_index' ], |
187 | 187 | $aFieldset[ '_is_section_repeatable' ], |
188 | 188 | $aFieldset[ '_caller_object' ] |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | $_oFieldsetOutputFormatter = new AdminPageFramework_Form_Model___Format_FieldsetOutput( |
193 | 193 | $aFieldset, |
194 | - $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
194 | + $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
195 | 195 | $_oCallerForm->aFieldTypeDefinitions |
196 | 196 | ); |
197 | 197 | return $_oFieldsetOutputFormatter->get(); |
@@ -228,12 +228,12 @@ discard block |
||
228 | 228 | if ( empty( $aArguments ) ) { |
229 | 229 | return ''; |
230 | 230 | } |
231 | - if ( self::hasBeenCalled( 'disabled_repeatable_elements_modal_' . $sBoxElementID ) ) { |
|
231 | + if ( self::hasBeenCalled( 'disabled_repeatable_elements_modal_'.$sBoxElementID ) ) { |
|
232 | 232 | return ''; |
233 | 233 | } |
234 | 234 | add_thickbox(); // to display a message to the user. |
235 | 235 | return "<div id='{$sBoxElementID}' style='display:none'>" |
236 | - . "<p>" . $aArguments[ 'message' ] . "</p>" |
|
236 | + . "<p>".$aArguments[ 'message' ]."</p>" |
|
237 | 237 | . "</div>"; |
238 | 238 | |
239 | 239 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $_sPageSlug = $this->getElement( $_GET, 'page', '' ); |
47 | 47 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
48 | 48 | $_sUserID = get_current_user_id(); |
49 | - return "apf_fe_" . md5( |
|
49 | + return "apf_fe_".md5( |
|
50 | 50 | $_sPageNow |
51 | 51 | . $_sPageSlug |
52 | 52 | . $_sTabSlug |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | public function get() { |
135 | 135 | |
136 | 136 | // Use a cache if exists. |
137 | - self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
137 | + self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
138 | 138 | ? self::$_aFieldErrorCaches[ $this->sTransientKey ] |
139 | 139 | : $this->getTransient( $this->sTransientKey ); |
140 | 140 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @since 3.7.0 |
152 | 152 | */ |
153 | 153 | public function delete() { |
154 | - if ( $this->hasBeenCalled( 'delete_' . $this->sTransientKey ) ) { |
|
154 | + if ( $this->hasBeenCalled( 'delete_'.$this->sTransientKey ) ) { |
|
155 | 155 | return; |
156 | 156 | } |
157 | 157 | add_action( 'shutdown', array( $this, '_replyToDelete' ) ); |
@@ -112,7 +112,7 @@ |
||
112 | 112 | * @return void |
113 | 113 | */ |
114 | 114 | public function _replyToSave() { |
115 | - if ( empty( self::$_aErrors ) ) { |
|
115 | + if ( empty( self::$_aErrors ) ) { |
|
116 | 116 | return; |
117 | 117 | } |
118 | 118 | $this->setTransient( |
@@ -80,10 +80,6 @@ discard block |
||
80 | 80 | * ` |
81 | 81 | * @since 3.7.0 |
82 | 82 | * @access public |
83 | - * @param string $sMessage the text message to be displayed. |
|
84 | - * @param string $sType (optional) the type of the message, either "error" or "updated" is used. |
|
85 | - * @param array $asAttributes (optional) the tag attribute array applied to the message container HTML element. If a string is given, it is used as the ID attribute value. |
|
86 | - * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
|
87 | 83 | * @return void |
88 | 84 | */ |
89 | 85 | public function set( $aErrors ) { |
@@ -128,7 +124,6 @@ discard block |
||
128 | 124 | * Retrieves the settings error array set by the user in the validation callback. |
129 | 125 | * |
130 | 126 | * @since 3.7.0 |
131 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
132 | 127 | * @return array |
133 | 128 | */ |
134 | 129 | public function get() { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string $sType If empty, the method will check if a message exists in all types. Otherwise, it checks the existence of a message of the specified type. |
46 | 46 | * @return boolean True if a setting notice is set; otherwise, false. |
47 | 47 | */ |
48 | - public function hasSubmitNotice( $sType='' ) { |
|
48 | + public function hasSubmitNotice( $sType = '' ) { |
|
49 | 49 | return $this->oSubmitNotice->hasNotice( $sType ); |
50 | 50 | } |
51 | 51 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
72 | 72 | * @return void |
73 | 73 | */ |
74 | - public function setSubmitNotice( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
|
74 | + public function setSubmitNotice( $sMessage, $sType = 'error', $asAttributes = array(), $bOverride = true ) { |
|
75 | 75 | $this->oSubmitNotice->set( |
76 | 76 | $sMessage, |
77 | 77 | $sType, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $this->aSectionsets[ $aSectionset[ 'section_id' ] ] = $aSectionset; |
100 | 100 | $this->aFieldsets[ $aSectionset[ 'section_id' ] ] = $this->getElement( |
101 | - $this->aFieldsets, // subject array |
|
101 | + $this->aFieldsets, // subject array |
|
102 | 102 | $aSectionset[ 'section_id' ], // key |
103 | 103 | array() // default |
104 | 104 | ); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function removeSection( $sSectionID ) { |
115 | 115 | |
116 | - if ( '_default' === $sSectionID ){ |
|
116 | + if ( '_default' === $sSectionID ) { |
|
117 | 117 | return; |
118 | 118 | } |
119 | 119 | unset( |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return void |
144 | 144 | */ |
145 | 145 | public function addResource( $sKey, $sValue ) { |
146 | - self::$_aResources[ $sKey ][] = $sValue; |
|
146 | + self::$_aResources[ $sKey ][ ] = $sValue; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | public function addField( $asFieldset ) { |
167 | 167 | |
168 | 168 | // If it is a target section, update the property and return. |
169 | - if ( ! $this->_isFieldsetDefinition( $asFieldset ) ) { |
|
169 | + if ( !$this->_isFieldsetDefinition( $asFieldset ) ) { |
|
170 | 170 | $this->_asTargetSectionID = $this->_getTargetSectionID( $asFieldset ); |
171 | 171 | return $this->_asTargetSectionID; |
172 | 172 | } |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | |
176 | 176 | // Set the target section ID |
177 | 177 | $this->_asTargetSectionID = $this->getElement( |
178 | - $_aFieldset, // subject array |
|
178 | + $_aFieldset, // subject array |
|
179 | 179 | 'section_id', // key |
180 | 180 | $this->_asTargetSectionID // default |
181 | 181 | ); |
182 | 182 | |
183 | 183 | // Required Keys - 3.8.0+ Now 'type' can be omitted. |
184 | - if ( ! isset( $_aFieldset[ 'field_id' ] ) ) { |
|
184 | + if ( !isset( $_aFieldset[ 'field_id' ] ) ) { |
|
185 | 185 | return null; |
186 | 186 | } |
187 | 187 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function removeField( $sFieldID ) { |
286 | 286 | |
287 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
287 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
288 | 288 | |
289 | 289 | if ( array_key_exists( $sFieldID, $_aSubSectionsOrFields ) ) { |
290 | 290 | unset( $this->aFieldsets[ $_sSectionID ][ $sFieldID ] ); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function removeSection( $sSectionID ) { |
115 | 115 | |
116 | - if ( '_default' === $sSectionID ){ |
|
116 | + if ( '_default' === $sSectionID ) { |
|
117 | 117 | return; |
118 | 118 | } |
119 | 119 | unset( |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ); |
182 | 182 | |
183 | 183 | // Required Keys - 3.8.0+ Now 'type' can be omitted. |
184 | - if ( ! isset( $_aFieldset[ 'field_id' ] ) ) { |
|
184 | + if ( ! isset( $_aFieldset[ 'field_id' ] ) ) { |
|
185 | 185 | return null; |
186 | 186 | } |
187 | 187 |
@@ -148,6 +148,8 @@ |
||
148 | 148 | } |
149 | 149 | /** |
150 | 150 | * @since 3.7.0 |
151 | + * @param string $sKey |
|
152 | + * @param string $sValue |
|
151 | 153 | * @return void |
152 | 154 | */ |
153 | 155 | public function addResource( $sKey, $sValue ) { |
@@ -44,7 +44,7 @@ |
||
44 | 44 | call_user_func_array( |
45 | 45 | $aFieldTypeDefinition[ 'hfFieldSetTypeSetter' ], |
46 | 46 | array( $sStructureType ) |
47 | - ); |
|
47 | + ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | if ( is_callable( $aFieldTypeDefinition[ 'hfFieldLoader' ] ) ) { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
108 | 108 | |
109 | 109 | // If the section is not set, skip. |
110 | - if ( ! isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
110 | + if ( ! isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
111 | 111 | continue; |
112 | 112 | } |
113 | 113 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | $_aSortedFields = array(); |
261 | - foreach( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
261 | + foreach( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
262 | 262 | if ( isset( $aFieldsets[ $_sSectionPath ] ) ) { |
263 | 263 | $_aSortedFields[ $_sSectionPath ] = $aFieldsets[ $_sSectionPath ]; |
264 | 264 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | private function _getFieldsetFormatted( $aFieldset, $aSectionsets, $sCapability, $iCountOfElements, $iSubSectionIndex, $bIsSectionRepeatable, $oCallerObject ) { |
278 | 278 | |
279 | 279 | // 3.8.0+ Dropped the check for $aFieldset[ 'type' ] to allow it to be omitted. |
280 | - if ( ! isset( $aFieldset[ 'field_id' ] ) ) { |
|
280 | + if ( ! isset( $aFieldset[ 'field_id' ] ) ) { |
|
281 | 281 | return; |
282 | 282 | } |
283 | 283 |
@@ -99,6 +99,7 @@ discard block |
||
99 | 99 | * @since 3.1.1 Added a parameter. Changed to return the formatted sections array. |
100 | 100 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition`. Changed the name from `formatFields()`. |
101 | 101 | * Added the `$aSectionsets` parameter. |
102 | + * @param string $sCapability |
|
102 | 103 | * @return array |
103 | 104 | */ |
104 | 105 | private function _getFieldsetsFormatted( array $aFieldsets, array $aSectionsets, $sCapability ) { |
@@ -278,6 +279,7 @@ discard block |
||
278 | 279 | * |
279 | 280 | * @since 3.0.0 |
280 | 281 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition`. Changed the name from `formatField()`. |
282 | + * @param integer $iCountOfElements |
|
281 | 283 | * @return array|void An array of formatted field definition array. If required keys are not set, nothing will be returned. |
282 | 284 | */ |
283 | 285 | private function _getFieldsetFormatted( $aFieldset, $aSectionsets, $sCapability, $iCountOfElements, $iSubSectionIndex, $bIsSectionRepeatable, $oCallerObject ) { |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | ); |
114 | 114 | |
115 | 115 | $_aNewFieldsets = array(); |
116 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
116 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
117 | 117 | |
118 | 118 | // If the section is not set, skip. |
119 | - if ( ! isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
119 | + if ( !isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
120 | 120 | continue; |
121 | 121 | } |
122 | 122 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $_aItems, |
126 | 126 | $this->getElement( // 3.6.0+ Get the section's capability |
127 | 127 | $aSectionsets, |
128 | - array( $_sSectionPath, 'capability', ), |
|
128 | + array( $_sSectionPath, 'capability',), |
|
129 | 129 | $sCapability |
130 | 130 | ), |
131 | 131 | $aSectionsets |
@@ -182,16 +182,16 @@ discard block |
||
182 | 182 | */ |
183 | 183 | private function _getNormalFieldsetsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
184 | 184 | |
185 | - $_aNewItems = array(); |
|
186 | - foreach( $aItems as $_sFieldID => $_aFieldset ) { |
|
185 | + $_aNewItems = array(); |
|
186 | + foreach ( $aItems as $_sFieldID => $_aFieldset ) { |
|
187 | 187 | |
188 | 188 | // Insert the formatted field definition array. The fields count is needed to set each order value. |
189 | - $_aFieldset = $this->_getFieldsetFormatted( |
|
189 | + $_aFieldset = $this->_getFieldsetFormatted( |
|
190 | 190 | $_aFieldset, |
191 | 191 | $aSectionsets, |
192 | 192 | $sCapability, |
193 | 193 | count( $_aNewItems ), // index of elements - zero based |
194 | - null, // sub-section index |
|
194 | + null, // sub-section index |
|
195 | 195 | $_abSectionRepeatable, |
196 | 196 | $this->oCallerForm |
197 | 197 | ); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @return boolean |
211 | 211 | */ |
212 | 212 | private function _isSubSections( $aItems, $_abSectionRepeatable ) { |
213 | - if ( ! empty( $_abSectionRepeatable ) ) { |
|
213 | + if ( !empty( $_abSectionRepeatable ) ) { |
|
214 | 214 | return true; |
215 | 215 | } |
216 | 216 | return ( boolean ) count( $this->getIntegerKeyElements( $aItems ) ); |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | private function _getSubSectionsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
222 | 222 | |
223 | 223 | $_aNewFieldset = array(); |
224 | - foreach( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
224 | + foreach ( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
225 | 225 | |
226 | - foreach( $_aFieldsets as $_aFieldset ) { |
|
226 | + foreach ( $_aFieldsets as $_aFieldset ) { |
|
227 | 227 | $_iCountElement = count( $this->getElementAsArray( $_aNewFieldset, $_iSubSectionIndex ) ); |
228 | 228 | $_aFieldset = $this->_getFieldsetFormatted( |
229 | 229 | $_aFieldset, |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if ( empty( $_aFieldset ) ) { |
238 | 238 | continue; |
239 | 239 | } |
240 | - $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset['field_id'] ] = $_aFieldset; |
|
240 | + $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
|
241 | 241 | } |
242 | 242 | uasort( $_aNewFieldset[ $_iSubSectionIndex ], array( $this, 'sortArrayByKey' ) ); |
243 | 243 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } |
265 | 265 | |
266 | 266 | $_aSortedFields = array(); |
267 | - foreach( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
267 | + foreach ( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
268 | 268 | if ( isset( $aFieldsets[ $_sSectionPath ] ) ) { |
269 | 269 | $_aSortedFields[ $_sSectionPath ] = $aFieldsets[ $_sSectionPath ]; |
270 | 270 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | private function _getFieldsetFormatted( $aFieldset, $aSectionsets, $sCapability, $iCountOfElements, $iSubSectionIndex, $bIsSectionRepeatable, $oCallerObject ) { |
284 | 284 | |
285 | 285 | // 3.8.0+ Dropped the check for $aFieldset[ 'type' ] to allow it to be omitted. |
286 | - if ( ! isset( $aFieldset[ 'field_id' ] ) ) { |
|
286 | + if ( !isset( $aFieldset[ 'field_id' ] ) ) { |
|
287 | 287 | return; |
288 | 288 | } |
289 | 289 |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * Represents the structure of the sub-field definition array. |
25 | 25 | */ |
26 | 26 | static public $aStructure = array( |
27 | - '_is_sub_field' => false, // @todo change this key name as all the parsed field is technically a sub-field. |
|
28 | - '_index' => 0, // indicates the field index |
|
27 | + '_is_sub_field' => false, // @todo change this key name as all the parsed field is technically a sub-field. |
|
28 | + '_index' => 0, // indicates the field index |
|
29 | 29 | '_is_multiple_fields' => false, |
30 | 30 | '_saved_value' => null, |
31 | 31 | '_is_value_set_by_user' => false, |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | '_fields_container_id' => '', |
40 | 40 | '_fieldset_container_id' => '', |
41 | 41 | |
42 | - '_field_object' => null, // 3.6.0+ |
|
43 | - '_parent_field_object' => null, // 3.6.0+ Stores the parent field object to be accessed from the nested fields to generate id and name attribute models. |
|
42 | + '_field_object' => null, // 3.6.0+ |
|
43 | + '_parent_field_object' => null, // 3.6.0+ Stores the parent field object to be accessed from the nested fields to generate id and name attribute models. |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $_aField = $this->aField + self::$aStructure; |
89 | 89 | |
90 | - $_aField[ '_is_sub_field' ] = is_numeric( $this->isIndex ) && 0 < $this->isIndex; // 3.5.3+ |
|
90 | + $_aField[ '_is_sub_field' ] = is_numeric( $this->isIndex ) && 0 < $this->isIndex; // 3.5.3+ |
|
91 | 91 | $_aField[ '_index' ] = $this->isIndex; |
92 | 92 | |
93 | 93 | // 'input_id' - something like ({section id}_){field_id}__{index} e.g. my_section_id_my_field_id__0 |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | 'value' => $_aField[ 'value' ], |
135 | 135 | 'type' => $_aField[ 'type' ], // text, password, etc. |
136 | 136 | 'disabled' => null, |
137 | - 'data-id_model' => $_aField[ '_input_id_model' ], // 3.3.1+ |
|
138 | - 'data-name_model' => $_aField[ '_input_name_model' ], // 3.3.1+ |
|
137 | + 'data-id_model' => $_aField[ '_input_id_model' ], // 3.3.1+ |
|
138 | + 'data-name_model' => $_aField[ '_input_name_model' ], // 3.3.1+ |
|
139 | 139 | ) |
140 | 140 | ), |
141 | 141 | // this allows sub-fields with different field types to set the default key-values for the sub-field. |
@@ -33,23 +33,23 @@ discard block |
||
33 | 33 | * @internal |
34 | 34 | */ |
35 | 35 | static public $aStructure = array( |
36 | - '_section_index' => null, // 3.0.0+ - internally set to indicate the section index for repeatable sections. |
|
36 | + '_section_index' => null, // 3.0.0+ - internally set to indicate the section index for repeatable sections. |
|
37 | 37 | |
38 | 38 | 'tag_id' => null, |
39 | - '_tag_id_model' => '', // 3.6.0+ |
|
39 | + '_tag_id_model' => '', // 3.6.0+ |
|
40 | 40 | |
41 | - '_field_name' => '', // 3.6.0+ |
|
42 | - '_field_name_model' => '', // 3.6.0+ |
|
41 | + '_field_name' => '', // 3.6.0+ |
|
42 | + '_field_name_model' => '', // 3.6.0+ |
|
43 | 43 | |
44 | - '_field_name_flat' => '', // 3.6.0+ |
|
45 | - '_field_name_flat_model' => '', // 3.6.0+ |
|
44 | + '_field_name_flat' => '', // 3.6.0+ |
|
45 | + '_field_name_flat_model' => '', // 3.6.0+ |
|
46 | 46 | |
47 | - '_field_address' => '', // 3.6.0+ |
|
48 | - '_field_address_model' => '', // 3.6.0+ |
|
47 | + '_field_address' => '', // 3.6.0+ |
|
48 | + '_field_address_model' => '', // 3.6.0+ |
|
49 | 49 | |
50 | - '_parent_field_object' => null, // 3.6.0+ Assigned when a field creates a nested field. |
|
50 | + '_parent_field_object' => null, // 3.6.0+ Assigned when a field creates a nested field. |
|
51 | 51 | |
52 | - '_parent_tag_id' => null, // 3.8.0+ Set outside the class. |
|
52 | + '_parent_tag_id' => null, // 3.8.0+ Set outside the class. |
|
53 | 53 | |
54 | 54 | ); |
55 | 55 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $_aFieldset = $this->aFieldset + self::$aStructure; |
93 | 93 | |
94 | 94 | // The section index must be set before generating a field tag id as it uses a section index. |
95 | - $_aFieldset[ '_section_index' ] = $this->iSectionIndex; |
|
95 | + $_aFieldset[ '_section_index' ] = $this->iSectionIndex; |
|
96 | 96 | $_oFieldTagIDGenerator = new AdminPageFramework_Form_View___Generate_FieldTagID( |
97 | 97 | $_aFieldset, |
98 | 98 | $_aFieldset[ '_caller_object' ]->aCallbacks[ 'hfTagID' ] |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | // 3.8.0+ Format nested fieldsets. |
128 | 128 | if ( $this->hasFieldDefinitionsInContent( $_aFieldset ) ) { |
129 | - foreach( $_aFieldset[ 'content' ] as &$_aNestedFieldset ) { |
|
129 | + foreach ( $_aFieldset[ 'content' ] as &$_aNestedFieldset ) { |
|
130 | 130 | // The inline-mixed type has a string element. |
131 | 131 | if ( is_scalar( $_aNestedFieldset ) ) { |
132 | 132 | continue; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public $sNotice = ''; |
47 | 47 | public $aAttributes = array(); |
48 | 48 | public $aCallbacks = array( |
49 | - 'should_show' => null, // determines whether the admin notice should be displayed. |
|
49 | + 'should_show' => null, // determines whether the admin notice should be displayed. |
|
50 | 50 | ); |
51 | 51 | /**#@-*/ |
52 | 52 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * </ul> |
63 | 63 | * @since 3.5.0 |
64 | 64 | */ |
65 | - public function __construct( $sNotice, array $aAttributes=array( 'class' => 'error' ), array $aCallbacks=array() ) { |
|
65 | + public function __construct( $sNotice, array $aAttributes = array( 'class' => 'error' ), array $aCallbacks = array() ) { |
|
66 | 66 | |
67 | 67 | $this->aAttributes = $aAttributes + array( |
68 | 68 | 'class' => 'error', // 'updated' etc. |
@@ -70,17 +70,17 @@ discard block |
||
70 | 70 | $this->aAttributes[ 'class' ] = $this->getClassAttribute( |
71 | 71 | $this->aAttributes[ 'class' ], |
72 | 72 | 'admin-page-framework-settings-notice-message', |
73 | - 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
73 | + 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
74 | 74 | 'notice', |
75 | 75 | 'is-dismissible' // 3.5.12+ |
76 | 76 | ); |
77 | - $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
77 | + $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
78 | 78 | |
79 | 79 | // Load resources. |
80 | 80 | new AdminPageFramework_AdminNotice___Script; |
81 | 81 | |
82 | 82 | // An empty value may be set in oreder only to laode the fade-in script. |
83 | - if ( ! $sNotice ) { |
|
83 | + if ( !$sNotice ) { |
|
84 | 84 | return; |
85 | 85 | } |
86 | 86 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function _replyToDisplayAdminNotice() { |
110 | 110 | |
111 | - if ( ! $this->_shouldProceed() ) { |
|
111 | + if ( !$this->_shouldProceed() ) { |
|
112 | 112 | return; |
113 | 113 | } |
114 | 114 | |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | 'display: none' |
120 | 120 | ); |
121 | 121 | |
122 | - echo "<div " . $this->getAttributes( $_aAttributes ) . ">" |
|
122 | + echo "<div ".$this->getAttributes( $_aAttributes ).">" |
|
123 | 123 | . "<p>" |
124 | 124 | . self::$_aNotices[ $this->sNotice ] |
125 | 125 | . "</p>" |
126 | 126 | . "</div>" |
127 | 127 | // Insert the same message except it is not hidden. |
128 | 128 | . "<noscript>" |
129 | - . "<div " . $this->getAttributes( $this->aAttributes ) . ">" |
|
129 | + . "<div ".$this->getAttributes( $this->aAttributes ).">" |
|
130 | 130 | . "<p>" |
131 | 131 | . self::$_aNotices[ $this->sNotice ] |
132 | 132 | . "</p>" |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | private function _shouldProceed() { |
146 | 146 | |
147 | - if ( ! is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
147 | + if ( !is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
148 | 148 | return true; |
149 | 149 | } |
150 | 150 | return call_user_func_array( |