@@ -71,7 +71,7 @@ |
||
71 | 71 | * </code> |
72 | 72 | * @access public This must be public as accessed from outside. |
73 | 73 | */ |
74 | - public $aFieldTypeSlugs = array( 'default', ); |
|
74 | + public $aFieldTypeSlugs = array( 'default',); |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Defines the default key-values of this field type. |
@@ -72,7 +72,7 @@ |
||
72 | 72 | protected function getField( $aField ) { |
73 | 73 | |
74 | 74 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
75 | - if ( $aField[ 'is_multiple' ] ) { |
|
75 | + if ( $aField[ 'is_multiple' ] ) { |
|
76 | 76 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
77 | 77 | } |
78 | 78 | return |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * Defines the field type slugs used for this field type. |
105 | 105 | */ |
106 | - public $aFieldTypeSlugs = array( 'select', ); |
|
106 | + public $aFieldTypeSlugs = array( 'select',); |
|
107 | 107 | |
108 | 108 | /** |
109 | 109 | * Defines the default key-values of this field type. |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'select' => array( |
116 | 116 | 'size' => 1, |
117 | 117 | 'autofocusNew' => null, |
118 | - 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
118 | + 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
119 | 119 | 'required' => null, |
120 | 120 | ), |
121 | 121 | 'optgroup' => array(), |
@@ -155,12 +155,12 @@ discard block |
||
155 | 155 | protected function getField( $aField ) { |
156 | 156 | |
157 | 157 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
158 | - if ( $aField[ 'is_multiple' ] ) { |
|
158 | + if ( $aField[ 'is_multiple' ] ) { |
|
159 | 159 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
160 | 160 | } |
161 | 161 | return |
162 | 162 | $aField[ 'before_label' ] |
163 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">" |
|
163 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">" |
|
164 | 164 | . "<label for='{$aField[ 'input_id' ]}'>" |
165 | 165 | . $aField[ 'before_input' ] |
166 | 166 | . $_oSelectInput->get( $aField[ 'label' ] ) |
@@ -54,13 +54,13 @@ |
||
54 | 54 | public function getFieldsetOutput( $aFieldset ) { |
55 | 55 | |
56 | 56 | // Check if the field is visible |
57 | - if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
57 | + if ( !$this->isFieldsetVisible( $aFieldset ) ) { |
|
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 | |
61 | 61 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
62 | 62 | $aFieldset, |
63 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
63 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
64 | 64 | $this->aFieldErrors, |
65 | 65 | $this->aFieldTypeDefinitions, |
66 | 66 | $this->oMsg, |
@@ -54,7 +54,7 @@ |
||
54 | 54 | public function getFieldsetOutput( $aFieldset ) { |
55 | 55 | |
56 | 56 | // Check if the field is visible |
57 | - if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
57 | + if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class AdminPageFramework_Form_View___CollapsibleSectionTitle extends AdminPageFramework_Form_View___SectionTitle { |
20 | 20 | |
21 | - public $aArguments = array( |
|
21 | + public $aArguments = array( |
|
22 | 22 | 'title' => null, |
23 | 23 | 'tag' => null, |
24 | 24 | 'section_index' => null, |
25 | 25 | 'collapsible' => array(), |
26 | 26 | 'container_type' => 'section', // section or sections |
27 | 27 | |
28 | - 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
28 | + 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
29 | 29 | |
30 | 30 | ); |
31 | - public $aFieldsets = array(); |
|
31 | + public $aFieldsets = array(); |
|
32 | 32 | public $aSavedData = array(); |
33 | 33 | public $aFieldErrors = array(); |
34 | 34 | public $aFieldTypeDefinitions = array(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @param array|boolean $aCollapsible The collapsible argument. |
63 | 63 | * @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. |
64 | 64 | */ |
65 | - private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', $iSectionIndex=null ) { |
|
65 | + private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer = 'sections', $iSectionIndex = null ) { |
|
66 | 66 | |
67 | 67 | if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
68 | 68 | return ''; |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | ); |
79 | 79 | |
80 | 80 | $_aSectionset = $this->aArguments[ 'sectionset' ]; |
81 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $iSectionIndex; |
|
81 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$iSectionIndex; |
|
82 | 82 | |
83 | 83 | return $this->_getCollapsibleSectionsEnablerScript() |
84 | - . "<div " . $this->getAttributes( |
|
84 | + . "<div ".$this->getAttributes( |
|
85 | 85 | array( |
86 | 86 | 'id' => $_sSectionTitleTagID, |
87 | 87 | 'class' => $this->getClassAttribute( |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | 'collapsed', |
103 | 103 | '' |
104 | 104 | ), |
105 | - 'admin-page-framework-collapsible-type-' . $aCollapsible[ 'type' ] |
|
105 | + 'admin-page-framework-collapsible-type-'.$aCollapsible[ 'type' ] |
|
106 | 106 | ), |
107 | 107 | ) |
108 | 108 | + $this->getDataAttributeArray( $aCollapsible ) |
109 | - ) . ">" |
|
109 | + ).">" |
|
110 | 110 | . $_sSectionTitle |
111 | 111 | . "</div>"; |
112 | 112 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | */ |
62 | 62 | private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', $iSectionIndex=null ) { |
63 | 63 | |
64 | - if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
|
64 | + if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
|
65 | 65 | return ''; |
66 | 66 | } |
67 | 67 |
@@ -531,7 +531,7 @@ |
||
531 | 531 | * @return string The generated section tab list as HTML. |
532 | 532 | */ |
533 | 533 | private function _getSectionTabList( $sSectionTabSlug, array $aSectionTabList ) { |
534 | - return $sSectionTabSlug |
|
534 | + return $sSectionTabSlug |
|
535 | 535 | ? "<ul class='admin-page-framework-section-tabs nav-tab-wrapper'>" |
536 | 536 | . implode( PHP_EOL, $aSectionTabList ) |
537 | 537 | . "</ul>" |
@@ -165,6 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | /** |
167 | 167 | * @since 3.7.0 |
168 | + * @param string $_sOutput |
|
168 | 169 | * @return string |
169 | 170 | */ |
170 | 171 | private function _getSpinnerOutput( $_sOutput ) { |
@@ -299,7 +300,7 @@ discard block |
||
299 | 300 | * @param array $_aOutputs Holds output elements - contents, section tab list, count of subsections. |
300 | 301 | * @param string $_sSectionsID The container id of sections. |
301 | 302 | * @param array $_aSection |
302 | - * @param array $_aFieldsInSections A field-sets array already divided by section tab. |
|
303 | + * @param array $aFieldsInSections A field-sets array already divided by section tab. |
|
303 | 304 | * @return array The updated sections table output array. |
304 | 305 | */ |
305 | 306 | private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
@@ -354,6 +355,7 @@ discard block |
||
354 | 355 | * Returns the output of sub-sections for repeatable and sortable sections. |
355 | 356 | * |
356 | 357 | * @since 3.7.0 |
358 | + * @param string $_sSectionsID |
|
357 | 359 | * @return array |
358 | 360 | */ |
359 | 361 | private function _getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
@@ -500,6 +502,7 @@ discard block |
||
500 | 502 | * @since 3.5.3 |
501 | 503 | * @since 3.6.0 Removed the `$sSectionID` parameter. Added the `$aSectionset` parameter. |
502 | 504 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_Table`. |
505 | + * @param string $sSectionsID |
|
503 | 506 | * @return string The formatted sections table HTML output. |
504 | 507 | */ |
505 | 508 | private function _getFormattedSectionsTablesOutput( array $aOutputs, $aSectionset, $sSectionsID, array $aCollapsible, $sSectionTabSlug ) { |
@@ -126,16 +126,16 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function get() { |
128 | 128 | |
129 | - $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
129 | + $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
130 | 130 | $this->aStructure[ 'sectionsets' ], |
131 | 131 | $this->aStructure[ 'fieldsets' ], |
132 | 132 | $this->aArguments[ 'nested_depth' ] |
133 | 133 | ); |
134 | 134 | |
135 | - $_aOutput = array(); |
|
136 | - foreach( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
135 | + $_aOutput = array(); |
|
136 | + foreach ( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
137 | 137 | |
138 | - $_aOutput[] = $this->_getFormOutput( |
|
138 | + $_aOutput[ ] = $this->_getFormOutput( |
|
139 | 139 | $_oFormatSectionsetsByTab->getSectionsets( $_sSectionTabSlug ), |
140 | 140 | $_oFormatSectionsetsByTab->getFieldsets( $_sSectionTabSlug ), |
141 | 141 | $_sSectionTabSlug, |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | // Generate id for this output |
154 | 154 | $_sOutput = implode( PHP_EOL, $_aOutput ); |
155 | - $_sElementID = "admin-page-framework-sectionsets-" . uniqid(); |
|
155 | + $_sElementID = "admin-page-framework-sectionsets-".uniqid(); |
|
156 | 156 | return $this->_getSpinnerOutput( $_sOutput ) |
157 | 157 | . "<div id='{$_sElementID}' class='admin-page-framework-sctionsets admin-page-framework-form-js-on'>" |
158 | 158 | . $_sOutput |
@@ -187,17 +187,17 @@ discard block |
||
187 | 187 | |
188 | 188 | // A sectionset is a set of sections. |
189 | 189 | $_sSectionSet = $this->_getSectionsetsTables( |
190 | - $aSectionsets, // section-set definition (already divided by section tab) |
|
191 | - $aFieldsets, // field-set definitions (already divided by section tab) |
|
190 | + $aSectionsets, // section-set definition (already divided by section tab) |
|
191 | + $aFieldsets, // field-set definitions (already divided by section tab) |
|
192 | 192 | $aCallbacks |
193 | 193 | ); |
194 | 194 | return $_sSectionSet |
195 | - ? "<div " . $this->getAttributes( |
|
195 | + ? "<div ".$this->getAttributes( |
|
196 | 196 | array( |
197 | 197 | 'class' => 'admin-page-framework-sectionset', |
198 | - 'id' => "sectionset-{$sSectionTabSlug}_" . md5( serialize( $aSectionsets ) ), |
|
198 | + 'id' => "sectionset-{$sSectionTabSlug}_".md5( serialize( $aSectionsets ) ), |
|
199 | 199 | ) |
200 | - ) . ">" |
|
200 | + ).">" |
|
201 | 201 | . $_sSectionSet |
202 | 202 | . "</div>" |
203 | 203 | : ''; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * If there is no field overall to the section and its section tab, return an empty string. |
230 | 230 | * Otherwise, the section-sets container gets rendered and its CSS rules such as margins give unwanted results. |
231 | 231 | */ |
232 | - if ( ! count( $aFieldsets ) ) { |
|
232 | + if ( !count( $aFieldsets ) ) { |
|
233 | 233 | return ''; |
234 | 234 | } |
235 | 235 | |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | ); |
242 | 242 | $_sSectionTabSlug = $_aFirstSectionset[ 'section_tab_slug' ]; |
243 | 243 | $_sThisSectionID = $_aFirstSectionset[ 'section_id' ]; |
244 | - $_sSectionsID = 'sections-' . $_sThisSectionID; |
|
244 | + $_sSectionsID = 'sections-'.$_sThisSectionID; |
|
245 | 245 | $_aCollapsible = $this->_getCollapsibleArgumentForSections( |
246 | 246 | $_aFirstSectionset |
247 | 247 | ); |
248 | 248 | |
249 | - foreach( $aSectionsets as $_aSectionset ) { |
|
250 | - $_aOutputs = $this->_getSectionsetTable( |
|
249 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
250 | + $_aOutputs = $this->_getSectionsetTable( |
|
251 | 251 | $_aOutputs, |
252 | 252 | $_sSectionsID, |
253 | 253 | $_aSectionset, |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
276 | 276 | * @return array |
277 | 277 | */ |
278 | - private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
278 | + private function _getCollapsibleArgumentForSections( array $aSectionset = array() ) { |
|
279 | 279 | |
280 | 280 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
281 | 281 | $aSectionset[ 'collapsible' ], |
@@ -303,19 +303,19 @@ discard block |
||
303 | 303 | */ |
304 | 304 | private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
305 | 305 | |
306 | - if ( ! $this->isSectionsetVisible( $_aSection ) ) { |
|
306 | + if ( !$this->isSectionsetVisible( $_aSection ) ) { |
|
307 | 307 | return $_aOutputs; |
308 | 308 | } |
309 | 309 | |
310 | 310 | // If the 'save' argument is false, insert a flag that disables saving the section inputs. |
311 | - $_aOutputs[ 'section_contents' ][] = $this->_getUnsetFlagSectionInputTag( $_aSection ); |
|
311 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getUnsetFlagSectionInputTag( $_aSection ); |
|
312 | 312 | |
313 | 313 | // For repeatable sections - sub-sections are divided field definition arrays by sub-section index, |
314 | 314 | // not section definition arrays. |
315 | - $_aSubSections = $this->getIntegerKeyElements( |
|
315 | + $_aSubSections = $this->getIntegerKeyElements( |
|
316 | 316 | $this->getElementAsArray( |
317 | 317 | $aFieldsInSections, // subject array |
318 | - $_aSection[ '_section_path' ], // dimensional path |
|
318 | + $_aSection[ '_section_path' ], // dimensional path |
|
319 | 319 | array() // default |
320 | 320 | ) |
321 | 321 | ); |
@@ -358,28 +358,28 @@ discard block |
||
358 | 358 | private function _getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
359 | 359 | |
360 | 360 | // Add the repeatable sections enabler script. |
361 | - if ( ! empty( $_aSection[ 'repeatable' ] ) ) { |
|
362 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( |
|
361 | + if ( !empty( $_aSection[ 'repeatable' ] ) ) { |
|
362 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( |
|
363 | 363 | $_sSectionsID, |
364 | 364 | $_aOutputs[ 'count_subsections' ], |
365 | 365 | $_aSection[ 'repeatable' ], |
366 | 366 | $this->oMsg |
367 | 367 | ); |
368 | - $_aOutputs[ 'section_contents' ][] = $this->_getRepeatableSectionFlagTag( $_aSection ); |
|
368 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getRepeatableSectionFlagTag( $_aSection ); |
|
369 | 369 | } |
370 | 370 | // Add the sortable sections enabler script. 3.6.0+ |
371 | - if ( ! empty( $_aSection[ 'sortable' ] ) ) { |
|
372 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
371 | + if ( !empty( $_aSection[ 'sortable' ] ) ) { |
|
372 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
373 | 373 | $_sSectionsID, |
374 | 374 | $_aSection[ 'sortable' ], |
375 | 375 | $this->oMsg |
376 | 376 | ); |
377 | - $_aOutputs[ 'section_contents' ][] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
377 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | // Get the section tables. |
381 | 381 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
382 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
382 | + foreach ( $_aSubSections as $_iIndex => $_aFields ) { |
|
383 | 383 | |
384 | 384 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
385 | 385 | $_aSection, |
@@ -409,8 +409,8 @@ discard block |
||
409 | 409 | array( |
410 | 410 | 'class' => 'element-address', |
411 | 411 | 'type' => 'hidden', |
412 | - 'name' => '__repeatable_elements_' . $aSection[ '_structure_type' ] |
|
413 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
412 | + 'name' => '__repeatable_elements_'.$aSection[ '_structure_type' ] |
|
413 | + . '['.$aSection[ 'section_id' ].']', |
|
414 | 414 | // @todo examine whether this value should include a section index. |
415 | 415 | 'value' => $aSection[ 'section_id' ], |
416 | 416 | ) |
@@ -428,8 +428,8 @@ discard block |
||
428 | 428 | array( |
429 | 429 | 'class' => 'element-address', |
430 | 430 | 'type' => 'hidden', |
431 | - 'name' => '__sortable_elements_' . $aSection[ '_structure_type' ] |
|
432 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
431 | + 'name' => '__sortable_elements_'.$aSection[ '_structure_type' ] |
|
432 | + . '['.$aSection[ 'section_id' ].']', |
|
433 | 433 | // @todo examine whether this value should include a section index. |
434 | 434 | 'value' => $aSection[ 'section_id' ], |
435 | 435 | ) |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | 'input', |
452 | 452 | array( |
453 | 453 | 'type' => 'hidden', |
454 | - 'name' => '__unset_' . $aSection[ '_structure_type' ] . '[' . $aSection[ 'section_id' ] . ']', |
|
455 | - 'value' => "__dummy_option_key|" . $aSection[ 'section_id' ], |
|
454 | + 'name' => '__unset_'.$aSection[ '_structure_type' ].'['.$aSection[ 'section_id' ].']', |
|
455 | + 'value' => "__dummy_option_key|".$aSection[ 'section_id' ], |
|
456 | 456 | 'class' => 'unset-element-names element-address', |
457 | 457 | ) |
458 | 458 | ); |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | private function _getSectionTableWithTabList( array $_aOutputs, array $aSectionset, $aFieldsetsPerSection ) { |
469 | 469 | |
470 | 470 | // Tab list |
471 | - $_aOutputs[ 'section_tab_list' ][] = $this->_getTabList( |
|
471 | + $_aOutputs[ 'section_tab_list' ][ ] = $this->_getTabList( |
|
472 | 472 | $aSectionset, |
473 | 473 | $aFieldsetsPerSection, |
474 | 474 | $this->aCallbacks[ 'fieldset_output' ] |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | |
477 | 477 | // Section container |
478 | 478 | $_oSectionTable = new AdminPageFramework_Form_View___Section( |
479 | - $this->aArguments, // for nested sections |
|
479 | + $this->aArguments, // for nested sections |
|
480 | 480 | $aSectionset, |
481 | 481 | $this->aStructure, |
482 | 482 | $aFieldsetsPerSection, |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $this->aCallbacks, |
487 | 487 | $this->oMsg |
488 | 488 | ); |
489 | - $_aOutputs[ 'section_contents' ][] = $_oSectionTable->get(); |
|
489 | + $_aOutputs[ 'section_contents' ][ ] = $_oSectionTable->get(); |
|
490 | 490 | |
491 | 491 | return $_aOutputs; |
492 | 492 | |
@@ -514,9 +514,9 @@ discard block |
||
514 | 514 | 'section_index' => null, |
515 | 515 | 'collapsible' => $aCollapsible, |
516 | 516 | 'container_type' => 'sections', // section or sections |
517 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
517 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
518 | 518 | ), |
519 | - array(), // fieldsets |
|
519 | + array(), // fieldsets |
|
520 | 520 | $this->aSavedData, |
521 | 521 | $this->aFieldErrors, |
522 | 522 | $this->aStructure[ 'field_type_definitions' ], |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | $aOutputs[ 'count_subsections' ] |
534 | 534 | ); |
535 | 535 | return $_oCollapsibleSectionTitle->get() |
536 | - . "<div " . $_oSectionsTablesContainerAttributes->get() . ">" |
|
536 | + . "<div ".$_oSectionsTablesContainerAttributes->get().">" |
|
537 | 537 | . $this->_getSectionTabList( $sSectionTabSlug, $aOutputs[ 'section_tab_list' ] ) |
538 | 538 | . implode( PHP_EOL, $aOutputs[ 'section_contents' ] ) |
539 | 539 | . "</div>"; |
@@ -564,21 +564,21 @@ discard block |
||
564 | 564 | */ |
565 | 565 | private function _getTabList( array $aSection, array $aFields, $hfFieldCallback ) { |
566 | 566 | |
567 | - if ( ! $aSection[ 'section_tab_slug' ] ) { |
|
567 | + if ( !$aSection[ 'section_tab_slug' ] ) { |
|
568 | 568 | return ''; |
569 | 569 | } |
570 | 570 | |
571 | 571 | $iSectionIndex = $aSection[ '_index' ]; |
572 | 572 | |
573 | - $_sSectionTagID = 'section-' . $aSection[ 'section_id' ] . '__' . $iSectionIndex; |
|
573 | + $_sSectionTagID = 'section-'.$aSection[ 'section_id' ].'__'.$iSectionIndex; |
|
574 | 574 | $_aTabAttributes = $aSection[ 'attributes' ][ 'tab' ] |
575 | 575 | + array( |
576 | 576 | 'class' => 'admin-page-framework-section-tab nav-tab', |
577 | 577 | 'id' => "section_tab-{$_sSectionTagID}", |
578 | 578 | 'style' => null |
579 | 579 | ); |
580 | - $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
581 | - $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
580 | + $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
581 | + $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
582 | 582 | |
583 | 583 | $_oSectionTitle = new AdminPageFramework_Form_View___SectionTitle( |
584 | 584 | array( |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | 'tag' => 'h4', |
587 | 587 | 'section_index' => $iSectionIndex, |
588 | 588 | |
589 | - 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
589 | + 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
590 | 590 | ), |
591 | 591 | $aFields, |
592 | 592 | $this->aSavedData, |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $this->aCallbacks // field output element callables. |
597 | 597 | ); |
598 | 598 | |
599 | - return "<li " . $this->getAttributes( $_aTabAttributes ) . ">" |
|
599 | + return "<li ".$this->getAttributes( $_aTabAttributes ).">" |
|
600 | 600 | . "<a href='#{$_sSectionTagID}'>" |
601 | 601 | . $_oSectionTitle->get() |
602 | 602 | ."</a>" |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | private function _getSectionsetsTables( array $aSectionsets, array $aFieldsets, array $aCallbacks ) { |
223 | 223 | |
224 | - if ( empty( $aSectionsets ) ) { |
|
224 | + if ( empty( $aSectionsets ) ) { |
|
225 | 225 | return ''; |
226 | 226 | } |
227 | 227 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
276 | 276 | * @return array |
277 | 277 | */ |
278 | - private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
278 | + private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
279 | 279 | |
280 | 280 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
281 | 281 | $aSectionset[ 'collapsible' ], |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | |
380 | 380 | // Get the section tables. |
381 | 381 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
382 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
382 | + foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
383 | 383 | |
384 | 384 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
385 | 385 | $_aSection, |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | */ |
445 | 445 | private function _getUnsetFlagSectionInputTag( array $aSection ) { |
446 | 446 | |
447 | - if ( false !== $aSection[ 'save' ] ) { |
|
447 | + if ( false !== $aSection[ 'save' ] ) { |
|
448 | 448 | return ''; |
449 | 449 | } |
450 | 450 | return $this->getHTMLTag( |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | private function _getCaption( array $aSectionset, $iSectionIndex, $aFieldsets, $aFieldErrors, $aFieldTypeDefinitions, $aCallbacks, $oMsg ) { |
81 | 81 | |
82 | - if ( ! $aSectionset[ 'description' ] && ! $aSectionset[ 'title' ] ) { |
|
82 | + if ( !$aSectionset[ 'description' ] && !$aSectionset[ 'title' ] ) { |
|
83 | 83 | return "<caption class='admin-page-framework-section-caption' style='display:none;'></caption>"; |
84 | 84 | } |
85 | 85 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | 'collapsible' => $_abCollapsible, |
103 | 103 | 'container_type' => 'section', // section or sections |
104 | 104 | |
105 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
105 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
106 | 106 | ), |
107 | 107 | $aFieldsets, |
108 | 108 | $this->aSavedData, |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | $aCallbacks // field output element callables. |
113 | 113 | ); |
114 | 114 | |
115 | - $_bShowTitle = empty( $_abCollapsible ) && ! $aSectionset[ 'section_tab_slug' ]; |
|
115 | + $_bShowTitle = empty( $_abCollapsible ) && !$aSectionset[ 'section_tab_slug' ]; |
|
116 | 116 | return |
117 | - "<caption " . $this->getAttributes( |
|
117 | + "<caption ".$this->getAttributes( |
|
118 | 118 | array( |
119 | 119 | 'class' => 'admin-page-framework-section-caption', |
120 | 120 | // data-section_tab is referred by the repeater script to hide/show the title and the description |
121 | 121 | 'data-section_tab' => $aSectionset[ 'section_tab_slug' ], |
122 | 122 | ) |
123 | - ) . ">" |
|
123 | + ).">" |
|
124 | 124 | . $_oCollapsibleSectionTitle->get() |
125 | 125 | . $this->getAOrB( |
126 | 126 | $_bShowTitle, |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | 'tag' => 'h3', |
175 | 175 | 'section_index' => $iSectionIndex, |
176 | 176 | |
177 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
177 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
178 | 178 | ), |
179 | 179 | $aFieldsets, |
180 | 180 | $this->aSavedData, |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $this->oMsg, |
184 | 184 | $this->aCallbacks // field output element callables. |
185 | 185 | ); |
186 | - return "<div " . $this->getAttributes( |
|
186 | + return "<div ".$this->getAttributes( |
|
187 | 187 | array( |
188 | 188 | 'class' => 'admin-page-framework-section-title', |
189 | 189 | 'style' => $this->getAOrB( |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | 'display: none;' |
193 | 193 | ), |
194 | 194 | ) |
195 | - ). ">" |
|
195 | + ).">" |
|
196 | 196 | . $_oSectionTitle->get() |
197 | 197 | . "</div>"; |
198 | 198 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if ( $aSectionset[ 'collapsible' ] ) { |
209 | 209 | return ''; |
210 | 210 | } |
211 | - if ( ! is_callable( $hfSectionCallback ) ) { |
|
211 | + if ( !is_callable( $hfSectionCallback ) ) { |
|
212 | 212 | return ''; |
213 | 213 | } |
214 | 214 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | private function _shouldShowCaptionTitle( $aSectionset, $iSectionIndex ) { |
242 | 242 | |
243 | - if ( ! $aSectionset[ 'title' ] ){ |
|
243 | + if ( !$aSectionset[ 'title' ] ) { |
|
244 | 244 | return false; |
245 | 245 | } |
246 | 246 | if ( $aSectionset[ 'collapsible' ] ) { |
@@ -236,7 +236,7 @@ |
||
236 | 236 | */ |
237 | 237 | private function _shouldShowCaptionTitle( $aSectionset, $iSectionIndex ) { |
238 | 238 | |
239 | - if ( ! $aSectionset[ 'title' ] ){ |
|
239 | + if ( ! $aSectionset[ 'title' ] ) { |
|
240 | 240 | return false; |
241 | 241 | } |
242 | 242 | if ( $aSectionset[ 'collapsible' ] ) { |
@@ -77,15 +77,15 @@ discard block |
||
77 | 77 | $_oSectionTableBodyAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableBody( $this->aSectionset ); |
78 | 78 | |
79 | 79 | $_aOutput = array(); |
80 | - $_aOutput[] = "<table " . $_oSectionTableAttributes->get() . ">" |
|
80 | + $_aOutput[ ] = "<table ".$_oSectionTableAttributes->get().">" |
|
81 | 81 | . $_oTableCaption->get() |
82 | - . "<tbody " . $_oSectionTableBodyAttributes->get() . ">" |
|
82 | + . "<tbody ".$_oSectionTableBodyAttributes->get().">" |
|
83 | 83 | . $this->_getSectionContent( $_iSectionIndex ) |
84 | 84 | . "</tbody>" |
85 | 85 | . "</table>"; |
86 | 86 | |
87 | - $_oSectionTableContainerAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableContainer( $this->aSectionset ); |
|
88 | - return "<div " . $_oSectionTableContainerAttributes->get() . ">" |
|
87 | + $_oSectionTableContainerAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableContainer( $this->aSectionset ); |
|
88 | + return "<div ".$_oSectionTableContainerAttributes->get().">" |
|
89 | 89 | . implode( PHP_EOL, $_aOutput ) |
90 | 90 | . "</div>"; |
91 | 91 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | // Retrieve the formatted sectionsets of the content. |
136 | 136 | $_sSectionPath = $this->aSectionset[ '_section_path' ]; |
137 | 137 | $_aSectionsets = $this->aStructure[ 'sectionsets' ]; |
138 | - if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
138 | + if ( !isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
139 | 139 | return ''; |
140 | 140 | } |
141 | 141 | |
@@ -190,22 +190,22 @@ discard block |
||
190 | 190 | $_aNestedSectionPaths = array(); |
191 | 191 | |
192 | 192 | // List the section paths of the direct children |
193 | - foreach( $aNestedSctionsets as $_aNestedSectionset ) { |
|
193 | + foreach ( $aNestedSctionsets as $_aNestedSectionset ) { |
|
194 | 194 | |
195 | 195 | // 3.7.6+ There were cases non array gets passed (like the FAQ page in the demo) |
196 | 196 | // and caused warnings in PHP 7. |
197 | - if ( ! is_array( $_aNestedSectionset ) ) { |
|
197 | + if ( !is_array( $_aNestedSectionset ) ) { |
|
198 | 198 | continue; |
199 | 199 | } |
200 | 200 | |
201 | - $_sThisSectionPath = $sSubjectSectionPath . '|' . $_aNestedSectionset[ 'section_id' ]; |
|
201 | + $_sThisSectionPath = $sSubjectSectionPath.'|'.$_aNestedSectionset[ 'section_id' ]; |
|
202 | 202 | $_aNestedSectionPaths[ $_sThisSectionPath ] = $_sThisSectionPath; |
203 | 203 | |
204 | 204 | } |
205 | 205 | |
206 | 206 | // Now we need children's children. |
207 | 207 | $_aChildSectionPaths = array(); |
208 | - foreach( $_aNestedSectionPaths as $_sNestedSectionPath ) { |
|
208 | + foreach ( $_aNestedSectionPaths as $_sNestedSectionPath ) { |
|
209 | 209 | $_aNestedSectionsets = $this->getElementAsArray( |
210 | 210 | $aSectionsets, |
211 | 211 | array( $_sNestedSectionPath, 'content' ) |
@@ -144,7 +144,8 @@ |
||
144 | 144 | // Retrieve the formatted sectionsets of the content. |
145 | 145 | $_sSectionPath = $this->aSectionset[ '_section_path' ]; |
146 | 146 | $_aSectionsets = $this->aStructure[ 'sectionsets' ]; |
147 | - if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
147 | + if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { |
|
148 | +// @todo not sure what this check is for |
|
148 | 149 | return ''; |
149 | 150 | } |
150 | 151 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
41 | 41 | // so make sure it is processed only once per page. |
42 | 42 | if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
43 | - return; |
|
43 | + return; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $this->_setHooks(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
42 | 42 | // so make sure it is processed only once per page. |
43 | - if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
|
43 | + if ( $this->hasBeenCalled( 'resource_'.$oForm->aArguments[ 'caller_id' ] ) ) { |
|
44 | 44 | return; |
45 | 45 | } |
46 | 46 | |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | * @since 3.7.0 |
114 | 114 | */ |
115 | 115 | public function _replyToEnqueueScripts() { |
116 | - if ( ! $this->oForm->isInThePage() ) { |
|
116 | + if ( !$this->oForm->isInThePage() ) { |
|
117 | 117 | return; |
118 | 118 | } |
119 | - foreach( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
119 | + foreach ( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
120 | 120 | $this->_enqueueScript( $_asEnqueue ); |
121 | - $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
121 | + $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | private function _getFormattedEnqueueScript( $asEnqueue ) { |
166 | 166 | static $_iCallCount = 1; |
167 | 167 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
168 | - 'handle_id' => 'script_form_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
168 | + 'handle_id' => 'script_form_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
169 | 169 | 'src' => null, |
170 | 170 | 'dependencies' => null, |
171 | 171 | 'version' => null, |
@@ -188,10 +188,10 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function _replyToEnqueueStyles() { |
190 | 190 | |
191 | - if ( ! $this->oForm->isInThePage() ) { |
|
191 | + if ( !$this->oForm->isInThePage() ) { |
|
192 | 192 | return; |
193 | 193 | } |
194 | - foreach( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
194 | + foreach ( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
195 | 195 | $this->_enqueueStyle( $_asEnqueueItem ); |
196 | 196 | $this->oForm->unsetResources( array( 'src_styles', $_isIndex ) ); // no longer needed |
197 | 197 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | private function _getFormattedEnqueueStyle( $asEnqueue ) { |
214 | 214 | static $_iCallCount = 1; |
215 | 215 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
216 | - 'handle_id' => 'style_form_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
216 | + 'handle_id' => 'style_form_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
217 | 217 | 'src' => null, |
218 | 218 | 'dependencies' => null, |
219 | 219 | 'version' => null, |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function _replyToAddStyle() { |
239 | 239 | |
240 | - if ( ! $this->oForm->isInThePage() ) { |
|
240 | + if ( !$this->oForm->isInThePage() ) { |
|
241 | 241 | return; |
242 | 242 | } |
243 | 243 | $_sCSSRules = $this->_getFormattedInternalStyles( |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function _replyToAddScript() { |
281 | 281 | |
282 | - if ( ! $this->oForm->isInThePage() ) { |
|
282 | + if ( !$this->oForm->isInThePage() ) { |
|
283 | 283 | return; |
284 | 284 | } |
285 | 285 |
@@ -244,7 +244,7 @@ |
||
244 | 244 | ); |
245 | 245 | |
246 | 246 | $_sID = $this->sanitizeSlug( strtolower( $this->oForm->aArguments[ 'caller_id' ] ) ); |
247 | - if ( $_sCSSRules ) { |
|
247 | + if ( $_sCSSRules ) { |
|
248 | 248 | echo "<style type='text/css' id='internal-style-{$_sID}' class='admin-page-framework-form-style'>" |
249 | 249 | . $_sCSSRules |
250 | 250 | . "</style>"; |
@@ -65,7 +65,7 @@ |
||
65 | 65 | private function _getFieldError( $aErrors, $aSectionPath, $aFieldPath, $sHeadingMessage ) { |
66 | 66 | |
67 | 67 | // If this field has a section and the error element is set |
68 | - $_aErrorPath = array_merge( $aSectionPath, $aFieldPath ); |
|
68 | + $_aErrorPath = array_merge( $aSectionPath, $aFieldPath ); |
|
69 | 69 | if ( $this->_hasFieldError( $aErrors, $_aErrorPath ) ) { |
70 | 70 | return "<span class='field-error'>* " |
71 | 71 | . $sHeadingMessage |
@@ -75,6 +75,7 @@ |
||
75 | 75 | * |
76 | 76 | * @since 3.1.0 |
77 | 77 | * @since 3.7.0 Moved from `AdminPageFramework_Form_View___Fieldset`. |
78 | + * @param string $sHeadingMessage |
|
78 | 79 | * @return string The error string message. An empty value if not found. |
79 | 80 | */ |
80 | 81 | private function _getFieldError( $aErrors, $aSectionPath, $aFieldPath, $sHeadingMessage ) { |