@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | 'AdminPageFramework_Form_View___CSS_CollapsibleSection', |
90 | 90 | 'AdminPageFramework_Form_View___CSS_FieldError', |
91 | 91 | ); |
92 | - foreach( $_aClassNames as $_sClassName ) { |
|
92 | + foreach ( $_aClassNames as $_sClassName ) { |
|
93 | 93 | $_oCSS = new $_sClassName; |
94 | - $this->aResources[ 'inline_styles' ][] = $_oCSS->get(); |
|
94 | + $this->aResources[ 'inline_styles' ][ ] = $_oCSS->get(); |
|
95 | 95 | } |
96 | 96 | $_aClassNamesForIE = array( |
97 | 97 | 'AdminPageFramework_Form_View___CSS_CollapsibleSectionIE', |
98 | 98 | ); |
99 | - foreach( $_aClassNames as $_sClassName ) { |
|
99 | + foreach ( $_aClassNames as $_sClassName ) { |
|
100 | 100 | $_oCSS = new $_sClassName; |
101 | - $this->aResources[ 'inline_styles_ie' ][] = $_oCSS->get(); |
|
101 | + $this->aResources[ 'inline_styles_ie' ][ ] = $_oCSS->get(); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | } |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | |
119 | 119 | // Parse all added fieldsets and check associated resources. |
120 | 120 | // @todo Find a way to retrieve the section id for nested sections and fields. |
121 | - foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
|
121 | + foreach ( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
|
122 | 122 | |
123 | 123 | $_bIsSubSectionLoaded = false; |
124 | - foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
124 | + foreach ( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
125 | 125 | // @todo Examine if this structure is correct or not. |
126 | 126 | // It may not be necessary to check the sub-section dimensions as this is not the saved options array. |
127 | 127 | // if it's a sub-section |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | continue; |
133 | 133 | } |
134 | 134 | $_bIsSubSectionLoaded = true; |
135 | - foreach( $_aSubSectionOrField as $_aField ) { |
|
135 | + foreach ( $_aSubSectionOrField as $_aField ) { |
|
136 | 136 | $this->_setFieldResources( $_aField ); |
137 | 137 | } |
138 | 138 | continue; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | private function _setFieldResources( array $aFieldset ) { |
158 | 158 | |
159 | 159 | // Check the field conditions here. |
160 | - if ( ! $this->_isFieldsetAllowed( $aFieldset ) ) { |
|
160 | + if ( !$this->_isFieldsetAllowed( $aFieldset ) ) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $this->callBack( |
186 | 186 | $this->aCallbacks[ 'load_fieldset_resource' ], |
187 | 187 | array( |
188 | - $aFieldset, // 1st parameter |
|
188 | + $aFieldset, // 1st parameter |
|
189 | 189 | ) |
190 | 190 | ); |
191 | 191 | |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | * @return boolean |
219 | 219 | */ |
220 | 220 | private function _isAlreadyRegistered( $sFieldtype, $sStructureType ) { |
221 | - if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] ) ) { |
|
221 | + if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] ) ) { |
|
222 | 222 | return true; |
223 | 223 | } |
224 | - self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] = true; |
|
224 | + self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] = true; |
|
225 | 225 | return false; |
226 | 226 | } |
227 | 227 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | return $this->callBack( |
241 | 241 | $this->aCallbacks[ 'is_fieldset_registration_allowed' ], |
242 | 242 | array( |
243 | - true, // 1st parameter |
|
243 | + true, // 1st parameter |
|
244 | 244 | $aFieldset, // 2nd parameter |
245 | 245 | ) |
246 | 246 | ); |
@@ -124,7 +124,7 @@ |
||
124 | 124 | foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
125 | 125 | |
126 | 126 | $_bIsSubSectionLoaded = false; |
127 | - foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
127 | + foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
128 | 128 | // @todo Examine if this structure is correct or not. |
129 | 129 | // It may not be necessary to check the sub-section dimensions as this is not the saved options array. |
130 | 130 | // if it's a sub-section |
@@ -33,7 +33,7 @@ |
||
33 | 33 | array( $this, '_replyToAddPostTypeQueryInEditPostLink' ), |
34 | 34 | 10, |
35 | 35 | 3 |
36 | - ); |
|
36 | + ); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @return array The formatted definition array. |
41 | 41 | */ |
42 | 42 | public function get() { |
43 | - foreach( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
43 | + foreach ( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
44 | 44 | $this->unsetDimensionalArrayElement( |
45 | 45 | $this->aSubject, |
46 | 46 | explode( '|', $_sFlatFieldAddress ) |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $this->aInput, |
30 | 30 | $this->aFieldAddresses, |
31 | 31 | ); |
32 | - $this->aInput = $_aParameters[ 0 ]; |
|
32 | + $this->aInput = $_aParameters[ 0 ]; |
|
33 | 33 | $this->aFieldAddresses = $_aParameters[ 1 ]; |
34 | 34 | |
35 | 35 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function get() { |
44 | 44 | |
45 | - foreach( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
45 | + foreach ( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
46 | 46 | |
47 | 47 | $_aDimensionalKeys = explode( '|', $_sFlatFieldAddress ); |
48 | 48 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | // If the retrieved value does not exist, null will be given. |
55 | 55 | // This occurs with page meta boxes. |
56 | - if ( ! is_array( $_aDynamicElements ) ) { |
|
56 | + if ( !is_array( $_aDynamicElements ) ) { |
|
57 | 57 | continue; |
58 | 58 | } |
59 | 59 |
@@ -109,7 +109,7 @@ |
||
109 | 109 | /** |
110 | 110 | * @deprecated |
111 | 111 | */ |
112 | - /* public function _get() { |
|
112 | + /* public function _get() { |
|
113 | 113 | |
114 | 114 | $_aDefaultOptions = array(); |
115 | 115 | foreach( $this->aFieldsets as $_sSectionID => $_aFieldsetsPerSection ) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Form_Model___DefaultValues extends AdminPageFramework_Form_Base { |
19 | 19 | |
20 | - public $aFieldsets = array(); |
|
20 | + public $aFieldsets = array(); |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets up hooks. |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $_aParameters = func_get_args() + array( |
29 | 29 | $this->aFieldsets, |
30 | 30 | ); |
31 | - $this->aFieldsets = $_aParameters[ 0 ]; |
|
31 | + $this->aFieldsets = $_aParameters[ 0 ]; |
|
32 | 32 | |
33 | 33 | } |
34 | 34 | |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private function _getDefaultValues( $aFieldsets, $aDefaultOptions ) { |
89 | 89 | |
90 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
90 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
91 | 91 | |
92 | 92 | $_aSectionPath = explode( '|', $_sSectionPath ); |
93 | - foreach( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
93 | + foreach ( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
94 | 94 | $_aFieldPath = explode( '|', $_sFieldPath ); |
95 | 95 | $this->setMultiDimensionalArray( |
96 | - $aDefaultOptions, // by reference |
|
96 | + $aDefaultOptions, // by reference |
|
97 | 97 | '_default' === $_sSectionPath |
98 | 98 | ? array( $_sFieldPath ) |
99 | 99 | : array_merge( $_aSectionPath, $_aFieldPath ), // key address |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | // If there are no sub-fields |
151 | 151 | if ( count( $_aSubFields ) == 0 ) { |
152 | 152 | return $this->getElement( |
153 | - $aFieldset, // subject |
|
154 | - 'value', // key |
|
153 | + $aFieldset, // subject |
|
154 | + 'value', // key |
|
155 | 155 | $this->getElement( // default value |
156 | - $aFieldset, // subject |
|
157 | - 'default', // key |
|
156 | + $aFieldset, // subject |
|
157 | + 'default', // key |
|
158 | 158 | null // default value |
159 | 159 | ) |
160 | 160 | ); |
@@ -163,13 +163,13 @@ discard block |
||
163 | 163 | // Otherwise, there are sub-fields |
164 | 164 | $_aDefault = array(); |
165 | 165 | array_unshift( $_aSubFields, $aFieldset ); // insert the main field into the very first index. |
166 | - foreach( $_aSubFields as $_iIndex => $_aField ) { |
|
166 | + foreach ( $_aSubFields as $_iIndex => $_aField ) { |
|
167 | 167 | $_aDefault[ $_iIndex ] = $this->getElement( |
168 | - $_aField, // subject |
|
169 | - 'value', // key |
|
168 | + $_aField, // subject |
|
169 | + 'value', // key |
|
170 | 170 | $this->getElement( // default value |
171 | - $_aField, // subject |
|
172 | - 'default', // key |
|
171 | + $_aField, // subject |
|
172 | + 'default', // key |
|
173 | 173 | null // default value |
174 | 174 | ) |
175 | 175 | ); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Defines the field type slugs used for this field type. |
22 | 22 | */ |
23 | - public $aFieldTypeSlugs = array( 'file', ); |
|
23 | + public $aFieldTypeSlugs = array( 'file',); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Defines the default key-values of this field type. |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | array( |
77 | 77 | 'type' => 'hidden', |
78 | 78 | 'value' => '', |
79 | - 'name' => $aField[ 'attributes' ][ 'name' ] . '[_dummy_value]', |
|
79 | + 'name' => $aField[ 'attributes' ][ 'name' ].'[_dummy_value]', |
|
80 | 80 | ) |
81 | 81 | ) |
82 | 82 | . $this->getHTMLTag( |
83 | 83 | 'input', |
84 | 84 | array( |
85 | 85 | 'type' => 'hidden', |
86 | - 'name' => '__unset_' . $aField[ '_structure_type' ] . '[' . $aField[ '_input_name_flat' ] . '|_dummy_value' . ']', |
|
87 | - 'value' => $aField[ '_input_name_flat' ] . '|_dummy_value', |
|
86 | + 'name' => '__unset_'.$aField[ '_structure_type' ].'['.$aField[ '_input_name_flat' ].'|_dummy_value'.']', |
|
87 | + 'value' => $aField[ '_input_name_flat' ].'|_dummy_value', |
|
88 | 88 | 'class' => 'unset-element-names element-address', |
89 | 89 | ) |
90 | 90 | ); |
@@ -277,7 +277,7 @@ |
||
277 | 277 | ); |
278 | 278 | } |
279 | 279 | |
280 | - /** |
|
280 | + /** |
|
281 | 281 | * Extracts meta box form fields options array from the given options array of an admin page. |
282 | 282 | * |
283 | 283 | * @since 3.5.6 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Defines the field type slugs used for this field type. |
24 | 24 | */ |
25 | - public $aFieldTypeSlugs = array( 'image', ); |
|
25 | + public $aFieldTypeSlugs = array( 'image',); |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Defines the default key-values of this field type. |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | protected $aDefaultKeys = array( |
33 | 33 | 'attributes_to_store' => array(), // ( array ) This is for the image and media field type. The attributes to save besides URL. e.g. ( for the image field type ) array( 'title', 'alt', 'width', 'height', 'caption', 'id', 'align', 'link' ). |
34 | - 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
35 | - 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
34 | + 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
35 | + 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
36 | 36 | 'attributes' => array( |
37 | 37 | 'input' => array( |
38 | 38 | 'size' => 40, |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return // $this->_getScript_CustomMediaUploaderObject() . PHP_EOL |
61 | 61 | $this->_getScript_ImageSelector( |
62 | 62 | "admin_page_framework" |
63 | - ) . PHP_EOL |
|
63 | + ).PHP_EOL |
|
64 | 64 | . $this->_getScript_RegisterCallbacks(); |
65 | 65 | } |
66 | 66 | /** |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $_sInsertFromURL = esc_js( $this->oMsg->get( 'insert_from_url' ) ); |
184 | 184 | |
185 | 185 | // if the WordPress version is 3.4.x or below |
186 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
186 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
187 | 187 | |
188 | 188 | return <<<JAVASCRIPTS |
189 | 189 | /** |
@@ -569,11 +569,11 @@ discard block |
||
569 | 569 | . "<label for='{$aField[ 'input_id' ]}'>" |
570 | 570 | . $aField[ 'before_input' ] |
571 | 571 | . $this->getAOrB( |
572 | - $aField[ 'label' ] && ! $aField[ 'repeatable' ], |
|
573 | - "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>" . $aField[ 'label' ] . "</span>", |
|
572 | + $aField[ 'label' ] && !$aField[ 'repeatable' ], |
|
573 | + "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>".$aField[ 'label' ]."</span>", |
|
574 | 574 | '' |
575 | 575 | ) |
576 | - . "<input " . $this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) ) . " />" |
|
576 | + . "<input ".$this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) )." />" |
|
577 | 577 | . $aField[ 'after_input' ] |
578 | 578 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
579 | 579 | . $this->getExtraInputFields( $aField ) |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | */ |
613 | 613 | private function _getBaseAttributes( array $aField ) { |
614 | 614 | |
615 | - $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
615 | + $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
616 | 616 | unset( |
617 | 617 | $_aBaseAttributes[ 'input' ], |
618 | 618 | $_aBaseAttributes[ 'button' ], |
@@ -680,8 +680,8 @@ discard block |
||
680 | 680 | protected function getExtraInputFields( array $aField ) { |
681 | 681 | |
682 | 682 | $_aOutputs = array(); |
683 | - foreach( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
684 | - $_aOutputs[] = "<input " . $this->getAttributes( |
|
683 | + foreach ( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
684 | + $_aOutputs[ ] = "<input ".$this->getAttributes( |
|
685 | 685 | array( |
686 | 686 | 'id' => "{$aField[ 'input_id' ]}_{$sAttribute}", |
687 | 687 | 'type' => 'hidden', |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | '' |
698 | 698 | ), |
699 | 699 | ) |
700 | - ) . "/>"; |
|
700 | + )."/>"; |
|
701 | 701 | } |
702 | 702 | |
703 | 703 | return implode( PHP_EOL, $_aOutputs ); |
@@ -710,18 +710,18 @@ discard block |
||
710 | 710 | */ |
711 | 711 | protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAtrributes ) { |
712 | 712 | |
713 | - if ( ! $aField[ 'show_preview' ] ) { |
|
713 | + if ( !$aField[ 'show_preview' ] ) { |
|
714 | 714 | return ''; |
715 | 715 | } |
716 | 716 | |
717 | 717 | $sImageURL = esc_url( $this->getResolvedSRC( $sImageURL, true ) ); |
718 | 718 | |
719 | 719 | return |
720 | - "<div " . $this->getAttributes( |
|
720 | + "<div ".$this->getAttributes( |
|
721 | 721 | array( |
722 | 722 | 'id' => "image_preview_container_{$aField[ 'input_id' ]}", |
723 | - 'class' => 'image_preview ' . $this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
724 | - 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
723 | + 'class' => 'image_preview '.$this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
724 | + 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
725 | 725 | . $this->getElement( $aPreviewAtrributes, 'style', '' ), |
726 | 726 | ) + $aPreviewAtrributes |
727 | 727 | ) |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
747 | 747 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
748 | 748 | // which causes the PHP syntax error. |
749 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $bRpeatable, $bExternalSource ) . '"'; |
|
749 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $bRpeatable, $bExternalSource ).'"'; |
|
750 | 750 | $_sScript = <<<JAVASCRIPTS |
751 | 751 | if ( 0 === jQuery( 'a#select_image_{$sInputID}' ).length ) { |
752 | 752 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | . '/* <![CDATA[ */' |
761 | 761 | . $_sScript |
762 | 762 | . '/* ]]> */' |
763 | - . "</script>". PHP_EOL; |
|
763 | + . "</script>".PHP_EOL; |
|
764 | 764 | |
765 | 765 | } |
766 | 766 | /** |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | $bExternalSource |
780 | 780 | ); |
781 | 781 | |
782 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
782 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
783 | 783 | . ( $_bIsLabelSet |
784 | 784 | ? $_aAttributes[ 'data-label' ] |
785 | 785 | : ( strrpos( $_aAttributes[ 'class' ], 'dashicons' ) |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | */ |
798 | 798 | private function _getFormattedUploadButtonAttributes( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bRpeatable, $bExternalSource ) { |
799 | 799 | |
800 | - $_aAttributes = array( |
|
800 | + $_aAttributes = array( |
|
801 | 801 | 'id' => "select_image_{$sInputID}", |
802 | 802 | 'href' => '#', |
803 | 803 | 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | : $this->oMsg->get( 'select_image' ), |
811 | 811 | 'data-label' => null, |
812 | 812 | ); |
813 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
813 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
814 | 814 | 'select_image button button-small ', |
815 | 815 | $this->getAOrB( |
816 | 816 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -838,16 +838,16 @@ discard block |
||
838 | 838 | * @since 3.5.3 Aded the `$sType` parameter. |
839 | 839 | * @return string |
840 | 840 | */ |
841 | - protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
841 | + protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
842 | 842 | |
843 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
843 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
844 | 844 | return ''; |
845 | 845 | } |
846 | 846 | |
847 | 847 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
848 | 848 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
849 | 849 | // which causes the PHP syntax error. |
850 | - $_sButtonHTML = '"' . $this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ) . '"'; |
|
850 | + $_sButtonHTML = '"'.$this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ).'"'; |
|
851 | 851 | $_sScript = <<<JAVASCRIPTS |
852 | 852 | if ( 0 === jQuery( 'a#remove_{$sType}_{$sInputID}' ).length ) { |
853 | 853 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | . '/* <![CDATA[ */' |
859 | 859 | . $_sScript |
860 | 860 | . '/* ]]> */' |
861 | - . "</script>". PHP_EOL; |
|
861 | + . "</script>".PHP_EOL; |
|
862 | 862 | |
863 | 863 | } |
864 | 864 | |
@@ -867,12 +867,12 @@ discard block |
||
867 | 867 | * @since 3.5.3 |
868 | 868 | * @return string The generated HTML remove button output. |
869 | 869 | */ |
870 | - protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
870 | + protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
871 | 871 | |
872 | 872 | $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
873 | 873 | $_aAttributes = $this->_getFormattedRemoveButtonAttributesByType( $sInputID, $aButtonAttributes, $_bIsLabelSet, $sType ); |
874 | 874 | |
875 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
875 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
876 | 876 | . ( $_bIsLabelSet |
877 | 877 | ? $_aAttributes[ 'data-label' ] |
878 | 878 | : $this->getAOrB( |
@@ -890,9 +890,9 @@ discard block |
||
890 | 890 | * @since 3.5.3 |
891 | 891 | * @return array The formatted remove button attributes array. |
892 | 892 | */ |
893 | - protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType='image' ) { |
|
893 | + protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType = 'image' ) { |
|
894 | 894 | |
895 | - $_sOnClickFunctionName = 'removeInputValuesFor' . ucfirst( $sType ); |
|
895 | + $_sOnClickFunctionName = 'removeInputValuesFor'.ucfirst( $sType ); |
|
896 | 896 | $_aAttributes = array( |
897 | 897 | 'id' => "remove_{$sType}_{$sInputID}", |
898 | 898 | 'href' => '#', |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | ? $aButtonAttributes[ 'data-label' ] |
905 | 905 | : $this->oMsg->get( 'remove_value' ), |
906 | 906 | ); |
907 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
907 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
908 | 908 | "remove_value remove_{$sType} button button-small", |
909 | 909 | $this->getAOrB( |
910 | 910 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * Defines the field type slugs used for this field type. |
27 | 27 | */ |
28 | - public $aFieldTypeSlugs = array( 'section_title', ); |
|
28 | + public $aFieldTypeSlugs = array( 'section_title',); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Defines the default key-values of this field type. |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2016 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2016 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides utility methods which can be accessed among different components of the framework. |
@@ -71,7 +71,7 @@ |
||
71 | 71 | * </code> |
72 | 72 | * @access public This must be public as accessed from outside. |
73 | 73 | */ |
74 | - public $aFieldTypeSlugs = array( 'default', ); |
|
74 | + public $aFieldTypeSlugs = array( 'default',); |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Defines the default key-values of this field type. |
@@ -37,19 +37,19 @@ |
||
37 | 37 | */ |
38 | 38 | public function _replyToGetField( $aField ) { |
39 | 39 | return |
40 | - $aField['before_label'] |
|
40 | + $aField[ 'before_label' ] |
|
41 | 41 | . "<div class='admin-page-framework-input-label-container'>" |
42 | - . "<label for='{$aField['input_id']}'>" |
|
43 | - . $aField['before_input'] |
|
44 | - . ( $aField['label'] && ! $aField['repeatable'] |
|
45 | - ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField['label_min_width'] ) . ";'>" . $aField['label'] . "</span>" |
|
42 | + . "<label for='{$aField[ 'input_id' ]}'>" |
|
43 | + . $aField[ 'before_input' ] |
|
44 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
45 | + ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>".$aField[ 'label' ]."</span>" |
|
46 | 46 | : "" |
47 | 47 | ) |
48 | - . $aField['value'] |
|
49 | - . $aField['after_input'] |
|
48 | + . $aField[ 'value' ] |
|
49 | + . $aField[ 'after_input' ] |
|
50 | 50 | . "</label>" |
51 | 51 | . "</div>" |
52 | - . $aField['after_label'] |
|
52 | + . $aField[ 'after_label' ] |
|
53 | 53 | ; |
54 | 54 | } |
55 | 55 |