@@ -51,6 +51,7 @@ |
||
| 51 | 51 | /** |
| 52 | 52 | * Applies the subject string to the set callback filter function. |
| 53 | 53 | * @since 3.6.0 |
| 54 | + * @param string $sSubject |
|
| 54 | 55 | */ |
| 55 | 56 | protected function _getFiltered( $sSubject ) { |
| 56 | 57 | return is_callable( $this->hfCallback ) |
@@ -93,8 +93,8 @@ |
||
| 93 | 93 | |
| 94 | 94 | // Extract the first part as it does not have braces |
| 95 | 95 | $_sName = array_shift( $aParts ); |
| 96 | - foreach( $aParts as $_sPart ) { |
|
| 97 | - $_sName .= '[' . $_sPart . ']'; |
|
| 96 | + foreach ( $aParts as $_sPart ) { |
|
| 97 | + $_sName .= '['.$_sPart.']'; |
|
| 98 | 98 | } |
| 99 | 99 | return $_sName; |
| 100 | 100 | |
@@ -161,6 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | /** |
| 163 | 163 | * @since DEVVER |
| 164 | + * @param string $_sOutput |
|
| 164 | 165 | * @return string |
| 165 | 166 | */ |
| 166 | 167 | private function _getSpinnerOutput( $_sOutput ) { |
@@ -297,7 +298,7 @@ discard block |
||
| 297 | 298 | * @param array $_aOutputs Holds output elements - contents, section tab list, count of subsections |
| 298 | 299 | * @param string $_sSectionsID The container id of secitons. |
| 299 | 300 | * @param array $_aSection |
| 300 | - * @param array $_aFieldsInSections A fieldsets array already divided by section tab. |
|
| 301 | + * @param array $aFieldsInSections A fieldsets array already divided by section tab. |
|
| 301 | 302 | * @return array The updated sections table output array. |
| 302 | 303 | */ |
| 303 | 304 | private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
@@ -351,6 +352,7 @@ discard block |
||
| 351 | 352 | } |
| 352 | 353 | /** |
| 353 | 354 | * @since DEVVER |
| 355 | + * @param string $_sSectionsID |
|
| 354 | 356 | * @return array |
| 355 | 357 | */ |
| 356 | 358 | private function _getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
@@ -499,6 +501,7 @@ discard block |
||
| 499 | 501 | * @since 3.5.3 |
| 500 | 502 | * @since 3.6.0 Removed the `$sSectionID` parameter. Added the `$aSectionset` parameter. |
| 501 | 503 | * @since DEVVER Moved from `AdminPageFramework_FormPart_Table`. |
| 504 | + * @param string $sSectionsID |
|
| 502 | 505 | * @return string The formatted sections table HTML output. |
| 503 | 506 | */ |
| 504 | 507 | private function _getFormattedSectionsTablesOutput( array $aOutputs, $aSectionset, $sSectionsID, array $aCollapsible, $sSectionTabSlug ) { |
@@ -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>" |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | private function _getSectionsetsTables( array $aSectionsets, array $aFieldsets, array $aCallbacks ) { |
| 205 | 205 | |
| 206 | 206 | |
| 207 | - if ( empty( $aSectionsets ) ) { |
|
| 207 | + if ( empty( $aSectionsets ) ) { |
|
| 208 | 208 | return ''; |
| 209 | 209 | } |
| 210 | 210 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
| 259 | 259 | * @return array |
| 260 | 260 | */ |
| 261 | - private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
| 261 | + private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
| 262 | 262 | |
| 263 | 263 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
| 264 | 264 | $aSectionset[ 'collapsible' ], |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | // Get the section tables. |
| 365 | 365 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
| 366 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
| 366 | + foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
| 367 | 367 | |
| 368 | 368 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
| 369 | 369 | $_aSection, |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | */ |
| 429 | 429 | private function _getUnsetFlagSectionInputTag( array $aSection ) { |
| 430 | 430 | |
| 431 | - if ( false !== $aSection[ 'save' ] ) { |
|
| 431 | + if ( false !== $aSection[ 'save' ] ) { |
|
| 432 | 432 | return ''; |
| 433 | 433 | } |
| 434 | 434 | return $this->getHTMLTag( |
@@ -127,16 +127,16 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function get() { |
| 129 | 129 | |
| 130 | - $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
| 130 | + $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
| 131 | 131 | $this->aStructure[ 'sectionsets' ], |
| 132 | 132 | $this->aStructure[ 'fieldsets' ], |
| 133 | 133 | $this->aArguments[ 'nested_depth' ] |
| 134 | 134 | ); |
| 135 | 135 | |
| 136 | - $_aOutput = array(); |
|
| 137 | - foreach( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
| 136 | + $_aOutput = array(); |
|
| 137 | + foreach ( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
| 138 | 138 | |
| 139 | - $_aOutput[] = $this->_getFormOutput( |
|
| 139 | + $_aOutput[ ] = $this->_getFormOutput( |
|
| 140 | 140 | $_oFormatSectionsetsByTab->getSectionsets( $_sSectionTabSlug ), |
| 141 | 141 | $_oFormatSectionsetsByTab->getFieldsets( $_sSectionTabSlug ), |
| 142 | 142 | $_sSectionTabSlug, |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | // Generate id for this output |
| 152 | 152 | $_sOutput = implode( PHP_EOL, $_aOutput ); |
| 153 | - $_sElementID = "admin-page-framework-sectionsets-" . uniqid(); |
|
| 153 | + $_sElementID = "admin-page-framework-sectionsets-".uniqid(); |
|
| 154 | 154 | return $this->_getSpinnerOutput( $_sOutput ) |
| 155 | 155 | . "<div id='{$_sElementID}' class='admin-page-framework-sctionsets admin-page-framework-form-js-on'>" |
| 156 | 156 | . $_sOutput |
@@ -185,17 +185,17 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | // A sectionset is a set of sections. |
| 187 | 187 | $_sSectionSet = $this->_getSectionsetsTables( |
| 188 | - $aSectionsets, // section-set definition (already divided by section tab) |
|
| 189 | - $aFieldsets, // field-set definitions (already divided by section tab) |
|
| 188 | + $aSectionsets, // section-set definition (already divided by section tab) |
|
| 189 | + $aFieldsets, // field-set definitions (already divided by section tab) |
|
| 190 | 190 | $aCallbacks |
| 191 | 191 | ); |
| 192 | 192 | return $_sSectionSet |
| 193 | - ? "<div " . $this->getAttributes( |
|
| 193 | + ? "<div ".$this->getAttributes( |
|
| 194 | 194 | array( |
| 195 | 195 | 'class' => 'admin-page-framework-sectionset', |
| 196 | - 'id' => "sectionset-{$sSectionTabSlug}_" . md5( serialize( $aSectionsets ) ), |
|
| 196 | + 'id' => "sectionset-{$sSectionTabSlug}_".md5( serialize( $aSectionsets ) ), |
|
| 197 | 197 | ) |
| 198 | - ) . ">" |
|
| 198 | + ).">" |
|
| 199 | 199 | . $_sSectionSet |
| 200 | 200 | . "</div>" |
| 201 | 201 | : ''; |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | * If there is no field overall to the section and its section tab, return an empty string. |
| 228 | 228 | * Otherwise, the sectionsets container gets rendered and its CSS rules such as margins give unwanted results. |
| 229 | 229 | */ |
| 230 | - if ( ! count( $aFieldsets ) ) { |
|
| 230 | + if ( !count( $aFieldsets ) ) { |
|
| 231 | 231 | return ''; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -239,13 +239,13 @@ discard block |
||
| 239 | 239 | ); |
| 240 | 240 | $_sSectionTabSlug = $_aFirstSectionset[ 'section_tab_slug' ]; |
| 241 | 241 | $_sThisSectionID = $_aFirstSectionset[ 'section_id' ]; |
| 242 | - $_sSectionsID = 'sections-' . $_sThisSectionID; |
|
| 242 | + $_sSectionsID = 'sections-'.$_sThisSectionID; |
|
| 243 | 243 | $_aCollapsible = $this->_getCollapsibleArgumentForSections( |
| 244 | 244 | $_aFirstSectionset |
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | - foreach( $aSectionsets as $_aSectionset ) { |
|
| 248 | - $_aOutputs = $this->_getSectionsetTable( |
|
| 247 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
| 248 | + $_aOutputs = $this->_getSectionsetTable( |
|
| 249 | 249 | $_aOutputs, |
| 250 | 250 | $_sSectionsID, |
| 251 | 251 | $_aSectionset, |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
| 274 | 274 | * @return array |
| 275 | 275 | */ |
| 276 | - private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
| 276 | + private function _getCollapsibleArgumentForSections( array $aSectionset = array() ) { |
|
| 277 | 277 | |
| 278 | 278 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
| 279 | 279 | $aSectionset[ 'collapsible' ], |
@@ -301,19 +301,19 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
| 303 | 303 | |
| 304 | - if ( ! $this->isSectionsetVisible( $_aSection ) ) { |
|
| 304 | + if ( !$this->isSectionsetVisible( $_aSection ) ) { |
|
| 305 | 305 | return $_aOutputs; |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | // If the 'save' argument is false, insert a flag that disables saving the section inputs. |
| 309 | - $_aOutputs[ 'section_contents' ][] = $this->_getUnsetFlagSectionInputTag( $_aSection ); |
|
| 309 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getUnsetFlagSectionInputTag( $_aSection ); |
|
| 310 | 310 | |
| 311 | 311 | // For repeatable sections - sub-sections are divided field definition arrays by sub-section index, |
| 312 | 312 | // not section definition arrays. |
| 313 | - $_aSubSections = $this->getIntegerKeyElements( |
|
| 313 | + $_aSubSections = $this->getIntegerKeyElements( |
|
| 314 | 314 | $this->getElementAsArray( |
| 315 | 315 | $aFieldsInSections, // subject array |
| 316 | - $_aSection[ '_section_path' ], // dimensional path |
|
| 316 | + $_aSection[ '_section_path' ], // dimensional path |
|
| 317 | 317 | array() // default |
| 318 | 318 | ) |
| 319 | 319 | ); |
@@ -356,28 +356,28 @@ discard block |
||
| 356 | 356 | private function _getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
| 357 | 357 | |
| 358 | 358 | // Add the repeatable sections enabler script. |
| 359 | - if ( ! empty( $_aSection[ 'repeatable' ] ) ) { |
|
| 360 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( |
|
| 359 | + if ( !empty( $_aSection[ 'repeatable' ] ) ) { |
|
| 360 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( |
|
| 361 | 361 | $_sSectionsID, |
| 362 | 362 | $_aOutputs[ 'count_subsections' ], |
| 363 | 363 | $_aSection[ 'repeatable' ], |
| 364 | 364 | $this->oMsg |
| 365 | 365 | ); |
| 366 | - $_aOutputs[ 'section_contents' ][] = $this->_getRepeatableSectionFlagTag( $_aSection ); |
|
| 366 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getRepeatableSectionFlagTag( $_aSection ); |
|
| 367 | 367 | } |
| 368 | 368 | // Add the sortable sections enabler script. 3.6.0+ |
| 369 | - if ( ! empty( $_aSection[ 'sortable' ] ) ) { |
|
| 370 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
| 369 | + if ( !empty( $_aSection[ 'sortable' ] ) ) { |
|
| 370 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
| 371 | 371 | $_sSectionsID, |
| 372 | 372 | $_aSection[ 'sortable' ], |
| 373 | 373 | $this->oMsg |
| 374 | 374 | ); |
| 375 | - $_aOutputs[ 'section_contents' ][] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
| 375 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | // Get the section tables. |
| 379 | 379 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
| 380 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
| 380 | + foreach ( $_aSubSections as $_iIndex => $_aFields ) { |
|
| 381 | 381 | |
| 382 | 382 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
| 383 | 383 | $_aSection, |
@@ -407,8 +407,8 @@ discard block |
||
| 407 | 407 | array( |
| 408 | 408 | 'class' => 'element-address', |
| 409 | 409 | 'type' => 'hidden', |
| 410 | - 'name' => '__repeatable_elements_' . $aSection[ '_structure_type' ] |
|
| 411 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
| 410 | + 'name' => '__repeatable_elements_'.$aSection[ '_structure_type' ] |
|
| 411 | + . '['.$aSection[ 'section_id' ].']', |
|
| 412 | 412 | // @todo examine whether this value should include a section index. |
| 413 | 413 | 'value' => $aSection[ 'section_id' ], |
| 414 | 414 | ) |
@@ -426,8 +426,8 @@ discard block |
||
| 426 | 426 | array( |
| 427 | 427 | 'class' => 'element-address', |
| 428 | 428 | 'type' => 'hidden', |
| 429 | - 'name' => '__sortable_elements_' . $aSection[ '_structure_type' ] |
|
| 430 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
| 429 | + 'name' => '__sortable_elements_'.$aSection[ '_structure_type' ] |
|
| 430 | + . '['.$aSection[ 'section_id' ].']', |
|
| 431 | 431 | // @todo examine whether this value should include a section index. |
| 432 | 432 | 'value' => $aSection[ 'section_id' ], |
| 433 | 433 | ) |
@@ -449,8 +449,8 @@ discard block |
||
| 449 | 449 | 'input', |
| 450 | 450 | array( |
| 451 | 451 | 'type' => 'hidden', |
| 452 | - 'name' => '__unset_' . $aSection[ '_structure_type' ] . '[' . $aSection[ 'section_id' ] . ']', |
|
| 453 | - 'value' => "__dummy_option_key|" . $aSection[ 'section_id' ], |
|
| 452 | + 'name' => '__unset_'.$aSection[ '_structure_type' ].'['.$aSection[ 'section_id' ].']', |
|
| 453 | + 'value' => "__dummy_option_key|".$aSection[ 'section_id' ], |
|
| 454 | 454 | 'class' => 'unset-element-names element-address', |
| 455 | 455 | ) |
| 456 | 456 | ); |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | private function _getSectionTableWithTabList( array $_aOutputs, array $aSectionset, $aFieldsetsPerSection ) { |
| 467 | 467 | |
| 468 | 468 | // Tab list |
| 469 | - $_aOutputs[ 'section_tab_list' ][] = $this->_getTabList( |
|
| 469 | + $_aOutputs[ 'section_tab_list' ][ ] = $this->_getTabList( |
|
| 470 | 470 | $aSectionset, |
| 471 | 471 | $aFieldsetsPerSection, |
| 472 | 472 | $this->aCallbacks[ 'fieldset_output' ] |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | // Section container |
| 476 | 476 | $_oSectionTable = new AdminPageFramework_Form_View___Section( |
| 477 | - $this->aArguments, // for nested sections |
|
| 477 | + $this->aArguments, // for nested sections |
|
| 478 | 478 | $aSectionset, |
| 479 | 479 | $this->aStructure, |
| 480 | 480 | $aFieldsetsPerSection, |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | $this->aCallbacks, |
| 485 | 485 | $this->oMsg |
| 486 | 486 | ); |
| 487 | - $_aOutputs[ 'section_contents' ][] = $_oSectionTable->get(); |
|
| 487 | + $_aOutputs[ 'section_contents' ][ ] = $_oSectionTable->get(); |
|
| 488 | 488 | |
| 489 | 489 | return $_aOutputs; |
| 490 | 490 | |
@@ -512,9 +512,9 @@ discard block |
||
| 512 | 512 | 'section_index' => null, |
| 513 | 513 | 'collapsible' => $aCollapsible, |
| 514 | 514 | 'container_type' => 'sections', // section or sections |
| 515 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
| 515 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
| 516 | 516 | ), |
| 517 | - array(), // fieldsets |
|
| 517 | + array(), // fieldsets |
|
| 518 | 518 | $this->aSavedData, |
| 519 | 519 | $this->aFieldErrors, |
| 520 | 520 | $this->aStructure[ 'field_type_definitions' ], |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | $aOutputs[ 'count_subsections' ] |
| 532 | 532 | ); |
| 533 | 533 | return $_oCollapsibleSectionTitle->get() |
| 534 | - . "<div " . $_oSectionsTablesContainerAttributes->get() . ">" |
|
| 534 | + . "<div ".$_oSectionsTablesContainerAttributes->get().">" |
|
| 535 | 535 | . $this->_getSectionTabList( $sSectionTabSlug, $aOutputs[ 'section_tab_list' ] ) |
| 536 | 536 | . implode( PHP_EOL, $aOutputs[ 'section_contents' ] ) |
| 537 | 537 | . "</div>"; |
@@ -562,21 +562,21 @@ discard block |
||
| 562 | 562 | */ |
| 563 | 563 | private function _getTabList( array $aSection, array $aFields, $hfFieldCallback ) { |
| 564 | 564 | |
| 565 | - if ( ! $aSection[ 'section_tab_slug' ] ) { |
|
| 565 | + if ( !$aSection[ 'section_tab_slug' ] ) { |
|
| 566 | 566 | return ''; |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | $iSectionIndex = $aSection[ '_index' ]; |
| 570 | 570 | |
| 571 | - $_sSectionTagID = 'section-' . $aSection[ 'section_id' ] . '__' . $iSectionIndex; |
|
| 571 | + $_sSectionTagID = 'section-'.$aSection[ 'section_id' ].'__'.$iSectionIndex; |
|
| 572 | 572 | $_aTabAttributes = $aSection[ 'attributes' ][ 'tab' ] |
| 573 | 573 | + array( |
| 574 | 574 | 'class' => 'admin-page-framework-section-tab nav-tab', |
| 575 | 575 | 'id' => "section_tab-{$_sSectionTagID}", |
| 576 | 576 | 'style' => null |
| 577 | 577 | ); |
| 578 | - $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
| 579 | - $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
| 578 | + $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
| 579 | + $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
| 580 | 580 | |
| 581 | 581 | $_oSectionTitle = new AdminPageFramework_Form_View___SectionTitle( |
| 582 | 582 | array( |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | 'tag' => 'h4', |
| 585 | 585 | 'section_index' => $iSectionIndex, |
| 586 | 586 | |
| 587 | - 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
| 587 | + 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
| 588 | 588 | ), |
| 589 | 589 | $aFields, |
| 590 | 590 | $this->aSavedData, |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | $this->aCallbacks // field output element callables. |
| 595 | 595 | ); |
| 596 | 596 | |
| 597 | - return "<li " . $this->getAttributes( $_aTabAttributes ) . ">" |
|
| 597 | + return "<li ".$this->getAttributes( $_aTabAttributes ).">" |
|
| 598 | 598 | . "<a href='#{$_sSectionTagID}'>" |
| 599 | 599 | . $_oSectionTitle->get() |
| 600 | 600 | ."</a>" |
@@ -121,6 +121,8 @@ |
||
| 121 | 121 | } |
| 122 | 122 | /** |
| 123 | 123 | * @since DEVVER |
| 124 | + * @param string $sKey |
|
| 125 | + * @param string $sValue |
|
| 124 | 126 | * @return void |
| 125 | 127 | */ |
| 126 | 128 | public function addResource( $sKey, $sValue ) { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @param string $sType If empty, the method will check if a message exists in all types. Otherwise, it checks the existence of a message of the specified type. |
| 46 | 46 | * @return boolean True if a setting notice is set; otherwise, false. |
| 47 | 47 | */ |
| 48 | - public function hasSubmitNotice( $sType='' ) { |
|
| 48 | + public function hasSubmitNotice( $sType = '' ) { |
|
| 49 | 49 | return $this->oSubmitNotice->hasNotice( $sType ); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
| 72 | 72 | * @return void |
| 73 | 73 | */ |
| 74 | - public function setSubmitNotice( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
|
| 74 | + public function setSubmitNotice( $sMessage, $sType = 'error', $asAttributes = array(), $bOverride = true ) { |
|
| 75 | 75 | $this->oSubmitNotice->set( |
| 76 | 76 | $sMessage, |
| 77 | 77 | $sType, |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | $this->aSectionsets[ $aSectionset[ 'section_id' ] ] = $aSectionset; |
| 100 | 100 | $this->aFieldsets[ $aSectionset[ 'section_id' ] ] = $this->getElement( |
| 101 | - $this->aFieldsets, // subject array |
|
| 101 | + $this->aFieldsets, // subject array |
|
| 102 | 102 | $aSectionset[ 'section_id' ], // key |
| 103 | 103 | array() // default |
| 104 | 104 | ); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function removeSection( $sSectionID ) { |
| 115 | 115 | |
| 116 | - if ( '_default' === $sSectionID ){ |
|
| 116 | + if ( '_default' === $sSectionID ) { |
|
| 117 | 117 | return; |
| 118 | 118 | } |
| 119 | 119 | unset( |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @return void |
| 144 | 144 | */ |
| 145 | 145 | public function addResource( $sKey, $sValue ) { |
| 146 | - self::$_aResources[ $sKey ][] = $sValue; |
|
| 146 | + self::$_aResources[ $sKey ][ ] = $sValue; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | public function addField( $asFieldset ) { |
| 167 | 167 | |
| 168 | 168 | // If it is a target section, update the property and return. |
| 169 | - if ( ! $this->_isFieldsetDefinition( $asFieldset ) ) { |
|
| 169 | + if ( !$this->_isFieldsetDefinition( $asFieldset ) ) { |
|
| 170 | 170 | $this->_asTargetSectionID = $this->_getTargetSectionID( $asFieldset ); |
| 171 | 171 | return $this->_asTargetSectionID; |
| 172 | 172 | } |
@@ -175,13 +175,13 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | // Set the target section ID |
| 177 | 177 | $this->_asTargetSectionID = $this->getElement( |
| 178 | - $_aFieldset, // subject array |
|
| 178 | + $_aFieldset, // subject array |
|
| 179 | 179 | 'section_id', // key |
| 180 | 180 | $this->_asTargetSectionID // default |
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | 183 | // Required Keys - 3.8.0+ Now 'type' can be omitted. |
| 184 | - if ( ! isset( $_aFieldset[ 'field_id' ] ) ) { |
|
| 184 | + if ( !isset( $_aFieldset[ 'field_id' ] ) ) { |
|
| 185 | 185 | return null; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | public function removeField( $sFieldID ) { |
| 286 | 286 | |
| 287 | - foreach( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 287 | + foreach ( $this->aFieldsets as $_sSectionID => $_aSubSectionsOrFields ) { |
|
| 288 | 288 | |
| 289 | 289 | if ( array_key_exists( $sFieldID, $_aSubSectionsOrFields ) ) { |
| 290 | 290 | unset( $this->aFieldsets[ $_sSectionID ][ $sFieldID ] ); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function removeSection( $sSectionID ) { |
| 115 | 115 | |
| 116 | - if ( '_default' === $sSectionID ){ |
|
| 116 | + if ( '_default' === $sSectionID ) { |
|
| 117 | 117 | return; |
| 118 | 118 | } |
| 119 | 119 | unset( |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | 183 | // Required Keys - 3.8.0+ Now 'type' can be omitted. |
| 184 | - if ( ! isset( $_aFieldset[ 'field_id' ] ) ) { |
|
| 184 | + if ( ! isset( $_aFieldset[ 'field_id' ] ) ) { |
|
| 185 | 185 | return null; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -391,7 +391,6 @@ discard block |
||
| 391 | 391 | * |
| 392 | 392 | * @since DEVVER |
| 393 | 393 | * @param array $aSavedData |
| 394 | - * @param boolean $bOnlyFieldsets Whether to format only the fieldsets. The taxonomy field factory uses this parameter. |
|
| 395 | 394 | */ |
| 396 | 395 | protected function _formatElementDefinitions( array $aSavedData ) { |
| 397 | 396 | |
@@ -427,7 +426,6 @@ discard block |
||
| 427 | 426 | * Changed the name from `_getFieldErrors()`. |
| 428 | 427 | * @access public The field type class accesses this method to render nested fields. |
| 429 | 428 | * @internal |
| 430 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
| 431 | 429 | * @return array |
| 432 | 430 | */ |
| 433 | 431 | public function getFieldErrors() { |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | * @since 3.7.0 |
| 44 | 44 | * @return array |
| 45 | 45 | */ |
| 46 | - public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure=true, $bStripSlashes=true ) { |
|
| 46 | + public function getSubmittedData( array $aDataToParse, $bExtractFromFieldStructure = true, $bStripSlashes = true ) { |
|
| 47 | 47 | |
| 48 | 48 | // Extracts the form data from the subject data for parsing |
| 49 | - $_aSubmittedFormData = $bExtractFromFieldStructure |
|
| 49 | + $_aSubmittedFormData = $bExtractFromFieldStructure |
|
| 50 | 50 | ? $this->castArrayContents( |
| 51 | 51 | $this->getDataStructureFromAddedFieldsets(), // form data (options) structure |
| 52 | 52 | $aDataToParse // the subject data array, usually $_POST. |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | : $aDataToParse; |
| 55 | 55 | |
| 56 | 56 | // 3.6.0 - sorts dynamic eleemnts. |
| 57 | - $_aSubmittedFormData = $this->getSortedInputs( $_aSubmittedFormData ); |
|
| 57 | + $_aSubmittedFormData = $this->getSortedInputs( $_aSubmittedFormData ); |
|
| 58 | 58 | |
| 59 | 59 | return $bStripSlashes |
| 60 | 60 | ? stripslashes_deep( $_aSubmittedFormData ) // fixes magic quotes |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | array_merge( |
| 80 | 80 | $this->getElementAsArray( |
| 81 | 81 | $_POST, |
| 82 | - '__repeatable_elements_' . $this->aArguments[ 'structure_type' ], |
|
| 82 | + '__repeatable_elements_'.$this->aArguments[ 'structure_type' ], |
|
| 83 | 83 | array() |
| 84 | 84 | ), |
| 85 | 85 | $this->getElementAsArray( |
| 86 | 86 | $_POST, |
| 87 | - '__sortable_elements_' . $this->aArguments[ 'structure_type' ], |
|
| 87 | + '__sortable_elements_'.$this->aArguments[ 'structure_type' ], |
|
| 88 | 88 | array() |
| 89 | 89 | ) |
| 90 | 90 | ) |
@@ -147,9 +147,9 @@ discard block |
||
| 147 | 147 | * Changed the name from `getFieldsModel()`. |
| 148 | 148 | * @return array |
| 149 | 149 | */ |
| 150 | - public function getDataStructureFromAddedFieldsets() { |
|
| 150 | + public function getDataStructureFromAddedFieldsets() { |
|
| 151 | 151 | |
| 152 | - $_aFormDataStructure = array(); |
|
| 152 | + $_aFormDataStructure = array(); |
|
| 153 | 153 | foreach ( $this->getAsArray( $this->aFieldsets ) as $_sSectionID => $_aFieldsets ) { |
| 154 | 154 | |
| 155 | 155 | if ( $_sSectionID != '_default' ) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | // For default field items. |
| 161 | - foreach( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
| 161 | + foreach ( $_aFieldsets as $_sFieldID => $_aFieldset ) { |
|
| 162 | 162 | $_aFormDataStructure[ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $aSubject, |
| 191 | 191 | $this->getElementAsArray( |
| 192 | 192 | $_POST, |
| 193 | - '__repeatable_elements_' . $this->aArguments[ 'structure_type' ] |
|
| 193 | + '__repeatable_elements_'.$this->aArguments[ 'structure_type' ] |
|
| 194 | 194 | ) |
| 195 | 195 | ); |
| 196 | 196 | return $_oFilterRepeatableElements->get(); |
@@ -203,13 +203,13 @@ discard block |
||
| 203 | 203 | public function _replyToRegisterFormItems() { |
| 204 | 204 | |
| 205 | 205 | // Check if the form should be created or not. |
| 206 | - if ( ! $this->isInThePage() ) { |
|
| 206 | + if ( !$this->isInThePage() ) { |
|
| 207 | 207 | return; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | // Load field type definitions. |
| 211 | - $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
| 212 | - $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
| 211 | + $this->_setFieldTypeDefinitions( 'admin_page_framework' ); // site-wide |
|
| 212 | + $this->_setFieldTypeDefinitions( $this->aArguments[ 'caller_id' ] ); // per class |
|
| 213 | 213 | |
| 214 | 214 | // Set the options array |
| 215 | 215 | $this->aSavedData = $this->_getSavedData( |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $this->aArguments, |
| 238 | 238 | $this->aFieldsets, |
| 239 | 239 | self::$_aResources, |
| 240 | - $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
| 240 | + $this->aFieldTypeDefinitions, // must be called after performing `_setFieldTypeDefinitions()`. |
|
| 241 | 241 | $this->aCallbacks |
| 242 | 242 | ); |
| 243 | 243 | self::$_aResources = $_oFieldResources->get(); // updates the property |
@@ -254,10 +254,10 @@ discard block |
||
| 254 | 254 | $this->callBack( |
| 255 | 255 | $this->aCallbacks[ 'handle_form_data' ], |
| 256 | 256 | array( |
| 257 | - $this->aSavedData, // 1st parameter |
|
| 258 | - $this->aArguments, // 2nd parameter |
|
| 259 | - $this->aSectionsets, // 3rd parameter |
|
| 260 | - $this->aFieldsets, // 4th parameter |
|
| 257 | + $this->aSavedData, // 1st parameter |
|
| 258 | + $this->aArguments, // 2nd parameter |
|
| 259 | + $this->aSectionsets, // 3rd parameter |
|
| 260 | + $this->aFieldsets, // 4th parameter |
|
| 261 | 261 | ) |
| 262 | 262 | ); |
| 263 | 263 | |
@@ -271,15 +271,15 @@ discard block |
||
| 271 | 271 | $this->aSectionsets = $this->callBack( |
| 272 | 272 | $this->aCallbacks[ 'secitonsets_before_registration' ], |
| 273 | 273 | array( |
| 274 | - $this->aSectionsets, // 1st parameter |
|
| 274 | + $this->aSectionsets, // 1st parameter |
|
| 275 | 275 | ) |
| 276 | 276 | ); |
| 277 | 277 | // Let the main routine modify the fieldsets definition array. |
| 278 | 278 | $this->aFieldsets = $this->callBack( |
| 279 | 279 | $this->aCallbacks[ 'fieldsets_before_registration' ], |
| 280 | 280 | array( |
| 281 | - $this->aFieldsets, // 1st parameter |
|
| 282 | - $this->aSectionsets, // 2nd parameter |
|
| 281 | + $this->aFieldsets, // 1st parameter |
|
| 282 | + $this->aSectionsets, // 2nd parameter |
|
| 283 | 283 | ) |
| 284 | 284 | ); |
| 285 | 285 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | array( $this, '_replyToRegisterFormItems' ), |
| 30 | 30 | 100 // priority - low value is set as meta boxes use the `current_screen` action hook for `setUp()`. |
| 31 | 31 | ); |
| 32 | - } else { |
|
| 32 | + } else { |
|
| 33 | 33 | add_action( |
| 34 | 34 | $this->aArguments[ 'action_hook_form_registration' ], |
| 35 | 35 | array( $this, '_replyToRegisterFormItems' ) |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | * Changed the name from `getFieldsModel()`. |
| 148 | 148 | * @return array |
| 149 | 149 | */ |
| 150 | - public function getDataStructureFromAddedFieldsets() { |
|
| 150 | + public function getDataStructureFromAddedFieldsets() { |
|
| 151 | 151 | |
| 152 | 152 | $_aFormDataStructure = array(); |
| 153 | 153 | foreach ( $this->getAsArray( $this->aFieldsets ) as $_sSectionID => $_aFieldsets ) { |
| 154 | 154 | |
| 155 | - if ( $_sSectionID != '_default' ) { |
|
| 155 | + if ( $_sSectionID != '_default' ) { |
|
| 156 | 156 | $_aFormDataStructure[ $_sSectionID ] = $_aFieldsets; |
| 157 | 157 | continue; |
| 158 | 158 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * @param array $aSubject The subject array to modify. Usually the saved option data. |
| 186 | 186 | * @return array The modified options array. |
| 187 | 187 | */ |
| 188 | - public function dropRepeatableElements( array $aSubject ) { |
|
| 188 | + public function dropRepeatableElements( array $aSubject ) { |
|
| 189 | 189 | $_oFilterRepeatableElements = new AdminPageFramework_Form_Model___Modifier_FilterRepeatableElements( |
| 190 | 190 | $aSubject, |
| 191 | 191 | $this->getElementAsArray( |
@@ -231,6 +231,7 @@ discard block |
||
| 231 | 231 | /** |
| 232 | 232 | * Returns the system information by section. |
| 233 | 233 | * @since 3.5.3 |
| 234 | + * @param integer $iPrintType |
|
| 234 | 235 | * @return string The system information by section. |
| 235 | 236 | */ |
| 236 | 237 | private function _getSystemInfoBySection( $sSectionName, $aData, $iPrintType ) { |
@@ -350,6 +351,8 @@ discard block |
||
| 350 | 351 | /** |
| 351 | 352 | * |
| 352 | 353 | * @since 3.5.12 |
| 354 | + * @param string $asCategories |
|
| 355 | + * @param string $asRemovingCategories |
|
| 353 | 356 | * @return stirng|array |
| 354 | 357 | */ |
| 355 | 358 | private function _getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @internal |
| 145 | 145 | * @return array |
| 146 | 146 | */ |
| 147 | - protected function getEnqueuingScripts() { |
|
| 147 | + protected function getEnqueuingScripts() { |
|
| 148 | 148 | return array(); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @return array |
| 163 | 163 | * @internal |
| 164 | 164 | */ |
| 165 | - protected function getEnqueuingStyles() { |
|
| 165 | + protected function getEnqueuingStyles() { |
|
| 166 | 166 | return array(); |
| 167 | 167 | } |
| 168 | 168 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * @internal |
| 173 | 173 | * @return string |
| 174 | 174 | */ |
| 175 | - protected function getScripts() { |
|
| 175 | + protected function getScripts() { |
|
| 176 | 176 | return ''; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @internal |
| 183 | 183 | * @return string |
| 184 | 184 | */ |
| 185 | - protected function getIEStyles() { |
|
| 185 | + protected function getIEStyles() { |
|
| 186 | 186 | return ''; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * @internal |
| 224 | 224 | * @return string |
| 225 | 225 | */ |
| 226 | - protected function getField( $aField ) { |
|
| 226 | + protected function getField( $aField ) { |
|
| 227 | 227 | |
| 228 | 228 | $_aInputAttributes = $aField['attributes']; |
| 229 | 229 | $_aInputAttributes['class'] .= ' system'; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * </code> |
| 74 | 74 | * @var array |
| 75 | 75 | */ |
| 76 | - public $aFieldTypeSlugs = array( 'system', ); |
|
| 76 | + public $aFieldTypeSlugs = array( 'system',); |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Defines the default key-values of this field type. |
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | * @remark `$_aDefaultKeys` holds shared default key-values defined in the base class. |
| 94 | 94 | */ |
| 95 | 95 | protected $aDefaultKeys = array( |
| 96 | - 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
| 97 | - 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
| 96 | + 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
| 97 | + 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
| 98 | 98 | 'attributes' => array( |
| 99 | 99 | 'rows' => 60, |
| 100 | 100 | 'autofocus' => null, |
@@ -233,13 +233,13 @@ discard block |
||
| 233 | 233 | . "<div class='admin-page-framework-input-label-container'>" |
| 234 | 234 | . "<label for='{$aField[ 'input_id' ]}'>" |
| 235 | 235 | . $aField[ 'before_input' ] |
| 236 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
| 237 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 236 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
| 237 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 238 | 238 | . $aField[ 'label' ] |
| 239 | 239 | . "</span>" |
| 240 | 240 | : "" |
| 241 | 241 | ) |
| 242 | - . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >" |
|
| 242 | + . "<textarea ".$this->getAttributes( $_aInputAttributes )." >" |
|
| 243 | 243 | . esc_textarea( $this->_getSystemInfomation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) ) |
| 244 | 244 | . "</textarea>" |
| 245 | 245 | . $aField[ 'after_input' ] |
@@ -254,15 +254,15 @@ discard block |
||
| 254 | 254 | * @return string The human readable system information. |
| 255 | 255 | * @internal |
| 256 | 256 | */ |
| 257 | - private function _getSystemInfomation( $asValue=null, $asCustomData=null, $iPrintType=1 ) { |
|
| 257 | + private function _getSystemInfomation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) { |
|
| 258 | 258 | |
| 259 | 259 | if ( isset( $asValue ) ) { |
| 260 | 260 | return $asValue; |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | - $_aOutput = array(); |
|
| 264 | - foreach( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
| 265 | - $_aOutput[] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
| 263 | + $_aOutput = array(); |
|
| 264 | + foreach ( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
| 265 | + $_aOutput[ ] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
| 266 | 266 | } |
| 267 | 267 | return implode( PHP_EOL, $_aOutput ); |
| 268 | 268 | |
@@ -277,18 +277,18 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | $_aData = $this->getAsArray( $asCustomData ); |
| 279 | 279 | $_aData = $_aData + array( |
| 280 | - 'Admin Page Framework' => isset( $_aData['Admin Page Framework'] ) |
|
| 280 | + 'Admin Page Framework' => isset( $_aData[ 'Admin Page Framework' ] ) |
|
| 281 | 281 | ? null |
| 282 | 282 | : AdminPageFramework_Registry::getInfo(), |
| 283 | - 'WordPress' => $this->_getSiteInfoWithCache( ! isset( $_aData['WordPress'] ) ), |
|
| 284 | - 'PHP' => $this->_getPHPInfo( ! isset( $_aData['PHP'] ) ), |
|
| 285 | - 'PHP Error Log' => $this->_getErrorLogByType( 'php', ! isset( $_aData['PHP Error Log'] ) ), |
|
| 286 | - 'MySQL' => isset( $_aData['MySQL'] ) |
|
| 283 | + 'WordPress' => $this->_getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ), |
|
| 284 | + 'PHP' => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ), |
|
| 285 | + 'PHP Error Log' => $this->_getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ), |
|
| 286 | + 'MySQL' => isset( $_aData[ 'MySQL' ] ) |
|
| 287 | 287 | ? null |
| 288 | - : $this->getMySQLInfo(), // defined in the utility class. |
|
| 289 | - 'MySQL Error Log' => $this->_getErrorLogByType( 'mysql', ! isset( $_aData['MySQL Error Log'] ) ), |
|
| 290 | - 'Server' => $this->_getWebServerInfo( ! isset( $_aData['Server'] ) ), |
|
| 291 | - 'Browser' => $this->_getClientInfo( ! isset( $_aData['Browser'] ) ), |
|
| 288 | + : $this->getMySQLInfo(), // defined in the utility class. |
|
| 289 | + 'MySQL Error Log' => $this->_getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
| 290 | + 'Server' => $this->_getWebServerInfo( !isset( $_aData[ 'Server' ] ) ), |
|
| 291 | + 'Browser' => $this->_getClientInfo( !isset( $_aData[ 'Browser' ] ) ), |
|
| 292 | 292 | ); |
| 293 | 293 | |
| 294 | 294 | // Dropping empty elements allows the user to remove a section by setting an empty section. |
@@ -305,10 +305,10 @@ discard block |
||
| 305 | 305 | switch ( $iPrintType ) { |
| 306 | 306 | default: |
| 307 | 307 | case 1: // use the framework readable representation of arrays. |
| 308 | - return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL; |
|
| 308 | + return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL; |
|
| 309 | 309 | case 2: // use print_r() |
| 310 | - return "[{$sSectionName}]" . PHP_EOL |
|
| 311 | - . print_r( $aData, true ) . PHP_EOL; |
|
| 310 | + return "[{$sSectionName}]".PHP_EOL |
|
| 311 | + . print_r( $aData, true ).PHP_EOL; |
|
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | /** |
@@ -318,17 +318,17 @@ discard block |
||
| 318 | 318 | * @since 3.4.6 |
| 319 | 319 | * @since 3.5.3 Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method. |
| 320 | 320 | */ |
| 321 | - private function _getClientInfo( $bGenerateInfo=true ) { |
|
| 321 | + private function _getClientInfo( $bGenerateInfo = true ) { |
|
| 322 | 322 | |
| 323 | - if ( ! $bGenerateInfo ) { |
|
| 323 | + if ( !$bGenerateInfo ) { |
|
| 324 | 324 | return ''; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | // Check the browscap value in the ini file first to prevent warnings from being populated |
| 328 | 328 | $_aBrowser = @ini_get( 'browscap' ) |
| 329 | - ? get_browser( $_SERVER['HTTP_USER_AGENT'], true ) |
|
| 329 | + ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true ) |
|
| 330 | 330 | : array(); |
| 331 | - unset( $_aBrowser['browser_name_regex'] ); // this element causes output to be blank |
|
| 331 | + unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
| 332 | 332 | return empty( $_aBrowser ) |
| 333 | 333 | ? __( 'No browser information found.', 'admin-page-framework' ) |
| 334 | 334 | : $_aBrowser; |
@@ -344,9 +344,9 @@ discard block |
||
| 344 | 344 | * @param string $sType The error log type. Either 'php' or 'mysql' is accepted. |
| 345 | 345 | * @param boolean $bGenerateInfo Whether to generate a log. This is for the caller method to reduce a conditinal statement. |
| 346 | 346 | */ |
| 347 | - private function _getErrorLogByType( $sType, $bGenerateInfo=true ) { |
|
| 347 | + private function _getErrorLogByType( $sType, $bGenerateInfo = true ) { |
|
| 348 | 348 | |
| 349 | - if ( ! $bGenerateInfo ) { |
|
| 349 | + if ( !$bGenerateInfo ) { |
|
| 350 | 350 | return ''; |
| 351 | 351 | } |
| 352 | 352 | switch ( $sType ) { |
@@ -378,9 +378,9 @@ discard block |
||
| 378 | 378 | * @since 3.5.3 Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method. |
| 379 | 379 | * @return array The generated site information array. |
| 380 | 380 | */ |
| 381 | - private function _getSiteInfoWithCache( $bGenerateInfo=true ) { |
|
| 381 | + private function _getSiteInfoWithCache( $bGenerateInfo = true ) { |
|
| 382 | 382 | |
| 383 | - if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
| 383 | + if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
| 384 | 384 | return self::$_aSiteInfo; |
| 385 | 385 | } |
| 386 | 386 | self::$_aSiteInfo = self::_getSiteInfo(); |
@@ -414,8 +414,8 @@ discard block |
||
| 414 | 414 | 'wp_remote_get()' => $this->_getWPRemoteGetStatus(), |
| 415 | 415 | __( 'Multibite String Extension', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
| 416 | 416 | __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' ) => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
| 417 | - __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->_getActivePlugins(), |
|
| 418 | - __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->_getNetworkActivePlugins(), |
|
| 417 | + __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->_getActivePlugins(), |
|
| 418 | + __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->_getNetworkActivePlugins(), |
|
| 419 | 419 | __( 'Constants', 'admin-page-framework' ) => $this->_getDefinedConstants( 'user' ), |
| 420 | 420 | ); |
| 421 | 421 | } |
@@ -425,9 +425,9 @@ discard block |
||
| 425 | 425 | * @return string|array |
| 426 | 426 | * @internal |
| 427 | 427 | */ |
| 428 | - private function _getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
|
| 428 | + private function _getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) { |
|
| 429 | 429 | $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories ); |
| 430 | - if ( ! is_array( $_asConstants ) ) { |
|
| 430 | + if ( !is_array( $_asConstants ) ) { |
|
| 431 | 431 | return $_asConstants; |
| 432 | 432 | } |
| 433 | 433 | if ( isset( $_asConstants[ 'user' ] ) ) { |
@@ -463,13 +463,13 @@ discard block |
||
| 463 | 463 | private function _getActiveThemeName() { |
| 464 | 464 | |
| 465 | 465 | // If the WordPress version is less than 3.4, |
| 466 | - if ( version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) { |
|
| 467 | - $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
| 468 | - return $_aThemeData['Name'] . ' ' . $_aThemeData['Version']; |
|
| 466 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) { |
|
| 467 | + $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' ); |
|
| 468 | + return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ]; |
|
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | $_oThemeData = wp_get_theme(); |
| 472 | - return $_oThemeData->Name . ' ' . $_oThemeData->Version; |
|
| 472 | + return $_oThemeData->Name.' '.$_oThemeData->Version; |
|
| 473 | 473 | |
| 474 | 474 | } |
| 475 | 475 | /** |
@@ -483,10 +483,10 @@ discard block |
||
| 483 | 483 | $_aPluginList = array(); |
| 484 | 484 | $_aActivePlugins = get_option( 'active_plugins', array() ); |
| 485 | 485 | foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) { |
| 486 | - if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
| 486 | + if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
| 487 | 487 | continue; |
| 488 | 488 | } |
| 489 | - $_aPluginList[] = ' ' . $_aPlugin['Name'] . ': ' . $_aPlugin['Version']; |
|
| 489 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ]; |
|
| 490 | 490 | } |
| 491 | 491 | return implode( PHP_EOL, $_aPluginList ); |
| 492 | 492 | |
@@ -498,17 +498,17 @@ discard block |
||
| 498 | 498 | */ |
| 499 | 499 | private function _getNetworkActivePlugins() { |
| 500 | 500 | |
| 501 | - if ( ! is_multisite() ) { |
|
| 501 | + if ( !is_multisite() ) { |
|
| 502 | 502 | return ''; |
| 503 | 503 | } |
| 504 | 504 | $_aPluginList = array(); |
| 505 | 505 | $_aActivePlugins = get_site_option( 'active_sitewide_plugins', array() ); |
| 506 | 506 | foreach ( wp_get_active_network_plugins() as $_sPluginPath ) { |
| 507 | - if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
| 507 | + if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
| 508 | 508 | continue; |
| 509 | 509 | } |
| 510 | 510 | $_aPlugin = get_plugin_data( $_sPluginPath ); |
| 511 | - $_aPluginList[] = ' ' . $_aPlugin['Name'] . ' :' . $_aPlugin['Version']; |
|
| 511 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ]; |
|
| 512 | 512 | } |
| 513 | 513 | return implode( PHP_EOL, $_aPluginList ); |
| 514 | 514 | |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $_vResponse = false === $_vResponse |
| 527 | 527 | ? wp_remote_post( |
| 528 | 528 | // 'https://www.paypal.com/cgi-bin/webscr', |
| 529 | - add_query_arg( $_GET, admin_url( $GLOBALS['pagenow'] ) ), |
|
| 529 | + add_query_arg( $_GET, admin_url( $GLOBALS[ 'pagenow' ] ) ), |
|
| 530 | 530 | array( |
| 531 | 531 | 'sslverify' => false, |
| 532 | 532 | 'timeout' => 60, |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | $_vResponse = $this->getTransient( 'apf_rg_check' ); |
| 550 | 550 | $_vResponse = false === $_vResponse |
| 551 | 551 | ? wp_remote_get( |
| 552 | - add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS['pagenow'] ) ), |
|
| 552 | + add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS[ 'pagenow' ] ) ), |
|
| 553 | 553 | array( |
| 554 | 554 | 'sslverify' => false, |
| 555 | 555 | 'timeout' => 60, |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | if ( is_wp_error( $mResponse ) ) { |
| 575 | 575 | return true; |
| 576 | 576 | } |
| 577 | - if ( $mResponse[ 'response'][ 'code' ] < 200 ) { |
|
| 577 | + if ( $mResponse[ 'response' ][ 'code' ] < 200 ) { |
|
| 578 | 578 | return true; |
| 579 | 579 | } |
| 580 | 580 | if ( $mResponse[ 'response' ][ 'code' ] >= 300 ) { |
@@ -597,13 +597,13 @@ discard block |
||
| 597 | 597 | * @since 3.4.6 |
| 598 | 598 | * @since 3.5.3 Added the $bGenerateInfo parameter. This is to reduce conditional statement in the caller method. |
| 599 | 599 | */ |
| 600 | - private function _getPHPInfo( $bGenerateInfo=true ) { |
|
| 600 | + private function _getPHPInfo( $bGenerateInfo = true ) { |
|
| 601 | 601 | |
| 602 | - if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
| 602 | + if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
| 603 | 603 | return self::$_aPHPInfo; |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | - $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
| 606 | + $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
| 607 | 607 | self::$_aPHPInfo = array( |
| 608 | 608 | __( 'Version', 'admin-page-framework' ) => phpversion(), |
| 609 | 609 | __( 'Safe Mode', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
@@ -614,16 +614,16 @@ discard block |
||
| 614 | 614 | __( 'Max Execution Time', 'admin-page-framework' ) => @ini_get( 'max_execution_time' ), |
| 615 | 615 | __( 'Max Input Vars', 'admin-page-framework' ) => @ini_get( 'max_input_vars' ), |
| 616 | 616 | __( 'Argument Separator', 'admin-page-framework' ) => @ini_get( 'arg_separator.output' ), |
| 617 | - __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
| 618 | - __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
| 619 | - __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
| 617 | + __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
| 618 | + __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
| 619 | + __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
| 620 | 620 | __( 'Error log location', 'admin-page-framework' ) => @ini_get( 'error_log' ), |
| 621 | 621 | __( 'Error Reporting Level', 'admin-page-framework' ) => $_oErrorReporting->getErrorLevel(), |
| 622 | - __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 623 | - __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 624 | - __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 625 | - __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 626 | - 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 622 | + __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 623 | + __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 624 | + __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 625 | + __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 626 | + 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
| 627 | 627 | ) |
| 628 | 628 | + $this->getPHPInfo() |
| 629 | 629 | + array( |
@@ -642,11 +642,11 @@ discard block |
||
| 642 | 642 | * @since 3.5.3 Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method. |
| 643 | 643 | * @return array|string |
| 644 | 644 | */ |
| 645 | - private function _getWebServerInfo( $bGenerateInfo=true ) { |
|
| 645 | + private function _getWebServerInfo( $bGenerateInfo = true ) { |
|
| 646 | 646 | |
| 647 | 647 | return $bGenerateInfo |
| 648 | 648 | ? array( |
| 649 | - __( 'Web Server', 'admin-page-framework' ) => $_SERVER['SERVER_SOFTWARE'], |
|
| 649 | + __( 'Web Server', 'admin-page-framework' ) => $_SERVER[ 'SERVER_SOFTWARE' ], |
|
| 650 | 650 | 'SSL' => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
| 651 | 651 | __( 'Session', 'admin-page-framework' ) => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
| 652 | 652 | __( 'Session Name', 'admin-page-framework' ) => esc_html( @ini_get( 'session.name' ) ), |
@@ -426,7 +426,7 @@ |
||
| 426 | 426 | * |
| 427 | 427 | * @since 2.0.0 |
| 428 | 428 | * @param array $vValue This can be either an one-dimensional array ( for single field ) or a two-dimensional array ( for multiple fields ). |
| 429 | - * @param string $sKey |
|
| 429 | + * @param string $sTaxonomySlug |
|
| 430 | 430 | * @return array Returns an numerically indexed array holding the keys that yield true as the value. |
| 431 | 431 | */ |
| 432 | 432 | private function _getSelectedKeyArray( $vValue, $sTaxonomySlug ) { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | /** |
| 22 | 22 | * Defines the field type slugs used for this field type. |
| 23 | 23 | */ |
| 24 | - public $aFieldTypeSlugs = array( 'taxonomy', ); |
|
| 24 | + public $aFieldTypeSlugs = array( 'taxonomy',); |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Defines the default key-values of this field type. |
@@ -29,40 +29,40 @@ discard block |
||
| 29 | 29 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
| 30 | 30 | */ |
| 31 | 31 | protected $aDefaultKeys = array( |
| 32 | - 'taxonomy_slugs' => 'category', // (array|string) This is for the taxonomy field type. |
|
| 33 | - 'height' => '250px', // the tab box height |
|
| 34 | - 'width' => null, // 3.5.7.2+ the tab box width |
|
| 35 | - 'max_width' => '100%', // for the taxonomy checklist field type, since 2.1.1. |
|
| 36 | - 'show_post_count' => true, // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not. |
|
| 32 | + 'taxonomy_slugs' => 'category', // (array|string) This is for the taxonomy field type. |
|
| 33 | + 'height' => '250px', // the tab box height |
|
| 34 | + 'width' => null, // 3.5.7.2+ the tab box width |
|
| 35 | + 'max_width' => '100%', // for the taxonomy checklist field type, since 2.1.1. |
|
| 36 | + 'show_post_count' => true, // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not. |
|
| 37 | 37 | 'attributes' => array(), |
| 38 | - 'select_all_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 39 | - 'select_none_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 40 | - 'label_no_term_found' => null, // (string) 3.3.2+ The label to display when no term is found. null needs to be set here as the default value will be assigned in the field output method. |
|
| 41 | - 'label_list_title' => '', // (string) 3.3.2+ The heading title string for a term list. Default: `''`. Insert an HTML custom string right before the list starts. |
|
| 38 | + 'select_all_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 39 | + 'select_none_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 40 | + 'label_no_term_found' => null, // (string) 3.3.2+ The label to display when no term is found. null needs to be set here as the default value will be assigned in the field output method. |
|
| 41 | + 'label_list_title' => '', // (string) 3.3.2+ The heading title string for a term list. Default: `''`. Insert an HTML custom string right before the list starts. |
|
| 42 | 42 | 'query' => array( // (array) 3.3.2+ Defines the default query argument. |
| 43 | 43 | // see the arguments of the get_category() function: http://codex.wordpress.org/Function_Reference/get_categories |
| 44 | 44 | // see the argument of the get_terms() function: http://codex.wordpress.org/Function_Reference/get_terms |
| 45 | 45 | 'child_of' => 0, |
| 46 | 46 | 'parent' => '', |
| 47 | - 'orderby' => 'name', // (string) 'ID' or 'term_id' or 'name' |
|
| 48 | - 'order' => 'ASC', // (string) 'ASC' or 'DESC' |
|
| 49 | - 'hide_empty' => false, // (boolean) whether to show the terms with no post associated. Default: false |
|
| 50 | - 'hierarchical' => true, // (boolean) whether to show the terms as a hierarchical tree. |
|
| 51 | - 'number' => '', // (integer) The maximum number of the terms to show. |
|
| 52 | - 'pad_counts' => false, // (boolean) whether to sum up the post counts with the child post counts. |
|
| 53 | - 'exclude' => array(), // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list. |
|
| 47 | + 'orderby' => 'name', // (string) 'ID' or 'term_id' or 'name' |
|
| 48 | + 'order' => 'ASC', // (string) 'ASC' or 'DESC' |
|
| 49 | + 'hide_empty' => false, // (boolean) whether to show the terms with no post associated. Default: false |
|
| 50 | + 'hierarchical' => true, // (boolean) whether to show the terms as a hierarchical tree. |
|
| 51 | + 'number' => '', // (integer) The maximum number of the terms to show. |
|
| 52 | + 'pad_counts' => false, // (boolean) whether to sum up the post counts with the child post counts. |
|
| 53 | + 'exclude' => array(), // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list. |
|
| 54 | 54 | 'exclude_tree' => array(), |
| 55 | - 'include' => array(), // (string) Comma separated term IDs to include in the list. |
|
| 55 | + 'include' => array(), // (string) Comma separated term IDs to include in the list. |
|
| 56 | 56 | 'fields' => 'all', |
| 57 | 57 | 'slug' => '', |
| 58 | 58 | 'get' => '', |
| 59 | 59 | 'name__like' => '', |
| 60 | 60 | 'description__like' => '', |
| 61 | 61 | 'offset' => '', |
| 62 | - 'search' => '', // (string) The search keyword to get the term with. |
|
| 62 | + 'search' => '', // (string) The search keyword to get the term with. |
|
| 63 | 63 | 'cache_domain' => 'core', |
| 64 | 64 | ), |
| 65 | - 'queries' => array(), // (optional, array) 3.3.2+ Allows to set a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array. |
|
| 65 | + 'queries' => array(), // (optional, array) 3.3.2+ Allows to set a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array. |
|
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $_aJSArray = json_encode( $this->aFieldTypeSlugs ); |
| 90 | 90 | |
| 91 | - return parent::getScripts() . |
|
| 91 | + return parent::getScripts(). |
|
| 92 | 92 | // return |
| 93 | 93 | <<<JAVASCRIPTS |
| 94 | 94 | /* For tabs */ |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | protected function getField( $aField ) { |
| 322 | 322 | |
| 323 | 323 | // Format |
| 324 | - $aField['label_no_term_found'] = $this->getElement( |
|
| 324 | + $aField[ 'label_no_term_found' ] = $this->getElement( |
|
| 325 | 325 | $aField, |
| 326 | 326 | 'label_no_term_found', |
| 327 | 327 | $this->oMsg->get( 'no_term_found' ) |
@@ -330,18 +330,18 @@ discard block |
||
| 330 | 330 | // Parse |
| 331 | 331 | $_aTabs = array(); |
| 332 | 332 | $_aCheckboxes = array(); |
| 333 | - foreach( $this->getAsArray( $aField['taxonomy_slugs'] ) as $sKey => $sTaxonomySlug ) { |
|
| 334 | - $_aTabs[] = $this->_getTaxonomyTab( $aField, $sKey, $sTaxonomySlug ); |
|
| 335 | - $_aCheckboxes[] = $this->_getTaxonomyCheckboxes( $aField, $sKey, $sTaxonomySlug ); |
|
| 333 | + foreach ( $this->getAsArray( $aField[ 'taxonomy_slugs' ] ) as $sKey => $sTaxonomySlug ) { |
|
| 334 | + $_aTabs[ ] = $this->_getTaxonomyTab( $aField, $sKey, $sTaxonomySlug ); |
|
| 335 | + $_aCheckboxes[ ] = $this->_getTaxonomyCheckboxes( $aField, $sKey, $sTaxonomySlug ); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | // Output |
| 339 | - return "<div id='tabbox-{$aField['field_id']}' class='tab-box-container categorydiv' style='max-width:{$aField['max_width']};'>" |
|
| 339 | + return "<div id='tabbox-{$aField[ 'field_id' ]}' class='tab-box-container categorydiv' style='max-width:{$aField[ 'max_width' ]};'>" |
|
| 340 | 340 | . "<ul class='tab-box-tabs category-tabs'>" |
| 341 | 341 | . implode( PHP_EOL, $_aTabs ) |
| 342 | 342 | . "</ul>" |
| 343 | 343 | . "<div class='tab-box-contents-container'>" |
| 344 | - . "<div class='tab-box-contents' style='height: {$aField['height']};'>" |
|
| 344 | + . "<div class='tab-box-contents' style='height: {$aField[ 'height' ]};'>" |
|
| 345 | 345 | . implode( PHP_EOL, $_aCheckboxes ) |
| 346 | 346 | . "</div>" |
| 347 | 347 | . "</div>" |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | private function _getTaxonomyCheckboxes( array $aField, $sKey, $sTaxonomySlug ) { |
| 359 | 359 | |
| 360 | 360 | $_aTabBoxContainerArguments = array( |
| 361 | - 'id' => "tab_{$aField['input_id']}_{$sKey}", |
|
| 361 | + 'id' => "tab_{$aField[ 'input_id' ]}_{$sKey}", |
|
| 362 | 362 | 'class' => 'tab-box-content', |
| 363 | 363 | 'style' => $this->generateInlineCSS( |
| 364 | 364 | array( |
@@ -367,9 +367,9 @@ discard block |
||
| 367 | 367 | ) |
| 368 | 368 | ), |
| 369 | 369 | ); |
| 370 | - return "<div " . $this->getAttributes( $_aTabBoxContainerArguments ) . ">" |
|
| 370 | + return "<div ".$this->getAttributes( $_aTabBoxContainerArguments ).">" |
|
| 371 | 371 | . $this->getElement( $aField, array( 'before_label', $sKey ) ) |
| 372 | - . "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . "></div>" |
|
| 372 | + . "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) )."></div>" |
|
| 373 | 373 | . "<ul class='list:category taxonomychecklist form-no-clear'>" |
| 374 | 374 | . $this->_getTaxonomyChecklist( $aField, $sKey, $sTaxonomySlug ) |
| 375 | 375 | . "</ul>" |
@@ -389,23 +389,23 @@ discard block |
||
| 389 | 389 | array( |
| 390 | 390 | 'walker' => new AdminPageFramework_WalkerTaxonomyChecklist, // the walker class instance |
| 391 | 391 | 'taxonomy' => $sTaxonomySlug, |
| 392 | - '_name_prefix' => is_array( $aField['taxonomy_slugs'] ) |
|
| 393 | - ? "{$aField['_input_name']}[{$sTaxonomySlug}]" |
|
| 394 | - : $aField['_input_name'], // name prefix of the input |
|
| 395 | - '_input_id_prefix' => $aField['input_id'], |
|
| 392 | + '_name_prefix' => is_array( $aField[ 'taxonomy_slugs' ] ) |
|
| 393 | + ? "{$aField[ '_input_name' ]}[{$sTaxonomySlug}]" |
|
| 394 | + : $aField[ '_input_name' ], // name prefix of the input |
|
| 395 | + '_input_id_prefix' => $aField[ 'input_id' ], |
|
| 396 | 396 | '_attributes' => $this->getElement( |
| 397 | 397 | $aField, |
| 398 | 398 | array( 'attributes', $sKey ), |
| 399 | 399 | array() |
| 400 | - ) + $aField['attributes'], |
|
| 400 | + ) + $aField[ 'attributes' ], |
|
| 401 | 401 | |
| 402 | 402 | // checked items ( term IDs ) e.g. array( 6, 10, 7, 15 ), |
| 403 | - '_selected_items' => $this->_getSelectedKeyArray( $aField['value'], $sTaxonomySlug ), |
|
| 403 | + '_selected_items' => $this->_getSelectedKeyArray( $aField[ 'value' ], $sTaxonomySlug ), |
|
| 404 | 404 | |
| 405 | - 'echo' => false, // returns the output |
|
| 406 | - 'show_post_count' => $aField['show_post_count'], // 3.2.0+ |
|
| 407 | - 'show_option_none' => $aField['label_no_term_found'], // 3.3.2+ |
|
| 408 | - 'title_li' => $aField['label_list_title'], // 3.3.2+ |
|
| 405 | + 'echo' => false, // returns the output |
|
| 406 | + 'show_post_count' => $aField[ 'show_post_count' ], // 3.2.0+ |
|
| 407 | + 'show_option_none' => $aField[ 'label_no_term_found' ], // 3.3.2+ |
|
| 408 | + 'title_li' => $aField[ 'label_list_title' ], // 3.3.2+ |
|
| 409 | 409 | ) |
| 410 | 410 | + $this->getAsArray( |
| 411 | 411 | $this->getElement( |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | ), |
| 416 | 416 | true |
| 417 | 417 | ) |
| 418 | - + $aField['query'] |
|
| 418 | + + $aField[ 'query' ] |
|
| 419 | 419 | ); |
| 420 | 420 | } |
| 421 | 421 | |
@@ -433,10 +433,10 @@ discard block |
||
| 433 | 433 | |
| 434 | 434 | $vValue = ( array ) $vValue; // cast array because the initial value (null) may not be an array. |
| 435 | 435 | |
| 436 | - if ( ! isset( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 436 | + if ( !isset( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 437 | 437 | return array(); |
| 438 | 438 | } |
| 439 | - if ( ! is_array( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 439 | + if ( !is_array( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 440 | 440 | return array(); |
| 441 | 441 | } |
| 442 | 442 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | */ |
| 453 | 453 | private function _getTaxonomyTab( array $aField, $sKey, $sTaxonomySlug ) { |
| 454 | 454 | return "<li class='tab-box-tab'>" |
| 455 | - . "<a href='#tab_{$aField['input_id']}_{$sKey}'>" |
|
| 455 | + . "<a href='#tab_{$aField[ 'input_id' ]}_{$sKey}'>" |
|
| 456 | 456 | . "<span class='tab-box-tab-text'>" |
| 457 | 457 | . $this->_getLabelFromTaxonomySlug( $sTaxonomySlug ) |
| 458 | 458 | . "</span>" |
@@ -433,10 +433,10 @@ |
||
| 433 | 433 | |
| 434 | 434 | $vValue = ( array ) $vValue; // cast array because the initial value (null) may not be an array. |
| 435 | 435 | |
| 436 | - if ( ! isset( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 436 | + if ( ! isset( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 437 | 437 | return array(); |
| 438 | 438 | } |
| 439 | - if ( ! is_array( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 439 | + if ( ! is_array( $vValue[ $sTaxonomySlug ] ) ) { |
|
| 440 | 440 | return array(); |
| 441 | 441 | } |
| 442 | 442 | |
@@ -105,10 +105,8 @@ |
||
| 105 | 105 | * If a parameter is not passed, it returns the entire attribute array. |
| 106 | 106 | * |
| 107 | 107 | * @since 3.5.3 |
| 108 | - * @return string|array|null The specified attribute value or the entire attribute array if not specified. |
|
| 108 | + * @return string The specified attribute value or the entire attribute array if not specified. |
|
| 109 | 109 | * If not set, null will be returned as the `getAttributes()` method will not list an attribute with the null value. |
| 110 | - * @param string $sName The attribute name. |
|
| 111 | - * @param string $sDefault The defaqult value if the value is not set. |
|
| 112 | 110 | */ |
| 113 | 111 | public function getAttribute( /* $sName=null, $sDefault=null */ ) { |
| 114 | 112 | $_aParams = func_get_args() + array( |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | * @param array $aAttributes The attribute array. A field definition array is deprecated. |
| 64 | 64 | * @param array $aOptions options that allows to set custom container tags and class selctors. |
| 65 | 65 | */ |
| 66 | - public function __construct( array $aAttributes, array $aOptions=array() ) { |
|
| 66 | + public function __construct( array $aAttributes, array $aOptions = array() ) { |
|
| 67 | 67 | |
| 68 | - $this->aAttributes = $this->getElementAsArray( |
|
| 68 | + $this->aAttributes = $this->getElementAsArray( |
|
| 69 | 69 | $aAttributes, |
| 70 | 70 | 'attributes', |
| 71 | 71 | $aAttributes // if the above key is not set, this will be set |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | * @return string The set class selector(s). |
| 128 | 128 | */ |
| 129 | 129 | public function addClass( /* $asSelectors1, $asSelectors2 */ ) { |
| 130 | - foreach( func_get_args() as $_asSelectors ) { |
|
| 131 | - $this->aAttributes['class'] = $this->getClassAttribute( |
|
| 132 | - $this->aAttributes['class'], |
|
| 130 | + foreach ( func_get_args() as $_asSelectors ) { |
|
| 131 | + $this->aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 132 | + $this->aAttributes[ 'class' ], |
|
| 133 | 133 | $_asSelectors |
| 134 | 134 | ); |
| 135 | 135 | } |
| 136 | - return $this->aAttributes['class']; |
|
| 136 | + return $this->aAttributes[ 'class' ]; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | // $this->aAttributes[ $_aParams[ 0 ] ] = $_aParams[ 1 ]; |
| 159 | 159 | $this->setMultiDimensionalArray( |
| 160 | 160 | $this->aAttributes, |
| 161 | - $this->getElementAsArray( $_aParams, 0 ), // $asAttributeName |
|
| 161 | + $this->getElementAsArray( $_aParams, 0 ), // $asAttributeName |
|
| 162 | 162 | $_aParams[ 1 ] // $mValue |
| 163 | 163 | ); |
| 164 | 164 | } |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | * @return string The set class selector(s). |
| 128 | 128 | */ |
| 129 | 129 | public function addClass( /* $asSelectors1, $asSelectors2 */ ) { |
| 130 | - foreach( func_get_args() as $_asSelectors ) { |
|
| 130 | + foreach( func_get_args() as $_asSelectors ) { |
|
| 131 | 131 | $this->aAttributes['class'] = $this->getClassAttribute( |
| 132 | 132 | $this->aAttributes['class'], |
| 133 | 133 | $_asSelectors |
@@ -21,8 +21,6 @@ |
||
| 21 | 21 | * Returns the output of the input element. |
| 22 | 22 | * |
| 23 | 23 | * @since 3.4.0 |
| 24 | - * @param string $sLabel The label text. |
|
| 25 | - * @param array $aAttributes (optional) The attribute array. If set, it will be merged with the attribute set in the constructor. |
|
| 26 | 24 | */ |
| 27 | 25 | public function get( /* $sLabel, $aAttributes=array() */ ) { |
| 28 | 26 | |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | // Output |
| 48 | 48 | return |
| 49 | - "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">" |
|
| 49 | + "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">" |
|
| 50 | 50 | // the unchecked value must be set prior to the checkbox input field. |
| 51 | 51 | . "<input " . $this->getAttributes( |
| 52 | 52 | array( |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | public function get( /* $sLabel, $aAttributes=array() */ ) { |
| 28 | 28 | |
| 29 | 29 | // Parameters |
| 30 | - $_aParams = func_get_args() + array( |
|
| 31 | - 0 => '', // 1st parameter |
|
| 30 | + $_aParams = func_get_args() + array( |
|
| 31 | + 0 => '', // 1st parameter |
|
| 32 | 32 | 1 => array() // 2nd parameter |
| 33 | 33 | ); |
| 34 | - $_sLabel = $_aParams[ 0 ]; // first parameter |
|
| 34 | + $_sLabel = $_aParams[ 0 ]; // first parameter |
|
| 35 | 35 | |
| 36 | 36 | // Attributes |
| 37 | 37 | $_aAttributes = $this->uniteArrays( // second parameter |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | // Output |
| 48 | 48 | return |
| 49 | - "<{$this->aOptions[ 'input_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ) . ">" |
|
| 49 | + "<{$this->aOptions[ 'input_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ).">" |
|
| 50 | 50 | // the unchecked value must be set prior to the checkbox input field. |
| 51 | - . "<input " . $this->getAttributes( |
|
| 51 | + . "<input ".$this->getAttributes( |
|
| 52 | 52 | array( |
| 53 | 53 | 'type' => 'hidden', |
| 54 | 54 | 'class' => $_aAttributes[ 'class' ], |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | ) |
| 58 | 58 | ) |
| 59 | 59 | . " />" |
| 60 | - . "<input " . $this->getAttributes( $_aAttributes ) . " />" |
|
| 60 | + . "<input ".$this->getAttributes( $_aAttributes )." />" |
|
| 61 | 61 | . "</{$this->aOptions[ 'input_container_tag' ]}>" |
| 62 | - . "<{$this->aOptions[ 'label_container_tag' ]} " . $this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ) . ">" |
|
| 62 | + . "<{$this->aOptions[ 'label_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ).">" |
|
| 63 | 63 | . $_sLabel |
| 64 | 64 | . "</{$this->aOptions[ 'label_container_tag' ]}>" |
| 65 | 65 | ; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | public function getAttributesByKey( /* $sKey */ ) { |
| 76 | 76 | |
| 77 | 77 | // Parameters |
| 78 | - $_aParams = func_get_args() + array( 0 => '', ); |
|
| 78 | + $_aParams = func_get_args() + array( 0 => '',); |
|
| 79 | 79 | $_sKey = $_aParams[ 0 ]; |
| 80 | 80 | $_bIsMultiple = '' !== $_sKey; |
| 81 | 81 | |
@@ -87,13 +87,13 @@ discard block |
||
| 87 | 87 | // The type needs to be specified since the postytpe field type extends this class. If not set, the 'posttype' will be passed to the type attribute. |
| 88 | 88 | + array( |
| 89 | 89 | 'type' => 'checkbox', |
| 90 | - 'id' => $this->aAttributes[ 'id' ] . '_' . $_sKey, |
|
| 90 | + 'id' => $this->aAttributes[ 'id' ].'_'.$_sKey, |
|
| 91 | 91 | 'checked' => $this->_getCheckedAttributeValue( $_sKey ), |
| 92 | - 'value' => 1, // this must be always 1 because the key value can be zero. In that case, the value always will be false and unchecked. |
|
| 92 | + 'value' => 1, // this must be always 1 because the key value can be zero. In that case, the value always will be false and unchecked. |
|
| 93 | 93 | 'name' => $_bIsMultiple |
| 94 | 94 | ? "{$this->aAttributes[ 'name' ]}[{$_sKey}]" |
| 95 | 95 | : $this->aAttributes[ 'name' ], |
| 96 | - 'data-id' => $this->aAttributes[ 'id' ], // referenced by the JavaScript scripts such as the revealer script. |
|
| 96 | + 'data-id' => $this->aAttributes[ 'id' ], // referenced by the JavaScript scripts such as the revealer script. |
|
| 97 | 97 | ) |
| 98 | 98 | + $this->aAttributes |
| 99 | 99 | ; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | : array( 'value', $_sKey ); |
| 111 | 111 | return $this->getElement( $this->aAttributes, $_aValueDimension ) |
| 112 | 112 | ? 'checked' |
| 113 | - : null; // to not to set, pass null. An empty value '' will still set the attribute. |
|
| 113 | + : null; // to not to set, pass null. An empty value '' will still set the attribute. |
|
| 114 | 114 | |
| 115 | 115 | } |
| 116 | 116 | |
@@ -21,8 +21,6 @@ discard block |
||
| 21 | 21 | * Returns the output of the input element. |
| 22 | 22 | * |
| 23 | 23 | * @since 3.4.0 |
| 24 | - * @param string $sLabel The label text. |
|
| 25 | - * @param array $aAttributes (optional) The attribute array. If set, it will be merged with the attribute set in the constructor. |
|
| 26 | 24 | */ |
| 27 | 25 | public function get( /* $sLabel, $aAttributes=array() */ ) { |
| 28 | 26 | |
@@ -52,8 +50,6 @@ discard block |
||
| 52 | 50 | * |
| 53 | 51 | * @return array The updated attribute array. |
| 54 | 52 | * @since 3.5.3 |
| 55 | - * @param string $sKey The array element key of the radio button. |
|
| 56 | - * It is assumed that there is an array that holds multiple radio buttons and each of them has an array key. |
|
| 57 | 53 | */ |
| 58 | 54 | public function getAttributesByKey( /* $sKey */ ) { |
| 59 | 55 | |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | // Output |
| 38 | 38 | return |
| 39 | - "<{$this->aOptions['input_container_tag']} " . $this->getAttributes( $this->aOptions['input_container_attributes'] ) . ">" |
|
| 40 | - . "<input " . $this->getAttributes( $_aAttributes ) . " />" |
|
| 41 | - . "</{$this->aOptions['input_container_tag']}>" |
|
| 42 | - . "<{$this->aOptions['label_container_tag']} " . $this->getAttributes( $this->aOptions['label_container_attributes'] ) . ">" |
|
| 39 | + "<{$this->aOptions[ 'input_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'input_container_attributes' ] ).">" |
|
| 40 | + . "<input ".$this->getAttributes( $_aAttributes )." />" |
|
| 41 | + . "</{$this->aOptions[ 'input_container_tag' ]}>" |
|
| 42 | + . "<{$this->aOptions[ 'label_container_tag' ]} ".$this->getAttributes( $this->aOptions[ 'label_container_attributes' ] ).">" |
|
| 43 | 43 | . $_sLabel |
| 44 | - . "</{$this->aOptions['label_container_tag']}>" |
|
| 44 | + . "</{$this->aOptions[ 'label_container_tag' ]}>" |
|
| 45 | 45 | ; |
| 46 | 46 | |
| 47 | 47 | } |
@@ -58,22 +58,22 @@ discard block |
||
| 58 | 58 | public function getAttributesByKey( /* $sKey */ ) { |
| 59 | 59 | |
| 60 | 60 | // Parameters |
| 61 | - $_aParams = func_get_args() + array( 0 => '', ); |
|
| 62 | - $_sKey = $_aParams[ 0 ]; |
|
| 61 | + $_aParams = func_get_args() + array( 0 => '',); |
|
| 62 | + $_sKey = $_aParams[ 0 ]; |
|
| 63 | 63 | |
| 64 | 64 | // Result |
| 65 | 65 | return $this->getElementAsArray( $this->aAttributes, $_sKey, array() ) |
| 66 | 66 | + array( |
| 67 | 67 | 'type' => 'radio', |
| 68 | - 'checked' => isset( $this->aAttributes['value'] ) && $this->aAttributes['value'] == $_sKey |
|
| 68 | + 'checked' => isset( $this->aAttributes[ 'value' ] ) && $this->aAttributes[ 'value' ] == $_sKey |
|
| 69 | 69 | ? 'checked' |
| 70 | 70 | : null, |
| 71 | 71 | 'value' => $_sKey, |
| 72 | 72 | // 'id' => $this->aField['input_id'] . '_' . $_sKey, |
| 73 | - 'id' => $this->getAttribute( 'id' ) . '_' . $_sKey, |
|
| 73 | + 'id' => $this->getAttribute( 'id' ).'_'.$_sKey, |
|
| 74 | 74 | // 'data-default' => $this->aField['default'], // refered by the repeater script |
| 75 | 75 | // 'data-id' => $this->aField['input_id'], // refered by the JavaScript scripts such as the revealer script. |
| 76 | - 'data-id' => $this->getAttribute( 'id' ), // refered by the JavaScript scripts such as the revealer script. |
|
| 76 | + 'data-id' => $this->getAttribute( 'id' ), // refered by the JavaScript scripts such as the revealer script. |
|
| 77 | 77 | ) |
| 78 | 78 | + $this->aAttributes; |
| 79 | 79 | |