@@ -391,6 +391,7 @@ |
||
391 | 391 | * This is used for element that `label_min_width` is applied. |
392 | 392 | * |
393 | 393 | * @since 3.8.0 |
394 | + * @param string $asClassAttributes |
|
394 | 395 | * @return string |
395 | 396 | */ |
396 | 397 | protected function getLabelContainerAttributes( array $aField, $asClassAttributes, array $aAttributes=array() ) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | 'after_label' => null, |
61 | 61 | 'before_field' => null, |
62 | 62 | 'after_field' => null, |
63 | - 'label_min_width' => 0, // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applie through embedded CSS. When this value is set by the user, it is set inline and the value will be overriden. |
|
63 | + 'label_min_width' => 0, // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applie through embedded CSS. When this value is set by the user, it is set inline and the value will be overriden. |
|
64 | 64 | 'before_fieldset' => null, // 3.1.1+ |
65 | 65 | 'after_fieldset' => null, // 3.1.1+ |
66 | 66 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @param object $oMsg The framework message object. |
101 | 101 | * @param boolean $bAutoRegister Whether or not to register the field type(s). |
102 | 102 | */ |
103 | - public function __construct( $asClassName='admin_page_framework', $asFieldTypeSlug=null, $oMsg=null, $bAutoRegister=true ) { |
|
103 | + public function __construct( $asClassName = 'admin_page_framework', $asFieldTypeSlug = null, $oMsg = null, $bAutoRegister = true ) { |
|
104 | 104 | |
105 | 105 | $this->aFieldTypeSlugs = empty( $asFieldTypeSlug ) |
106 | 106 | ? $this->aFieldTypeSlugs |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | |
112 | 112 | // This automatically registers the field type. The build-in ones will be registered manually so it will be skipped. |
113 | 113 | if ( $bAutoRegister ) { |
114 | - foreach( ( array ) $asClassName as $_sClassName ) { |
|
114 | + foreach ( ( array ) $asClassName as $_sClassName ) { |
|
115 | 115 | add_filter( |
116 | - 'field_types_' . $_sClassName, |
|
116 | + 'field_types_'.$_sClassName, |
|
117 | 117 | array( $this, '_replyToRegisterInputFieldType' ) |
118 | 118 | ); |
119 | 119 | } |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | } |
160 | 160 | return is_array( $asLabel ) // if the user stes multiple items |
161 | 161 | ? $this->getElement( |
162 | - $asElement, // subject |
|
163 | - $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
162 | + $asElement, // subject |
|
163 | + $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
164 | 164 | '' // default - if the element is not found, return an empty |
165 | 165 | ) |
166 | 166 | : $asElement; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | protected function getFieldOutput( array $aFieldset ) { |
177 | 177 | |
178 | - if ( ! is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
178 | + if ( !is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
179 | 179 | return ''; |
180 | 180 | } |
181 | 181 | |
@@ -183,14 +183,14 @@ discard block |
||
183 | 183 | $aFieldset[ '_parent_field_object' ] = $aFieldset[ '_field_object' ]; // 3.6.0+ |
184 | 184 | |
185 | 185 | // 3.7.0+ The caller object is no longer a factory object but a form object. |
186 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
186 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
187 | 187 | |
188 | 188 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
189 | - $aFieldset, // the field definition array |
|
190 | - $_oCallerForm->aSavedData, // the stored form data |
|
191 | - $_oCallerForm->getFieldErrors(), // the field error array. |
|
192 | - $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
193 | - $_oCallerForm->oMsg, // the system message object |
|
189 | + $aFieldset, // the field definition array |
|
190 | + $_oCallerForm->aSavedData, // the stored form data |
|
191 | + $_oCallerForm->getFieldErrors(), // the field error array. |
|
192 | + $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
193 | + $_oCallerForm->oMsg, // the system message object |
|
194 | 194 | $_oCallerForm->aCallbacks // field output element callables. |
195 | 195 | ); |
196 | 196 | return $_oFieldset->get(); |
@@ -230,13 +230,13 @@ discard block |
||
230 | 230 | * @since 3.0.3 Tweaked it to have better execution speed. |
231 | 231 | * @internal |
232 | 232 | */ |
233 | - public function getDefinitionArray( $sFieldTypeSlug='' ) { |
|
233 | + public function getDefinitionArray( $sFieldTypeSlug = '' ) { |
|
234 | 234 | |
235 | 235 | // The uniteArrays() method resulted in somewhat being slow due to overhead on checking array keys for recursive array merges. |
236 | 236 | $_aDefaultKeys = $this->aDefaultKeys + self::$_aDefaultKeys; |
237 | - $_aDefaultKeys['attributes'] = isset( $this->aDefaultKeys['attributes'] ) && is_array( $this->aDefaultKeys['attributes'] ) |
|
238 | - ? $this->aDefaultKeys['attributes'] + self::$_aDefaultKeys['attributes'] |
|
239 | - : self::$_aDefaultKeys['attributes']; |
|
237 | + $_aDefaultKeys[ 'attributes' ] = isset( $this->aDefaultKeys[ 'attributes' ] ) && is_array( $this->aDefaultKeys[ 'attributes' ] ) |
|
238 | + ? $this->aDefaultKeys[ 'attributes' ] + self::$_aDefaultKeys[ 'attributes' ] |
|
239 | + : self::$_aDefaultKeys[ 'attributes' ]; |
|
240 | 240 | |
241 | 241 | return array( |
242 | 242 | 'sFieldTypeSlug' => $sFieldTypeSlug, |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * @since 3.0.0 |
275 | 275 | * @internal |
276 | 276 | */ |
277 | - public function _replyToFieldTypeSetter( $sFieldSetType='' ) { |
|
277 | + public function _replyToFieldTypeSetter( $sFieldSetType = '' ) { |
|
278 | 278 | $this->_sFieldSetType = $sFieldSetType; |
279 | 279 | } |
280 | 280 | |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | wp_enqueue_script( 'media-upload' ); |
329 | 329 | } |
330 | 330 | |
331 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
332 | - add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
|
331 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php',) ) ) { |
|
332 | + add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ), 1, 2 ); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | } |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
345 | 345 | |
346 | 346 | // Replace the button label in the media thick box. |
347 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
347 | + if ( !in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
348 | 348 | return $sTranslated; |
349 | 349 | } |
350 | 350 | if ( $sText !== 'Insert into Post' ) { |
@@ -354,8 +354,8 @@ discard block |
||
354 | 354 | return $sTranslated; |
355 | 355 | } |
356 | 356 | |
357 | - if ( isset( $_GET['button_label'] ) ) { |
|
358 | - return $_GET['button_label']; |
|
357 | + if ( isset( $_GET[ 'button_label' ] ) ) { |
|
358 | + return $_GET[ 'button_label' ]; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | return $this->oProp->sThickBoxButtonUseThis |
@@ -374,12 +374,12 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public function _replyToRemovingMediaLibraryTab( $aTabs ) { |
376 | 376 | |
377 | - if ( ! isset( $_REQUEST['enable_external_source'] ) ) { |
|
377 | + if ( !isset( $_REQUEST[ 'enable_external_source' ] ) ) { |
|
378 | 378 | return $aTabs; |
379 | 379 | } |
380 | 380 | |
381 | - if ( ! $_REQUEST['enable_external_source'] ) { |
|
382 | - unset( $aTabs['type_url'] ); // removes the 'From URL' tab in the thick box. |
|
381 | + if ( !$_REQUEST[ 'enable_external_source' ] ) { |
|
382 | + unset( $aTabs[ 'type_url' ] ); // removes the 'From URL' tab in the thick box. |
|
383 | 383 | } |
384 | 384 | return $aTabs; |
385 | 385 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | * @since 3.8.0 |
394 | 394 | * @return string |
395 | 395 | */ |
396 | - protected function getLabelContainerAttributes( array $aField, $asClassAttributes, array $aAttributes=array() ) { |
|
396 | + protected function getLabelContainerAttributes( array $aField, $asClassAttributes, array $aAttributes = array() ) { |
|
397 | 397 | |
398 | 398 | $aAttributes[ 'class' ] = $this->getClassAttribute( $asClassAttributes, $this->getElement( $aAttributes, 'class' ) ); |
399 | 399 | $aAttributes[ 'style' ] = $this->getStyleAttribute( |
@@ -183,6 +183,8 @@ |
||
183 | 183 | } |
184 | 184 | /** |
185 | 185 | * Trims a traling sub-string if exists. |
186 | + * @param string $sString |
|
187 | + * @param string $sSuffix |
|
186 | 188 | * @return string |
187 | 189 | * @since 3.7.2 |
188 | 190 | */ |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | * @since 3.8.0 Renamed from `sanitizeLength()`. |
28 | 28 | * @return string |
29 | 29 | */ |
30 | - static public function getLengthSanitized( $sLength, $sUnit='px' ) { |
|
30 | + static public function getLengthSanitized( $sLength, $sUnit = 'px' ) { |
|
31 | 31 | return is_numeric( $sLength ) |
32 | - ? $sLength . $sUnit |
|
32 | + ? $sLength.$sUnit |
|
33 | 33 | : $sLength; |
34 | 34 | } |
35 | 35 | /** |
36 | 36 | * @deprecated 3.8.0 Use `getLengthSanitized()` instead. |
37 | 37 | */ |
38 | - static public function sanitizeLength( $sLength, $sUnit='px' ) { |
|
38 | + static public function sanitizeLength( $sLength, $sUnit = 'px' ) { |
|
39 | 39 | return self::getLengthSanitized( $sLength, $sUnit ); |
40 | 40 | } |
41 | 41 | |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | * @since 2.0.0 |
79 | 79 | * @return string|integer A numeric value will be returned. |
80 | 80 | */ |
81 | - static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
81 | + static public function fixNumber( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
82 | 82 | |
83 | - if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
83 | + if ( !is_numeric( trim( $nToFix ) ) ) { |
|
84 | 84 | return $nDefault; |
85 | 85 | } |
86 | 86 | if ( $nMin !== '' && $nToFix < $nMin ) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | static public function getCSSMinified( $sCSSRules ) { |
104 | 104 | return str_replace( |
105 | - array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' '), // remove line breaks, tab, and white sspaces. |
|
105 | + array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), // remove line breaks, tab, and white sspaces. |
|
106 | 106 | '', |
107 | 107 | preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $sCSSRules ) // remove comments |
108 | 108 | ); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | static public function minifyCSS( $sCSSRules ) { |
114 | 114 | trigger_error( |
115 | - AdminPageFramework_Registry::NAME . ': ' . sprintf( |
|
115 | + AdminPageFramework_Registry::NAME.': '.sprintf( |
|
116 | 116 | 'The method, %1$s, is deprecated. Use %2$s instead.', |
117 | 117 | 'minifyCSS()', |
118 | 118 | 'getCSSMinified()' |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | */ |
142 | 142 | static public function getNumberOfReadableSize( $nSize ) { |
143 | 143 | |
144 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
145 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
144 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
145 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
146 | 146 | case 'P': |
147 | 147 | $_nReturn *= 1024; |
148 | 148 | case 'T': |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $_nLog = log( $nBytes, 1024 ); |
169 | 169 | $_iPower = ( int ) $_nLog; |
170 | 170 | $_iSize = pow( 1024, $_nLog - $_iPower ); |
171 | - return $_iSize . $_aUnits[ $_iPower ]; |
|
171 | + return $_iSize.$_aUnits[ $_iPower ]; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -112,18 +112,18 @@ discard block |
||
112 | 112 | */ |
113 | 113 | private function _setHooks( $aScreenIDs ) { |
114 | 114 | |
115 | - foreach( $aScreenIDs as $_sScreenID ) { |
|
116 | - if ( ! $_sScreenID ) { |
|
115 | + foreach ( $aScreenIDs as $_sScreenID ) { |
|
116 | + if ( !$_sScreenID ) { |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | add_filter( |
120 | - get_class( $this ) . '-' . $_sScreenID, |
|
120 | + get_class( $this ).'-'.$_sScreenID, |
|
121 | 121 | array( $this, '_replyToSetPointer' ) |
122 | 122 | ); |
123 | 123 | |
124 | 124 | } |
125 | 125 | |
126 | - if ( ! $this->_hasBeenCalled() ) { |
|
126 | + if ( !$this->_hasBeenCalled() ) { |
|
127 | 127 | return; |
128 | 128 | } |
129 | 129 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | $_aPointers = $this->_getValidPointers( $this->_getPointers() ); |
172 | 172 | |
173 | - if ( empty( $_aPointers ) || ! is_array( $_aPointers ) ) { |
|
173 | + if ( empty( $_aPointers ) || !is_array( $_aPointers ) ) { |
|
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
@@ -190,11 +190,11 @@ discard block |
||
190 | 190 | $_oScreen = get_current_screen(); |
191 | 191 | $_sScreenID = $_oScreen->id; |
192 | 192 | if ( in_array( $_sScreenID, $this->aScreenIDs ) ) { |
193 | - return apply_filters( get_class( $this ) . '-' . $_sScreenID, array() ); |
|
193 | + return apply_filters( get_class( $this ).'-'.$_sScreenID, array() ); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | if ( isset( $_GET[ 'page' ] ) ) { |
197 | - return apply_filters( get_class( $this ) . '-' . $_GET[ 'page' ], array() ); |
|
197 | + return apply_filters( get_class( $this ).'-'.$_GET[ 'page' ], array() ); |
|
198 | 198 | } |
199 | 199 | return array(); |
200 | 200 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | private function _getValidPointers( $_aPointers ) { |
209 | 209 | |
210 | 210 | // Get dismissed pointers |
211 | - $_aDismissed = explode( |
|
211 | + $_aDismissed = explode( |
|
212 | 212 | ',', |
213 | 213 | ( string ) get_user_meta( |
214 | 214 | get_current_user_id(), |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $_aPointer[ 'pointer_id' ] = $_iPointerID; |
237 | 237 | |
238 | 238 | // Add the pointer to $_aValidPointers array |
239 | - $_aValidPointers[] = $_aPointer; |
|
239 | + $_aValidPointers[ ] = $_aPointer; |
|
240 | 240 | |
241 | 241 | } |
242 | 242 | return $_aValidPointers; |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | * @return string |
313 | 313 | * @internal |
314 | 314 | */ |
315 | - public function _getInternalScript( $aPointers=array() ) { |
|
315 | + public function _getInternalScript( $aPointers = array() ) { |
|
316 | 316 | |
317 | - $_aJSArray = json_encode( $aPointers ); |
|
317 | + $_aJSArray = json_encode( $aPointers ); |
|
318 | 318 | |
319 | 319 | /** |
320 | 320 | * Checks check-boxes in siblings. |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | */ |
37 | 37 | static public function getInlineCSS( array $aCSSRules ) { |
38 | 38 | $_aOutput = array(); |
39 | - foreach( $aCSSRules as $_sProperty => $_sValue ) { |
|
39 | + foreach ( $aCSSRules as $_sProperty => $_sValue ) { |
|
40 | 40 | if ( is_null( $_sValue ) ) { |
41 | 41 | continue; |
42 | 42 | } |
43 | - $_aOutput[] = $_sProperty . ': ' . $_sValue; |
|
43 | + $_aOutput[ ] = $_sProperty.': '.$_sValue; |
|
44 | 44 | } |
45 | 45 | return implode( '; ', $_aOutput ); |
46 | 46 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | static public function getStyleAttribute( $asInlineCSSes ) { |
72 | 72 | |
73 | 73 | $_aCSSRules = array(); |
74 | - foreach( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
74 | + foreach ( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
75 | 75 | |
76 | 76 | // For array, store in the container. |
77 | 77 | if ( is_array( $_asCSSRules ) ) { |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | // At this point, it is a string. Break them down to array elements. |
83 | 83 | $__aCSSRules = explode( ';', $_asCSSRules ); |
84 | - foreach( $__aCSSRules as $_sPair ) { |
|
84 | + foreach ( $__aCSSRules as $_sPair ) { |
|
85 | 85 | $_aCSSPair = explode( ':', $_sPair ); |
86 | - if ( ! isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
86 | + if ( !isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | $_aCSSRules[ $_aCSSPair[ 0 ] ] = $_aCSSPair[ 1 ]; |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | */ |
121 | 121 | static public function getClassAttribute( /* $asClassSelectors1, $asClassSelectors12, ... */ ) { |
122 | 122 | |
123 | - $_aClasses = array(); |
|
124 | - foreach( func_get_args() as $_asClasses ) { |
|
125 | - if ( ! in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
123 | + $_aClasses = array(); |
|
124 | + foreach ( func_get_args() as $_asClasses ) { |
|
125 | + if ( !in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
126 | 126 | continue; |
127 | 127 | } |
128 | 128 | $_aClasses = array_merge( |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | : explode( ' ', $_asClasses ) |
133 | 133 | ); |
134 | 134 | } |
135 | - $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
135 | + $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
136 | 136 | |
137 | 137 | // @todo examine if it is okay to remove the trim() function below. |
138 | 138 | return trim( implode( ' ', $_aClasses ) ); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | static public function generateClassAttribute( /* $asClassSelectors1, $asClassSelectors12 ... */ ) { |
149 | 149 | $_aParams = func_get_args(); |
150 | 150 | return call_user_func_array( |
151 | - array( __CLASS__ , 'getClassAttribute' ), |
|
151 | + array( __CLASS__, 'getClassAttribute' ), |
|
152 | 152 | $_aParams |
153 | 153 | ); |
154 | 154 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | static public function getDataAttributeArray( array $aArray ) { |
163 | 163 | |
164 | 164 | $_aNewArray = array(); |
165 | - foreach( $aArray as $sKey => $v ) { |
|
165 | + foreach ( $aArray as $sKey => $v ) { |
|
166 | 166 | if ( in_array( gettype( $v ), array( 'array', 'object' ) ) ) { |
167 | 167 | continue; |
168 | 168 | } |
@@ -59,23 +59,23 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function get() { |
61 | 61 | |
62 | - $this->aResources[ 'internal_scripts' ] = $this->_getUpdatedInternalItemsByCallback( |
|
62 | + $this->aResources[ 'internal_scripts' ] = $this->_getUpdatedInternalItemsByCallback( |
|
63 | 63 | $this->aResources[ 'internal_scripts' ], |
64 | 64 | 'hfGetScripts' |
65 | 65 | ); |
66 | - $this->aResources[ 'internal_styles' ] = $this->_getUpdatedInternalItemsByCallback( |
|
66 | + $this->aResources[ 'internal_styles' ] = $this->_getUpdatedInternalItemsByCallback( |
|
67 | 67 | $this->aResources[ 'internal_styles' ], |
68 | 68 | 'hfGetStyles' |
69 | 69 | ); |
70 | - $this->aResources[ 'internal_styles_ie' ] = $this->_getUpdatedInternalItemsByCallback( |
|
70 | + $this->aResources[ 'internal_styles_ie' ] = $this->_getUpdatedInternalItemsByCallback( |
|
71 | 71 | $this->aResources[ 'internal_styles_ie' ], |
72 | 72 | 'hfGetIEStyles' |
73 | 73 | ); |
74 | - $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
74 | + $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
75 | 75 | $this->aResources[ 'src_styles' ], |
76 | 76 | 'aEnqueueStyles' |
77 | 77 | ); |
78 | - $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
78 | + $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
79 | 79 | $this->aResources[ 'src_scripts' ], |
80 | 80 | 'aEnqueueScripts' |
81 | 81 | ); |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | */ |
90 | 90 | private function _getUpdatedInternalItemsByCallback( array $aSubject, $sKey ) { |
91 | 91 | $_oCallable = $this->getElement( $this->aFieldTypeDefinition, $sKey ); |
92 | - if ( ! is_callable( $_oCallable ) ) { |
|
92 | + if ( !is_callable( $_oCallable ) ) { |
|
93 | 93 | return $aSubject; |
94 | 94 | } |
95 | - $aSubject[] = call_user_func_array( |
|
95 | + $aSubject[ ] = call_user_func_array( |
|
96 | 96 | $_oCallable, |
97 | 97 | array() |
98 | 98 | ); |
@@ -92,16 +92,16 @@ discard block |
||
92 | 92 | 'AdminPageFramework_Form_View___CSS_FieldError', |
93 | 93 | 'AdminPageFramework_Form_View___CSS_ToolTip', |
94 | 94 | ); |
95 | - foreach( $_aClassNames as $_sClassName ) { |
|
95 | + foreach ( $_aClassNames as $_sClassName ) { |
|
96 | 96 | $_oCSS = new $_sClassName; |
97 | - $this->aResources[ 'internal_styles' ][] = $_oCSS->get(); |
|
97 | + $this->aResources[ 'internal_styles' ][ ] = $_oCSS->get(); |
|
98 | 98 | } |
99 | 99 | $_aClassNamesForIE = array( |
100 | 100 | 'AdminPageFramework_Form_View___CSS_CollapsibleSectionIE', |
101 | 101 | ); |
102 | - foreach( $_aClassNames as $_sClassName ) { |
|
102 | + foreach ( $_aClassNames as $_sClassName ) { |
|
103 | 103 | $_oCSS = new $_sClassName; |
104 | - $this->aResources[ 'internal_styles_ie' ][] = $_oCSS->get(); |
|
104 | + $this->aResources[ 'internal_styles_ie' ][ ] = $_oCSS->get(); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | } |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | protected function _set( ) { |
121 | 121 | |
122 | 122 | // Parse all added fieldsets and check associated resources. |
123 | - foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
|
123 | + foreach ( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) { |
|
124 | 124 | |
125 | 125 | $_bIsSubSectionLoaded = false; |
126 | - foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
126 | + foreach ( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) { |
|
127 | 127 | // @todo Examine if this structure is correct or not. |
128 | 128 | // It may not be necessary to check the sub-section dimensions as this is not the saved options array. |
129 | 129 | // if it's a sub-section |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | continue; |
135 | 135 | } |
136 | 136 | $_bIsSubSectionLoaded = true; |
137 | - foreach( $_aSubSectionOrField as $_aField ) { |
|
137 | + foreach ( $_aSubSectionOrField as $_aField ) { |
|
138 | 138 | $this->_setFieldResources( $_aField ); |
139 | 139 | } |
140 | 140 | continue; |
@@ -159,13 +159,13 @@ discard block |
||
159 | 159 | private function _setFieldResources( array $aFieldset ) { |
160 | 160 | |
161 | 161 | // Check the field conditions here. |
162 | - if ( ! $this->_isFieldsetAllowed( $aFieldset ) ) { |
|
162 | + if ( !$this->_isFieldsetAllowed( $aFieldset ) ) { |
|
163 | 163 | return; |
164 | 164 | } |
165 | 165 | |
166 | 166 | // 3.8.0+ Support nested fields. |
167 | 167 | if ( $this->hasFieldDefinitionsInContent( $aFieldset ) ) { |
168 | - foreach( $aFieldset[ 'content' ] as $_asNestedFieldset ) { |
|
168 | + foreach ( $aFieldset[ 'content' ] as $_asNestedFieldset ) { |
|
169 | 169 | if ( is_scalar( $_asNestedFieldset ) ) { |
170 | 170 | continue; |
171 | 171 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $this->callBack( |
203 | 203 | $this->aCallbacks[ 'load_fieldset_resource' ], |
204 | 204 | array( |
205 | - $aFieldset, // 1st parameter |
|
205 | + $aFieldset, // 1st parameter |
|
206 | 206 | ) |
207 | 207 | ); |
208 | 208 | |
@@ -235,10 +235,10 @@ discard block |
||
235 | 235 | * @return boolean |
236 | 236 | */ |
237 | 237 | private function _isAlreadyRegistered( $sFieldtype, $sStructureType ) { |
238 | - if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] ) ) { |
|
238 | + if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] ) ) { |
|
239 | 239 | return true; |
240 | 240 | } |
241 | - self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] = true; |
|
241 | + self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] = true; |
|
242 | 242 | return false; |
243 | 243 | } |
244 | 244 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | return $this->callBack( |
258 | 258 | $this->aCallbacks[ 'is_fieldset_registration_allowed' ], |
259 | 259 | array( |
260 | - true, // 1st parameter |
|
260 | + true, // 1st parameter |
|
261 | 261 | $aFieldset, // 2nd parameter |
262 | 262 | ) |
263 | 263 | ); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | /** |
60 | 60 | * Defines the field type slugs used for this field type. |
61 | 61 | */ |
62 | - public $aFieldTypeSlugs = array( 'image', ); |
|
62 | + public $aFieldTypeSlugs = array( 'image',); |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Defines the default key-values of this field type. |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected $aDefaultKeys = array( |
70 | 70 | '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' ). |
71 | - 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
72 | - 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
71 | + 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
72 | + 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
73 | 73 | 'attributes' => array( |
74 | 74 | 'input' => array( |
75 | 75 | 'size' => 40, |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | return // $this->_getScript_CustomMediaUploaderObject() . PHP_EOL |
100 | 100 | $this->_getScript_ImageSelector( |
101 | 101 | "admin_page_framework" |
102 | - ) . PHP_EOL |
|
102 | + ).PHP_EOL |
|
103 | 103 | . $this->_getScript_RegisterCallbacks(); |
104 | 104 | } |
105 | 105 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $_sInsertFromURL = esc_js( $this->oMsg->get( 'insert_from_url' ) ); |
218 | 218 | |
219 | 219 | // if the WordPress version is 3.4.x or below |
220 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
220 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
221 | 221 | |
222 | 222 | return <<<JAVASCRIPTS |
223 | 223 | /** |
@@ -605,13 +605,13 @@ discard block |
||
605 | 605 | . "<label for='{$aField[ 'input_id' ]}'>" |
606 | 606 | . $aField[ 'before_input' ] |
607 | 607 | . $this->getAOrB( |
608 | - $aField[ 'label' ] && ! $aField[ 'repeatable' ], |
|
609 | - "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
608 | + $aField[ 'label' ] && !$aField[ 'repeatable' ], |
|
609 | + "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
610 | 610 | . $aField[ 'label' ] |
611 | 611 | . "</span>", |
612 | 612 | '' |
613 | 613 | ) |
614 | - . "<input " . $this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) ) . " />" |
|
614 | + . "<input ".$this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) )." />" |
|
615 | 615 | . $aField[ 'after_input' ] |
616 | 616 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
617 | 617 | . $this->getExtraInputFields( $aField ) |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | */ |
652 | 652 | private function _getBaseAttributes( array $aField ) { |
653 | 653 | |
654 | - $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
654 | + $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
655 | 655 | unset( |
656 | 656 | $_aBaseAttributes[ 'input' ], |
657 | 657 | $_aBaseAttributes[ 'button' ], |
@@ -720,8 +720,8 @@ discard block |
||
720 | 720 | protected function getExtraInputFields( array $aField ) { |
721 | 721 | |
722 | 722 | $_aOutputs = array(); |
723 | - foreach( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
724 | - $_aOutputs[] = "<input " . $this->getAttributes( |
|
723 | + foreach ( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
724 | + $_aOutputs[ ] = "<input ".$this->getAttributes( |
|
725 | 725 | array( |
726 | 726 | 'id' => "{$aField[ 'input_id' ]}_{$sAttribute}", |
727 | 727 | 'type' => 'hidden', |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | '' |
738 | 738 | ), |
739 | 739 | ) |
740 | - ) . "/>"; |
|
740 | + )."/>"; |
|
741 | 741 | } |
742 | 742 | return implode( PHP_EOL, $_aOutputs ); |
743 | 743 | |
@@ -750,17 +750,17 @@ discard block |
||
750 | 750 | */ |
751 | 751 | protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAtrributes ) { |
752 | 752 | |
753 | - if ( ! $aField[ 'show_preview' ] ) { |
|
753 | + if ( !$aField[ 'show_preview' ] ) { |
|
754 | 754 | return ''; |
755 | 755 | } |
756 | 756 | |
757 | 757 | $sImageURL = esc_url( $this->getResolvedSRC( $sImageURL, true ) ); |
758 | 758 | return |
759 | - "<div " . $this->getAttributes( |
|
759 | + "<div ".$this->getAttributes( |
|
760 | 760 | array( |
761 | 761 | 'id' => "image_preview_container_{$aField[ 'input_id' ]}", |
762 | - 'class' => 'image_preview ' . $this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
763 | - 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
762 | + 'class' => 'image_preview '.$this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
763 | + 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
764 | 764 | . $this->getElement( $aPreviewAtrributes, 'style', '' ), |
765 | 765 | ) + $aPreviewAtrributes |
766 | 766 | ) |
@@ -783,12 +783,12 @@ discard block |
||
783 | 783 | */ |
784 | 784 | protected function _getUploaderButtonScript( $sInputID, $abRepeatable, $bExternalSource, array $aButtonAttributes ) { |
785 | 785 | |
786 | - $_bRepeatable = ! empty( $abRepeatable ); |
|
786 | + $_bRepeatable = !empty( $abRepeatable ); |
|
787 | 787 | |
788 | 788 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
789 | 789 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
790 | 790 | // which causes the PHP syntax error. |
791 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ) . '"'; |
|
791 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ).'"'; |
|
792 | 792 | $_sRepeatable = $this->getAOrB( $_bRepeatable, 'true', 'false' ); |
793 | 793 | $_bExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
794 | 794 | $_sScript = <<<JAVASCRIPTS |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | . '/* <![CDATA[ */' |
805 | 805 | . $_sScript |
806 | 806 | . '/* ]]> */' |
807 | - . "</script>". PHP_EOL; |
|
807 | + . "</script>".PHP_EOL; |
|
808 | 808 | |
809 | 809 | } |
810 | 810 | /** |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | $bRepeatable, |
824 | 824 | $bExternalSource |
825 | 825 | ); |
826 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
826 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
827 | 827 | . ( $_bIsLabelSet |
828 | 828 | ? $_aAttributes[ 'data-label' ] |
829 | 829 | : ( strrpos( $_aAttributes[ 'class' ], 'dashicons' ) |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | */ |
843 | 843 | private function _getFormattedUploadButtonAttributes( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bRepeatable, $bExternalSource ) { |
844 | 844 | |
845 | - $_aAttributes = array( |
|
845 | + $_aAttributes = array( |
|
846 | 846 | 'id' => "select_image_{$sInputID}", |
847 | 847 | 'href' => '#', |
848 | 848 | 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | : $this->oMsg->get( 'select_image' ), |
856 | 856 | 'data-label' => null, |
857 | 857 | ); |
858 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
858 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
859 | 859 | 'select_image button button-small ', |
860 | 860 | $this->getAOrB( |
861 | 861 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -883,16 +883,16 @@ discard block |
||
883 | 883 | * @return string |
884 | 884 | * @internal |
885 | 885 | */ |
886 | - protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
886 | + protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
887 | 887 | |
888 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
888 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
889 | 889 | return ''; |
890 | 890 | } |
891 | 891 | |
892 | 892 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
893 | 893 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
894 | 894 | // which causes the PHP syntax error. |
895 | - $_sButtonHTML = '"' . $this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ) . '"'; |
|
895 | + $_sButtonHTML = '"'.$this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ).'"'; |
|
896 | 896 | $_sScript = <<<JAVASCRIPTS |
897 | 897 | if ( 0 === jQuery( 'a#remove_{$sType}_{$sInputID}' ).length ) { |
898 | 898 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | . '/* <![CDATA[ */' |
904 | 904 | . $_sScript |
905 | 905 | . '/* ]]> */' |
906 | - . "</script>". PHP_EOL; |
|
906 | + . "</script>".PHP_EOL; |
|
907 | 907 | |
908 | 908 | } |
909 | 909 | |
@@ -913,11 +913,11 @@ discard block |
||
913 | 913 | * @return string The generated HTML remove button output. |
914 | 914 | * @internal |
915 | 915 | */ |
916 | - protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
916 | + protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
917 | 917 | |
918 | 918 | $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
919 | 919 | $_aAttributes = $this->_getFormattedRemoveButtonAttributesByType( $sInputID, $aButtonAttributes, $_bIsLabelSet, $sType ); |
920 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
920 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
921 | 921 | . ( $_bIsLabelSet |
922 | 922 | ? $_aAttributes[ 'data-label' ] |
923 | 923 | : $this->getAOrB( |
@@ -936,9 +936,9 @@ discard block |
||
936 | 936 | * @return array The formatted remove button attributes array. |
937 | 937 | * @internal |
938 | 938 | */ |
939 | - protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType='image' ) { |
|
939 | + protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType = 'image' ) { |
|
940 | 940 | |
941 | - $_sOnClickFunctionName = 'removeInputValuesFor' . ucfirst( $sType ); |
|
941 | + $_sOnClickFunctionName = 'removeInputValuesFor'.ucfirst( $sType ); |
|
942 | 942 | $_aAttributes = array( |
943 | 943 | 'id' => "remove_{$sType}_{$sInputID}", |
944 | 944 | 'href' => '#', |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | ? $aButtonAttributes[ 'data-label' ] |
951 | 951 | : $this->oMsg->get( 'remove_value' ), |
952 | 952 | ); |
953 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
953 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
954 | 954 | "remove_value remove_{$sType} button button-small", |
955 | 955 | $this->getAOrB( |
956 | 956 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * Defines the field type slugs used for this field type. |
105 | 105 | */ |
106 | - public $aFieldTypeSlugs = array( 'select', ); |
|
106 | + public $aFieldTypeSlugs = array( 'select',); |
|
107 | 107 | |
108 | 108 | /** |
109 | 109 | * Defines the default key-values of this field type. |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'select' => array( |
116 | 116 | 'size' => 1, |
117 | 117 | 'autofocusNew' => null, |
118 | - 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
118 | + 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
119 | 119 | 'required' => null, |
120 | 120 | ), |
121 | 121 | 'optgroup' => array(), |
@@ -155,12 +155,12 @@ discard block |
||
155 | 155 | protected function getField( $aField ) { |
156 | 156 | |
157 | 157 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
158 | - if ( $aField[ 'is_multiple' ] ) { |
|
158 | + if ( $aField[ 'is_multiple' ] ) { |
|
159 | 159 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
160 | 160 | } |
161 | 161 | return |
162 | 162 | $aField[ 'before_label' ] |
163 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">" |
|
163 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">" |
|
164 | 164 | . "<label for='{$aField[ 'input_id' ]}'>" |
165 | 165 | . $aField[ 'before_input' ] |
166 | 166 | . $_oSelectInput->get( $aField[ 'label' ] ) |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | /** |
66 | 66 | * Defines the field type slugs used for this field type. |
67 | 67 | */ |
68 | - public $aFieldTypeSlugs = array( 'size', ); |
|
68 | + public $aFieldTypeSlugs = array( 'size',); |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Defines the default key-values of this field type. |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | protected $aDefaultKeys = array( |
76 | 76 | 'is_multiple' => false, // indicates whether the select tag alloes multiple selections. |
77 | - 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
77 | + 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
78 | 78 | 'attributes' => array( |
79 | 79 | 'size' => array( |
80 | 80 | 'min' => null, |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | protected $aDefaultUnits = array( |
104 | 104 | 'px' => 'px', // pixel |
105 | - '%' => '%', // percentage |
|
105 | + '%' => '%', // percentage |
|
106 | 106 | 'em' => 'em', // font size |
107 | 107 | 'ex' => 'ex', // font height |
108 | 108 | 'in' => 'in', // inch |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | ); |
163 | 163 | |
164 | 164 | $_aOutput = array(); |
165 | - foreach( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
166 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
165 | + foreach ( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
166 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
167 | 167 | $_isKey, |
168 | 168 | $_sLabel, |
169 | 169 | $aField |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | |
187 | 187 | $_aBaseAttributes = $_bMultiLabels |
188 | 188 | ? array( |
189 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$isKey}]", |
|
190 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$isKey}", |
|
189 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$isKey}]", |
|
190 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$isKey}", |
|
191 | 191 | 'value' => $aField[ 'value' ], |
192 | 192 | ) |
193 | 193 | + $aField[ 'attributes' ] |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | |
200 | 200 | $_aOutput = array( |
201 | 201 | $this->getElementByLabel( $aField[ 'before_label' ], $isKey, $aField[ 'label' ] ), |
202 | - "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">", |
|
203 | - $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The size (number) part |
|
204 | - $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The unit (select) part |
|
202 | + "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">", |
|
203 | + $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The size (number) part |
|
204 | + $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The unit (select) part |
|
205 | 205 | "</div>", |
206 | 206 | $this->getElementByLabel( $aField[ 'after_label' ], $isKey, $aField[ 'label' ] ) |
207 | 207 | ); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | private function _getNumberInputPart( array $aField, array $aBaseAttributes, $isKey, $bMultiLabels ) { |
219 | 219 | |
220 | 220 | // Size and Size Label |
221 | - $_aSizeAttributes = $this->_getSizeAttributes( |
|
221 | + $_aSizeAttributes = $this->_getSizeAttributes( |
|
222 | 222 | $aField, |
223 | 223 | $aBaseAttributes, |
224 | 224 | $bMultiLabels |
@@ -226,32 +226,32 @@ discard block |
||
226 | 226 | : '' |
227 | 227 | ); |
228 | 228 | |
229 | - $_aSizeLabelAttributes = array( |
|
229 | + $_aSizeLabelAttributes = array( |
|
230 | 230 | 'for' => $_aSizeAttributes[ 'id' ], |
231 | 231 | 'class' => $_aSizeAttributes[ 'disabled' ] |
232 | 232 | ? 'disabled' |
233 | 233 | : null, |
234 | 234 | ); |
235 | 235 | |
236 | - $_sLabel = $this->getElementByLabel( |
|
236 | + $_sLabel = $this->getElementByLabel( |
|
237 | 237 | $aField[ 'label' ], |
238 | 238 | $isKey, |
239 | 239 | $aField[ 'label' ] |
240 | 240 | ); |
241 | - return "<label " . $this->getAttributes( $_aSizeLabelAttributes ) . ">" |
|
241 | + return "<label ".$this->getAttributes( $_aSizeLabelAttributes ).">" |
|
242 | 242 | . $this->getElement( |
243 | 243 | $aField, |
244 | 244 | $bMultiLabels |
245 | 245 | ? array( 'before_label', $isKey, 'size' ) |
246 | 246 | : array( 'before_label', 'size' ) |
247 | 247 | ) |
248 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
249 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
248 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
249 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
250 | 250 | . $_sLabel |
251 | 251 | . "</span>" |
252 | 252 | : "" |
253 | 253 | ) |
254 | - . "<input " . $this->getAttributes( $_aSizeAttributes ) . " />" |
|
254 | + . "<input ".$this->getAttributes( $_aSizeAttributes )." />" |
|
255 | 255 | . $this->getElement( |
256 | 256 | $aField, |
257 | 257 | $bMultiLabels |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | ) |
295 | 295 | : $aField[ 'units' ]; |
296 | 296 | |
297 | - return "<label " . $this->getAttributes( |
|
297 | + return "<label ".$this->getAttributes( |
|
298 | 298 | array( |
299 | 299 | 'for' => $_aUnitAttributes[ 'id' ], |
300 | 300 | 'class' => $_aUnitAttributes[ 'disabled' ] |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | * @return array an unit attribute array |
327 | 327 | * @internal |
328 | 328 | */ |
329 | - private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey='' ) { |
|
329 | + private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey = '' ) { |
|
330 | 330 | |
331 | - $_bIsMultiple = $aField[ 'is_multiple' ] |
|
331 | + $_bIsMultiple = $aField[ 'is_multiple' ] |
|
332 | 332 | ? true |
333 | 333 | : $this->getElement( |
334 | 334 | $aField, |
@@ -340,13 +340,13 @@ discard block |
||
340 | 340 | |
341 | 341 | $_aSelectAttributes = array( |
342 | 342 | 'type' => 'select', |
343 | - 'id' => $aField[ 'input_id' ] . ( '' === $isLabelKey ? '' : '_' . $isLabelKey ) . '_' . 'unit', |
|
343 | + 'id' => $aField[ 'input_id' ].( '' === $isLabelKey ? '' : '_'.$isLabelKey ).'_'.'unit', |
|
344 | 344 | 'multiple' => $_bIsMultiple |
345 | 345 | ? 'multiple' |
346 | 346 | : null, |
347 | 347 | 'name' => $_bIsMultiple |
348 | - ? "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit][]" |
|
349 | - : "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit]", |
|
348 | + ? "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit][]" |
|
349 | + : "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit]", |
|
350 | 350 | 'value' => $this->getElement( |
351 | 351 | $aField, |
352 | 352 | array( 'value', 'unit' ), |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | '' === $isLabelKey |
359 | 359 | ? array( 'attributes', 'unit' ) |
360 | 360 | : array( 'attributes', $isLabelKey, 'unit' ), |
361 | - $this->aDefaultKeys['attributes']['unit'] |
|
361 | + $this->aDefaultKeys[ 'attributes' ][ 'unit' ] |
|
362 | 362 | ) |
363 | 363 | + $aBaseAttributes; |
364 | 364 | return $_aSelectAttributes; |
@@ -372,15 +372,15 @@ discard block |
||
372 | 372 | * @return array an size attribute array |
373 | 373 | * @internal |
374 | 374 | */ |
375 | - private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey='' ) { |
|
375 | + private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey = '' ) { |
|
376 | 376 | |
377 | 377 | return array( |
378 | 378 | 'type' => 'number', |
379 | - 'id' => $aField['input_id'] . '_' . ( '' !== $sLabelKey ? $sLabelKey . '_' : '' ) . 'size', |
|
380 | - 'name' => $aField[ '_input_name' ] . ( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ) . '[size]', |
|
379 | + 'id' => $aField[ 'input_id' ].'_'.( '' !== $sLabelKey ? $sLabelKey.'_' : '' ).'size', |
|
380 | + 'name' => $aField[ '_input_name' ].( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ).'[size]', |
|
381 | 381 | 'value' => $this->getElement( |
382 | - $aField, // subject |
|
383 | - array( 'value', 'size' ), // dimensional keys |
|
382 | + $aField, // subject |
|
383 | + array( 'value', 'size' ), // dimensional keys |
|
384 | 384 | '' // default |
385 | 385 | ), |
386 | 386 | ) |