@@ -60,6 +60,7 @@ |
||
60 | 60 | /** |
61 | 61 | * Applies the subject string to the set callback filter function. |
62 | 62 | * @since 3.6.0 |
63 | + * @param string $sSubject |
|
63 | 64 | */ |
64 | 65 | protected function _getFiltered( $sSubject ) { |
65 | 66 | return is_callable( $this->hfCallback ) |
@@ -51,9 +51,9 @@ |
||
51 | 51 | $_sIndex = $this->getAOrB( |
52 | 52 | '0' !== $this->sIndex && empty( $this->sIndex ), |
53 | 53 | '', |
54 | - "[" . $this->sIndex . "]" |
|
54 | + "[".$this->sIndex."]" |
|
55 | 55 | ); |
56 | - return $this->_getFiltered( $this->_getFieldName() . $_sIndex ); |
|
56 | + return $this->_getFiltered( $this->_getFieldName().$_sIndex ); |
|
57 | 57 | |
58 | 58 | } |
59 | 59 |
@@ -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>" |
@@ -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' ] |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | |
478 | 478 | // Section container |
479 | 479 | $_oSectionTable = new AdminPageFramework_Form_View___Section( |
480 | - $this->aArguments, // for nested sections |
|
480 | + $this->aArguments, // for nested sections |
|
481 | 481 | $aSectionset, |
482 | 482 | $this->aStructure, |
483 | 483 | $aFieldsetsPerSection, |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | $this->aCallbacks, |
488 | 488 | $this->oMsg |
489 | 489 | ); |
490 | - $_aOutputs[ 'section_contents' ][] = $_oSectionTable->get(); |
|
490 | + $_aOutputs[ 'section_contents' ][ ] = $_oSectionTable->get(); |
|
491 | 491 | |
492 | 492 | return $_aOutputs; |
493 | 493 | |
@@ -515,9 +515,9 @@ discard block |
||
515 | 515 | 'section_index' => null, |
516 | 516 | 'collapsible' => $aCollapsible, |
517 | 517 | 'container_type' => 'sections', // section or sections |
518 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
518 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
519 | 519 | ), |
520 | - array(), // fieldsets |
|
520 | + array(), // fieldsets |
|
521 | 521 | $this->aSavedData, |
522 | 522 | $this->aFieldErrors, |
523 | 523 | $this->aStructure[ 'field_type_definitions' ], |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | $aOutputs[ 'count_subsections' ] |
535 | 535 | ); |
536 | 536 | return $_oCollapsibleSectionTitle->get() |
537 | - . "<div " . $_oSectionsTablesContainerAttributes->get() . ">" |
|
537 | + . "<div ".$_oSectionsTablesContainerAttributes->get().">" |
|
538 | 538 | . $this->_getSectionTabList( $sSectionTabSlug, $aOutputs[ 'section_tab_list' ] ) |
539 | 539 | . implode( PHP_EOL, $aOutputs[ 'section_contents' ] ) |
540 | 540 | . "</div>"; |
@@ -565,21 +565,21 @@ discard block |
||
565 | 565 | */ |
566 | 566 | private function _getTabList( array $aSection, array $aFields, $hfFieldCallback ) { |
567 | 567 | |
568 | - if ( ! $aSection[ 'section_tab_slug' ] ) { |
|
568 | + if ( !$aSection[ 'section_tab_slug' ] ) { |
|
569 | 569 | return ''; |
570 | 570 | } |
571 | 571 | |
572 | 572 | $iSectionIndex = $aSection[ '_index' ]; |
573 | 573 | |
574 | - $_sSectionTagID = 'section-' . $aSection[ 'section_id' ] . '__' . $iSectionIndex; |
|
574 | + $_sSectionTagID = 'section-'.$aSection[ 'section_id' ].'__'.$iSectionIndex; |
|
575 | 575 | $_aTabAttributes = $aSection[ 'attributes' ][ 'tab' ] |
576 | 576 | + array( |
577 | 577 | 'class' => 'admin-page-framework-section-tab nav-tab', |
578 | 578 | 'id' => "section_tab-{$_sSectionTagID}", |
579 | 579 | 'style' => null |
580 | 580 | ); |
581 | - $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
582 | - $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
581 | + $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
582 | + $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
583 | 583 | |
584 | 584 | $_oSectionTitle = new AdminPageFramework_Form_View___SectionTitle( |
585 | 585 | array( |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | 'tag' => 'h4', |
588 | 588 | 'section_index' => $iSectionIndex, |
589 | 589 | |
590 | - 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
590 | + 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
591 | 591 | ), |
592 | 592 | $aFields, |
593 | 593 | $this->aSavedData, |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | $this->aCallbacks // field output element callables. |
598 | 598 | ); |
599 | 599 | |
600 | - return "<li " . $this->getAttributes( $_aTabAttributes ) . ">" |
|
600 | + return "<li ".$this->getAttributes( $_aTabAttributes ).">" |
|
601 | 601 | . "<a href='#{$_sSectionTagID}'>" |
602 | 602 | . $_oSectionTitle->get() |
603 | 603 | ."</a>" |
@@ -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( |
@@ -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 |