@@ -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, |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | // Generate id for this output |
| 151 | 151 | $_sOutput = implode( PHP_EOL, $_aOutput ); |
| 152 | - $_sElementID = "admin-page-framework-sectionsets-" . uniqid(); |
|
| 152 | + $_sElementID = "admin-page-framework-sectionsets-".uniqid(); |
|
| 153 | 153 | return $this->_getSpinnerOutput( $_sOutput ) |
| 154 | 154 | . "<div id='{$_sElementID}' class='admin-page-framework-sctionsets admin-page-framework-form-js-on'>" |
| 155 | 155 | . $_sOutput |
@@ -184,17 +184,17 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | // A sectionset is a set of sections. |
| 186 | 186 | $_sSectionSet = $this->_getSectionsetsTables( |
| 187 | - $aSectionsets, // sectionset definition (already devided by section tab) |
|
| 188 | - $aFieldsets, // fieldset definitions (already devided by section tab) |
|
| 187 | + $aSectionsets, // sectionset definition (already devided by section tab) |
|
| 188 | + $aFieldsets, // fieldset definitions (already devided by section tab) |
|
| 189 | 189 | $aCallbacks |
| 190 | 190 | ); |
| 191 | 191 | return $_sSectionSet |
| 192 | - ? "<div " . $this->getAttributes( |
|
| 192 | + ? "<div ".$this->getAttributes( |
|
| 193 | 193 | array( |
| 194 | 194 | 'class' => 'admin-page-framework-sectionset', |
| 195 | - 'id' => "sectionset-{$sSectionTabSlug}_" . md5( serialize( $aSectionsets ) ), |
|
| 195 | + 'id' => "sectionset-{$sSectionTabSlug}_".md5( serialize( $aSectionsets ) ), |
|
| 196 | 196 | ) |
| 197 | - ) . ">" |
|
| 197 | + ).">" |
|
| 198 | 198 | . $_sSectionSet |
| 199 | 199 | . "</div>" |
| 200 | 200 | : ''; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * If no fields belonging to the section, return empty. |
| 227 | 227 | * Otherwise, the sectionsets container gets rendered and its CSS rules such as margins give unwanted results. |
| 228 | 228 | */ |
| 229 | - if ( ! count( $aFieldsets ) ) { |
|
| 229 | + if ( !count( $aFieldsets ) ) { |
|
| 230 | 230 | return ''; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -238,12 +238,12 @@ discard block |
||
| 238 | 238 | 'count_subsections' => 0, |
| 239 | 239 | ); |
| 240 | 240 | $_sThisSectionID = $_aFirstSectionset[ 'section_id' ]; |
| 241 | - $_sSectionsID = 'sections-' . $_sThisSectionID; |
|
| 241 | + $_sSectionsID = 'sections-'.$_sThisSectionID; |
|
| 242 | 242 | $_aCollapsible = $this->_getCollapsibleArgumentForSections( |
| 243 | 243 | $_aFirstSectionset |
| 244 | 244 | ); |
| 245 | 245 | |
| 246 | - foreach( $aSectionsets as $_aSectionset ) { |
|
| 246 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
| 247 | 247 | |
| 248 | 248 | $_sSectionTabSlug = $_aSectionset[ 'section_tab_slug' ]; // needed outside the loop |
| 249 | 249 | $_aOutputs = $this->_getSectionsetTable( |
@@ -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' ], |
@@ -304,17 +304,17 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
| 306 | 306 | |
| 307 | - if ( ! $this->isSectionsetVisible( $_aSection ) ) { |
|
| 307 | + if ( !$this->isSectionsetVisible( $_aSection ) ) { |
|
| 308 | 308 | // var_dump( 'not visible: ' . $_aSection[ '_section_path' ] ); |
| 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 |
| 320 | 320 | $_aSection[ '_section_path' ], // $_aSection[ 'section_id' ], // dimensional key |
@@ -358,29 +358,29 @@ 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' ] ) ) { |
|
| 371 | + if ( !empty( $_aSection[ 'sortable' ] ) ) { |
|
| 372 | 372 | // @todo Change the name of the class to AdminPageFramework_Form_Script_... |
| 373 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
| 373 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
| 374 | 374 | $_sSectionsID, |
| 375 | 375 | $_aSection[ 'sortable' ], |
| 376 | 376 | $this->oMsg |
| 377 | 377 | ); |
| 378 | - $_aOutputs[ 'section_contents' ][] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
| 378 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | // Get the section tables. |
| 382 | 382 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
| 383 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
| 383 | + foreach ( $_aSubSections as $_iIndex => $_aFields ) { |
|
| 384 | 384 | |
| 385 | 385 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
| 386 | 386 | $_aSection, |
@@ -410,8 +410,8 @@ discard block |
||
| 410 | 410 | array( |
| 411 | 411 | 'class' => 'element-address', |
| 412 | 412 | 'type' => 'hidden', |
| 413 | - 'name' => '__repeatable_elements_' . $aSection[ '_structure_type' ] |
|
| 414 | - . '[ ' . $aSection[ 'section_id' ] . ' ]', |
|
| 413 | + 'name' => '__repeatable_elements_'.$aSection[ '_structure_type' ] |
|
| 414 | + . '[ '.$aSection[ 'section_id' ].' ]', |
|
| 415 | 415 | // @todo examine whether this value should include a section index. |
| 416 | 416 | 'value' => $aSection[ 'section_id' ], |
| 417 | 417 | ) |
@@ -429,8 +429,8 @@ discard block |
||
| 429 | 429 | array( |
| 430 | 430 | 'class' => 'element-address', |
| 431 | 431 | 'type' => 'hidden', |
| 432 | - 'name' => '__sortable_elements_' . $aSection[ '_structure_type' ] |
|
| 433 | - . '[ ' . $aSection[ 'section_id' ] . ' ]', |
|
| 432 | + 'name' => '__sortable_elements_'.$aSection[ '_structure_type' ] |
|
| 433 | + . '[ '.$aSection[ 'section_id' ].' ]', |
|
| 434 | 434 | // @todo examine whether this value should include a section index. |
| 435 | 435 | 'value' => $aSection[ 'section_id' ], |
| 436 | 436 | ) |
@@ -452,8 +452,8 @@ discard block |
||
| 452 | 452 | 'input', |
| 453 | 453 | array( |
| 454 | 454 | 'type' => 'hidden', |
| 455 | - 'name' => '__unset_' . $aSection[ '_structure_type' ] . '[ ' . $aSection[ 'section_id' ] . ' ]', |
|
| 456 | - 'value' => "__dummy_option_key|" . $aSection[ 'section_id' ], |
|
| 455 | + 'name' => '__unset_'.$aSection[ '_structure_type' ].'[ '.$aSection[ 'section_id' ].' ]', |
|
| 456 | + 'value' => "__dummy_option_key|".$aSection[ 'section_id' ], |
|
| 457 | 457 | 'class' => 'unset-element-names element-address', |
| 458 | 458 | ) |
| 459 | 459 | ); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | private function _getSectionTableWithTabList( array $_aOutputs, array $aSectionset, $aFieldsetsPerSection ) { |
| 470 | 470 | |
| 471 | 471 | // Tab list |
| 472 | - $_aOutputs[ 'section_tab_list' ][] = $this->_getTabList( |
|
| 472 | + $_aOutputs[ 'section_tab_list' ][ ] = $this->_getTabList( |
|
| 473 | 473 | $aSectionset, |
| 474 | 474 | $aFieldsetsPerSection, |
| 475 | 475 | $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>" |
@@ -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' ] ) { |
@@ -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 | |
@@ -24,13 +24,13 @@ |
||
| 24 | 24 | protected function _get() { |
| 25 | 25 | return $this->_getFormSectionRules(); |
| 26 | 26 | } |
| 27 | - /** |
|
| 28 | - * Returns the CSS rules for form fields. |
|
| 29 | - * |
|
| 30 | - * @since 3.4.0 |
|
| 31 | - * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
| 32 | - * @internal |
|
| 33 | - */ |
|
| 27 | + /** |
|
| 28 | + * Returns the CSS rules for form fields. |
|
| 29 | + * |
|
| 30 | + * @since 3.4.0 |
|
| 31 | + * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
| 32 | + * @internal |
|
| 33 | + */ |
|
| 34 | 34 | private function _getFormSectionRules() { |
| 35 | 35 | |
| 36 | 36 | return <<<CSSRULES |
@@ -23,12 +23,12 @@ discard block |
||
| 23 | 23 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
| 24 | 24 | */ |
| 25 | 25 | static public $aStructure = array( |
| 26 | - 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
| 27 | - 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
| 28 | - 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
| 29 | - 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
| 30 | - 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
| 31 | - 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
| 26 | + 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
| 27 | + 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
| 28 | + 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
| 29 | + 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
| 30 | + 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
| 31 | + 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | 34 | public $abCollapsible = false; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @remark The framework will not pass this parameter when formatting a section definition array. |
| 42 | 42 | * It will be passed when the framework is rendering a form table to generate collapsible elements. |
| 43 | 43 | */ |
| 44 | - public $aSection = array(); |
|
| 44 | + public $aSection = array(); |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Sets up properties. |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | $_aCollapsible = $this->getAsArray( $this->abCollapsible ) + array( |
| 86 | 86 | 'title' => $sTitle, |
| 87 | - ) + self::$aStructure; |
|
| 87 | + ) + self::$aStructure; |
|
| 88 | 88 | |
| 89 | 89 | $_aCollapsible[ 'toggle_all_button' ] = implode( |
| 90 | 90 | ',', |
| 91 | 91 | $this->getAsArray( $_aCollapsible[ 'toggle_all_button' ] ) |
| 92 | 92 | ); |
| 93 | 93 | |
| 94 | - if ( ! empty( $aSection ) ) { |
|
| 94 | + if ( !empty( $aSection ) ) { |
|
| 95 | 95 | $_aCollapsible[ 'toggle_all_button' ] = $this->_getToggleAllButtonArgument( |
| 96 | 96 | $_aCollapsible[ 'toggle_all_button' ], |
| 97 | 97 | $aSection |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | private function _getToggleAllButtonArgument( $sToggleAll, array $aSection ) { |
| 117 | 117 | |
| 118 | - if ( ! $aSection[ 'repeatable' ] ) { |
|
| 118 | + if ( !$aSection[ 'repeatable' ] ) { |
|
| 119 | 119 | return $sToggleAll; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // Disable the toggle all button for middle sub-sections in repeatable sections. |
| 128 | - if ( ! $aSection[ '_is_first_index' ] && ! $aSection[ '_is_last_index' ] ) { |
|
| 128 | + if ( !$aSection[ '_is_first_index' ] && !$aSection[ '_is_last_index' ] ) { |
|
| 129 | 129 | return 0; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | $_aToggleAll = $this->getAOrB( |
| 133 | - true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
| 134 | - array( 'top-right', 'bottom-right' ), // if true |
|
| 133 | + true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
| 134 | + array( 'top-right', 'bottom-right' ), // if true |
|
| 135 | 135 | explode( ',', $sToggleAll ) // if false |
| 136 | 136 | ); |
| 137 | 137 | $_aToggleAll = $this->getAOrB( |
@@ -35,41 +35,41 @@ discard block |
||
| 35 | 35 | // Optional |
| 36 | 36 | 'page_slug' => null, |
| 37 | 37 | 'tab_slug' => null, |
| 38 | - 'section_tab_slug' => null, // 3.0.0+ |
|
| 38 | + 'section_tab_slug' => null, // 3.0.0+ |
|
| 39 | 39 | 'title' => null, |
| 40 | 40 | 'description' => null, |
| 41 | 41 | 'capability' => null, |
| 42 | 42 | 'if' => true, |
| 43 | - 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
| 43 | + 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
| 44 | 44 | 'help' => null, |
| 45 | 45 | 'help_aside' => null, |
| 46 | - 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
| 47 | - 'sortable' => false, // (boolean|array) 3.6.0+ |
|
| 46 | + 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
| 47 | + 'sortable' => false, // (boolean|array) 3.6.0+ |
|
| 48 | 48 | 'attributes' => array( // 3.3.1+ |
| 49 | - 'class' => null, // set null to avoid undefined index warnings. |
|
| 50 | - 'style' => null, // set null to avoid undefined index warnings. |
|
| 49 | + 'class' => null, // set null to avoid undefined index warnings. |
|
| 50 | + 'style' => null, // set null to avoid undefined index warnings. |
|
| 51 | 51 | 'tab' => array(), |
| 52 | 52 | ), |
| 53 | 53 | 'class' => array( // 3.3.1+ |
| 54 | 54 | 'tab' => array(), |
| 55 | 55 | ), |
| 56 | - 'hidden' => false, // 3.3.1+ |
|
| 57 | - 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
| 58 | - 'save' => true, // 3.6.0+ |
|
| 56 | + 'hidden' => false, // 3.3.1+ |
|
| 57 | + 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
| 58 | + 'save' => true, // 3.6.0+ |
|
| 59 | 59 | |
| 60 | - 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
| 60 | + 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
| 61 | 61 | |
| 62 | - 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
| 62 | + 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
| 63 | 63 | |
| 64 | 64 | // Internal |
| 65 | - '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
| 66 | - '_structure_type' => null, // 3.7.0+ |
|
| 67 | - '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
| 68 | - '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
| 65 | + '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
| 66 | + '_structure_type' => null, // 3.7.0+ |
|
| 67 | + '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
| 68 | + '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
| 69 | 69 | |
| 70 | - '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
| 71 | - '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
| 72 | - '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
| 70 | + '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
| 71 | + '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
| 72 | + '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
| 73 | 73 | |
| 74 | 74 | // 3.6.0+ - (object) the caller framework factory object. This allows the framework to access the factory property when rendering the section. |
| 75 | 75 | // 3.7.0+ It no longer stores a factory object but a form object. |
@@ -124,11 +124,11 @@ discard block |
||
| 124 | 124 | $_aSectionPath = explode( '|', $this->sSectionPath ); |
| 125 | 125 | $_aSectionset = $this->uniteArrays( |
| 126 | 126 | array( |
| 127 | - '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
| 128 | - '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
| 129 | - '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
| 127 | + '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
| 128 | + '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
| 129 | + '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
| 130 | 130 | '_section_path_array' => $_aSectionPath, |
| 131 | - '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
| 131 | + '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
| 132 | 132 | ) |
| 133 | 133 | + $this->aSectionset |
| 134 | 134 | + array( |
@@ -29,36 +29,36 @@ discard block |
||
| 29 | 29 | static public $aStructure = array( |
| 30 | 30 | |
| 31 | 31 | // Required Keys |
| 32 | - 'field_id' => null, // (string) |
|
| 33 | - 'type' => null, // (string) |
|
| 34 | - 'section_id' => null, // (string) |
|
| 32 | + 'field_id' => null, // (string) |
|
| 33 | + 'type' => null, // (string) |
|
| 34 | + 'section_id' => null, // (string) |
|
| 35 | 35 | |
| 36 | 36 | // Optional Keys |
| 37 | - 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
| 38 | - 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
| 39 | - 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
| 40 | - 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
| 41 | - 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
| 37 | + 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
| 38 | + 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
| 39 | + 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
| 40 | + 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
| 41 | + 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
| 42 | 42 | 'capability' => null, |
| 43 | 43 | 'title' => null, |
| 44 | 44 | 'tip' => null, |
| 45 | 45 | 'description' => null, |
| 46 | - 'error_message' => null, // error message for the field |
|
| 46 | + 'error_message' => null, // error message for the field |
|
| 47 | 47 | 'before_label' => null, |
| 48 | 48 | 'after_label' => null, |
| 49 | 49 | 'if' => true, |
| 50 | - 'order' => null, // do not set the default number here for this key. |
|
| 50 | + 'order' => null, // do not set the default number here for this key. |
|
| 51 | 51 | 'default' => null, |
| 52 | 52 | 'value' => null, |
| 53 | - 'help' => null, // 2.1.0+ |
|
| 54 | - 'help_aside' => null, // 2.1.0+ |
|
| 55 | - 'repeatable' => null, // 2.1.3+ |
|
| 56 | - 'sortable' => null, // 2.1.3+ |
|
| 57 | - 'show_title_column' => true, // 3.0.0+ |
|
| 58 | - 'hidden' => null, // 3.0.0+ |
|
| 53 | + 'help' => null, // 2.1.0+ |
|
| 54 | + 'help_aside' => null, // 2.1.0+ |
|
| 55 | + 'repeatable' => null, // 2.1.3+ |
|
| 56 | + 'sortable' => null, // 2.1.3+ |
|
| 57 | + 'show_title_column' => true, // 3.0.0+ |
|
| 58 | + 'hidden' => null, // 3.0.0+ |
|
| 59 | 59 | |
| 60 | 60 | // @todo Examine why an array is not set but null here for the attributes argument. |
| 61 | - 'attributes' => null, // 3.0.0+ - the array represents the attributes of input tag |
|
| 61 | + 'attributes' => null, // 3.0.0+ - the array represents the attributes of input tag |
|
| 62 | 62 | 'class' => array( // 3.3.1+ |
| 63 | 63 | 'fieldrow' => array(), |
| 64 | 64 | 'fieldset' => array(), |
@@ -66,21 +66,21 @@ discard block |
||
| 66 | 66 | 'field' => array(), |
| 67 | 67 | ), |
| 68 | 68 | |
| 69 | - 'save' => true, // 3.6.0+ |
|
| 70 | - 'content' => null, // 3.6.1+ - (string) An overriding field-set output. |
|
| 69 | + 'save' => true, // 3.6.0+ |
|
| 70 | + 'content' => null, // 3.6.1+ - (string) An overriding field-set output. |
|
| 71 | 71 | |
| 72 | 72 | // Internal Keys |
| 73 | - '_fields_type' => null, // @deprecated 3.7.0++, 3.0.0+ - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
| 74 | - '_structure_type' => null, // DEVVEr+ |
|
| 75 | - '_caller_object' => null, // 3.4.0+ - (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
| 73 | + '_fields_type' => null, // @deprecated 3.7.0++, 3.0.0+ - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
| 74 | + '_structure_type' => null, // DEVVEr+ |
|
| 75 | + '_caller_object' => null, // 3.4.0+ - (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
| 76 | 76 | |
| 77 | - '_section_path' => '', // 3.7.0+ (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
| 78 | - '_section_path_array' => '', // 3.7.0+ (array) An array version of the above section path. |
|
| 79 | - '_nested_depth' => 0, // 3.4.0+ - (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
| 80 | - '_subsection_index' => null, // 3.7.0+ Passed to the `field_definition_{...}` filter hook callbacks. |
|
| 77 | + '_section_path' => '', // 3.7.0+ (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
| 78 | + '_section_path_array' => '', // 3.7.0+ (array) An array version of the above section path. |
|
| 79 | + '_nested_depth' => 0, // 3.4.0+ - (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
| 80 | + '_subsection_index' => null, // 3.7.0+ Passed to the `field_definition_{...}` filter hook callbacks. |
|
| 81 | 81 | |
| 82 | - '_field_path' => '', // 3.7.0+ (string Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
| 83 | - '_field_path_array' => '', // 3.7.0+ (array) An array version of the above field path. |
|
| 82 | + '_field_path' => '', // 3.7.0+ (string Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
| 83 | + '_field_path_array' => '', // 3.7.0+ (array) An array version of the above field path. |
|
| 84 | 84 | |
| 85 | 85 | ); |
| 86 | 86 | |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | array( |
| 158 | 158 | '_fields_type' => $this->sStructureType, // @deprecated 3.7.0 backward-compatibility |
| 159 | 159 | '_structure_type' => $this->sStructureType, |
| 160 | - '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller framework factory object. |
|
| 161 | - '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
| 160 | + '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller framework factory object. |
|
| 161 | + '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
| 162 | 162 | ) |
| 163 | 163 | + $this->aFieldset, |
| 164 | 164 | array( |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | // @todo when nested fields are supported, set an appropriate value here. |
| 178 | 178 | $_aFieldset[ '_field_path' ] = $this->getFormElementPath( $_aFieldset[ 'field_id' ] ); |
| 179 | 179 | $_aFieldset[ '_field_path_array' ] = explode( '|', $_aFieldset[ '_field_path' ] ); |
| 180 | -$_aFieldset[ '_nested_depth' ] = count( $_aFieldset[ '_field_path_array' ] ) - 1 ; |
|
| 180 | +$_aFieldset[ '_nested_depth' ] = count( $_aFieldset[ '_field_path_array' ] ) - 1; |
|
| 181 | 181 | |
| 182 | - $_aFieldset[ 'order' ] = $this->getAOrB( |
|
| 182 | + $_aFieldset[ 'order' ] = $this->getAOrB( |
|
| 183 | 183 | is_numeric( $_aFieldset[ 'order' ] ), |
| 184 | 184 | $_aFieldset[ 'order' ], |
| 185 | 185 | $this->iCountOfElements + 10 |
@@ -52,16 +52,16 @@ discard block |
||
| 52 | 52 | public function getPageOnlyOptions( $aOptions, $sPageSlug ) { |
| 53 | 53 | |
| 54 | 54 | $_aStoredOptionsOfThePage = array(); |
| 55 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 55 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 56 | 56 | |
| 57 | 57 | // Check the section |
| 58 | - if ( ! $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
| 58 | + if ( !$this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
| 59 | 59 | continue; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // At this point, the element belongs the given page slug as the section is of the given page slug's. |
| 63 | 63 | $this->_setPageOnlyOptions( |
| 64 | - $_aStoredOptionsOfThePage, // by reference - gets updated in the method. |
|
| 64 | + $_aStoredOptionsOfThePage, // by reference - gets updated in the method. |
|
| 65 | 65 | $aOptions, |
| 66 | 66 | $_aSubSectionsOrFields, |
| 67 | 67 | $sPageSlug, |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * @internal |
| 82 | 82 | */ |
| 83 | 83 | private function _setPageOnlyOptions( array &$_aStoredOptionsOfThePage, array $aOptions, array $_aSubSectionsOrFields, $sPageSlug, $_sSectionID ) { |
| 84 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
| 84 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
| 85 | 85 | |
| 86 | 86 | // If it's a sub-section array, |
| 87 | 87 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | public function getOtherPageOptions( $aOptions, $sPageSlug ) { |
| 154 | 154 | |
| 155 | 155 | $_aStoredOptionsNotOfThePage = array(); |
| 156 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 156 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 157 | 157 | |
| 158 | 158 | // Check the section |
| 159 | 159 | if ( $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @internal |
| 183 | 183 | */ |
| 184 | 184 | private function _setOtherPageOptions( array &$_aStoredOptionsNotOfThePage, array $aOptions, array $_aSubSectionsOrFields, $sPageSlug ) { |
| 185 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
| 185 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
| 186 | 186 | |
| 187 | 187 | // It's a sub-section array. |
| 188 | 188 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | public function getOtherTabOptions( $aOptions, $sPageSlug, $sTabSlug ) { |
| 246 | 246 | |
| 247 | 247 | $_aStoredOptionsNotOfTheTab = array(); |
| 248 | - foreach( $this->aFieldsets as $_sSectionPath => $_aSubSectionsOrFields ) { |
|
| 248 | + foreach ( $this->aFieldsets as $_sSectionPath => $_aSubSectionsOrFields ) { |
|
| 249 | 249 | |
| 250 | 250 | // If the section is of the given page and the given tab, skip. |
| 251 | 251 | if ( $this->_isThisSectionSetToThisTab( $_sSectionPath, $sPageSlug, $sTabSlug ) ) { |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | private function _setOtherTabOptions( array &$_aStoredOptionsNotOfTheTab, array $aOptions, array $_aSubSectionsOrFields, $sSectionPath ) { |
| 277 | 277 | |
| 278 | 278 | // At this point, the passed element belongs to the other tabs since the section of the given tab is skipped. |
| 279 | - foreach ( $_aSubSectionsOrFields as $_isSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 279 | + foreach ( $_aSubSectionsOrFields as $_isSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
| 280 | 280 | |
| 281 | 281 | // If it's a sub section |
| 282 | 282 | if ( $this->isNumericInteger( $_isSubSectionIndexOrFieldID ) ) { |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition_Page`. |
| 334 | 334 | * @return array |
| 335 | 335 | */ |
| 336 | - public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
| 336 | + public function getTabOptions( $aOptions, $sPageSlug, $sTabSlug = '' ) { |
|
| 337 | 337 | $_aOtherTabOptions = $this->getOtherTabOptions( $aOptions, $sPageSlug, $sTabSlug ); |
| 338 | 338 | return $this->invertCastArrayContents( $aOptions, $_aOtherTabOptions ); |
| 339 | 339 | } |
@@ -348,17 +348,17 @@ discard block |
||
| 348 | 348 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition_Page`. |
| 349 | 349 | * @return array |
| 350 | 350 | */ |
| 351 | - public function getTabOnlyOptions( array $aOptions, $sPageSlug, $sTabSlug='' ) { |
|
| 351 | + public function getTabOnlyOptions( array $aOptions, $sPageSlug, $sTabSlug = '' ) { |
|
| 352 | 352 | |
| 353 | 353 | $_aStoredOptionsOfTheTab = array(); |
| 354 | - if ( ! $sTabSlug ) { |
|
| 354 | + if ( !$sTabSlug ) { |
|
| 355 | 355 | return $_aStoredOptionsOfTheTab; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 358 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 359 | 359 | |
| 360 | 360 | // Check the section |
| 361 | - if ( ! $this->_isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) ) { |
|
| 361 | + if ( !$this->_isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) ) { |
|
| 362 | 362 | continue; |
| 363 | 363 | } |
| 364 | 364 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | */ |
| 385 | 385 | private function _setTabOnlyOptions( array &$_aStoredOptionsOfTheTab, array $aOptions, array $_aSubSectionsOrFields, $_sSectionID ) { |
| 386 | 386 | |
| 387 | - foreach( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
| 387 | + foreach ( $_aSubSectionsOrFields as $_sFieldID => $_aFieldset ) { |
|
| 388 | 388 | |
| 389 | 389 | // if it's a sub-section array. |
| 390 | 390 | if ( $this->isNumericInteger( $_sFieldID ) ) { |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | */ |
| 442 | 442 | private function _isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) { |
| 443 | 443 | |
| 444 | - if ( ! isset( $this->aSectionsets[ $_sSectionID ][ 'page_slug' ] ) ) { |
|
| 444 | + if ( !isset( $this->aSectionsets[ $_sSectionID ][ 'page_slug' ] ) ) { |
|
| 445 | 445 | return false; |
| 446 | 446 | } |
| 447 | 447 | return ( |
@@ -459,10 +459,10 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | private function _isThisSectionSetToThisTab( $_sSectionID, $sPageSlug, $sTabSlug ) { |
| 461 | 461 | |
| 462 | - if ( ! $this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
| 462 | + if ( !$this->_isThisSectionSetToThisPage( $_sSectionID, $sPageSlug ) ) { |
|
| 463 | 463 | return false; |
| 464 | 464 | } |
| 465 | - if ( ! isset( $this->aSectionsets[ $_sSectionID ][ 'tab_slug' ] ) ) { |
|
| 465 | + if ( !isset( $this->aSectionsets[ $_sSectionID ][ 'tab_slug' ] ) ) { |
|
| 466 | 466 | return false; |
| 467 | 467 | } |
| 468 | 468 | return ( |
@@ -479,9 +479,9 @@ discard block |
||
| 479 | 479 | */ |
| 480 | 480 | private function _setOptionValue( &$aSubject, $asDimensionalPath, $aOptions ) { |
| 481 | 481 | $_aDimensionalPath = $this->getAsArray( $asDimensionalPath ); |
| 482 | - $_mValue = $this->getElement( |
|
| 482 | + $_mValue = $this->getElement( |
|
| 483 | 483 | $aOptions, |
| 484 | - $_aDimensionalPath, // as of 3.7.0, it can be an array or string |
|
| 484 | + $_aDimensionalPath, // as of 3.7.0, it can be an array or string |
|
| 485 | 485 | null |
| 486 | 486 | ); |
| 487 | 487 | if ( isset( $_mValue ) ) { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @callback action try_validation_after_{class name} |
| 33 | 33 | */ |
| 34 | 34 | public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) { |
| 35 | - if ( ! $this->_shouldProceed() ) { |
|
| 35 | + if ( !$this->_shouldProceed() ) { |
|
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | $this->_doImportOptions( |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | // Check the uploaded file MIME type. |
| 103 | 103 | $_aMIMEType = $this->_getImportMIMEType( $_aArguments ); |
| 104 | 104 | $_sType = $_oImport->getType(); |
| 105 | - if ( ! in_array( $_sType, $_aMIMEType ) ) { |
|
| 105 | + if ( !in_array( $_sType, $_aMIMEType ) ) { |
|
| 106 | 106 | $this->oFactory->setSettingNotice( sprintf( $this->oFactory->oMsg->get( 'uploaded_file_type_not_supported' ), $_sType ) ); |
| 107 | - return $aStoredOptions; // do not change the framework's options. |
|
| 107 | + return $aStoredOptions; // do not change the framework's options. |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | // Retrieve the importing data. |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | array( |
| 170 | 170 | 'text/plain', |
| 171 | 171 | 'application/octet-stream', // .json file is dealt as a binary file. |
| 172 | - 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
| 172 | + 'application/json', // 3.7.0+ some servers cannot upload json files without this |
|
| 173 | 173 | ), |
| 174 | 174 | $aArguments |
| 175 | 175 | ); |
@@ -258,18 +258,18 @@ discard block |
||
| 258 | 258 | protected function _getPortFilterHookNames( $sPrefix, array $aArguments ) { |
| 259 | 259 | |
| 260 | 260 | return array( |
| 261 | - $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_input_id' ], |
|
| 261 | + $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_input_id' ], |
|
| 262 | 262 | $aArguments[ 'section_id' ] |
| 263 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] .'_' . $aArguments[ 'pressed_field_id' ] |
|
| 264 | - : $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'pressed_field_id' ], |
|
| 263 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ].'_'.$aArguments[ 'pressed_field_id' ] |
|
| 264 | + : $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'pressed_field_id' ], |
|
| 265 | 265 | $aArguments[ 'section_id' ] |
| 266 | - ? $sPrefix . $aArguments[ 'class_name' ] . '_' . $aArguments[ 'section_id' ] |
|
| 266 | + ? $sPrefix.$aArguments[ 'class_name' ].'_'.$aArguments[ 'section_id' ] |
|
| 267 | 267 | : null, |
| 268 | 268 | $aArguments[ 'tab_slug' ] |
| 269 | - ? $sPrefix . $aArguments[ 'page_slug' ] . '_' . $aArguments[ 'tab_slug' ] |
|
| 269 | + ? $sPrefix.$aArguments[ 'page_slug' ].'_'.$aArguments[ 'tab_slug' ] |
|
| 270 | 270 | : null, |
| 271 | - $sPrefix . $aArguments[ 'page_slug' ], |
|
| 272 | - $sPrefix . $aArguments[ 'class_name' ] |
|
| 271 | + $sPrefix.$aArguments[ 'page_slug' ], |
|
| 272 | + $sPrefix.$aArguments[ 'class_name' ] |
|
| 273 | 273 | ); |
| 274 | 274 | |
| 275 | 275 | } |