@@ -77,6 +77,8 @@ |
||
77 | 77 | } |
78 | 78 | /** |
79 | 79 | * @since 3.6.0 |
80 | + * @param boolean $abCollapsible |
|
81 | + * @param string $sTitle |
|
80 | 82 | * @return array |
81 | 83 | */ |
82 | 84 | private function _getArguments( $abCollapsible, $sTitle, array $aSection ) { |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
24 | 24 | */ |
25 | 25 | static public $aStructure = array( |
26 | - 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
27 | - 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
28 | - 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
29 | - 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
30 | - 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
31 | - 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
26 | + 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
27 | + 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
28 | + 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
29 | + 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
30 | + 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
31 | + 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
32 | 32 | ); |
33 | 33 | |
34 | 34 | public $abCollapsible = false; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @remark The framework will not pass this parameter when formatting a section definition array. |
42 | 42 | * It will be passed when the framework is rendering a form table to generate collapsible elements. |
43 | 43 | */ |
44 | - public $aSection = array(); |
|
44 | + public $aSection = array(); |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Sets up properties. |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | |
85 | 85 | $_aCollapsible = $this->getAsArray( $this->abCollapsible ) + array( |
86 | 86 | 'title' => $sTitle, |
87 | - ) + self::$aStructure; |
|
87 | + ) + self::$aStructure; |
|
88 | 88 | |
89 | 89 | $_aCollapsible[ 'toggle_all_button' ] = implode( |
90 | 90 | ',', |
91 | 91 | $this->getAsArray( $_aCollapsible[ 'toggle_all_button' ] ) |
92 | 92 | ); |
93 | 93 | |
94 | - if ( ! empty( $aSection ) ) { |
|
94 | + if ( !empty( $aSection ) ) { |
|
95 | 95 | $_aCollapsible[ 'toggle_all_button' ] = $this->_getToggleAllButtonArgument( |
96 | 96 | $_aCollapsible[ 'toggle_all_button' ], |
97 | 97 | $aSection |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | private function _getToggleAllButtonArgument( $sToggleAll, array $aSection ) { |
117 | 117 | |
118 | - if ( ! $aSection[ 'repeatable' ] ) { |
|
118 | + if ( !$aSection[ 'repeatable' ] ) { |
|
119 | 119 | return $sToggleAll; |
120 | 120 | } |
121 | 121 | |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | // Disable the toggle all button for middle sub-sections in repeatable sections. |
128 | - if ( ! $aSection[ '_is_first_index' ] && ! $aSection[ '_is_last_index' ] ) { |
|
128 | + if ( !$aSection[ '_is_first_index' ] && !$aSection[ '_is_last_index' ] ) { |
|
129 | 129 | return 0; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $_aToggleAll = $this->getAOrB( |
133 | - true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
134 | - array( 'top-right', 'bottom-right' ), // if true |
|
133 | + true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
134 | + array( 'top-right', 'bottom-right' ), // if true |
|
135 | 135 | explode( ',', $sToggleAll ) // if false |
136 | 136 | ); |
137 | 137 | $_aToggleAll = $this->getAOrB( |
@@ -114,7 +114,7 @@ |
||
114 | 114 | */ |
115 | 115 | private function _getToggleAllButtonArgument( $sToggleAll, array $aSection ) { |
116 | 116 | |
117 | - if ( ! $aSection[ 'repeatable' ] ) { |
|
117 | + if ( ! $aSection[ 'repeatable' ] ) { |
|
118 | 118 | return $sToggleAll; |
119 | 119 | } |
120 | 120 |
@@ -98,6 +98,7 @@ discard block |
||
98 | 98 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition`. Changed the name from `formatFields()`. |
99 | 99 | * Added the `$aSectionsets` parameter. |
100 | 100 | * @retuen array |
101 | + * @param string $sCapability |
|
101 | 102 | */ |
102 | 103 | private function _getFieldsetsFormatted( array $aFieldsets, array $aSectionsets, $sCapability ) { |
103 | 104 | |
@@ -271,6 +272,7 @@ discard block |
||
271 | 272 | * |
272 | 273 | * @since 3.0.0 |
273 | 274 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition`. Changed the name from `formatField()`. |
275 | + * @param integer $iCountOfElements |
|
274 | 276 | * @return array|void An array of formatted field definition array. If required keys are not set, nothing will be returned. |
275 | 277 | */ |
276 | 278 | private function _getFieldsetFormatted( $aFieldset, $aSectionsets, $sCapability, $iCountOfElements, $iSubSectionIndex, $bIsSectionRepeatable, $oCallerObject ) { |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | private function _getFieldsetsFormatted( array $aFieldsets, array $aSectionsets, $sCapability ) { |
105 | 105 | |
106 | 106 | $_aNewFieldsets = array(); |
107 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
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 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $_aItems, |
117 | 117 | $this->getElement( // 3.6.0+ Get the section's capability |
118 | 118 | $aSectionsets, |
119 | - array( $_sSectionPath, 'capability', ), |
|
119 | + array( $_sSectionPath, 'capability',), |
|
120 | 120 | $sCapability |
121 | 121 | ), |
122 | 122 | $aSectionsets |
@@ -176,16 +176,16 @@ discard block |
||
176 | 176 | */ |
177 | 177 | private function _getNormalFieldsetsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
178 | 178 | |
179 | - $_aNewItems = array(); |
|
180 | - foreach( $aItems as $_sFieldID => $_aFieldset ) { |
|
179 | + $_aNewItems = array(); |
|
180 | + foreach ( $aItems as $_sFieldID => $_aFieldset ) { |
|
181 | 181 | |
182 | 182 | // Insert the formatted field definition array. The fields count is needed to set each order value. |
183 | - $_aFieldset = $this->_getFieldsetFormatted( |
|
183 | + $_aFieldset = $this->_getFieldsetFormatted( |
|
184 | 184 | $_aFieldset, |
185 | 185 | $aSectionsets, |
186 | 186 | $sCapability, |
187 | 187 | count( $_aNewItems ), // index of elements - zero based |
188 | - null, // sub-section index |
|
188 | + null, // sub-section index |
|
189 | 189 | $_abSectionRepeatable, |
190 | 190 | $this->oCallerForm |
191 | 191 | ); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @return boolean |
205 | 205 | */ |
206 | 206 | private function _isSubSections( $aItems, $_abSectionRepeatable ) { |
207 | - if ( ! empty( $_abSectionRepeatable ) ) { |
|
207 | + if ( !empty( $_abSectionRepeatable ) ) { |
|
208 | 208 | return true; |
209 | 209 | } |
210 | 210 | return ( boolean ) count( $this->getIntegerKeyElements( $aItems ) ); |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | private function _getSubSectionsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
216 | 216 | |
217 | 217 | $_aNewFieldset = array(); |
218 | - foreach( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
218 | + foreach ( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
219 | 219 | |
220 | - foreach( $_aFieldsets as $_aFieldset ) { |
|
220 | + foreach ( $_aFieldsets as $_aFieldset ) { |
|
221 | 221 | $_iCountElement = count( $this->getElementAsArray( $_aNewFieldset, $_iSubSectionIndex ) ); |
222 | 222 | $_aFieldset = $this->_getFieldsetFormatted( |
223 | 223 | $_aFieldset, |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | if ( empty( $_aFieldset ) ) { |
232 | 232 | continue; |
233 | 233 | } |
234 | - $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset['field_id'] ] = $_aFieldset; |
|
234 | + $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
|
235 | 235 | } |
236 | 236 | uasort( $_aNewFieldset[ $_iSubSectionIndex ], array( $this, 'sortArrayByKey' ) ); |
237 | 237 | |
@@ -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 |
@@ -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 |
@@ -30,7 +30,6 @@ |
||
30 | 30 | * Returns the field container attribute array. |
31 | 31 | * |
32 | 32 | * @remark Formatting each sub-field should be performed prior to callign this method. |
33 | - * @param array $aField The (sub-)field definition array. This should have been formatted already. |
|
34 | 33 | * @return array The generated field container attribute array. |
35 | 34 | * @internal |
36 | 35 | * @since 3.5.3 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @since 3.6.0 |
27 | 27 | */ |
28 | - public $sContext = 'field'; |
|
28 | + public $sContext = 'field'; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Returns the field container attribute array. |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | protected function _getAttributes() { |
42 | 42 | |
43 | 43 | // 3.8.0+ Supports omitting the `type` argument. |
44 | - $_sFieldTypeSelector = $this->getAOrB( |
|
44 | + $_sFieldTypeSelector = $this->getAOrB( |
|
45 | 45 | $this->aArguments[ 'type' ], |
46 | 46 | " admin-page-framework-field-{$this->aArguments[ 'type' ]}", |
47 | 47 | '' |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | return array( |
68 | 68 | 'id' => $this->aArguments[ '_field_container_id' ], |
69 | - 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
69 | + 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
70 | 70 | 'class' => "admin-page-framework-field{$_sFieldTypeSelector}{$_sNestedFieldSelector}{$_sMixedFieldSelector}{$_sChildFieldSelector}" |
71 | 71 | . $this->getAOrB( |
72 | 72 | $this->aArguments[ 'attributes' ][ 'disabled' ], |
@@ -60,6 +60,7 @@ |
||
60 | 60 | * |
61 | 61 | * @since 3.1.0 |
62 | 62 | * @since DEVVER Moved from `AdminPageFramework_Form_View___Fieldset`. |
63 | + * @param string $sHeadingMessage |
|
63 | 64 | * @return string The error string message. An empty value if not found. |
64 | 65 | */ |
65 | 66 | private function _getFieldError( $aErrors, $aSectionPath, $aFieldPath, $sHeadingMessage ) { |
@@ -65,7 +65,7 @@ |
||
65 | 65 | private function _getFieldError( $aErrors, $aSectionPath, $aFieldPath, $sHeadingMessage ) { |
66 | 66 | |
67 | 67 | // If this field has a section and the error element is set |
68 | - $_aErrorPath = array_merge( $aSectionPath, $aFieldPath ); |
|
68 | + $_aErrorPath = array_merge( $aSectionPath, $aFieldPath ); |
|
69 | 69 | if ( $this->_hasFieldError( $aErrors, $_aErrorPath ) ) { |
70 | 70 | return "<span class='field-error'>* " |
71 | 71 | . $sHeadingMessage |
@@ -23,7 +23,6 @@ |
||
23 | 23 | * @internal |
24 | 24 | * @since 3.5.3 |
25 | 25 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
26 | - * @param array $aFieldset a field definition array. |
|
27 | 26 | * @return boolean |
28 | 27 | */ |
29 | 28 | protected function _isSectionSet() { |
@@ -60,6 +60,7 @@ |
||
60 | 60 | /** |
61 | 61 | * Applies the subject string to the set callback filter function. |
62 | 62 | * @since 3.6.0 |
63 | + * @param string $sSubject |
|
63 | 64 | */ |
64 | 65 | protected function _getFiltered( $sSubject ) { |
65 | 66 | return is_callable( $this->hfCallback ) |
@@ -51,9 +51,9 @@ |
||
51 | 51 | $_sIndex = $this->getAOrB( |
52 | 52 | '0' !== $this->sIndex && empty( $this->sIndex ), |
53 | 53 | '', |
54 | - "[" . $this->sIndex . "]" |
|
54 | + "[".$this->sIndex."]" |
|
55 | 55 | ); |
56 | - return $this->_getFiltered( $this->_getFieldName() . $_sIndex ); |
|
56 | + return $this->_getFiltered( $this->_getFieldName().$_sIndex ); |
|
57 | 57 | |
58 | 58 | } |
59 | 59 |
@@ -51,6 +51,7 @@ |
||
51 | 51 | /** |
52 | 52 | * Applies the subject string to the set callback filter function. |
53 | 53 | * @since 3.6.0 |
54 | + * @param string $sSubject |
|
54 | 55 | */ |
55 | 56 | protected function _getFiltered( $sSubject ) { |
56 | 57 | return is_callable( $this->hfCallback ) |
@@ -93,8 +93,8 @@ |
||
93 | 93 | |
94 | 94 | // Extract the first part as it does not have braces |
95 | 95 | $_sName = array_shift( $aParts ); |
96 | - foreach( $aParts as $_sPart ) { |
|
97 | - $_sName .= '[' . $_sPart . ']'; |
|
96 | + foreach ( $aParts as $_sPart ) { |
|
97 | + $_sName .= '['.$_sPart.']'; |
|
98 | 98 | } |
99 | 99 | return $_sName; |
100 | 100 |
@@ -121,6 +121,8 @@ |
||
121 | 121 | } |
122 | 122 | /** |
123 | 123 | * @since DEVVER |
124 | + * @param string $sKey |
|
125 | + * @param string $sValue |
|
124 | 126 | * @return void |
125 | 127 | */ |
126 | 128 | public function addResource( $sKey, $sValue ) { |
@@ -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 |
@@ -391,7 +391,6 @@ discard block |
||
391 | 391 | * |
392 | 392 | * @since DEVVER |
393 | 393 | * @param array $aSavedData |
394 | - * @param boolean $bOnlyFieldsets Whether to format only the fieldsets. The taxonomy field factory uses this parameter. |
|
395 | 394 | */ |
396 | 395 | protected function _formatElementDefinitions( array $aSavedData ) { |
397 | 396 | |
@@ -427,7 +426,6 @@ discard block |
||
427 | 426 | * Changed the name from `_getFieldErrors()`. |
428 | 427 | * @access public The field type class accesses this method to render nested fields. |
429 | 428 | * @internal |
430 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
431 | 429 | * @return array |
432 | 430 | */ |
433 | 431 | public function getFieldErrors() { |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | * @since 3.7.0 |
44 | 44 | * @return array |
45 | 45 | */ |
46 | - public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure=true, $bStripSlashes=true ) { |
|
46 | + public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure = true, $bStripSlashes = true ) { |
|
47 | 47 | |
48 | 48 | // Extracts the form data from the subject data for parsing |
49 | - $_aSubmittedFormData = $bExtractFromFieldStructure |
|
49 | + $_aSubmittedFormData = $bExtractFromFieldStructure |
|
50 | 50 | ? $this->castArrayContents( |
51 | 51 | $this->getDataStructureFromAddedFieldsets(), // form data (options) structure |
52 | 52 | $aDataToParse // the subject data array, usually $_POST. |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | : $aDataToParse; |
55 | 55 | |
56 | 56 | // 3.6.0 - sorts dynamic eleemnts. |
57 | - $_aSubmittedFormData = $this->getSortedInputs( $_aSubmittedFormData ); |
|
57 | + $_aSubmittedFormData = $this->getSortedInputs( $_aSubmittedFormData ); |
|
58 | 58 | |
59 | 59 | return $bStripSlashes |
60 | 60 | ? stripslashes_deep( $_aSubmittedFormData ) // fixes magic quotes |
@@ -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 | ) |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | * Changed the name from `getFieldsModel()`. |
148 | 148 | * @return array |
149 | 149 | */ |
150 | - public function getDataStructureFromAddedFieldsets() { |
|
150 | + public function getDataStructureFromAddedFieldsets() { |
|
151 | 151 | |
152 | - $_aFormDataStructure = array(); |
|
152 | + $_aFormDataStructure = array(); |
|
153 | 153 | foreach ( $this->getAsArray( $this->aFieldsets ) as $_sSectionID => $_aFieldsets ) { |
154 | 154 | |
155 | 155 | if ( $_sSectionID != '_default' ) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | // For default field items. |
161 | - foreach( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
161 | + foreach ( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
162 | 162 | $_aFormDataStructure[ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
163 | 163 | } |
164 | 164 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $aSubject, |
191 | 191 | $this->getElementAsArray( |
192 | 192 | $_POST, |
193 | - '__repeatable_elements_' . $this->aArguments[ 'structure_type' ] |
|
193 | + '__repeatable_elements_'.$this->aArguments[ 'structure_type' ] |
|
194 | 194 | ) |
195 | 195 | ); |
196 | 196 | return $_oFilterRepeatableElements->get(); |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | public function _replyToRegisterFormItems() { |
204 | 204 | |
205 | 205 | // Check if the form should be created or not. |
206 | - if ( ! $this->isInThePage() ) { |
|
206 | + if ( !$this->isInThePage() ) { |
|
207 | 207 | return; |
208 | 208 | } |
209 | 209 | |
210 | 210 | // Load field type definitions. |
211 | - $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
212 | - $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
211 | + $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
212 | + $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
213 | 213 | |
214 | 214 | // Set the options array |
215 | 215 | $this->aSavedData = $this->_getSavedData( |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $this->aArguments, |
238 | 238 | $this->aFieldsets, |
239 | 239 | self::$_aResources, |
240 | - $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
240 | + $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
241 | 241 | $this->aCallbacks |
242 | 242 | ); |
243 | 243 | self::$_aResources = $_oFieldResources->get(); // updates the property |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | $this->callBack( |
255 | 255 | $this->aCallbacks[ 'handle_form_data' ], |
256 | 256 | array( |
257 | - $this->aSavedData, // 1st parameter |
|
258 | - $this->aArguments, // 2nd parameter |
|
259 | - $this->aSectionsets, // 3rd parameter |
|
260 | - $this->aFieldsets, // 4th parameter |
|
257 | + $this->aSavedData, // 1st parameter |
|
258 | + $this->aArguments, // 2nd parameter |
|
259 | + $this->aSectionsets, // 3rd parameter |
|
260 | + $this->aFieldsets, // 4th parameter |
|
261 | 261 | ) |
262 | 262 | ); |
263 | 263 | |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | $this->aSectionsets = $this->callBack( |
272 | 272 | $this->aCallbacks[ 'secitonsets_before_registration' ], |
273 | 273 | array( |
274 | - $this->aSectionsets, // 1st parameter |
|
274 | + $this->aSectionsets, // 1st parameter |
|
275 | 275 | ) |
276 | 276 | ); |
277 | 277 | // Let the main routine modify the fieldsets definition array. |
278 | 278 | $this->aFieldsets = $this->callBack( |
279 | 279 | $this->aCallbacks[ 'fieldsets_before_registration' ], |
280 | 280 | array( |
281 | - $this->aFieldsets, // 1st parameter |
|
282 | - $this->aSectionsets, // 2nd parameter |
|
281 | + $this->aFieldsets, // 1st parameter |
|
282 | + $this->aSectionsets, // 2nd parameter |
|
283 | 283 | ) |
284 | 284 | ); |
285 | 285 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | array( $this, '_replyToRegisterFormItems' ), |
30 | 30 | 100 // priority - low value is set as meta boxes use the `current_screen` action hook for `setUp()`. |
31 | 31 | ); |
32 | - } else { |
|
32 | + } else { |
|
33 | 33 | add_action( |
34 | 34 | $this->aArguments[ 'action_hook_form_registration' ], |
35 | 35 | array( $this, '_replyToRegisterFormItems' ) |
@@ -147,12 +147,12 @@ discard block |
||
147 | 147 | * Changed the name from `getFieldsModel()`. |
148 | 148 | * @return array |
149 | 149 | */ |
150 | - public function getDataStructureFromAddedFieldsets() { |
|
150 | + public function getDataStructureFromAddedFieldsets() { |
|
151 | 151 | |
152 | 152 | $_aFormDataStructure = array(); |
153 | 153 | foreach ( $this->getAsArray( $this->aFieldsets ) as $_sSectionID => $_aFieldsets ) { |
154 | 154 | |
155 | - if ( $_sSectionID != '_default' ) { |
|
155 | + if ( $_sSectionID != '_default' ) { |
|
156 | 156 | $_aFormDataStructure[ $_sSectionID ] = $_aFieldsets; |
157 | 157 | continue; |
158 | 158 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * @param array $aSubject The subject array to modify. Usually the saved option data. |
186 | 186 | * @return array The modified options array. |
187 | 187 | */ |
188 | - public function dropRepeatableElements( array $aSubject ) { |
|
188 | + public function dropRepeatableElements( array $aSubject ) { |
|
189 | 189 | $_oFilterRepeatableElements = new AdminPageFramework_Form_Model___Modifier_FilterRepeatableElements( |
190 | 190 | $aSubject, |
191 | 191 | $this->getElementAsArray( |