@@ -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 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | static public $aStructure = array( |
26 | 26 | '_is_sub_field' => false, // @todo change this key name as all the parsed field is technically a sub-field. |
27 | - '_index' => 0, // indicates the field index |
|
27 | + '_index' => 0, // indicates the field index |
|
28 | 28 | '_is_multiple_fields' => false, |
29 | 29 | '_saved_value' => null, |
30 | 30 | '_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 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $_aField = $this->aField + self::$aStructure; |
85 | 85 | |
86 | - $_aField[ '_is_sub_field' ] = is_numeric( $this->isIndex ) && 0 < $this->isIndex; // 3.5.3+ |
|
86 | + $_aField[ '_is_sub_field' ] = is_numeric( $this->isIndex ) && 0 < $this->isIndex; // 3.5.3+ |
|
87 | 87 | $_aField[ '_index' ] = $this->isIndex; |
88 | 88 | |
89 | 89 | // 'input_id' - something like ({section id}_){field_id}_{index} e.g. my_section_id_my_field_id_0 |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | // ); |
128 | 128 | |
129 | 129 | // used in the attribute below plus it is also used in the sample custom field type. |
130 | - $_aField[ '_field_container_id' ] = "field-{$_aField[ 'input_id' ]}"; |
|
130 | + $_aField[ '_field_container_id' ] = "field-{$_aField[ 'input_id' ]}"; |
|
131 | 131 | |
132 | 132 | // @todo for issue #158 https://github.com/michaeluno/admin-page-framework/issues/158 |
133 | 133 | // These models are for generating ids and names dynamically. |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | 'value' => $_aField[ 'value' ], |
166 | 166 | 'type' => $_aField[ 'type' ], // text, password, etc. |
167 | 167 | 'disabled' => null, |
168 | - 'data-id_model' => $_aField[ '_input_id_model' ], // 3.3.1+ |
|
169 | - 'data-name_model' => $_aField[ '_input_name_model' ], // 3.3.1+ |
|
168 | + 'data-id_model' => $_aField[ '_input_id_model' ], // 3.3.1+ |
|
169 | + 'data-name_model' => $_aField[ '_input_name_model' ], // 3.3.1+ |
|
170 | 170 | ) |
171 | 171 | ), |
172 | 172 | // this allows sub-fields with different field types to set the default key-values for the sub-field. |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * Stores the section definition. |
45 | 45 | */ |
46 | - public $aSection = array(); |
|
46 | + public $aSection = array(); |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Indicates the sub section index. |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | |
92 | 92 | $_aSection[ '_is_collapsible' ] = $_aSection[ 'collapsible' ] && 'section' === $_aSection[ 'collapsible' ][ 'container' ]; |
93 | 93 | |
94 | - $_aSection[ '_tag_id' ] = 'section-' . $_aSection[ 'section_id' ] . '__' . $this->iIndex; |
|
95 | - $_aSection[ '_tag_id_model' ] = 'section-' . $_aSection[ 'section_id' ] . '__' . '___i___'; |
|
94 | + $_aSection[ '_tag_id' ] = 'section-'.$_aSection[ 'section_id' ].'__'.$this->iIndex; |
|
95 | + $_aSection[ '_tag_id_model' ] = 'section-'.$_aSection[ 'section_id' ].'__'.'___i___'; |
|
96 | 96 | |
97 | 97 | return $_aSection; |
98 | 98 |
@@ -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' ] ) { |
@@ -32,21 +32,21 @@ discard block |
||
32 | 32 | * @internal |
33 | 33 | */ |
34 | 34 | static public $aStructure = array( |
35 | - '_section_index' => null, // 3.0.0+ - internally set to indicate the section index for repeatable sections. |
|
35 | + '_section_index' => null, // 3.0.0+ - internally set to indicate the section index for repeatable sections. |
|
36 | 36 | |
37 | 37 | 'tag_id' => null, |
38 | - '_tag_id_model' => '', // 3.6.0+ |
|
38 | + '_tag_id_model' => '', // 3.6.0+ |
|
39 | 39 | |
40 | - '_field_name' => '', // 3.6.0+ |
|
41 | - '_field_name_model' => '', // 3.6.0+ |
|
40 | + '_field_name' => '', // 3.6.0+ |
|
41 | + '_field_name_model' => '', // 3.6.0+ |
|
42 | 42 | |
43 | - '_field_name_flat' => '', // 3.6.0+ |
|
44 | - '_field_name_flat_model' => '', // 3.6.0+ |
|
43 | + '_field_name_flat' => '', // 3.6.0+ |
|
44 | + '_field_name_flat_model' => '', // 3.6.0+ |
|
45 | 45 | |
46 | - '_field_address' => '', // 3.6.0+ |
|
47 | - '_field_address_model' => '', // 3.6.0+ |
|
46 | + '_field_address' => '', // 3.6.0+ |
|
47 | + '_field_address_model' => '', // 3.6.0+ |
|
48 | 48 | |
49 | - '_parent_field_object' => null, // 3.6.0+ Assigned when a field creates a nested field. |
|
49 | + '_parent_field_object' => null, // 3.6.0+ Assigned when a field creates a nested field. |
|
50 | 50 | |
51 | 51 | ); |
52 | 52 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $_aFieldset = $this->aFieldset + self::$aStructure; |
90 | 90 | |
91 | 91 | // The section index must be set before generating a field tag id as it uses a section index. |
92 | - $_aFieldset[ '_section_index' ] = $this->iSectionIndex; |
|
92 | + $_aFieldset[ '_section_index' ] = $this->iSectionIndex; |
|
93 | 93 | |
94 | 94 | $_oFieldTagIDGenerator = new AdminPageFramework_Form_View___Generate_FieldTagID( |
95 | 95 | $_aFieldset, |
@@ -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 ) |
@@ -33,7 +33,7 @@ |
||
33 | 33 | array( $this, '_replyToAddPostTypeQueryInEditPostLink' ), |
34 | 34 | 10, |
35 | 35 | 3 |
36 | - ); |
|
36 | + ); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -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 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class AdminPageFramework_Form_View___DebugInfo extends AdminPageFramework_WPUtility { |
20 | 20 | |
21 | - public $sStructureType = ''; |
|
21 | + public $sStructureType = ''; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Stores the message object. |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function get() { |
51 | 51 | |
52 | - if ( ! $this->isDebugModeEnabled() ) { |
|
52 | + if ( !$this->isDebugModeEnabled() ) { |
|
53 | 53 | return ''; |
54 | 54 | } |
55 | 55 | |
56 | 56 | // For the generic admin pages, do no show debug information for each section. |
57 | - if ( ! in_array( $this->sStructureType, array( 'widget', 'post_meta_box', 'page_meta_box', 'user_meta' ) ) ) { |
|
57 | + if ( !in_array( $this->sStructureType, array( 'widget', 'post_meta_box', 'page_meta_box', 'user_meta' ) ) ) { |
|
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 | |
61 | 61 | return "<div class='admin-page-framework-info'>" |
62 | - . $this->oMsg->get( 'debug_info' ) . ': ' |
|
63 | - . AdminPageFramework_Registry::NAME . ' ' . AdminPageFramework_Registry::getVersion() |
|
62 | + . $this->oMsg->get( 'debug_info' ).': ' |
|
63 | + . AdminPageFramework_Registry::NAME.' '.AdminPageFramework_Registry::getVersion() |
|
64 | 64 | . "</div>"; |
65 | 65 | |
66 | 66 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @since DEVVER Renamed from `AdminPageFramework_FormPart_DebugInfo`. |
17 | 17 | * @internal |
18 | 18 | */ |
19 | -class AdminPageFramework_Form_View___DebugInfo extends AdminPageFramework_WPUtility { |
|
19 | +class AdminPageFramework_Form_View___DebugInfo extends AdminPageFramework_WPUtility { |
|
20 | 20 | |
21 | 21 | public $sStructureType = ''; |
22 | 22 |
@@ -50,8 +50,8 @@ |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | $_aOutput = array(); |
53 | - foreach( $this->aDescriptions as $_sDescription ) { |
|
54 | - $_aOutput[] = "<p class='" . esc_attr( $this->sClassAttribute ) . "'>" |
|
53 | + foreach ( $this->aDescriptions as $_sDescription ) { |
|
54 | + $_aOutput[ ] = "<p class='".esc_attr( $this->sClassAttribute )."'>" |
|
55 | 55 | . "<span class='description'>" |
56 | 56 | . $_sDescription |
57 | 57 | . "</span>" |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @since 3.6.0 |
16 | 16 | * @internal |
17 | 17 | */ |
18 | -class AdminPageFramework_Form_View___Description extends AdminPageFramework_WPUtility { |
|
18 | +class AdminPageFramework_Form_View___Description extends AdminPageFramework_WPUtility { |
|
19 | 19 | |
20 | 20 | public $aDescriptions = array(); |
21 | 21 |