@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * Defines the field type slugs used for this field type. |
| 119 | 119 | * @var array |
| 120 | 120 | */ |
| 121 | - public $aFieldTypeSlugs = array( 'taxonomy', ); |
|
| 121 | + public $aFieldTypeSlugs = array( 'taxonomy',); |
|
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | 124 | * Defines the default key-values of this field type. |
@@ -127,41 +127,41 @@ discard block |
||
| 127 | 127 | * @var array |
| 128 | 128 | */ |
| 129 | 129 | protected $aDefaultKeys = array( |
| 130 | - 'taxonomy_slugs' => 'category', // (array|string) This is for the taxonomy field type. |
|
| 131 | - 'height' => '250px', // the tab box height |
|
| 132 | - 'width' => null, // 3.5.7.2+ the tab box width |
|
| 133 | - 'max_width' => '100%', // for the taxonomy checklist field type, since 2.1.1. |
|
| 134 | - 'show_post_count' => true, // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not. |
|
| 130 | + 'taxonomy_slugs' => 'category', // (array|string) This is for the taxonomy field type. |
|
| 131 | + 'height' => '250px', // the tab box height |
|
| 132 | + 'width' => null, // 3.5.7.2+ the tab box width |
|
| 133 | + 'max_width' => '100%', // for the taxonomy checklist field type, since 2.1.1. |
|
| 134 | + 'show_post_count' => true, // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not. |
|
| 135 | 135 | 'attributes' => array(), |
| 136 | - 'select_all_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 137 | - 'select_none_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 138 | - '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. |
|
| 139 | - '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. |
|
| 136 | + 'select_all_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 137 | + 'select_none_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
| 138 | + '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. |
|
| 139 | + '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. |
|
| 140 | 140 | 'query' => array( // (array) 3.3.2+ Defines the default query argument. |
| 141 | 141 | // see the arguments of the get_category() function: http://codex.wordpress.org/Function_Reference/get_categories |
| 142 | 142 | // see the argument of the get_terms() function: http://codex.wordpress.org/Function_Reference/get_terms |
| 143 | 143 | 'child_of' => 0, |
| 144 | 144 | 'parent' => '', |
| 145 | - 'orderby' => 'name', // (string) 'ID' or 'term_id' or 'name' |
|
| 146 | - 'order' => 'ASC', // (string) 'ASC' or 'DESC' |
|
| 147 | - 'hide_empty' => false, // (boolean) whether to show the terms with no post associated. Default: false |
|
| 148 | - 'hierarchical' => true, // (boolean) whether to show the terms as a hierarchical tree. |
|
| 149 | - 'number' => '', // (integer) The maximum number of the terms to show. |
|
| 150 | - 'pad_counts' => false, // (boolean) whether to sum up the post counts with the child post counts. |
|
| 151 | - 'exclude' => array(), // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list. |
|
| 145 | + 'orderby' => 'name', // (string) 'ID' or 'term_id' or 'name' |
|
| 146 | + 'order' => 'ASC', // (string) 'ASC' or 'DESC' |
|
| 147 | + 'hide_empty' => false, // (boolean) whether to show the terms with no post associated. Default: false |
|
| 148 | + 'hierarchical' => true, // (boolean) whether to show the terms as a hierarchical tree. |
|
| 149 | + 'number' => '', // (integer) The maximum number of the terms to show. |
|
| 150 | + 'pad_counts' => false, // (boolean) whether to sum up the post counts with the child post counts. |
|
| 151 | + 'exclude' => array(), // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list. |
|
| 152 | 152 | 'exclude_tree' => array(), |
| 153 | - 'include' => array(), // (string) Comma separated term IDs to include in the list. |
|
| 153 | + 'include' => array(), // (string) Comma separated term IDs to include in the list. |
|
| 154 | 154 | 'fields' => 'all', |
| 155 | 155 | 'slug' => '', |
| 156 | 156 | 'get' => '', |
| 157 | 157 | 'name__like' => '', |
| 158 | 158 | 'description__like' => '', |
| 159 | 159 | 'offset' => '', |
| 160 | - 'search' => '', // (string) The search keyword to get the term with. |
|
| 160 | + 'search' => '', // (string) The search keyword to get the term with. |
|
| 161 | 161 | 'cache_domain' => 'core', |
| 162 | 162 | ), |
| 163 | - 'queries' => array(), // (optional, array) 3.3.2+ Sets a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array. |
|
| 164 | - 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
| 163 | + 'queries' => array(), // (optional, array) 3.3.2+ Sets a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array. |
|
| 164 | + 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
| 165 | 165 | ); |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | $_aJSArray = json_encode( $this->aFieldTypeSlugs ); |
| 193 | 193 | |
| 194 | - return parent::getScripts() . |
|
| 194 | + return parent::getScripts(). |
|
| 195 | 195 | // return |
| 196 | 196 | <<<JAVASCRIPTS |
| 197 | 197 | /* For tabs */ |
@@ -412,22 +412,22 @@ discard block |
||
| 412 | 412 | // Parse |
| 413 | 413 | $_aTabs = array(); |
| 414 | 414 | $_aCheckboxes = array(); |
| 415 | - foreach( $this->getAsArray( $aField[ 'taxonomy_slugs' ] ) as $_isKey => $_sTaxonomySlug ) { |
|
| 415 | + foreach ( $this->getAsArray( $aField[ 'taxonomy_slugs' ] ) as $_isKey => $_sTaxonomySlug ) { |
|
| 416 | 416 | $_aAssociatedDataAttributes = $this->_getDataAttributesOfAssociatedPostTypes( |
| 417 | 417 | $_sTaxonomySlug, |
| 418 | 418 | $this->_getPostTypesByTaxonomySlug( $_sTaxonomySlug ) |
| 419 | 419 | ); |
| 420 | - $_aTabs[] = $this->_getTaxonomyTab( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
| 421 | - $_aCheckboxes[] = $this->_getTaxonomyCheckboxes( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
| 420 | + $_aTabs[ ] = $this->_getTaxonomyTab( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
| 421 | + $_aCheckboxes[ ] = $this->_getTaxonomyCheckboxes( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | // Output |
| 425 | - return "<div id='tabbox-{$aField['field_id']}' class='tab-box-container categorydiv' style='max-width:{$aField['max_width']};'>" |
|
| 425 | + return "<div id='tabbox-{$aField[ 'field_id' ]}' class='tab-box-container categorydiv' style='max-width:{$aField[ 'max_width' ]};'>" |
|
| 426 | 426 | . "<ul class='tab-box-tabs category-tabs'>" |
| 427 | 427 | . implode( PHP_EOL, $_aTabs ) |
| 428 | 428 | . "</ul>" |
| 429 | 429 | . "<div class='tab-box-contents-container'>" |
| 430 | - . "<div class='tab-box-contents' style='height: {$aField['height']};'>" |
|
| 430 | + . "<div class='tab-box-contents' style='height: {$aField[ 'height' ]};'>" |
|
| 431 | 431 | . implode( PHP_EOL, $_aCheckboxes ) |
| 432 | 432 | . "</div>" |
| 433 | 433 | . "</div>" |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | private function _getDataAttributesOfAssociatedPostTypes( $sTaxonomySlusg, $aPostTypes ) { |
| 454 | 454 | return array( |
| 455 | 455 | 'data-associated-with' => $sTaxonomySlusg, |
| 456 | - 'data-associated-post-types' => implode( ',', $aPostTypes ) . ',', // must add a trailing comma for jQuery to detect the item. |
|
| 456 | + 'data-associated-post-types' => implode( ',', $aPostTypes ).',', // must add a trailing comma for jQuery to detect the item. |
|
| 457 | 457 | ); |
| 458 | 458 | } |
| 459 | 459 | |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | private function _getTaxonomyCheckboxes( array $aField, $sKey, $sTaxonomySlug, $aAttributes ) { |
| 469 | 469 | |
| 470 | 470 | $_aTabBoxContainerArguments = array( |
| 471 | - 'id' => "tab_{$aField['input_id']}_{$sKey}", |
|
| 471 | + 'id' => "tab_{$aField[ 'input_id' ]}_{$sKey}", |
|
| 472 | 472 | 'class' => 'tab-box-content', |
| 473 | 473 | 'style' => $this->getInlineCSS( |
| 474 | 474 | array( |
@@ -477,9 +477,9 @@ discard block |
||
| 477 | 477 | ) |
| 478 | 478 | ), |
| 479 | 479 | ) + $aAttributes; |
| 480 | - return "<div " . $this->getAttributes( $_aTabBoxContainerArguments ) . ">" |
|
| 480 | + return "<div ".$this->getAttributes( $_aTabBoxContainerArguments ).">" |
|
| 481 | 481 | . $this->getElement( $aField, array( 'before_label', $sKey ) ) |
| 482 | - . "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . ">" |
|
| 482 | + . "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ).">" |
|
| 483 | 483 | . "</div>" |
| 484 | 484 | . "<ul class='list:category taxonomychecklist form-no-clear'>" |
| 485 | 485 | . $this->_getTaxonomyChecklist( $aField, $sKey, $sTaxonomySlug ) |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | 'taxonomy' => $sTaxonomySlug, |
| 505 | 505 | '_name_prefix' => is_array( $aField[ 'taxonomy_slugs' ] ) |
| 506 | 506 | ? "{$aField[ '_input_name' ]}[{$sTaxonomySlug}]" |
| 507 | - : $aField[ '_input_name' ], // name prefix of the input |
|
| 507 | + : $aField[ '_input_name' ], // name prefix of the input |
|
| 508 | 508 | '_input_id_prefix' => $aField[ 'input_id' ], |
| 509 | 509 | '_attributes' => $this->getElementAsArray( |
| 510 | 510 | $aField, |
@@ -512,12 +512,12 @@ discard block |
||
| 512 | 512 | ) + $aField[ 'attributes' ], |
| 513 | 513 | |
| 514 | 514 | // checked items ( term IDs ) e.g. array( 6, 10, 7, 15 ), |
| 515 | - '_selected_items' => $this->_getSelectedKeyArray( $aField['value'], $sTaxonomySlug ), |
|
| 515 | + '_selected_items' => $this->_getSelectedKeyArray( $aField[ 'value' ], $sTaxonomySlug ), |
|
| 516 | 516 | |
| 517 | - 'echo' => false, // returns the output |
|
| 518 | - 'show_post_count' => $aField[ 'show_post_count' ], // 3.2.0+ |
|
| 519 | - 'show_option_none' => $aField[ 'label_no_term_found' ], // 3.3.2+ |
|
| 520 | - 'title_li' => $aField[ 'label_list_title' ], // 3.3.2+ |
|
| 517 | + 'echo' => false, // returns the output |
|
| 518 | + 'show_post_count' => $aField[ 'show_post_count' ], // 3.2.0+ |
|
| 519 | + 'show_option_none' => $aField[ 'label_no_term_found' ], // 3.3.2+ |
|
| 520 | + 'title_li' => $aField[ 'label_list_title' ], // 3.3.2+ |
|
| 521 | 521 | |
| 522 | 522 | '_save_unchecked' => $aField[ 'save_unchecked' ], // 3.8.8+ Whether to insert hidden input element for unchecked. |
| 523 | 523 | ) |
@@ -564,8 +564,8 @@ discard block |
||
| 564 | 564 | $_aLiAttribues = array( |
| 565 | 565 | 'class' => 'tab-box-tab', |
| 566 | 566 | ) + $aAttributes; |
| 567 | - return "<li " . $this->getAttributes( $_aLiAttribues ) . ">" |
|
| 568 | - . "<a href='#tab_{$aField['input_id']}_{$sKey}'>" |
|
| 567 | + return "<li ".$this->getAttributes( $_aLiAttribues ).">" |
|
| 568 | + . "<a href='#tab_{$aField[ 'input_id' ]}_{$sKey}'>" |
|
| 569 | 569 | . "<span class='tab-box-tab-text'>" |
| 570 | 570 | . $this->_getLabelFromTaxonomySlug( $sTaxonomySlug ) |
| 571 | 571 | . "</span>" |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | /** |
| 65 | 65 | * Defines the field type slugs used for this field type. |
| 66 | 66 | */ |
| 67 | - public $aFieldTypeSlugs = array( 'size', ); |
|
| 67 | + public $aFieldTypeSlugs = array( 'size',); |
|
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Defines the default key-values of this field type. |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | protected $aDefaultKeys = array( |
| 75 | 75 | 'is_multiple' => false, // indicates whether the select tag alloes multiple selections. |
| 76 | - 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
| 76 | + 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
| 77 | 77 | 'attributes' => array( |
| 78 | 78 | 'size' => array( |
| 79 | 79 | 'min' => null, |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | protected $aDefaultUnits = array( |
| 103 | 103 | 'px' => 'px', // pixel |
| 104 | - '%' => '%', // percentage |
|
| 104 | + '%' => '%', // percentage |
|
| 105 | 105 | 'em' => 'em', // font size |
| 106 | 106 | 'ex' => 'ex', // font height |
| 107 | 107 | 'in' => 'in', // inch |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | ); |
| 162 | 162 | |
| 163 | 163 | $_aOutput = array(); |
| 164 | - foreach( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
| 165 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
| 164 | + foreach ( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
| 165 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
| 166 | 166 | $_isKey, |
| 167 | 167 | $_sLabel, |
| 168 | 168 | $aField |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | $_aBaseAttributes = $_bMultiLabels |
| 187 | 187 | ? array( |
| 188 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$isKey}]", |
|
| 189 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$isKey}", |
|
| 188 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$isKey}]", |
|
| 189 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$isKey}", |
|
| 190 | 190 | 'value' => $aField[ 'value' ], |
| 191 | 191 | ) |
| 192 | 192 | + $aField[ 'attributes' ] |
@@ -198,9 +198,9 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | $_aOutput = array( |
| 200 | 200 | $this->getElementByLabel( $aField[ 'before_label' ], $isKey, $aField[ 'label' ] ), |
| 201 | - "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">", |
|
| 202 | - $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The size (number) part |
|
| 203 | - $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The unit (select) part |
|
| 201 | + "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">", |
|
| 202 | + $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The size (number) part |
|
| 203 | + $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The unit (select) part |
|
| 204 | 204 | "</div>", |
| 205 | 205 | $this->getElementByLabel( $aField[ 'after_label' ], $isKey, $aField[ 'label' ] ) |
| 206 | 206 | ); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | private function _getNumberInputPart( array $aField, array $aBaseAttributes, $isKey, $bMultiLabels ) { |
| 218 | 218 | |
| 219 | 219 | // Size and Size Label |
| 220 | - $_aSizeAttributes = $this->_getSizeAttributes( |
|
| 220 | + $_aSizeAttributes = $this->_getSizeAttributes( |
|
| 221 | 221 | $aField, |
| 222 | 222 | $aBaseAttributes, |
| 223 | 223 | $bMultiLabels |
@@ -225,32 +225,32 @@ discard block |
||
| 225 | 225 | : '' |
| 226 | 226 | ); |
| 227 | 227 | |
| 228 | - $_aSizeLabelAttributes = array( |
|
| 228 | + $_aSizeLabelAttributes = array( |
|
| 229 | 229 | 'for' => $_aSizeAttributes[ 'id' ], |
| 230 | 230 | 'class' => $_aSizeAttributes[ 'disabled' ] |
| 231 | 231 | ? 'disabled' |
| 232 | 232 | : null, |
| 233 | 233 | ); |
| 234 | 234 | |
| 235 | - $_sLabel = $this->getElementByLabel( |
|
| 235 | + $_sLabel = $this->getElementByLabel( |
|
| 236 | 236 | $aField[ 'label' ], |
| 237 | 237 | $isKey, |
| 238 | 238 | $aField[ 'label' ] |
| 239 | 239 | ); |
| 240 | - return "<label " . $this->getAttributes( $_aSizeLabelAttributes ) . ">" |
|
| 240 | + return "<label ".$this->getAttributes( $_aSizeLabelAttributes ).">" |
|
| 241 | 241 | . $this->getElement( |
| 242 | 242 | $aField, |
| 243 | 243 | $bMultiLabels |
| 244 | 244 | ? array( 'before_label', $isKey, 'size' ) |
| 245 | 245 | : array( 'before_label', 'size' ) |
| 246 | 246 | ) |
| 247 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
| 248 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 247 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
| 248 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 249 | 249 | . $_sLabel |
| 250 | 250 | . "</span>" |
| 251 | 251 | : "" |
| 252 | 252 | ) |
| 253 | - . "<input " . $this->getAttributes( $_aSizeAttributes ) . " />" |
|
| 253 | + . "<input ".$this->getAttributes( $_aSizeAttributes )." />" |
|
| 254 | 254 | . $this->getElement( |
| 255 | 255 | $aField, |
| 256 | 256 | $bMultiLabels |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | ) |
| 294 | 294 | : $aField[ 'units' ]; |
| 295 | 295 | |
| 296 | - return "<label " . $this->getAttributes( |
|
| 296 | + return "<label ".$this->getAttributes( |
|
| 297 | 297 | array( |
| 298 | 298 | 'for' => $_aUnitAttributes[ 'id' ], |
| 299 | 299 | 'class' => $_aUnitAttributes[ 'disabled' ] |
@@ -325,9 +325,9 @@ discard block |
||
| 325 | 325 | * @return array an unit attribute array |
| 326 | 326 | * @internal |
| 327 | 327 | */ |
| 328 | - private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey='' ) { |
|
| 328 | + private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey = '' ) { |
|
| 329 | 329 | |
| 330 | - $_bIsMultiple = $aField[ 'is_multiple' ] |
|
| 330 | + $_bIsMultiple = $aField[ 'is_multiple' ] |
|
| 331 | 331 | ? true |
| 332 | 332 | : $this->getElement( |
| 333 | 333 | $aField, |
@@ -339,13 +339,13 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | $_aSelectAttributes = array( |
| 341 | 341 | 'type' => 'select', |
| 342 | - 'id' => $aField[ 'input_id' ] . ( '' === $isLabelKey ? '' : '_' . $isLabelKey ) . '_' . 'unit', |
|
| 342 | + 'id' => $aField[ 'input_id' ].( '' === $isLabelKey ? '' : '_'.$isLabelKey ).'_'.'unit', |
|
| 343 | 343 | 'multiple' => $_bIsMultiple |
| 344 | 344 | ? 'multiple' |
| 345 | 345 | : null, |
| 346 | 346 | 'name' => $_bIsMultiple |
| 347 | - ? "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit][]" |
|
| 348 | - : "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit]", |
|
| 347 | + ? "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit][]" |
|
| 348 | + : "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit]", |
|
| 349 | 349 | 'value' => $this->getElement( |
| 350 | 350 | $aField, |
| 351 | 351 | array( 'value', 'unit' ), |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | '' === $isLabelKey |
| 358 | 358 | ? array( 'attributes', 'unit' ) |
| 359 | 359 | : array( 'attributes', $isLabelKey, 'unit' ), |
| 360 | - $this->aDefaultKeys['attributes']['unit'] |
|
| 360 | + $this->aDefaultKeys[ 'attributes' ][ 'unit' ] |
|
| 361 | 361 | ) |
| 362 | 362 | + $aBaseAttributes; |
| 363 | 363 | return $_aSelectAttributes; |
@@ -371,15 +371,15 @@ discard block |
||
| 371 | 371 | * @return array an size attribute array |
| 372 | 372 | * @internal |
| 373 | 373 | */ |
| 374 | - private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey='' ) { |
|
| 374 | + private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey = '' ) { |
|
| 375 | 375 | |
| 376 | 376 | return array( |
| 377 | 377 | 'type' => 'number', |
| 378 | - 'id' => $aField['input_id'] . '_' . ( '' !== $sLabelKey ? $sLabelKey . '_' : '' ) . 'size', |
|
| 379 | - 'name' => $aField[ '_input_name' ] . ( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ) . '[size]', |
|
| 378 | + 'id' => $aField[ 'input_id' ].'_'.( '' !== $sLabelKey ? $sLabelKey.'_' : '' ).'size', |
|
| 379 | + 'name' => $aField[ '_input_name' ].( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ).'[size]', |
|
| 380 | 380 | 'value' => $this->getElement( |
| 381 | - $aField, // subject |
|
| 382 | - array( 'value', 'size' ), // dimensional keys |
|
| 381 | + $aField, // subject |
|
| 382 | + array( 'value', 'size' ), // dimensional keys |
|
| 383 | 383 | '' // default |
| 384 | 384 | ), |
| 385 | 385 | ) |
@@ -106,11 +106,11 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | protected function getField( $aField ) { |
| 108 | 108 | |
| 109 | - $_aOutput = array(); |
|
| 110 | - foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) { |
|
| 111 | - $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
| 109 | + $_aOutput = array(); |
|
| 110 | + foreach ( $this->getAsArray( $aField[ 'label' ] ) as $_sKey => $_sLabel ) { |
|
| 111 | + $_aOutput[ ] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
| 112 | 112 | } |
| 113 | - $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] ); |
|
| 113 | + $_aOutput[ ] = $this->_getUpdateCheckedScript( $aField[ 'input_id' ] ); |
|
| 114 | 114 | return implode( PHP_EOL, $_aOutput ); |
| 115 | 115 | |
| 116 | 116 | } |
@@ -126,12 +126,12 @@ discard block |
||
| 126 | 126 | $_aAttributes = $aField[ 'attributes' ] + $this->getElementAsArray( $aField, array( 'attributes', $sKey ) ); |
| 127 | 127 | $_oRadio = new AdminPageFramework_Input_radio( $_aAttributes ); |
| 128 | 128 | $_oRadio->setAttributesByKey( $sKey ); |
| 129 | - $_oRadio->setAttribute( 'data-default', $aField['default'] ); // refered by the repeater script |
|
| 129 | + $_oRadio->setAttribute( 'data-default', $aField[ 'default' ] ); // refered by the repeater script |
|
| 130 | 130 | |
| 131 | 131 | // Output |
| 132 | 132 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
| 133 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ) . ">" |
|
| 134 | - . "<label " . $this->getAttributes( |
|
| 133 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ).">" |
|
| 134 | + . "<label ".$this->getAttributes( |
|
| 135 | 135 | array( |
| 136 | 136 | 'for' => $_oRadio->getAttribute( 'id' ), |
| 137 | 137 | 'class' => $_oRadio->getAttribute( 'disabled' ) |
@@ -507,8 +507,8 @@ discard block |
||
| 507 | 507 | protected function getField( $aField ) { |
| 508 | 508 | |
| 509 | 509 | $_aOutput = array(); |
| 510 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 511 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
| 510 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 511 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
| 512 | 512 | $_sKey, |
| 513 | 513 | $_sLabel, |
| 514 | 514 | $aField |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | // the repeatable field buttons will be replaced with this element. |
| 519 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
| 519 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
| 520 | 520 | return implode( '', $_aOutput ); |
| 521 | 521 | |
| 522 | 522 | } |
@@ -537,27 +537,27 @@ discard block |
||
| 537 | 537 | $aField[ 'rich' ] = $this->getElementByLabel( $aField[ 'rich' ], $sKey, $aField[ 'label' ] ); |
| 538 | 538 | $aField[ 'attributes' ] = $_bIsArray |
| 539 | 539 | ? array( |
| 540 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
| 541 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
| 540 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
| 541 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
| 542 | 542 | 'value' => $aField[ 'value' ], |
| 543 | 543 | ) |
| 544 | 544 | + $aField[ 'attributes' ] |
| 545 | 545 | : $aField[ 'attributes' ]; |
| 546 | - $_aOutput = array( |
|
| 547 | - $this->getElementByLabel( $aField['before_label'], $sKey, $aField[ 'label' ] ), |
|
| 546 | + $_aOutput = array( |
|
| 547 | + $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
|
| 548 | 548 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
| 549 | - "<label for='" . $aField[ 'attributes' ][ 'id' ] . "'>", |
|
| 550 | - $this->getElementByLabel( $aField['before_input'], $sKey, $aField[ 'label' ] ), |
|
| 549 | + "<label for='".$aField[ 'attributes' ][ 'id' ]."'>", |
|
| 550 | + $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
|
| 551 | 551 | $_sLabel |
| 552 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 552 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 553 | 553 | . $_sLabel |
| 554 | 554 | . "</span>" |
| 555 | 555 | : '', |
| 556 | 556 | $this->_getEditor( $aField ), |
| 557 | - $this->getElementByLabel( $aField['after_input'], $sKey, $aField[ 'label' ] ), |
|
| 557 | + $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
|
| 558 | 558 | "</label>", |
| 559 | 559 | "</div>", |
| 560 | - $this->getElementByLabel( $aField['after_label'], $sKey, $aField[ 'label' ] ), |
|
| 560 | + $this->getElementByLabel( $aField[ 'after_label' ], $sKey, $aField[ 'label' ] ), |
|
| 561 | 561 | ); |
| 562 | 562 | return implode( '', $_aOutput ); |
| 563 | 563 | |
@@ -572,31 +572,31 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | private function _getEditor( $aField ) { |
| 574 | 574 | |
| 575 | - unset( $aField['attributes']['value'] ); |
|
| 575 | + unset( $aField[ 'attributes' ][ 'value' ] ); |
|
| 576 | 576 | |
| 577 | 577 | // For no TinyMCE |
| 578 | - if ( empty( $aField['rich'] ) || ! $this->isTinyMCESupported() ) { |
|
| 579 | - return "<textarea " . $this->getAttributes( $aField['attributes'] ) . " >" // this method is defined in the base class |
|
| 580 | - . esc_textarea( $aField['value'] ) |
|
| 578 | + if ( empty( $aField[ 'rich' ] ) || !$this->isTinyMCESupported() ) { |
|
| 579 | + return "<textarea ".$this->getAttributes( $aField[ 'attributes' ] )." >" // this method is defined in the base class |
|
| 580 | + . esc_textarea( $aField[ 'value' ] ) |
|
| 581 | 581 | . "</textarea>"; |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | // Rich editor |
| 585 | 585 | ob_start(); |
| 586 | 586 | wp_editor( |
| 587 | - $aField['value'], |
|
| 588 | - $aField['attributes']['id'], |
|
| 587 | + $aField[ 'value' ], |
|
| 588 | + $aField[ 'attributes' ][ 'id' ], |
|
| 589 | 589 | $this->uniteArrays( |
| 590 | - ( array ) $aField['rich'], |
|
| 590 | + ( array ) $aField[ 'rich' ], |
|
| 591 | 591 | array( |
| 592 | 592 | 'wpautop' => true, // use wpautop? |
| 593 | 593 | 'media_buttons' => true, // show insert/upload button(s) |
| 594 | - 'textarea_name' => $aField['attributes']['name'], |
|
| 595 | - 'textarea_rows' => $aField['attributes']['rows'], |
|
| 594 | + 'textarea_name' => $aField[ 'attributes' ][ 'name' ], |
|
| 595 | + 'textarea_rows' => $aField[ 'attributes' ][ 'rows' ], |
|
| 596 | 596 | 'tabindex' => '', |
| 597 | 597 | 'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE |
| 598 | 598 | 'editor_css' => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped". |
| 599 | - 'editor_class' => $aField['attributes']['class'], // add extra class(es) to the editor textarea |
|
| 599 | + 'editor_class' => $aField[ 'attributes' ][ 'class' ], // add extra class(es) to the editor textarea |
|
| 600 | 600 | 'teeny' => false, // output the minimal editor config used in Press This |
| 601 | 601 | 'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css) |
| 602 | 602 | 'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array() |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | ob_end_clean(); |
| 609 | 609 | |
| 610 | 610 | return $_sContent |
| 611 | - . $this->_getScriptForRichEditor( $aField['attributes']['id'] ); |
|
| 611 | + . $this->_getScriptForRichEditor( $aField[ 'attributes' ][ 'id' ] ); |
|
| 612 | 612 | |
| 613 | 613 | } |
| 614 | 614 | |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | * Defines the default key-values of this field type. |
| 77 | 77 | */ |
| 78 | 78 | protected $aDefaultKeys = array( |
| 79 | - 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
| 80 | - 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
| 81 | - 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
| 79 | + 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
| 80 | + 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
| 81 | + 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
| 82 | 82 | ); |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | protected function getScripts() { |
| 92 | 92 | new AdminPageFramework_Form_View___Script_CheckboxSelector; |
| 93 | - $_sClassSelectorSelectAll = $this->_getSelectButtonClassSelectors( |
|
| 93 | + $_sClassSelectorSelectAll = $this->_getSelectButtonClassSelectors( |
|
| 94 | 94 | $this->aFieldTypeSlugs, |
| 95 | 95 | 'select_all_button' // data attribute |
| 96 | 96 | ); |
@@ -117,14 +117,14 @@ discard block |
||
| 117 | 117 | * @return string |
| 118 | 118 | * @internal |
| 119 | 119 | */ |
| 120 | - private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute='select_all_button' ) { |
|
| 120 | + private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute = 'select_all_button' ) { |
|
| 121 | 121 | |
| 122 | 122 | $_aClassSelectors = array(); |
| 123 | 123 | foreach ( $aFieldTypeSlugs as $_sSlug ) { |
| 124 | - if ( ! is_scalar( $_sSlug ) ) { |
|
| 124 | + if ( !is_scalar( $_sSlug ) ) { |
|
| 125 | 125 | continue; |
| 126 | 126 | } |
| 127 | - $_aClassSelectors[] = '.admin-page-framework-checkbox-container-' . $_sSlug . "[data-{$sDataAttribute}]"; |
|
| 127 | + $_aClassSelectors[ ] = '.admin-page-framework-checkbox-container-'.$_sSlug."[data-{$sDataAttribute}]"; |
|
| 128 | 128 | } |
| 129 | 129 | return implode( ',', $_aClassSelectors ); |
| 130 | 130 | |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | $_aOutput = array(); |
| 187 | 187 | $_bIsMultiple = is_array( $aField[ 'label' ] ); |
| 188 | - foreach( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
| 189 | - $_aOutput[] = $this->_getEachCheckboxOutput( |
|
| 188 | + foreach ( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
| 189 | + $_aOutput[ ] = $this->_getEachCheckboxOutput( |
|
| 190 | 190 | $aField, |
| 191 | 191 | $_bIsMultiple |
| 192 | 192 | ? $_sKey |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $_sLabel |
| 195 | 195 | ); |
| 196 | 196 | } |
| 197 | - return "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . ">" |
|
| 197 | + return "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ).">" |
|
| 198 | 198 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
| 199 | 199 | . implode( PHP_EOL, $_aOutput ) |
| 200 | 200 | . "</div>"; |
@@ -209,12 +209,12 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | protected function _getCheckboxContainerAttributes( array $aField ) { |
| 211 | 211 | return array( |
| 212 | - 'class' => 'admin-page-framework-checkbox-container-' . $aField[ 'type' ], |
|
| 212 | + 'class' => 'admin-page-framework-checkbox-container-'.$aField[ 'type' ], |
|
| 213 | 213 | 'data-select_all_button' => $aField[ 'select_all_button' ] |
| 214 | - ? ( ! is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
| 214 | + ? ( !is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
| 215 | 215 | : null, |
| 216 | 216 | 'data-select_none_button' => $aField[ 'select_none_button' ] |
| 217 | - ? ( ! is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
| 217 | + ? ( !is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
| 218 | 218 | : null, |
| 219 | 219 | ); |
| 220 | 220 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | private function _getEachCheckboxOutput( array $aField, $sKey, $sLabel ) { |
| 230 | 230 | |
| 231 | 231 | $_aInputAttributes = array( |
| 232 | - 'data-key' => $sKey, // 3.8.8+ For the `post_type_taxonomy` field type. |
|
| 232 | + 'data-key' => $sKey, // 3.8.8+ For the `post_type_taxonomy` field type. |
|
| 233 | 233 | ) + $aField[ 'attributes' ]; |
| 234 | 234 | $_oCheckbox = new AdminPageFramework_Input_checkbox( |
| 235 | 235 | $_aInputAttributes, |
@@ -240,8 +240,8 @@ discard block |
||
| 240 | 240 | $_oCheckbox->setAttributesByKey( $sKey ); |
| 241 | 241 | $_oCheckbox->addClass( $this->_sCheckboxClassSelector ); |
| 242 | 242 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
| 243 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ) . ">" |
|
| 244 | - . "<label " . $this->getAttributes( |
|
| 243 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ).">" |
|
| 244 | + . "<label ".$this->getAttributes( |
|
| 245 | 245 | array( |
| 246 | 246 | 'for' => $_oCheckbox->getAttribute( 'id' ), |
| 247 | 247 | 'class' => $_oCheckbox->getAttribute( 'disabled' ) |
@@ -219,7 +219,7 @@ |
||
| 219 | 219 | * </code> |
| 220 | 220 | * @access public This must be public as accessed from outside. |
| 221 | 221 | */ |
| 222 | - public $aFieldTypeSlugs = array( 'default', ); |
|
| 222 | + public $aFieldTypeSlugs = array( 'default',); |
|
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | 225 | * Defines the default key-values of this field type. |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | // For front-end |
| 86 | 86 | // @see http://wordpress.stackexchange.com/a/82722 |
| 87 | - if ( ! is_admin() ) { |
|
| 87 | + if ( !is_admin() ) { |
|
| 88 | 88 | |
| 89 | 89 | // wp_enqueue_style( 'wp-color-picker' ); |
| 90 | 90 | wp_enqueue_script( |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | protected function getField( $aField ) { |
| 277 | 277 | |
| 278 | 278 | // If the value is not set, apply the default value, 'transparent'. |
| 279 | - $aField['value'] = is_null( $aField['value'] ) |
|
| 279 | + $aField[ 'value' ] = is_null( $aField[ 'value' ] ) |
|
| 280 | 280 | ? 'transparent' |
| 281 | - : $aField['value']; |
|
| 281 | + : $aField[ 'value' ]; |
|
| 282 | 282 | |
| 283 | 283 | $aField[ 'attributes' ] = $this->_getInputAttributes( $aField ); |
| 284 | 284 | |
@@ -287,20 +287,20 @@ discard block |
||
| 287 | 287 | . "<div class='admin-page-framework-input-label-container'>" |
| 288 | 288 | . "<label for='{$aField[ 'input_id' ]}'>" |
| 289 | 289 | . $aField[ 'before_input' ] |
| 290 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
| 291 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 292 | - . $aField['label'] |
|
| 290 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
| 291 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 292 | + . $aField[ 'label' ] |
|
| 293 | 293 | . "</span>" |
| 294 | 294 | : "" |
| 295 | 295 | ) |
| 296 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
| 296 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
| 297 | 297 | . $aField[ 'after_input' ] |
| 298 | 298 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
| 299 | 299 | . "</label>" |
| 300 | 300 | . "<div class='colorpicker' id='color_{$aField[ 'input_id' ]}'></div>" // this div element with this class selector becomes a farbtastic color picker. ( below 3.4.x ) // rel='{$aField['input_id']}' |
| 301 | 301 | . $this->_getColorPickerEnablerScript( "{$aField[ 'input_id' ]}" ) |
| 302 | 302 | . "</div>" |
| 303 | - . $aField['after_label']; |
|
| 303 | + . $aField[ 'after_label' ]; |
|
| 304 | 304 | |
| 305 | 305 | } |
| 306 | 306 | /** |
@@ -312,13 +312,13 @@ discard block |
||
| 312 | 312 | private function _getInputAttributes( array $aField ) { |
| 313 | 313 | |
| 314 | 314 | return array( |
| 315 | - 'color' => $aField['value'], |
|
| 316 | - 'value' => $aField['value'], |
|
| 315 | + 'color' => $aField[ 'value' ], |
|
| 316 | + 'value' => $aField[ 'value' ], |
|
| 317 | 317 | 'data-default' => isset( $aField[ 'default' ] ) |
| 318 | 318 | ? $aField[ 'default' ] |
| 319 | 319 | : 'transparent', // used by the repeatable script |
| 320 | 320 | 'type' => 'text', // it must be text |
| 321 | - 'class' => trim( 'input_color ' . $aField['attributes']['class'] ), |
|
| 321 | + 'class' => trim( 'input_color '.$aField[ 'attributes' ][ 'class' ] ), |
|
| 322 | 322 | ) + $aField[ 'attributes' ]; |
| 323 | 323 | |
| 324 | 324 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Defines the field type slugs used for this field type. |
| 40 | 40 | */ |
| 41 | - public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week', ); |
|
| 41 | + public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week',); |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Defines the default key-values of this field type. |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | protected function getField( $aField ) { |
| 83 | 83 | |
| 84 | 84 | $_aOutput = array(); |
| 85 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 86 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
| 85 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 86 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
| 87 | 87 | $_sKey, |
| 88 | 88 | $_sLabel, |
| 89 | 89 | $aField |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // the repeatable field buttons will be replaced with this element. |
| 94 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
| 94 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
| 95 | 95 | return implode( '', $_aOutput ); |
| 96 | 96 | |
| 97 | 97 | } |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | $aField[ 'value' ] = $this->getElementByLabel( $aField[ 'value' ], $sKey, $aField[ 'label' ] ); |
| 112 | 112 | $_aInputAttributes = $_bIsArray |
| 113 | 113 | ? array( |
| 114 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
| 115 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
| 114 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
| 115 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
| 116 | 116 | 'value' => $aField[ 'value' ], |
| 117 | 117 | ) |
| 118 | 118 | + $this->getAsArray( |
@@ -120,17 +120,17 @@ discard block |
||
| 120 | 120 | ) // 3.8.6+ Allows the user to set individual attributes by label. |
| 121 | 121 | + $aField[ 'attributes' ] |
| 122 | 122 | : $aField[ 'attributes' ]; |
| 123 | - $_aOutput = array( |
|
| 123 | + $_aOutput = array( |
|
| 124 | 124 | $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
| 125 | 125 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
| 126 | - "<label for='" . $_aInputAttributes[ 'id' ] . "'>", |
|
| 126 | + "<label for='".$_aInputAttributes[ 'id' ]."'>", |
|
| 127 | 127 | $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
| 128 | 128 | $_sLabel |
| 129 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 129 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 130 | 130 | . $_sLabel |
| 131 | 131 | . "</span>" |
| 132 | 132 | : '', |
| 133 | - "<input " . $this->getAttributes( $_aInputAttributes ) . " />", |
|
| 133 | + "<input ".$this->getAttributes( $_aInputAttributes )." />", |
|
| 134 | 134 | $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
| 135 | 135 | "</label>", |
| 136 | 136 | "</div>", |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * Defines the field type slugs used for this field type. |
| 49 | 49 | */ |
| 50 | - public $aFieldTypeSlugs = array( 'section_title', ); |
|
| 50 | + public $aFieldTypeSlugs = array( 'section_title',); |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Defines the default key-values of this field type. |