@@ -96,7 +96,7 @@ |
||
96 | 96 | // $aSubFields gets updated in the method |
97 | 97 | $this->_fillRepeatableElements( $aField, $aSubFields, $mSavedValue ); |
98 | 98 | |
99 | - // $aSubFields gets updated in the method |
|
99 | + // $aSubFields gets updated in the method |
|
100 | 100 | $this->_fillSubFields( $aSubFields, $aFirstField ); |
101 | 101 | |
102 | 102 | // Put them together |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function get() { |
54 | 54 | |
55 | 55 | // Get the set value(s) |
56 | - $_mSavedValue = $this->_getStoredInputFieldValue( |
|
56 | + $_mSavedValue = $this->_getStoredInputFieldValue( |
|
57 | 57 | $this->aField, |
58 | 58 | $this->aOptions |
59 | 59 | ); |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | * @return void |
114 | 114 | */ |
115 | 115 | private function _divideMainAndSubFields( array $aField, array &$aFirstField, array &$aSubFields ) { |
116 | - foreach( $aField as $_nsIndex => $_mFieldElement ) { |
|
116 | + foreach ( $aField as $_nsIndex => $_mFieldElement ) { |
|
117 | 117 | if ( is_numeric( $_nsIndex ) ) { |
118 | - $aSubFields[] = $_mFieldElement; |
|
118 | + $aSubFields[ ] = $_mFieldElement; |
|
119 | 119 | } else { |
120 | 120 | $aFirstField[ $_nsIndex ] = $_mFieldElement; |
121 | 121 | } |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | * @return void |
134 | 134 | */ |
135 | 135 | private function _fillRepeatableElements( array $aField, array &$aSubFields, $mSavedValue ) { |
136 | - if ( ! $aField[ 'repeatable' ] ) { |
|
136 | + if ( !$aField[ 'repeatable' ] ) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | $_aSavedValues = ( array ) $mSavedValue; |
140 | 140 | unset( $_aSavedValues[ 0 ] ); |
141 | - foreach( $_aSavedValues as $_iIndex => $vValue ) { |
|
141 | + foreach ( $_aSavedValues as $_iIndex => $vValue ) { |
|
142 | 142 | $aSubFields[ $_iIndex - 1 ] = isset( $aSubFields[ $_iIndex - 1 ] ) && is_array( $aSubFields[ $_iIndex - 1 ] ) |
143 | 143 | ? $aSubFields[ $_iIndex - 1 ] |
144 | 144 | : array(); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | private function _fillSubFields( array &$aSubFields, array $aFirstField ) { |
155 | 155 | |
156 | - foreach( $aSubFields as &$_aSubField ) { |
|
156 | + foreach ( $aSubFields as &$_aSubField ) { |
|
157 | 157 | |
158 | 158 | // Evacuate the label element which should not be merged. |
159 | 159 | $_aLabel = $this->getElement( |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | |
182 | 182 | // Determine whether the elements are saved in an array. |
183 | 183 | $_bHasSubFields = count( $aFields ) > 1 || $aField[ 'repeatable' ] || $aField[ 'sortable' ]; |
184 | - if ( ! $_bHasSubFields ) { |
|
184 | + if ( !$_bHasSubFields ) { |
|
185 | 185 | $aFields[ 0 ][ '_saved_value' ] = $mSavedValue; |
186 | 186 | $aFields[ 0 ][ '_is_multiple_fields' ] = false; |
187 | 187 | return; |
188 | 188 | } |
189 | 189 | |
190 | - foreach( $aFields as $_iIndex => &$_aThisField ) { |
|
190 | + foreach ( $aFields as $_iIndex => &$_aThisField ) { |
|
191 | 191 | $_aThisField[ '_saved_value' ] = $this->getElement( $mSavedValue, $_iIndex, null ); |
192 | 192 | $_aThisField[ '_is_multiple_fields' ] = true; |
193 | 193 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @since 3.6.0 Moved from `AdminPageFramework_FieldDefinition`. |
202 | 202 | */ |
203 | 203 | private function _setFieldsValue( array &$aFields ) { |
204 | - foreach( $aFields as &$_aField ) { |
|
204 | + foreach ( $aFields as &$_aField ) { |
|
205 | 205 | $_aField[ '_is_value_set_by_user' ] = isset( $_aField[ 'value' ] ); |
206 | 206 | $_aField[ 'value' ] = $this->_getSetFieldValue( $_aField ); |
207 | 207 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | private function _getStoredInputFieldValue( $aField, $aOptions ) { |
243 | 243 | |
244 | 244 | // If a section is not set, check the first dimension element. |
245 | - if ( ! isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) { |
|
245 | + if ( !isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) { |
|
246 | 246 | return $this->getElement( |
247 | 247 | $aOptions, |
248 | 248 | $aField[ 'field_id' ], |
@@ -239,7 +239,7 @@ |
||
239 | 239 | * @since 3.6.0 Moved from `AdminPageFramework_FieldDefinition`. |
240 | 240 | * @since DEVVER Changed the `_field_type` element to `_structure_type`. |
241 | 241 | */ |
242 | - private function _getStoredInputFieldValue( $aField, $aOptions ) { |
|
242 | + private function _getStoredInputFieldValue( $aField, $aOptions ) { |
|
243 | 243 | |
244 | 244 | // If a section is not set, check the first dimension element. |
245 | 245 | if ( ! isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) { |
@@ -29,36 +29,36 @@ discard block |
||
29 | 29 | static public $aStructure = array( |
30 | 30 | |
31 | 31 | // Required Keys |
32 | - 'field_id' => null, // (string) |
|
33 | - 'type' => null, // (string) |
|
34 | - 'section_id' => null, // (string) |
|
32 | + 'field_id' => null, // (string) |
|
33 | + 'type' => null, // (string) |
|
34 | + 'section_id' => null, // (string) |
|
35 | 35 | |
36 | 36 | // Optional Keys |
37 | - 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | - 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | - 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | - 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | - 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
37 | + 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | + 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | + 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | + 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | + 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
42 | 42 | 'capability' => null, |
43 | 43 | 'title' => null, |
44 | 44 | 'tip' => null, |
45 | 45 | 'description' => null, |
46 | - 'error_message' => null, // error message for the field |
|
46 | + 'error_message' => null, // error message for the field |
|
47 | 47 | 'before_label' => null, |
48 | 48 | 'after_label' => null, |
49 | 49 | 'if' => true, |
50 | - 'order' => null, // do not set the default number here for this key. |
|
50 | + 'order' => null, // do not set the default number here for this key. |
|
51 | 51 | 'default' => null, |
52 | 52 | 'value' => null, |
53 | - 'help' => null, // 2.1.0+ |
|
54 | - 'help_aside' => null, // 2.1.0+ |
|
55 | - 'repeatable' => null, // 2.1.3+ |
|
56 | - 'sortable' => null, // 2.1.3+ |
|
57 | - 'show_title_column' => true, // 3.0.0+ |
|
58 | - 'hidden' => null, // 3.0.0+ |
|
53 | + 'help' => null, // 2.1.0+ |
|
54 | + 'help_aside' => null, // 2.1.0+ |
|
55 | + 'repeatable' => null, // 2.1.3+ |
|
56 | + 'sortable' => null, // 2.1.3+ |
|
57 | + 'show_title_column' => true, // 3.0.0+ |
|
58 | + 'hidden' => null, // 3.0.0+ |
|
59 | 59 | |
60 | 60 | // @todo Examine why an array is not set but null here for the attributes argument. |
61 | - 'attributes' => null, // 3.0.0+ - the array represents the attributes of input tag |
|
61 | + 'attributes' => null, // 3.0.0+ - the array represents the attributes of input tag |
|
62 | 62 | 'class' => array( // 3.3.1+ |
63 | 63 | 'fieldrow' => array(), |
64 | 64 | 'fieldset' => array(), |
@@ -66,21 +66,21 @@ discard block |
||
66 | 66 | 'field' => array(), |
67 | 67 | ), |
68 | 68 | |
69 | - 'save' => true, // 3.6.0+ |
|
70 | - 'content' => null, // 3.6.1+ - (string) An overriding field-set output. |
|
69 | + 'save' => true, // 3.6.0+ |
|
70 | + 'content' => null, // 3.6.1+ - (string) An overriding field-set output. |
|
71 | 71 | |
72 | 72 | // Internal Keys |
73 | - '_fields_type' => null, // @deprecated 3.7.0++, 3.0.0+ - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
74 | - '_structure_type' => null, // DEVVEr+ |
|
75 | - '_caller_object' => null, // 3.4.0+ - (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
73 | + '_fields_type' => null, // @deprecated 3.7.0++, 3.0.0+ - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
74 | + '_structure_type' => null, // DEVVEr+ |
|
75 | + '_caller_object' => null, // 3.4.0+ - (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
76 | 76 | |
77 | - '_section_path' => '', // 3.7.0+ (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
78 | - '_section_path_array' => '', // 3.7.0+ (array) An array version of the above section path. |
|
79 | - '_nested_depth' => 0, // 3.4.0+ - (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
80 | - '_subsection_index' => null, // 3.7.0+ Passed to the `field_definition_{...}` filter hook callbacks. |
|
77 | + '_section_path' => '', // 3.7.0+ (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
78 | + '_section_path_array' => '', // 3.7.0+ (array) An array version of the above section path. |
|
79 | + '_nested_depth' => 0, // 3.4.0+ - (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
80 | + '_subsection_index' => null, // 3.7.0+ Passed to the `field_definition_{...}` filter hook callbacks. |
|
81 | 81 | |
82 | - '_field_path' => '', // 3.7.0+ (string Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
83 | - '_field_path_array' => '', // 3.7.0+ (array) An array version of the above field path. |
|
82 | + '_field_path' => '', // 3.7.0+ (string Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
83 | + '_field_path_array' => '', // 3.7.0+ (array) An array version of the above field path. |
|
84 | 84 | |
85 | 85 | ); |
86 | 86 | |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | array( |
158 | 158 | '_fields_type' => $this->sStructureType, // @deprecated 3.7.0 backward-compatibility |
159 | 159 | '_structure_type' => $this->sStructureType, |
160 | - '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller framework factory object. |
|
161 | - '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
160 | + '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller framework factory object. |
|
161 | + '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
162 | 162 | ) |
163 | 163 | + $this->aFieldset, |
164 | 164 | array( |
@@ -177,9 +177,9 @@ discard block |
||
177 | 177 | // @todo when nested fields are supported, set an appropriate value here. |
178 | 178 | $_aFieldset[ '_field_path' ] = $this->getFormElementPath( $_aFieldset[ 'field_id' ] ); |
179 | 179 | $_aFieldset[ '_field_path_array' ] = explode( '|', $_aFieldset[ '_field_path' ] ); |
180 | -$_aFieldset[ '_nested_depth' ] = count( $_aFieldset[ '_field_path_array' ] ) - 1 ; |
|
180 | +$_aFieldset[ '_nested_depth' ] = count( $_aFieldset[ '_field_path_array' ] ) - 1; |
|
181 | 181 | |
182 | - $_aFieldset[ 'order' ] = $this->getAOrB( |
|
182 | + $_aFieldset[ 'order' ] = $this->getAOrB( |
|
183 | 183 | is_numeric( $_aFieldset[ 'order' ] ), |
184 | 184 | $_aFieldset[ 'order' ], |
185 | 185 | $this->iCountOfElements + 10 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | class AdminPageFramework_Form_Model___FormatSectionsets extends AdminPageFramework_Form_Base { |
18 | 18 | |
19 | 19 | public $sStructureType = ''; |
20 | - public $aSectionsets = array(); |
|
20 | + public $aSectionsets = array(); |
|
21 | 21 | public $sCapability = ''; |
22 | 22 | public $aCallbacks = array( |
23 | 23 | 'sectionset_before_output' => null |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | $_aSectionsets = $this->_getSectionsetsFormatted( |
65 | - array(), // sectionsets array to modify - new formatted items will be stored here |
|
66 | - $this->aSectionsets, // parsing sectionsets |
|
67 | - array(), // section path - empty for root |
|
65 | + array(), // sectionsets array to modify - new formatted items will be stored here |
|
66 | + $this->aSectionsets, // parsing sectionsets |
|
67 | + array(), // section path - empty for root |
|
68 | 68 | $this->sCapability // capability |
69 | 69 | ); |
70 | 70 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | */ |
82 | 82 | private function _getSectionsetsFormatted( $_aNewSectionsets, $aSectionsetsToParse, $aSectionPath, $sCapability ) { |
83 | 83 | |
84 | - foreach( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
|
84 | + foreach ( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
|
85 | 85 | |
86 | 86 | // The '_default' section can be empty so do not check `if ( empty( $_aSectionset ) )` here. |
87 | - if ( ! is_array( $_aSectionset ) ) { |
|
87 | + if ( !is_array( $_aSectionset ) ) { |
|
88 | 88 | continue; |
89 | 89 | } |
90 | 90 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | // DEVVER+ For nested sections |
113 | 113 | $_aNewSectionsets = $this->_getNestedSections( |
114 | - $_aNewSectionsets, // sectionset array to modify |
|
114 | + $_aNewSectionsets, // sectionset array to modify |
|
115 | 115 | $_aSectionset, |
116 | 116 | $_aSectionPath, // section path |
117 | 117 | $_aSectionset[ 'capability' ] |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | */ |
129 | 129 | private function _getNestedSections( $aSectionsetsToEdit, $aSectionset, $aSectionPath, $sCapability ) { |
130 | 130 | |
131 | - if ( ! $this->_hasNestedSections( $aSectionset ) ) { |
|
131 | + if ( !$this->_hasNestedSections( $aSectionset ) ) { |
|
132 | 132 | return $aSectionsetsToEdit; |
133 | 133 | } |
134 | 134 | |
135 | 135 | // Reccursive call |
136 | 136 | return $this->_getSectionsetsFormatted( |
137 | - $aSectionsetsToEdit, // sectionsets array to modify - new formatted items will be stored here |
|
138 | - $aSectionset[ 'content' ], // parsing sectionsets |
|
139 | - $aSectionPath, // section path - empty for root |
|
137 | + $aSectionsetsToEdit, // sectionsets array to modify - new formatted items will be stored here |
|
138 | + $aSectionset[ 'content' ], // parsing sectionsets |
|
139 | + $aSectionPath, // section path - empty for root |
|
140 | 140 | $sCapability // capability |
141 | 141 | ); |
142 | 142 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | private function _hasNestedSections( $aSectionset ) { |
150 | 150 | |
151 | 151 | $aSectionset = $aSectionset + array( 'content' => null ); |
152 | - if ( ! is_array( $aSectionset[ 'content' ] ) ) { |
|
152 | + if ( !is_array( $aSectionset[ 'content' ] ) ) { |
|
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | $_aContents = $aSectionset[ 'content' ]; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | foreach( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
85 | 85 | |
86 | 86 | // The '_default' section can be empty so do not check `if ( empty( $_aSectionset ) )` here. |
87 | - if ( ! is_array( $_aSectionset ) ) { |
|
87 | + if ( ! is_array( $_aSectionset ) ) { |
|
88 | 88 | continue; |
89 | 89 | } |
90 | 90 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $this->aCallbacks[ 'sectionset_before_output' ], |
104 | 104 | array( $_aSectionsetFormatter->get() ) |
105 | 105 | ); |
106 | - if ( empty( $_aSectionset ) ) { |
|
106 | + if ( empty( $_aSectionset ) ) { |
|
107 | 107 | continue; |
108 | 108 | } |
109 | 109 |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function get() { |
57 | 57 | |
58 | - $this->aResources[ 'inline_scripts' ] = $this->_getUpdatedInlineItemsByCallback( |
|
58 | + $this->aResources[ 'inline_scripts' ] = $this->_getUpdatedInlineItemsByCallback( |
|
59 | 59 | $this->aResources[ 'inline_scripts' ], |
60 | 60 | 'hfGetScripts' |
61 | 61 | ); |
62 | - $this->aResources[ 'inline_styles' ] = $this->_getUpdatedInlineItemsByCallback( |
|
62 | + $this->aResources[ 'inline_styles' ] = $this->_getUpdatedInlineItemsByCallback( |
|
63 | 63 | $this->aResources[ 'inline_styles' ], |
64 | 64 | 'hfGetStyles' |
65 | 65 | ); |
66 | - $this->aResources[ 'inline_styles_ie' ] = $this->_getUpdatedInlineItemsByCallback( |
|
66 | + $this->aResources[ 'inline_styles_ie' ] = $this->_getUpdatedInlineItemsByCallback( |
|
67 | 67 | $this->aResources[ 'inline_styles_ie' ], |
68 | 68 | 'hfGetIEStyles' |
69 | 69 | ); |
70 | - $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
70 | + $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
71 | 71 | $this->aResources[ 'src_styles' ], |
72 | 72 | 'aEnqueueStyles' |
73 | 73 | ); |
74 | - $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
74 | + $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
75 | 75 | $this->aResources[ 'src_scripts' ], |
76 | 76 | 'aEnqueueScripts' |
77 | 77 | ); |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | */ |
85 | 85 | private function _getUpdatedInlineItemsByCallback( array $aSubject, $sKey ) { |
86 | 86 | $_oCallable = $this->getElement( $this->aFieldTypeDefinition, $sKey ); |
87 | - if ( ! is_callable( $_oCallable ) ) { |
|
87 | + if ( !is_callable( $_oCallable ) ) { |
|
88 | 88 | return $aSubject; |
89 | 89 | } |
90 | - $aSubject[] = call_user_func_array( |
|
90 | + $aSubject[ ] = call_user_func_array( |
|
91 | 91 | $_oCallable, |
92 | 92 | array() |
93 | 93 | ); |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | 'AdminPageFramework_Form_View___CSS_CollapsibleSection', |
90 | 90 | 'AdminPageFramework_Form_View___CSS_FieldError', |
91 | 91 | ); |
92 | - foreach( $_aClassNames as $_sClassName ) { |
|
92 | + foreach ( $_aClassNames as $_sClassName ) { |
|
93 | 93 | $_oCSS = new $_sClassName; |
94 | - $this->aResources[ 'inline_styles' ][] = $_oCSS->get(); |
|
94 | + $this->aResources[ 'inline_styles' ][ ] = $_oCSS->get(); |
|
95 | 95 | } |
96 | 96 | $_aClassNamesForIE = array( |
97 | 97 | 'AdminPageFramework_Form_View___CSS_CollapsibleSectionIE', |
98 | 98 | ); |
99 | - foreach( $_aClassNames as $_sClassName ) { |
|
99 | + foreach ( $_aClassNames as $_sClassName ) { |
|
100 | 100 | $_oCSS = new $_sClassName; |
101 | - $this->aResources[ 'inline_styles_ie' ][] = $_oCSS->get(); |
|
101 | + $this->aResources[ 'inline_styles_ie' ][ ] = $_oCSS->get(); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | } |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | |
119 | 119 | // Parse all added fieldsets and check associated resources. |
120 | 120 | // @todo Find a way to retrieve the section id for nested sections and fields. |
121 | - foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
|
121 | + foreach ( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
|
122 | 122 | |
123 | 123 | $_bIsSubSectionLoaded = false; |
124 | - foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
124 | + foreach ( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
125 | 125 | // @todo Examine if this structure is correct or not. |
126 | 126 | // It may not be necessary to check the sub-section dimensions as this is not the saved options array. |
127 | 127 | // if it's a sub-section |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | continue; |
133 | 133 | } |
134 | 134 | $_bIsSubSectionLoaded = true; |
135 | - foreach( $_aSubSectionOrField as $_aField ) { |
|
135 | + foreach ( $_aSubSectionOrField as $_aField ) { |
|
136 | 136 | $this->_setFieldResources( $_aField ); |
137 | 137 | } |
138 | 138 | continue; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | private function _setFieldResources( array $aFieldset ) { |
158 | 158 | |
159 | 159 | // Check the field conditions here. |
160 | - if ( ! $this->_isFieldsetAllowed( $aFieldset ) ) { |
|
160 | + if ( !$this->_isFieldsetAllowed( $aFieldset ) ) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $this->callBack( |
186 | 186 | $this->aCallbacks[ 'load_fieldset_resource' ], |
187 | 187 | array( |
188 | - $aFieldset, // 1st parameter |
|
188 | + $aFieldset, // 1st parameter |
|
189 | 189 | ) |
190 | 190 | ); |
191 | 191 | |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | * @return boolean |
219 | 219 | */ |
220 | 220 | private function _isAlreadyRegistered( $sFieldtype, $sStructureType ) { |
221 | - if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] ) ) { |
|
221 | + if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] ) ) { |
|
222 | 222 | return true; |
223 | 223 | } |
224 | - self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] = true; |
|
224 | + self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] = true; |
|
225 | 225 | return false; |
226 | 226 | } |
227 | 227 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | return $this->callBack( |
241 | 241 | $this->aCallbacks[ 'is_fieldset_registration_allowed' ], |
242 | 242 | array( |
243 | - true, // 1st parameter |
|
243 | + true, // 1st parameter |
|
244 | 244 | $aFieldset, // 2nd parameter |
245 | 245 | ) |
246 | 246 | ); |
@@ -121,14 +121,14 @@ |
||
121 | 121 | foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
122 | 122 | |
123 | 123 | $_bIsSubSectionLoaded = false; |
124 | - foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
124 | + foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
125 | 125 | // @todo Examine if this structure is correct or not. |
126 | 126 | // It may not be necessary to check the sub-section dimensions as this is not the saved options array. |
127 | 127 | // if it's a sub-section |
128 | 128 | if ( $this->isNumericInteger( $_iSubSectionIndexOrFieldID ) ) { |
129 | 129 | |
130 | 130 | // no need to repeat the same set of fields |
131 | - if ( $_bIsSubSectionLoaded ) { |
|
131 | + if ( $_bIsSubSectionLoaded ) { |
|
132 | 132 | continue; |
133 | 133 | } |
134 | 134 | $_bIsSubSectionLoaded = true; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | array( $this, '_replyToAddPostTypeQueryInEditPostLink' ), |
34 | 34 | 10, |
35 | 35 | 3 |
36 | - ); |
|
36 | + ); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @return array The formatted definition array. |
41 | 41 | */ |
42 | 42 | public function get() { |
43 | - foreach( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
43 | + foreach ( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
44 | 44 | $this->unsetDimensionalArrayElement( |
45 | 45 | $this->aSubject, |
46 | 46 | explode( '|', $_sFlatFieldAddress ) |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $this->aInput, |
30 | 30 | $this->aFieldAddresses, |
31 | 31 | ); |
32 | - $this->aInput = $_aParameters[ 0 ]; |
|
32 | + $this->aInput = $_aParameters[ 0 ]; |
|
33 | 33 | $this->aFieldAddresses = $_aParameters[ 1 ]; |
34 | 34 | |
35 | 35 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function get() { |
44 | 44 | |
45 | - foreach( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
45 | + foreach ( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
46 | 46 | |
47 | 47 | $_aDimensionalKeys = explode( '|', $_sFlatFieldAddress ); |
48 | 48 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | // If the retrieved value does not exist, null will be given. |
55 | 55 | // This occurs with page meta boxes. |
56 | - if ( ! is_array( $_aDynamicElements ) ) { |
|
56 | + if ( !is_array( $_aDynamicElements ) ) { |
|
57 | 57 | continue; |
58 | 58 | } |
59 | 59 |
@@ -109,7 +109,7 @@ |
||
109 | 109 | /** |
110 | 110 | * @deprecated |
111 | 111 | */ |
112 | - /* public function _get() { |
|
112 | + /* public function _get() { |
|
113 | 113 | |
114 | 114 | $_aDefaultOptions = array(); |
115 | 115 | foreach( $this->aFieldsets as $_sSectionID => $_aFieldsetsPerSection ) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Form_Model___DefaultValues extends AdminPageFramework_Form_Base { |
19 | 19 | |
20 | - public $aFieldsets = array(); |
|
20 | + public $aFieldsets = array(); |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets up hooks. |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $_aParameters = func_get_args() + array( |
29 | 29 | $this->aFieldsets, |
30 | 30 | ); |
31 | - $this->aFieldsets = $_aParameters[ 0 ]; |
|
31 | + $this->aFieldsets = $_aParameters[ 0 ]; |
|
32 | 32 | |
33 | 33 | } |
34 | 34 | |
@@ -86,13 +86,13 @@ discard block |
||
86 | 86 | */ |
87 | 87 | private function _getDefaultValues( $aFieldsets, $aDefaultOptions ) { |
88 | 88 | |
89 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
89 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
90 | 90 | |
91 | 91 | $_aSectionPath = explode( '|', $_sSectionPath ); |
92 | - foreach( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
92 | + foreach ( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
93 | 93 | $_aFieldPath = explode( '|', $_sFieldPath ); |
94 | 94 | $this->setMultiDimensionalArray( |
95 | - $aDefaultOptions, // by reference |
|
95 | + $aDefaultOptions, // by reference |
|
96 | 96 | '_default' === $_sSectionPath |
97 | 97 | ? array( $_sFieldPath ) |
98 | 98 | : array_merge( $_aSectionPath, $_aFieldPath ), // key address |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | // If there are no sub-fields |
149 | 149 | if ( count( $_aSubFields ) == 0 ) { |
150 | 150 | return $this->getElement( |
151 | - $aFieldset, // subject |
|
152 | - 'value', // key |
|
151 | + $aFieldset, // subject |
|
152 | + 'value', // key |
|
153 | 153 | $this->getElement( // default value |
154 | - $aFieldset, // subject |
|
155 | - 'default', // key |
|
154 | + $aFieldset, // subject |
|
155 | + 'default', // key |
|
156 | 156 | null // default value |
157 | 157 | ) |
158 | 158 | ); |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | // Otherwise, there are sub-fields |
162 | 162 | $_aDefault = array(); |
163 | 163 | array_unshift( $_aSubFields, $aFieldset ); // insert the main field into the very first index. |
164 | - foreach( $_aSubFields as $_iIndex => $_aField ) { |
|
164 | + foreach ( $_aSubFields as $_iIndex => $_aField ) { |
|
165 | 165 | $_aDefault[ $_iIndex ] = $this->getElement( |
166 | - $_aField, // subject |
|
167 | - 'value', // key |
|
166 | + $_aField, // subject |
|
167 | + 'value', // key |
|
168 | 168 | $this->getElement( // default value |
169 | - $_aField, // subject |
|
170 | - 'default', // key |
|
169 | + $_aField, // subject |
|
170 | + 'default', // key |
|
171 | 171 | null // default value |
172 | 172 | ) |
173 | 173 | ); |
@@ -60,18 +60,18 @@ discard block |
||
60 | 60 | |
61 | 61 | // Drop keys of fields-array which do not exist in the sections-array. |
62 | 62 | // For this reasons, the sections-array should be conditioned first before applying this method. |
63 | - $aFields = $this->castArrayContents( $aSections, $aFields ); |
|
63 | + $aFields = $this->castArrayContents( $aSections, $aFields ); |
|
64 | 64 | |
65 | 65 | $_aNewFields = array(); |
66 | - foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) { |
|
66 | + foreach ( $aFields as $_sSectionID => $_aSubSectionOrFields ) { |
|
67 | 67 | |
68 | 68 | // This type check is important as the parsing field array is content-cast, which can set null value to elements. |
69 | - if ( ! is_array( $_aSubSectionOrFields ) ) { |
|
69 | + if ( !is_array( $_aSubSectionOrFields ) ) { |
|
70 | 70 | continue; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $this->_setConditionedFields( |
74 | - $_aNewFields, // by reference - gets updated in the method. |
|
74 | + $_aNewFields, // by reference - gets updated in the method. |
|
75 | 75 | $_aSubSectionOrFields, |
76 | 76 | $_sSectionID |
77 | 77 | ); |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private function _setConditionedFields( array &$_aNewFields, $_aSubSectionOrFields, $_sSectionID ) { |
93 | 93 | |
94 | - foreach( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) { |
|
94 | + foreach ( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) { |
|
95 | 95 | |
96 | 96 | // If it is a sub-section array. |
97 | 97 | if ( $this->isNumericInteger( $_sIndexOrFieldID ) ) { |
98 | 98 | $_sSubSectionIndex = $_sIndexOrFieldID; |
99 | 99 | $_aFields = $_aSubSectionOrField; |
100 | - foreach( $_aFields as $_aField ) { |
|
101 | - if ( ! $this->_isAllowed( $_aField ) ) { |
|
100 | + foreach ( $_aFields as $_aField ) { |
|
101 | + if ( !$this->_isAllowed( $_aField ) ) { |
|
102 | 102 | continue; |
103 | 103 | } |
104 | 104 | $_aNewFields[ $_sSectionID ][ $_sSubSectionIndex ][ $_aField[ 'field_id' ] ] = $_aField; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | // Otherwise, insert the formatted field definition array. |
111 | 111 | $_aField = $_aSubSectionOrField; |
112 | - if ( ! $this->_isAllowed( $_aField ) ) { |
|
112 | + if ( !$this->_isAllowed( $_aField ) ) { |
|
113 | 113 | continue; |
114 | 114 | } |
115 | 115 | $_aNewFields[ $_sSectionID ][ $_aField[ 'field_id' ] ] = $_aField; |
@@ -66,7 +66,7 @@ |
||
66 | 66 | foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) { |
67 | 67 | |
68 | 68 | // This type check is important as the parsing field array is content-cast, which can set null value to elements. |
69 | - if ( ! is_array( $_aSubSectionOrFields ) ) { |
|
69 | + if ( ! is_array( $_aSubSectionOrFields ) ) { |
|
70 | 70 | continue; |
71 | 71 | } |
72 | 72 |