@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Stores the default argument values. |
22 | 22 | */ |
23 | - public $aArguments = array( |
|
23 | + public $aArguments = array( |
|
24 | 24 | 'attributes' => array( |
25 | 25 | 'container' => array(), |
26 | 26 | 'title' => array(), |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | 'description' => array(), |
29 | 29 | 'icon' => array(), |
30 | 30 | ), |
31 | - 'icon' => null, // the icon output to override |
|
32 | - 'dash-icon' => 'dashicons-editor-help', // the dash-icon class selector for the icon |
|
33 | - 'icon_alt_text' => '[?]', // [3.8.5+] alternative text when icon is not available. For WP v3.7.x or below. |
|
31 | + 'icon' => null, // the icon output to override |
|
32 | + 'dash-icon' => 'dashicons-editor-help', // the dash-icon class selector for the icon |
|
33 | + 'icon_alt_text' => '[?]', // [3.8.5+] alternative text when icon is not available. For WP v3.7.x or below. |
|
34 | 34 | 'title' => null, |
35 | - 'content' => null, // will be assigned in the constructor |
|
36 | - 'width' => null, // [3.9.0] |
|
37 | - 'height' => null, // [3.9.0] |
|
35 | + 'content' => null, // will be assigned in the constructor |
|
36 | + 'width' => null, // [3.9.0] |
|
37 | + 'height' => null, // [3.9.0] |
|
38 | 38 | ); |
39 | 39 | |
40 | 40 | public $sTitleElementID; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if ( is_string( $asContent ) ) { |
91 | 91 | return true; |
92 | 92 | } |
93 | - if ( is_array( $asContent ) && ! $this->isAssociative( $asContent ) ) { |
|
93 | + if ( is_array( $asContent ) && !$this->isAssociative( $asContent ) ) { |
|
94 | 94 | return true; |
95 | 95 | } |
96 | 96 | return false; |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | * @return string The output. |
104 | 104 | */ |
105 | 105 | public function get() { |
106 | - if ( ! $this->aArguments[ 'content' ] ) { |
|
106 | + if ( !$this->aArguments[ 'content' ] ) { |
|
107 | 107 | return ''; |
108 | 108 | } |
109 | 109 | $_aAttributes = array( |
110 | 110 | 'data-width' => $this->getElement( $this->aArguments, array( 'width' ) ), |
111 | 111 | 'data-height' => $this->getElement( $this->aArguments, array( 'height' ) ), |
112 | 112 | ); |
113 | - return "<span " . $this->___getElementAttributes( 'container', array( 'admin-page-framework-form-tooltip', 'no-js' ), $_aAttributes ) . ">" |
|
113 | + return "<span ".$this->___getElementAttributes( 'container', array( 'admin-page-framework-form-tooltip', 'no-js' ), $_aAttributes ).">" |
|
114 | 114 | . $this->___getTipIcon() |
115 | - . "<span " . $this->___getElementAttributes( 'content', 'admin-page-framework-form-tooltip-content' ) . ">" |
|
115 | + . "<span ".$this->___getElementAttributes( 'content', 'admin-page-framework-form-tooltip-content' ).">" |
|
116 | 116 | . $this->___getTipTitle() |
117 | 117 | . $this->___getDescriptions() |
118 | 118 | . "</span>" |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $this->aArguments[ 'icon' ]; |
131 | 131 | } |
132 | 132 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
133 | - return "<span " . $this->___getElementAttributes( |
|
133 | + return "<span ".$this->___getElementAttributes( |
|
134 | 134 | 'icon', |
135 | 135 | array( |
136 | 136 | 'dashicons', |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | private function ___getTipTitle() { |
150 | 150 | if ( isset( $this->aArguments[ 'title' ] ) ) { |
151 | - return "<span " . $this->___getElementAttributes( 'title', 'admin-page-framework-form-tooltip-title' ) . ">" |
|
151 | + return "<span ".$this->___getElementAttributes( 'title', 'admin-page-framework-form-tooltip-title' ).">" |
|
152 | 152 | . $this->aArguments[ 'title' ] |
153 | 153 | . "</span>"; |
154 | 154 | } |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | */ |
161 | 161 | private function ___getDescriptions() { |
162 | 162 | if ( isset( $this->aArguments[ 'content' ] ) ) { |
163 | - return "<span " . $this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ) . ">" |
|
163 | + return "<span ".$this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ).">" |
|
164 | 164 | . implode( |
165 | - "</span><span " . $this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ) . ">", |
|
165 | + "</span><span ".$this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ).">", |
|
166 | 166 | $this->getAsArray( $this->aArguments[ 'content' ] ) |
167 | 167 | ) |
168 | 168 | . "</span>" |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | * @return string |
180 | 180 | * @since 3.8.5 |
181 | 181 | */ |
182 | - private function ___getElementAttributes( $sElementKey, $asClassSelectors, $aAdditional=array() ) { |
|
182 | + private function ___getElementAttributes( $sElementKey, $asClassSelectors, $aAdditional = array() ) { |
|
183 | 183 | $_aContainerAttributes = $this->getElementAsArray( |
184 | 184 | $this->aArguments, |
185 | 185 | array( 'attributes', $sElementKey ) |
186 | - ) + array( 'class' => '' ) ; |
|
186 | + ) + array( 'class' => '' ); |
|
187 | 187 | $_aContainerAttributes[ 'class' ] = $this->getClassAttribute( |
188 | 188 | $_aContainerAttributes[ 'class' ], |
189 | 189 | $asClassSelectors |
@@ -520,7 +520,7 @@ |
||
520 | 520 | return self::getAttributes( |
521 | 521 | array( |
522 | 522 | 'class' => 'repeatable-section-remove-button button-secondary ' |
523 | - . 'repeatable-section-button button button-large', |
|
523 | + . 'repeatable-section-button button button-large', |
|
524 | 524 | 'title' => $oMsg->get( 'remove_section' ), |
525 | 525 | 'style' => $iSectionCount <= 1 |
526 | 526 | ? 'display:none' |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | if ( empty( $asArguments ) ) { |
28 | 28 | return ''; |
29 | 29 | } |
30 | - if ( self::hasBeenCalled( 'repeatable_section_' . $sContainerTagID ) ) { |
|
30 | + if ( self::hasBeenCalled( 'repeatable_section_'.$sContainerTagID ) ) { |
|
31 | 31 | return ''; |
32 | 32 | } |
33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $_aArguments = $_oFormatter->get(); |
36 | 36 | $_aArguments[ 'id' ] = $sContainerTagID; |
37 | 37 | $_sButtons = self::___getRepeatableSectionButtons( $_aArguments, $oMsg, $sContainerTagID, $iSectionCount ); |
38 | - return "<div class='hidden repeatable-section-buttons-model' " . self::getDataAttributes( $_aArguments ) . ">" |
|
38 | + return "<div class='hidden repeatable-section-buttons-model' ".self::getDataAttributes( $_aArguments ).">" |
|
39 | 39 | . $_sButtons |
40 | 40 | . "</div>"; |
41 | 41 | |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | $_sIconAdd = "<span class='dashicons dashicons-plus-alt2'></span>"; |
53 | 53 | } |
54 | 54 | return "<div class='admin-page-framework-repeatable-section-buttons-outer-container'>" |
55 | - . "<div " . self::___getContainerAttributes( $_aArguments, $oMsg ) . ' >' |
|
56 | - . "<a " . self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ) . ">" |
|
55 | + . "<div ".self::___getContainerAttributes( $_aArguments, $oMsg ).' >' |
|
56 | + . "<a ".self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ).">" |
|
57 | 57 | . $_sIconRemove |
58 | 58 | . "</a>" |
59 | - . "<a " . self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ) . ">" |
|
59 | + . "<a ".self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ).">" |
|
60 | 60 | . $_sIconAdd |
61 | 61 | . "</a>" |
62 | 62 | . "</div>" |
63 | 63 | . "</div>" |
64 | 64 | . AdminPageFramework_Form_Utility::getModalForDisabledRepeatableElement( |
65 | - 'repeatable_section_disabled_' . $sContainerTagID, |
|
65 | + 'repeatable_section_disabled_'.$sContainerTagID, |
|
66 | 66 | $_aArguments[ 'disabled' ] |
67 | 67 | ); |
68 | 68 | } |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | empty( $aArguments[ 'disabled' ] ) ? '' : 'disabled' |
80 | 80 | ), |
81 | 81 | ); |
82 | - unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
82 | + unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
83 | 83 | // Needs to remove it if it is empty as its data attribute will be checked in the JavaScript script. |
84 | 84 | if ( empty( $aArguments[ 'disabled' ] ) ) { |
85 | 85 | unset( $aArguments[ 'disabled' ] ); |
86 | 86 | } |
87 | - return self::getAttributes( $_aAttributes ) . ' ' . self::getDataAttributes( $aArguments ); |
|
87 | + return self::getAttributes( $_aAttributes ).' '.self::getDataAttributes( $aArguments ); |
|
88 | 88 | } |
89 | 89 | /** |
90 | 90 | * @return string |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | . 'repeatable-section-button button button-large', |
116 | 116 | 'title' => $oMsg->get( 'add_section' ), |
117 | 117 | 'data-id' => $sContainerTagID, |
118 | - 'href' => ! empty( $aArguments[ 'disabled' ] ) |
|
119 | - ? '#TB_inline?width=' . $aArguments[ 'disabled' ][ 'box_width' ] |
|
120 | - . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ] |
|
121 | - . '&inlineId=' . 'repeatable_section_disabled_' . $sContainerTagID |
|
118 | + 'href' => !empty( $aArguments[ 'disabled' ] ) |
|
119 | + ? '#TB_inline?width='.$aArguments[ 'disabled' ][ 'box_width' ] |
|
120 | + . '&height='.$aArguments[ 'disabled' ][ 'box_height' ] |
|
121 | + . '&inlineId='.'repeatable_section_disabled_'.$sContainerTagID |
|
122 | 122 | : null, |
123 | 123 | ) |
124 | 124 | ); |
@@ -549,7 +549,7 @@ |
||
549 | 549 | * @return string The generated section tab list as HTML. |
550 | 550 | */ |
551 | 551 | private function ___getSectionTabList( $sSectionTabSlug, array $aSectionTabList ) { |
552 | - return $sSectionTabSlug |
|
552 | + return $sSectionTabSlug |
|
553 | 553 | ? "<ul class='admin-page-framework-section-tabs nav-tab-wrapper'>" |
554 | 554 | . implode( PHP_EOL, $aSectionTabList ) |
555 | 555 | . "</ul>" |
@@ -129,16 +129,16 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function get() { |
131 | 131 | |
132 | - $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
132 | + $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
133 | 133 | $this->aStructure[ 'sectionsets' ], |
134 | 134 | $this->aStructure[ 'fieldsets' ], |
135 | 135 | $this->aArguments[ 'nested_depth' ] |
136 | 136 | ); |
137 | 137 | |
138 | - $_aOutput = array(); |
|
139 | - foreach( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
138 | + $_aOutput = array(); |
|
139 | + foreach ( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
140 | 140 | |
141 | - $_aOutput[] = $this->___getFormOutput( |
|
141 | + $_aOutput[ ] = $this->___getFormOutput( |
|
142 | 142 | $_oFormatSectionsetsByTab->getSectionsets( $_sSectionTabSlug ), |
143 | 143 | $_oFormatSectionsetsByTab->getFieldsets( $_sSectionTabSlug ), |
144 | 144 | $_sSectionTabSlug, |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | // Generate id for this output |
157 | 157 | $_sOutput = implode( PHP_EOL, $_aOutput ); |
158 | - $_sElementID = "admin-page-framework-sectionsets-" . uniqid(); |
|
158 | + $_sElementID = "admin-page-framework-sectionsets-".uniqid(); |
|
159 | 159 | return $this->___getSpinnerOutput( $_sOutput ) |
160 | 160 | . "<div id='{$_sElementID}' class='admin-page-framework-sectionsets admin-page-framework-form-js-on'>" |
161 | 161 | . $_sOutput |
@@ -189,17 +189,17 @@ discard block |
||
189 | 189 | |
190 | 190 | // A sectionset is a set of sections. |
191 | 191 | $_sSectionSet = $this->___getSectionsetsTables( |
192 | - $aSectionsets, // section-set definition (already divided by section tab) |
|
193 | - $aFieldsets, // field-set definitions (already divided by section tab) |
|
192 | + $aSectionsets, // section-set definition (already divided by section tab) |
|
193 | + $aFieldsets, // field-set definitions (already divided by section tab) |
|
194 | 194 | $aCallbacks |
195 | 195 | ); |
196 | 196 | return $_sSectionSet |
197 | - ? "<div " . $this->getAttributes( |
|
197 | + ? "<div ".$this->getAttributes( |
|
198 | 198 | array( |
199 | 199 | 'class' => 'admin-page-framework-sectionset', |
200 | - 'id' => "sectionset-{$sSectionTabSlug}_" . md5( serialize( $aSectionsets ) ), |
|
200 | + 'id' => "sectionset-{$sSectionTabSlug}_".md5( serialize( $aSectionsets ) ), |
|
201 | 201 | ) |
202 | - ) . ">" |
|
202 | + ).">" |
|
203 | 203 | . $_sSectionSet |
204 | 204 | . "</div>" |
205 | 205 | : ''; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * If there is no field overall to the section and its section tab, return an empty string. |
232 | 232 | * Otherwise, the section-sets container gets rendered and its CSS rules such as margins give unwanted results. |
233 | 233 | */ |
234 | - if ( ! count( $aFieldsets ) ) { |
|
234 | + if ( !count( $aFieldsets ) ) { |
|
235 | 235 | return ''; |
236 | 236 | } |
237 | 237 | |
@@ -243,13 +243,13 @@ discard block |
||
243 | 243 | ); |
244 | 244 | $_sSectionTabSlug = $_aFirstSectionset[ 'section_tab_slug' ]; |
245 | 245 | $_sThisSectionID = $_aFirstSectionset[ 'section_id' ]; |
246 | - $_sSectionsID = 'sections-' . $_sThisSectionID; |
|
246 | + $_sSectionsID = 'sections-'.$_sThisSectionID; |
|
247 | 247 | $_aCollapsible = $this->___getCollapsibleArgumentForSections( |
248 | 248 | $_aFirstSectionset |
249 | 249 | ); |
250 | 250 | |
251 | - foreach( $aSectionsets as $_aSectionset ) { |
|
252 | - $_aOutputs = $this->___getSectionsetTable( |
|
251 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
252 | + $_aOutputs = $this->___getSectionsetTable( |
|
253 | 253 | $_aOutputs, |
254 | 254 | $_sSectionsID, |
255 | 255 | $_aSectionset, |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
278 | 278 | * @return array |
279 | 279 | */ |
280 | - private function ___getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
280 | + private function ___getCollapsibleArgumentForSections( array $aSectionset = array() ) { |
|
281 | 281 | |
282 | 282 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
283 | 283 | $aSectionset[ 'collapsible' ], |
@@ -305,19 +305,19 @@ discard block |
||
305 | 305 | */ |
306 | 306 | private function ___getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
307 | 307 | |
308 | - if ( ! $this->isSectionsetVisible( $_aSection ) ) { |
|
308 | + if ( !$this->isSectionsetVisible( $_aSection ) ) { |
|
309 | 309 | return $_aOutputs; |
310 | 310 | } |
311 | 311 | |
312 | 312 | // If the 'save' argument is false, insert a flag that disables saving the section inputs. |
313 | - $_aOutputs[ 'section_contents' ][] = $this->___getUnsetFlagSectionInputTag( $_aSection ); |
|
313 | + $_aOutputs[ 'section_contents' ][ ] = $this->___getUnsetFlagSectionInputTag( $_aSection ); |
|
314 | 314 | |
315 | 315 | // For repeatable sections - sub-sections are divided field definition arrays by sub-section index, |
316 | 316 | // not section definition arrays. |
317 | - $_aSubSections = $this->getIntegerKeyElements( |
|
317 | + $_aSubSections = $this->getIntegerKeyElements( |
|
318 | 318 | $this->getElementAsArray( |
319 | 319 | $aFieldsInSections, // subject array |
320 | - $_aSection[ '_section_path' ], // dimensional path |
|
320 | + $_aSection[ '_section_path' ], // dimensional path |
|
321 | 321 | array() // default |
322 | 322 | ) |
323 | 323 | ); |
@@ -359,29 +359,29 @@ discard block |
||
359 | 359 | private function ___getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
360 | 360 | |
361 | 361 | // Add the repeatable sections enabler script. |
362 | - if ( ! empty( $_aSection[ 'repeatable' ] ) ) { |
|
363 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___SectionRepeatableButtons::get( |
|
362 | + if ( !empty( $_aSection[ 'repeatable' ] ) ) { |
|
363 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___SectionRepeatableButtons::get( |
|
364 | 364 | $_sSectionsID, |
365 | 365 | $_aOutputs[ 'count_subsections' ], |
366 | 366 | $_aSection[ 'repeatable' ], |
367 | 367 | $this->oMsg |
368 | 368 | ); |
369 | - $_aOutputs[ 'section_contents' ][] = $this->___getRepeatableSectionFlagTag( $_aSection ); |
|
369 | + $_aOutputs[ 'section_contents' ][ ] = $this->___getRepeatableSectionFlagTag( $_aSection ); |
|
370 | 370 | } |
371 | 371 | // Add the sortable sections enabler script. 3.6.0+ |
372 | - if ( ! empty( $_aSection[ 'sortable' ] ) ) { |
|
372 | + if ( !empty( $_aSection[ 'sortable' ] ) ) { |
|
373 | 373 | // @deprecated 3.9.0 |
374 | 374 | // $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
375 | 375 | // $_sSectionsID, |
376 | 376 | // $_aSection[ 'sortable' ], |
377 | 377 | // $this->oMsg |
378 | 378 | // ); |
379 | - $_aOutputs[ 'section_contents' ][] = $this->___getSortableSectionFlagTag( $_aSection ); |
|
379 | + $_aOutputs[ 'section_contents' ][ ] = $this->___getSortableSectionFlagTag( $_aSection ); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | // Get the section tables. |
383 | 383 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
384 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
384 | + foreach ( $_aSubSections as $_iIndex => $_aFields ) { |
|
385 | 385 | |
386 | 386 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
387 | 387 | $_aSection, |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | array( |
412 | 412 | 'class' => 'element-address', |
413 | 413 | 'type' => 'hidden', |
414 | - 'name' => '__repeatable_elements_' . $aSection[ '_structure_type' ] |
|
415 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
414 | + 'name' => '__repeatable_elements_'.$aSection[ '_structure_type' ] |
|
415 | + . '['.$aSection[ 'section_id' ].']', |
|
416 | 416 | // @todo examine whether this value should include a section index. |
417 | 417 | 'value' => $aSection[ 'section_id' ], |
418 | 418 | ) |
@@ -430,8 +430,8 @@ discard block |
||
430 | 430 | array( |
431 | 431 | 'class' => 'element-address', |
432 | 432 | 'type' => 'hidden', |
433 | - 'name' => '__sortable_elements_' . $aSection[ '_structure_type' ] |
|
434 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
433 | + 'name' => '__sortable_elements_'.$aSection[ '_structure_type' ] |
|
434 | + . '['.$aSection[ 'section_id' ].']', |
|
435 | 435 | // @todo examine whether this value should include a section index. |
436 | 436 | 'value' => $aSection[ 'section_id' ], |
437 | 437 | ) |
@@ -453,8 +453,8 @@ discard block |
||
453 | 453 | 'input', |
454 | 454 | array( |
455 | 455 | 'type' => 'hidden', |
456 | - 'name' => '__unset_' . $aSection[ '_structure_type' ] . '[' . $aSection[ 'section_id' ] . ']', |
|
457 | - 'value' => "__dummy_option_key|" . $aSection[ 'section_id' ], |
|
456 | + 'name' => '__unset_'.$aSection[ '_structure_type' ].'['.$aSection[ 'section_id' ].']', |
|
457 | + 'value' => "__dummy_option_key|".$aSection[ 'section_id' ], |
|
458 | 458 | 'class' => 'unset-element-names element-address', |
459 | 459 | ) |
460 | 460 | ); |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | private function ___getSectionTableWithTabList( array $_aOutputs, array $aSectionset, $aFieldsetsPerSection ) { |
471 | 471 | |
472 | 472 | // Tab list |
473 | - $_aOutputs[ 'section_tab_list' ][] = $this->___getTabList( |
|
473 | + $_aOutputs[ 'section_tab_list' ][ ] = $this->___getTabList( |
|
474 | 474 | $aSectionset, |
475 | 475 | $aFieldsetsPerSection, |
476 | 476 | $this->aCallbacks[ 'fieldset_output' ] |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | |
479 | 479 | // Section container |
480 | 480 | $_oSectionTable = new AdminPageFramework_Form_View___Section( |
481 | - $this->aArguments, // for nested sections |
|
481 | + $this->aArguments, // for nested sections |
|
482 | 482 | $aSectionset, |
483 | 483 | $this->aStructure, |
484 | 484 | $aFieldsetsPerSection, |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $this->aCallbacks, |
489 | 489 | $this->oMsg |
490 | 490 | ); |
491 | - $_aOutputs[ 'section_contents' ][] = $_oSectionTable->get(); |
|
491 | + $_aOutputs[ 'section_contents' ][ ] = $_oSectionTable->get(); |
|
492 | 492 | |
493 | 493 | return $_aOutputs; |
494 | 494 | |
@@ -516,9 +516,9 @@ discard block |
||
516 | 516 | 'section_index' => null, |
517 | 517 | 'collapsible' => $aCollapsible, |
518 | 518 | 'container_type' => 'sections', // section or sections |
519 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
519 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
520 | 520 | ), |
521 | - array(), // fieldsets |
|
521 | + array(), // fieldsets |
|
522 | 522 | $this->aSavedData, |
523 | 523 | $this->aFieldErrors, |
524 | 524 | $this->aStructure[ 'field_type_definitions' ], |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $aOutputs[ 'count_subsections' ] |
536 | 536 | ); |
537 | 537 | return $_oCollapsibleSectionTitle->get() |
538 | - . "<div " . $_oSectionsTablesContainerAttributes->get() . ">" |
|
538 | + . "<div ".$_oSectionsTablesContainerAttributes->get().">" |
|
539 | 539 | . $this->___getSectionTabList( $sSectionTabSlug, $aOutputs[ 'section_tab_list' ] ) |
540 | 540 | . implode( PHP_EOL, $aOutputs[ 'section_contents' ] ) |
541 | 541 | . "</div>"; |
@@ -566,21 +566,21 @@ discard block |
||
566 | 566 | */ |
567 | 567 | private function ___getTabList( array $aSection, array $aFields, $hfFieldCallback ) { |
568 | 568 | |
569 | - if ( ! $aSection[ 'section_tab_slug' ] ) { |
|
569 | + if ( !$aSection[ 'section_tab_slug' ] ) { |
|
570 | 570 | return ''; |
571 | 571 | } |
572 | 572 | |
573 | 573 | $iSectionIndex = $aSection[ '_index' ]; |
574 | 574 | |
575 | - $_sSectionTagID = 'section-' . $aSection[ 'section_id' ] . '__' . $iSectionIndex; |
|
575 | + $_sSectionTagID = 'section-'.$aSection[ 'section_id' ].'__'.$iSectionIndex; |
|
576 | 576 | $_aTabAttributes = $aSection[ 'attributes' ][ 'tab' ] |
577 | 577 | + array( |
578 | 578 | 'class' => 'admin-page-framework-section-tab nav-tab', |
579 | 579 | 'id' => "section_tab-{$_sSectionTagID}", |
580 | 580 | 'style' => null |
581 | 581 | ); |
582 | - $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
583 | - $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
582 | + $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
583 | + $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
584 | 584 | |
585 | 585 | $_oSectionTitle = new AdminPageFramework_Form_View___SectionTitle( |
586 | 586 | array( |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | 'tag' => 'h4', |
589 | 589 | 'section_index' => $iSectionIndex, |
590 | 590 | |
591 | - 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
591 | + 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
592 | 592 | ), |
593 | 593 | $aFields, |
594 | 594 | $this->aSavedData, |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | $this->aCallbacks // field output element callables. |
599 | 599 | ); |
600 | 600 | |
601 | - return "<li " . $this->getAttributes( $_aTabAttributes ) . ">" |
|
601 | + return "<li ".$this->getAttributes( $_aTabAttributes ).">" |
|
602 | 602 | . "<a href='#{$_sSectionTagID}'>" |
603 | 603 | . $_oSectionTitle->get() |
604 | 604 | ."</a>" |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Form_View___CollapsibleSectionTitle extends AdminPageFramework_Form_View___SectionTitle { |
19 | 19 | |
20 | - public $aArguments = array( |
|
20 | + public $aArguments = array( |
|
21 | 21 | 'title' => null, |
22 | 22 | 'tag' => null, |
23 | 23 | 'section_index' => null, |
24 | 24 | 'collapsible' => array(), |
25 | 25 | 'container_type' => 'section', // section or sections |
26 | - 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
26 | + 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
27 | 27 | ); |
28 | - public $aFieldsets = array(); |
|
28 | + public $aFieldsets = array(); |
|
29 | 29 | public $aSavedData = array(); |
30 | 30 | public $aFieldErrors = array(); |
31 | 31 | public $aFieldTypeDefinitions = array(); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array|boolean $aCollapsible The collapsible argument. |
70 | 70 | * @param string $sContainer The position context. Accepts either 'sections' or 'section'. If the set position in the argument array does not match this value, the method will return an empty string. |
71 | 71 | */ |
72 | - private function ___getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', $iSectionIndex=null ) { |
|
72 | + private function ___getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer = 'sections', $iSectionIndex = null ) { |
|
73 | 73 | |
74 | 74 | if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
75 | 75 | return ''; |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | ); |
86 | 86 | |
87 | 87 | $_aSectionset = $this->aArguments[ 'sectionset' ]; |
88 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $iSectionIndex; |
|
88 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$iSectionIndex; |
|
89 | 89 | |
90 | - return "<div " . $this->getAttributes( |
|
90 | + return "<div ".$this->getAttributes( |
|
91 | 91 | array( |
92 | 92 | 'id' => $_sSectionTitleTagID, |
93 | 93 | 'class' => $this->getClassAttribute( |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | 'collapsed', |
109 | 109 | '' |
110 | 110 | ), |
111 | - 'admin-page-framework-collapsible-type-' . $aCollapsible[ 'type' ] |
|
111 | + 'admin-page-framework-collapsible-type-'.$aCollapsible[ 'type' ] |
|
112 | 112 | ), |
113 | 113 | ) |
114 | 114 | + $this->getDataAttributeArray( $aCollapsible ) |
115 | - ) . ">" |
|
115 | + ).">" |
|
116 | 116 | . $_sSectionTitle |
117 | 117 | . "</div>"; |
118 | 118 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $this->aFieldset[ '_field_path_array' ], |
38 | 38 | $this->aFieldset[ 'error_message' ] |
39 | 39 | ); |
40 | - $_aOutputs[] = $_oFieldError->get(); |
|
40 | + $_aOutputs[ ] = $_oFieldError->get(); |
|
41 | 41 | |
42 | 42 | // 2. Construct fields array for sub-fields. |
43 | 43 | $_oFieldsFormatter = new AdminPageFramework_Form_Model___Format_Fields( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $_aFields = $_oFieldsFormatter->get(); |
48 | 48 | |
49 | 49 | // 3. Get the field and its sub-fields output. |
50 | - $_aOutputs[] = $this->_getFieldsOutput( |
|
50 | + $_aOutputs[ ] = $this->_getFieldsOutput( |
|
51 | 51 | $this->aFieldset, |
52 | 52 | $_aFields, |
53 | 53 | $this->aCallbacks |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | * @since 3.8.0 Added the `$aFieldset` parameter |
71 | 71 | * @return string |
72 | 72 | */ |
73 | - private function _getFieldsOutput( $aFieldset, array $aFields, array $aCallbacks=array() ) { |
|
73 | + private function _getFieldsOutput( $aFieldset, array $aFields, array $aCallbacks = array() ) { |
|
74 | 74 | |
75 | 75 | $_aOutput = array(); |
76 | - foreach( $aFields as $_isIndex => $_aField ) { |
|
77 | - $_aOutput[] = $this->_getEachFieldOutput( |
|
76 | + foreach ( $aFields as $_isIndex => $_aField ) { |
|
77 | + $_aOutput[ ] = $this->_getEachFieldOutput( |
|
78 | 78 | $_aField, |
79 | 79 | $_isIndex, |
80 | 80 | $aCallbacks, |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | * @since 3.5.3 |
94 | 94 | * @return string the HTML output of the given field. |
95 | 95 | */ |
96 | - private function _getEachFieldOutput( $aField, $isIndex, array $aCallbacks, $bIsLastElement=false ) { |
|
96 | + private function _getEachFieldOutput( $aField, $isIndex, array $aCallbacks, $bIsLastElement = false ) { |
|
97 | 97 | |
98 | 98 | // Field type definition - allows mixed field types in sub-fields |
99 | 99 | $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField[ 'type' ] ); |
100 | - if ( ! is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
100 | + if ( !is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
101 | 101 | return ''; |
102 | 102 | } |
103 | 103 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | private function _getFieldOutput( $sContent, $aField, $bIsLastElement ) { |
132 | 132 | $_oFieldAttribute = new AdminPageFramework_Form_View___Attribute_Field( $aField ); |
133 | 133 | return $aField[ 'before_field' ] |
134 | - . "<div " . $_oFieldAttribute->get() . ">" |
|
134 | + . "<div ".$_oFieldAttribute->get().">" |
|
135 | 135 | . $sContent |
136 | 136 | . $this->_getUnsetFlagFieldInputTag( $aField ) |
137 | 137 | . $this->_getDelimiter( $aField, $bIsLastElement ) |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | 'input', |
154 | 154 | array( |
155 | 155 | 'type' => 'hidden', |
156 | - 'name' => '__unset_' . $aField[ '_fields_type' ] . '[' . $aField[ '_input_name_flat' ] . ']', |
|
156 | + 'name' => '__unset_'.$aField[ '_fields_type' ].'['.$aField[ '_input_name_flat' ].']', |
|
157 | 157 | 'value' => $aField[ '_input_name_flat' ], |
158 | 158 | 'class' => 'unset-element-names element-address', |
159 | 159 | ) |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | private function _getDelimiter( $aField, $bIsLastElement ) { |
186 | 186 | return $aField[ 'delimiter' ] |
187 | - ? "<div " . $this->getAttributes( |
|
187 | + ? "<div ".$this->getAttributes( |
|
188 | 188 | array( |
189 | 189 | 'class' => 'delimiter', |
190 | 190 | 'id' => "delimiter-{$aField[ 'input_id' ]}", |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | "" |
195 | 195 | ), |
196 | 196 | ) |
197 | - ) . ">" |
|
197 | + ).">" |
|
198 | 198 | . $aField[ 'delimiter' ] |
199 | 199 | . "</div>" |
200 | 200 | : ''; |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | */ |
209 | 209 | private function _getFinalOutput( $aFieldset, array $aFieldsOutput, $iFieldsCount ) { |
210 | 210 | |
211 | - $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
211 | + $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
212 | 212 | return $aFieldset[ 'before_fieldset' ] |
213 | - . "<fieldset " . $_oFieldsetAttributes->get() . ">" |
|
213 | + . "<fieldset ".$_oFieldsetAttributes->get().">" |
|
214 | 214 | . $this->_getEmbeddedFieldTitle( $aFieldset ) |
215 | 215 | . $this->_getChildFieldTitle( $aFieldset ) |
216 | 216 | . $this->_getFieldsetContent( $aFieldset, $aFieldsOutput, $iFieldsCount ) |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | private function _getEmbeddedFieldTitle( $aFieldset ) { |
229 | 229 | |
230 | - if ( ! $aFieldset[ '_is_title_embedded' ] ) { |
|
230 | + if ( !$aFieldset[ '_is_title_embedded' ] ) { |
|
231 | 231 | return ''; |
232 | 232 | } |
233 | 233 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function _getChildFieldTitle( $aFieldset ) { |
254 | 254 | |
255 | - if ( ! $aFieldset[ '_nested_depth' ] ) { |
|
255 | + if ( !$aFieldset[ '_nested_depth' ] ) { |
|
256 | 256 | return ''; |
257 | 257 | } |
258 | 258 | if ( $aFieldset[ '_is_title_embedded' ] ) { |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | return $aFieldset[ 'content' ]; |
282 | 282 | } |
283 | 283 | |
284 | - $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
284 | + $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
285 | 285 | $aFieldset, |
286 | - array(), // attribute array |
|
286 | + array(), // attribute array |
|
287 | 287 | $iFieldsCount |
288 | 288 | ); |
289 | - return "<div " . $_oFieldsAttributes->get() . ">" |
|
289 | + return "<div ".$_oFieldsAttributes->get().">" |
|
290 | 290 | . $aFieldset[ 'before_fields' ] |
291 | 291 | . implode( PHP_EOL, $aFieldsOutput ) |
292 | 292 | . $aFieldset[ 'after_fields' ] |
@@ -309,12 +309,12 @@ discard block |
||
309 | 309 | $aField[ 'description' ], |
310 | 310 | 'admin-page-framework-fields-description' // class selector |
311 | 311 | ); |
312 | - $_aOutput[] = $_oFieldDescription->get(); |
|
312 | + $_aOutput[ ] = $_oFieldDescription->get(); |
|
313 | 313 | |
314 | 314 | // Dimensional keys of repeatable and sortable fields |
315 | - $_aOutput[] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
315 | + $_aOutput[ ] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
316 | 316 | |
317 | - $_aOutput[] = $this->_getRepeatableFieldButtons( 'fields-' . $aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ); |
|
317 | + $_aOutput[ ] = $this->_getRepeatableFieldButtons( 'fields-'.$aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ); |
|
318 | 318 | |
319 | 319 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
320 | 320 | |
@@ -326,10 +326,10 @@ discard block |
||
326 | 326 | */ |
327 | 327 | private function _getDynamicElementFlagFieldInputTag( $aFieldset ) { |
328 | 328 | |
329 | - if ( ! empty( $aFieldset[ 'repeatable' ] ) ) { |
|
329 | + if ( !empty( $aFieldset[ 'repeatable' ] ) ) { |
|
330 | 330 | return $this->_getRepeatableFieldFlagTag( $aFieldset ); |
331 | 331 | } |
332 | - if ( ! empty( $aFieldset[ 'sortable' ] ) ) { |
|
332 | + if ( !empty( $aFieldset[ 'sortable' ] ) ) { |
|
333 | 333 | return $this->_getSortableFieldFlagTag( $aFieldset ); |
334 | 334 | } |
335 | 335 | return ''; |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | 'input', |
345 | 345 | array( |
346 | 346 | 'type' => 'hidden', |
347 | - 'name' => '__repeatable_elements_' . $aFieldset[ '_structure_type' ] |
|
348 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
347 | + 'name' => '__repeatable_elements_'.$aFieldset[ '_structure_type' ] |
|
348 | + . '['.$aFieldset[ '_field_address' ].']', |
|
349 | 349 | 'class' => 'element-address', |
350 | 350 | 'value' => $aFieldset[ '_field_address' ], |
351 | 351 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | 'input', |
362 | 362 | array( |
363 | 363 | 'type' => 'hidden', |
364 | - 'name' => '__sortable_elements_' . $aFieldset[ '_structure_type' ] |
|
365 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
364 | + 'name' => '__sortable_elements_'.$aFieldset[ '_structure_type' ] |
|
365 | + . '['.$aFieldset[ '_field_address' ].']', |
|
366 | 366 | 'class' => 'element-address', |
367 | 367 | 'value' => $aFieldset[ '_field_address' ], |
368 | 368 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -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 |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | 'posttype', |
43 | 43 | 'size', |
44 | 44 | 'section_title', // 3.0.0+ |
45 | - 'system', // 3.3.0+ |
|
46 | - 'inline_mixed', // 3.8.0+ |
|
47 | - '_nested', // 3.8.0+ |
|
48 | - 'contact', // 3.9.0+ |
|
45 | + 'system', // 3.3.0+ |
|
46 | + 'inline_mixed', // 3.8.0+ |
|
47 | + '_nested', // 3.8.0+ |
|
48 | + 'contact', // 3.9.0+ |
|
49 | 49 | 'table' // 3.9.0+ |
50 | 50 | ); |
51 | 51 | |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | public function get() { |
77 | 77 | |
78 | 78 | $_aFieldTypeDefinitions = array(); |
79 | - foreach( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
79 | + foreach ( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
80 | 80 | |
81 | 81 | $_sFieldTypeClassName = "AdminPageFramework_FieldType_{$_sFieldTypeSlug}"; |
82 | 82 | $_oFieldType = new $_sFieldTypeClassName( |
83 | - $this->sCallerID, // usually an instantiated class name |
|
84 | - null, // field type slugs - if it is different from the one defined in the class property |
|
83 | + $this->sCallerID, // usually an instantiated class name |
|
84 | + null, // field type slugs - if it is different from the one defined in the class property |
|
85 | 85 | $this->oMsg, |
86 | 86 | false // `false` to disable auto-registering. |
87 | 87 | ); |
88 | - foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
88 | + foreach ( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
89 | 89 | $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray(); |
90 | 90 | } |
91 | 91 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | /** |
48 | 48 | * Defines the field type slugs used for this field type. |
49 | 49 | */ |
50 | - public $aFieldTypeSlugs = array( 'section_title', ); |
|
50 | + public $aFieldTypeSlugs = array( 'section_title',); |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Defines the default key-values of this field type. |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Defines the field type slugs used for this field type. |
42 | 42 | */ |
43 | - public $aFieldTypeSlugs = array( 'import', ); |
|
43 | + public $aFieldTypeSlugs = array( 'import',); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Defines the default key-values of this field type. |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | return array( |
74 | 74 | array( |
75 | 75 | 'handle_id' => 'admin-page-framework-field-type-import', |
76 | - 'src' => dirname( __FILE__ ) . '/js/import.bundle.js', |
|
76 | + 'src' => dirname( __FILE__ ).'/js/import.bundle.js', |
|
77 | 77 | 'in_footer' => true, |
78 | 78 | 'dependencies' => array( 'jquery', 'admin-page-framework-script-form-main' ), |
79 | 79 | 'translation_var' => 'AdminPageFrameworkImportFieldType', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @return string |
98 | 98 | */ |
99 | 99 | protected function getField( $aField ) { |
100 | - $aField[ 'attributes'][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
100 | + $aField[ 'attributes' ][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
101 | 101 | $aField[ 'label' ] = $aField[ 'label' ] |
102 | 102 | ? $aField[ 'label' ] |
103 | 103 | : $this->oMsg->get( 'import' ); |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | */ |
117 | 117 | protected function _getExtraFieldsBeforeLabel( &$aField ) { |
118 | 118 | return "<label>" |
119 | - . "<input " . $this->getAttributes( |
|
119 | + . "<input ".$this->getAttributes( |
|
120 | 120 | array( |
121 | 121 | 'id' => "{$aField[ 'input_id' ]}_file", |
122 | 122 | 'type' => 'file', |
123 | 123 | 'name' => "__import[{$aField[ 'input_id' ]}]", |
124 | 124 | ) + $aField[ 'attributes' ][ 'file' ] |
125 | - ) . " />" |
|
125 | + )." />" |
|
126 | 126 | . "</label>"; |
127 | 127 | } |
128 | 128 | |
@@ -135,44 +135,44 @@ discard block |
||
135 | 135 | */ |
136 | 136 | protected function _getExtraInputFields( &$aField ) { |
137 | 137 | |
138 | - $aHiddenAttributes = array( 'type' => 'hidden', ); |
|
138 | + $aHiddenAttributes = array( 'type' => 'hidden',); |
|
139 | 139 | return |
140 | - "<input " . $this->getAttributes( |
|
140 | + "<input ".$this->getAttributes( |
|
141 | 141 | array( |
142 | - 'name' => "__import[{$aField['input_id']}][input_id]", |
|
143 | - 'value' => $aField['input_id'], |
|
142 | + 'name' => "__import[{$aField[ 'input_id' ]}][input_id]", |
|
143 | + 'value' => $aField[ 'input_id' ], |
|
144 | 144 | ) + $aHiddenAttributes |
145 | - ) . "/>" |
|
146 | - . "<input " . $this->getAttributes( |
|
145 | + )."/>" |
|
146 | + . "<input ".$this->getAttributes( |
|
147 | 147 | array( |
148 | - 'name' => "__import[{$aField['input_id']}][field_id]", |
|
149 | - 'value' => $aField['field_id'], |
|
148 | + 'name' => "__import[{$aField[ 'input_id' ]}][field_id]", |
|
149 | + 'value' => $aField[ 'field_id' ], |
|
150 | 150 | ) + $aHiddenAttributes |
151 | - ) . "/>" |
|
152 | - . "<input " . $this->getAttributes( |
|
151 | + )."/>" |
|
152 | + . "<input ".$this->getAttributes( |
|
153 | 153 | array( |
154 | - 'name' => "__import[{$aField['input_id']}][section_id]", |
|
155 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
154 | + 'name' => "__import[{$aField[ 'input_id' ]}][section_id]", |
|
155 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
156 | 156 | ) + $aHiddenAttributes |
157 | - ) . "/>" |
|
158 | - . "<input " . $this->getAttributes( |
|
157 | + )."/>" |
|
158 | + . "<input ".$this->getAttributes( |
|
159 | 159 | array( |
160 | - 'name' => "__import[{$aField['input_id']}][is_merge]", |
|
161 | - 'value' => $aField['is_merge'], |
|
160 | + 'name' => "__import[{$aField[ 'input_id' ]}][is_merge]", |
|
161 | + 'value' => $aField[ 'is_merge' ], |
|
162 | 162 | ) + $aHiddenAttributes |
163 | - ) . "/>" |
|
164 | - . "<input " . $this->getAttributes( |
|
163 | + )."/>" |
|
164 | + . "<input ".$this->getAttributes( |
|
165 | 165 | array( |
166 | - 'name' => "__import[{$aField['input_id']}][option_key]", |
|
167 | - 'value' => $aField['option_key'], |
|
166 | + 'name' => "__import[{$aField[ 'input_id' ]}][option_key]", |
|
167 | + 'value' => $aField[ 'option_key' ], |
|
168 | 168 | ) + $aHiddenAttributes |
169 | - ) . "/>" |
|
170 | - . "<input " . $this->getAttributes( |
|
169 | + )."/>" |
|
170 | + . "<input ".$this->getAttributes( |
|
171 | 171 | array( |
172 | - 'name' => "__import[{$aField['input_id']}][format]", |
|
173 | - 'value' => $aField['format'], |
|
172 | + 'name' => "__import[{$aField[ 'input_id' ]}][format]", |
|
173 | + 'value' => $aField[ 'format' ], |
|
174 | 174 | ) + $aHiddenAttributes |
175 | - ) . "/>" |
|
175 | + )."/>" |
|
176 | 176 | ; |
177 | 177 | } |
178 | 178 |