@@ -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 | ); |
@@ -41,19 +41,19 @@ |
||
41 | 41 | protected function getField( $aField ) { |
42 | 42 | |
43 | 43 | return |
44 | - $aField['before_label'] |
|
44 | + $aField[ 'before_label' ] |
|
45 | 45 | . "<div class='admin-page-framework-input-label-container'>" |
46 | - . "<label for='{$aField['input_id']}'>" |
|
47 | - . $aField['before_input'] |
|
48 | - . ( $aField['label'] |
|
49 | - ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField['label_min_width'] ) . ";'>" . $aField['label'] . "</span>" |
|
46 | + . "<label for='{$aField[ 'input_id' ]}'>" |
|
47 | + . $aField[ 'before_input' ] |
|
48 | + . ( $aField[ 'label' ] |
|
49 | + ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>".$aField[ 'label' ]."</span>" |
|
50 | 50 | : "" |
51 | 51 | ) |
52 | - . "<input " . $this->getAttributes( $aField['attributes'] ) . " />" |
|
53 | - . $aField['after_input'] |
|
52 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
53 | + . $aField[ 'after_input' ] |
|
54 | 54 | . "</label>" |
55 | 55 | . "</div>" |
56 | - . $aField['after_label']; |
|
56 | + . $aField[ 'after_label' ]; |
|
57 | 57 | |
58 | 58 | } |
59 | 59 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | protected function setUp() { |
47 | 47 | |
48 | 48 | // If the WordPress version is greater than or equal to 3.5, then load the new WordPress color picker. |
49 | - if ( version_compare( $GLOBALS['wp_version'], '3.5', '>=' ) ) { |
|
49 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '3.5', '>=' ) ) { |
|
50 | 50 | //Both the necessary css and javascript have been registered already by WordPress, so all we have to do is load them with their handle. |
51 | 51 | wp_enqueue_style( 'wp-color-picker' ); |
52 | 52 | wp_enqueue_script( 'wp-color-picker' ); |
@@ -209,29 +209,29 @@ discard block |
||
209 | 209 | protected function getField( $aField ) { |
210 | 210 | |
211 | 211 | // If the value is not set, apply the default value, 'transparent'. |
212 | - $aField['value'] = is_null( $aField['value'] ) |
|
212 | + $aField[ 'value' ] = is_null( $aField[ 'value' ] ) |
|
213 | 213 | ? 'transparent' |
214 | - : $aField['value']; |
|
214 | + : $aField[ 'value' ]; |
|
215 | 215 | |
216 | 216 | $aField[ 'attributes' ] = $this->_getInputAttributes( $aField ); |
217 | 217 | |
218 | 218 | return |
219 | - $aField['before_label'] |
|
219 | + $aField[ 'before_label' ] |
|
220 | 220 | . "<div class='admin-page-framework-input-label-container'>" |
221 | - . "<label for='{$aField['input_id']}'>" |
|
221 | + . "<label for='{$aField[ 'input_id' ]}'>" |
|
222 | 222 | . $aField[ 'before_input' ] |
223 | - . ( $aField['label'] && ! $aField['repeatable'] |
|
224 | - ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField['label_min_width'] ) . ";'>" . $aField['label'] . "</span>" |
|
223 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
224 | + ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>".$aField[ 'label' ]."</span>" |
|
225 | 225 | : "" |
226 | 226 | ) |
227 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
227 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
228 | 228 | . $aField[ 'after_input' ] |
229 | 229 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
230 | 230 | . "</label>" |
231 | - . "<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']}' |
|
232 | - . $this->_getColorPickerEnablerScript( "{$aField['input_id']}" ) |
|
231 | + . "<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']}' |
|
232 | + . $this->_getColorPickerEnablerScript( "{$aField[ 'input_id' ]}" ) |
|
233 | 233 | . "</div>" |
234 | - . $aField['after_label']; |
|
234 | + . $aField[ 'after_label' ]; |
|
235 | 235 | |
236 | 236 | } |
237 | 237 | /** |
@@ -242,13 +242,13 @@ discard block |
||
242 | 242 | private function _getInputAttributes( array $aField ) { |
243 | 243 | |
244 | 244 | return array( |
245 | - 'color' => $aField['value'], |
|
246 | - 'value' => $aField['value'], |
|
245 | + 'color' => $aField[ 'value' ], |
|
246 | + 'value' => $aField[ 'value' ], |
|
247 | 247 | 'data-default' => isset( $aField[ 'default' ] ) |
248 | 248 | ? $aField[ 'default' ] |
249 | 249 | : 'transparent', // used by the repeatable script |
250 | 250 | 'type' => 'text', // it must be text |
251 | - 'class' => trim( 'input_color ' . $aField['attributes']['class'] ), |
|
251 | + 'class' => trim( 'input_color '.$aField[ 'attributes' ][ 'class' ] ), |
|
252 | 252 | ) + $aField[ 'attributes' ]; |
253 | 253 | |
254 | 254 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param object $oMsg The framework message object. |
100 | 100 | * @param boolean $bAutoRegister Whether or not to register the field type(s). |
101 | 101 | */ |
102 | - public function __construct( $asClassName='admin_page_framework', $asFieldTypeSlug=null, $oMsg=null, $bAutoRegister=true ) { |
|
102 | + public function __construct( $asClassName = 'admin_page_framework', $asFieldTypeSlug = null, $oMsg = null, $bAutoRegister = true ) { |
|
103 | 103 | |
104 | 104 | $this->aFieldTypeSlugs = empty( $asFieldTypeSlug ) |
105 | 105 | ? $this->aFieldTypeSlugs |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | |
111 | 111 | // This automatically registers the field type. The build-in ones will be registered manually so it will be skipped. |
112 | 112 | if ( $bAutoRegister ) { |
113 | - foreach( ( array ) $asClassName as $_sClassName ) { |
|
113 | + foreach ( ( array ) $asClassName as $_sClassName ) { |
|
114 | 114 | add_filter( |
115 | - 'field_types_' . $_sClassName, |
|
115 | + 'field_types_'.$_sClassName, |
|
116 | 116 | array( $this, '_replyToRegisterInputFieldType' ) |
117 | 117 | ); |
118 | 118 | } |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | } |
159 | 159 | return is_array( $asLabel ) // if the user stes multiple items |
160 | 160 | ? $this->getElement( |
161 | - $asElement, // subject |
|
162 | - $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
161 | + $asElement, // subject |
|
162 | + $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
163 | 163 | '' // default - if the element is not found, return an empty |
164 | 164 | ) |
165 | 165 | : $asElement; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | protected function geFieldOutput( array $aFieldset ) { |
176 | 176 | |
177 | - if ( ! is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
177 | + if ( !is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
178 | 178 | return ''; |
179 | 179 | } |
180 | 180 | |
@@ -182,14 +182,14 @@ discard block |
||
182 | 182 | $aFieldset[ '_parent_field_object' ] = $aFieldset[ '_field_object' ]; // 3.6.0+ |
183 | 183 | |
184 | 184 | // 3.7.0+ The caller object is no longer a factory object but a form object. |
185 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
185 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
186 | 186 | |
187 | 187 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
188 | - $aFieldset, // the field definition array |
|
189 | - $_oCallerForm->aSavedData, // the stored form data |
|
190 | - $_oCallerForm->getFieldErrors(), // the field error array. |
|
191 | - $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
192 | - $_oCallerForm->oMsg, // the system message object |
|
188 | + $aFieldset, // the field definition array |
|
189 | + $_oCallerForm->aSavedData, // the stored form data |
|
190 | + $_oCallerForm->getFieldErrors(), // the field error array. |
|
191 | + $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
192 | + $_oCallerForm->oMsg, // the system message object |
|
193 | 193 | $_oCallerForm->aCallbacks // field output element callables. |
194 | 194 | ); |
195 | 195 | return $_oFieldset->get(); |
@@ -223,13 +223,13 @@ discard block |
||
223 | 223 | * @since 3.0.3 Tweaked it to have better execution speed. |
224 | 224 | * @internal |
225 | 225 | */ |
226 | - public function getDefinitionArray( $sFieldTypeSlug='' ) { |
|
226 | + public function getDefinitionArray( $sFieldTypeSlug = '' ) { |
|
227 | 227 | |
228 | 228 | // The uniteArrays() method resulted in somewhat being slow due to overhead on checking array keys for recursive array merges. |
229 | 229 | $_aDefaultKeys = $this->aDefaultKeys + self::$_aDefaultKeys; |
230 | - $_aDefaultKeys['attributes'] = isset( $this->aDefaultKeys['attributes'] ) && is_array( $this->aDefaultKeys['attributes'] ) |
|
231 | - ? $this->aDefaultKeys['attributes'] + self::$_aDefaultKeys['attributes'] |
|
232 | - : self::$_aDefaultKeys['attributes']; |
|
230 | + $_aDefaultKeys[ 'attributes' ] = isset( $this->aDefaultKeys[ 'attributes' ] ) && is_array( $this->aDefaultKeys[ 'attributes' ] ) |
|
231 | + ? $this->aDefaultKeys[ 'attributes' ] + self::$_aDefaultKeys[ 'attributes' ] |
|
232 | + : self::$_aDefaultKeys[ 'attributes' ]; |
|
233 | 233 | |
234 | 234 | return array( |
235 | 235 | 'sFieldTypeSlug' => $sFieldTypeSlug, |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @since 3.0.0 |
268 | 268 | * @internal |
269 | 269 | */ |
270 | - public function _replyToFieldTypeSetter( $sFieldSetType='' ) { |
|
270 | + public function _replyToFieldTypeSetter( $sFieldSetType = '' ) { |
|
271 | 271 | $this->_sFieldSetType = $sFieldSetType; |
272 | 272 | } |
273 | 273 | |
@@ -321,8 +321,8 @@ discard block |
||
321 | 321 | wp_enqueue_script( 'media-upload' ); |
322 | 322 | } |
323 | 323 | |
324 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
325 | - add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
|
324 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php',) ) ) { |
|
325 | + add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ), 1, 2 ); |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
338 | 338 | |
339 | 339 | // Replace the button label in the media thick box. |
340 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
340 | + if ( !in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
341 | 341 | return $sTranslated; |
342 | 342 | } |
343 | 343 | if ( $sText !== 'Insert into Post' ) { |
@@ -347,8 +347,8 @@ discard block |
||
347 | 347 | return $sTranslated; |
348 | 348 | } |
349 | 349 | |
350 | - if ( isset( $_GET['button_label'] ) ) { |
|
351 | - return $_GET['button_label']; |
|
350 | + if ( isset( $_GET[ 'button_label' ] ) ) { |
|
351 | + return $_GET[ 'button_label' ]; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | return $this->oProp->sThickBoxButtonUseThis |
@@ -367,12 +367,12 @@ discard block |
||
367 | 367 | */ |
368 | 368 | public function _replyToRemovingMediaLibraryTab( $aTabs ) { |
369 | 369 | |
370 | - if ( ! isset( $_REQUEST['enable_external_source'] ) ) { |
|
370 | + if ( !isset( $_REQUEST[ 'enable_external_source' ] ) ) { |
|
371 | 371 | return $aTabs; |
372 | 372 | } |
373 | 373 | |
374 | - if ( ! $_REQUEST['enable_external_source'] ) { |
|
375 | - unset( $aTabs['type_url'] ); // removes the 'From URL' tab in the thick box. |
|
374 | + if ( !$_REQUEST[ 'enable_external_source' ] ) { |
|
375 | + unset( $aTabs[ 'type_url' ] ); // removes the 'From URL' tab in the thick box. |
|
376 | 376 | } |
377 | 377 | return $aTabs; |
378 | 378 |
@@ -315,14 +315,14 @@ discard block |
||
315 | 315 | wp_enqueue_script( 'thickbox' ); |
316 | 316 | wp_enqueue_style( 'thickbox' ); |
317 | 317 | |
318 | - if ( function_exists( 'wp_enqueue_media' ) ) { |
|
318 | + if ( function_exists( 'wp_enqueue_media' ) ) { |
|
319 | 319 | // If the WordPress version is 3.5 or above, |
320 | 320 | new AdminPageFramework_Form_View___Script_MediaUploader( $this->oMsg ); |
321 | 321 | } else { |
322 | 322 | wp_enqueue_script( 'media-upload' ); |
323 | 323 | } |
324 | 324 | |
325 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
325 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
326 | 326 | add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
327 | 327 | } |
328 | 328 | |
@@ -338,17 +338,17 @@ discard block |
||
338 | 338 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
339 | 339 | |
340 | 340 | // Replace the button label in the media thick box. |
341 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
341 | + if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
342 | 342 | return $sTranslated; |
343 | 343 | } |
344 | - if ( $sText !== 'Insert into Post' ) { |
|
344 | + if ( $sText !== 'Insert into Post' ) { |
|
345 | 345 | return $sTranslated; |
346 | 346 | } |
347 | - if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
347 | + if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
348 | 348 | return $sTranslated; |
349 | 349 | } |
350 | 350 | |
351 | - if ( isset( $_GET['button_label'] ) ) { |
|
351 | + if ( isset( $_GET['button_label'] ) ) { |
|
352 | 352 | return $_GET['button_label']; |
353 | 353 | } |
354 | 354 | |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | public function _replyToRemovingMediaLibraryTab( $aTabs ) { |
370 | 370 | |
371 | - if ( ! isset( $_REQUEST['enable_external_source'] ) ) { |
|
371 | + if ( ! isset( $_REQUEST['enable_external_source'] ) ) { |
|
372 | 372 | return $aTabs; |
373 | 373 | } |
374 | 374 |
@@ -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 |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | /** |
479 | 479 | * Returns the field type specific CSS rules. |
480 | 480 | */ |
481 | - protected function getStyles() { |
|
481 | + protected function getStyles() { |
|
482 | 482 | return <<<CSSRULES |
483 | 483 | /* Image Field Preview Container */ |
484 | 484 | .admin-page-framework-field .image_preview { |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | */ |
708 | 708 | protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAtrributes ) { |
709 | 709 | |
710 | - if ( ! $aField[ 'show_preview' ] ) { |
|
710 | + if ( ! $aField[ 'show_preview' ] ) { |
|
711 | 711 | return ''; |
712 | 712 | } |
713 | 713 |
@@ -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' ], |
@@ -678,8 +678,8 @@ discard block |
||
678 | 678 | protected function getExtraInputFields( array $aField ) { |
679 | 679 | |
680 | 680 | $_aOutputs = array(); |
681 | - foreach( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
682 | - $_aOutputs[] = "<input " . $this->getAttributes( |
|
681 | + foreach ( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
682 | + $_aOutputs[ ] = "<input ".$this->getAttributes( |
|
683 | 683 | array( |
684 | 684 | 'id' => "{$aField[ 'input_id' ]}_{$sAttribute}", |
685 | 685 | 'type' => 'hidden', |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | '' |
696 | 696 | ), |
697 | 697 | ) |
698 | - ) . "/>"; |
|
698 | + )."/>"; |
|
699 | 699 | } |
700 | 700 | return implode( PHP_EOL, $_aOutputs ); |
701 | 701 | |
@@ -707,17 +707,17 @@ discard block |
||
707 | 707 | */ |
708 | 708 | protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAtrributes ) { |
709 | 709 | |
710 | - if ( ! $aField[ 'show_preview' ] ) { |
|
710 | + if ( !$aField[ 'show_preview' ] ) { |
|
711 | 711 | return ''; |
712 | 712 | } |
713 | 713 | |
714 | 714 | $sImageURL = esc_url( $this->getResolvedSRC( $sImageURL, true ) ); |
715 | 715 | return |
716 | - "<div " . $this->getAttributes( |
|
716 | + "<div ".$this->getAttributes( |
|
717 | 717 | array( |
718 | 718 | 'id' => "image_preview_container_{$aField[ 'input_id' ]}", |
719 | - 'class' => 'image_preview ' . $this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
720 | - 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
719 | + 'class' => 'image_preview '.$this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
720 | + 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
721 | 721 | . $this->getElement( $aPreviewAtrributes, 'style', '' ), |
722 | 722 | ) + $aPreviewAtrributes |
723 | 723 | ) |
@@ -739,12 +739,12 @@ discard block |
||
739 | 739 | */ |
740 | 740 | protected function _getUploaderButtonScript( $sInputID, $abRepeatable, $bExternalSource, array $aButtonAttributes ) { |
741 | 741 | |
742 | - $_bRepeatable = ! empty( $abRepeatable ); |
|
742 | + $_bRepeatable = !empty( $abRepeatable ); |
|
743 | 743 | |
744 | 744 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
745 | 745 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
746 | 746 | // which causes the PHP syntax error. |
747 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ) . '"'; |
|
747 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ).'"'; |
|
748 | 748 | $_sRepeatable = $this->getAOrB( $_bRepeatable, 'true', 'false' ); |
749 | 749 | $_bExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
750 | 750 | $_sScript = <<<JAVASCRIPTS |
@@ -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 | /** |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | $bRepeatable, |
779 | 779 | $bExternalSource |
780 | 780 | ); |
781 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
781 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
782 | 782 | . ( $_bIsLabelSet |
783 | 783 | ? $_aAttributes[ 'data-label' ] |
784 | 784 | : ( strrpos( $_aAttributes[ 'class' ], 'dashicons' ) |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | */ |
797 | 797 | private function _getFormattedUploadButtonAttributes( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bRepeatable, $bExternalSource ) { |
798 | 798 | |
799 | - $_aAttributes = array( |
|
799 | + $_aAttributes = array( |
|
800 | 800 | 'id' => "select_image_{$sInputID}", |
801 | 801 | 'href' => '#', |
802 | 802 | 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | : $this->oMsg->get( 'select_image' ), |
810 | 810 | 'data-label' => null, |
811 | 811 | ); |
812 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
812 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
813 | 813 | 'select_image button button-small ', |
814 | 814 | $this->getAOrB( |
815 | 815 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -836,16 +836,16 @@ discard block |
||
836 | 836 | * @since 3.5.3 Added the `$sType` parameter. |
837 | 837 | * @return string |
838 | 838 | */ |
839 | - protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
839 | + protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
840 | 840 | |
841 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
841 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
842 | 842 | return ''; |
843 | 843 | } |
844 | 844 | |
845 | 845 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
846 | 846 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
847 | 847 | // which causes the PHP syntax error. |
848 | - $_sButtonHTML = '"' . $this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ) . '"'; |
|
848 | + $_sButtonHTML = '"'.$this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ).'"'; |
|
849 | 849 | $_sScript = <<<JAVASCRIPTS |
850 | 850 | if ( 0 === jQuery( 'a#remove_{$sType}_{$sInputID}' ).length ) { |
851 | 851 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | . '/* <![CDATA[ */' |
857 | 857 | . $_sScript |
858 | 858 | . '/* ]]> */' |
859 | - . "</script>". PHP_EOL; |
|
859 | + . "</script>".PHP_EOL; |
|
860 | 860 | |
861 | 861 | } |
862 | 862 | |
@@ -865,11 +865,11 @@ discard block |
||
865 | 865 | * @since 3.5.3 |
866 | 866 | * @return string The generated HTML remove button output. |
867 | 867 | */ |
868 | - protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
868 | + protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
869 | 869 | |
870 | 870 | $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
871 | 871 | $_aAttributes = $this->_getFormattedRemoveButtonAttributesByType( $sInputID, $aButtonAttributes, $_bIsLabelSet, $sType ); |
872 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
872 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
873 | 873 | . ( $_bIsLabelSet |
874 | 874 | ? $_aAttributes[ 'data-label' ] |
875 | 875 | : $this->getAOrB( |
@@ -887,9 +887,9 @@ discard block |
||
887 | 887 | * @since 3.5.3 |
888 | 888 | * @return array The formatted remove button attributes array. |
889 | 889 | */ |
890 | - protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType='image' ) { |
|
890 | + protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType = 'image' ) { |
|
891 | 891 | |
892 | - $_sOnClickFunctionName = 'removeInputValuesFor' . ucfirst( $sType ); |
|
892 | + $_sOnClickFunctionName = 'removeInputValuesFor'.ucfirst( $sType ); |
|
893 | 893 | $_aAttributes = array( |
894 | 894 | 'id' => "remove_{$sType}_{$sInputID}", |
895 | 895 | 'href' => '#', |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | ? $aButtonAttributes[ 'data-label' ] |
902 | 902 | : $this->oMsg->get( 'remove_value' ), |
903 | 903 | ); |
904 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
904 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
905 | 905 | "remove_value remove_{$sType} button button-small", |
906 | 906 | $this->getAOrB( |
907 | 907 | 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. |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | */ |
76 | 76 | protected function getField( $aField ) { |
77 | 77 | |
78 | - $_aOutput = array(); |
|
79 | - foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) { |
|
80 | - $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
78 | + $_aOutput = array(); |
|
79 | + foreach ( $this->getAsArray( $aField[ 'label' ] ) as $_sKey => $_sLabel ) { |
|
80 | + $_aOutput[ ] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
81 | 81 | } |
82 | - $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] ); |
|
82 | + $_aOutput[ ] = $this->_getUpdateCheckedScript( $aField[ 'input_id' ] ); |
|
83 | 83 | return implode( PHP_EOL, $_aOutput ); |
84 | 84 | |
85 | 85 | } |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | $_aAttributes = $aField[ 'attributes' ] + $this->getElementAsArray( $aField, array( 'attributes', $sKey ) ); |
94 | 94 | $_oRadio = new AdminPageFramework_Input_radio( $_aAttributes ); |
95 | 95 | $_oRadio->setAttributesByKey( $sKey ); |
96 | - $_oRadio->setAttribute( 'data-default', $aField['default'] ); // refered by the repeater script |
|
96 | + $_oRadio->setAttribute( 'data-default', $aField[ 'default' ] ); // refered by the repeater script |
|
97 | 97 | |
98 | 98 | // Output |
99 | 99 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
100 | - . "<div class='admin-page-framework-input-label-container admin-page-framework-radio-label' style='min-width: " . $this->sanitizeLength( $aField['label_min_width'] ) . ";'>" |
|
101 | - . "<label " . $this->getAttributes( |
|
100 | + . "<div class='admin-page-framework-input-label-container admin-page-framework-radio-label' style='min-width: ".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>" |
|
101 | + . "<label ".$this->getAttributes( |
|
102 | 102 | array( |
103 | 103 | 'for' => $_oRadio->getAttribute( 'id' ), |
104 | 104 | 'class' => $_oRadio->getAttribute( 'disabled' ) |
@@ -76,7 +76,7 @@ |
||
76 | 76 | protected function getField( $aField ) { |
77 | 77 | |
78 | 78 | $_aOutput = array(); |
79 | - foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) { |
|
79 | + foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) { |
|
80 | 80 | $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
81 | 81 | } |
82 | 82 | $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] ); |
@@ -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. |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * @since 3.5.0 |
39 | 39 | * @callback fieldtype hfDoOnRegistration |
40 | 40 | */ |
41 | - public function _replyToDoOnFieldRegistration( array $aField ) { |
|
41 | + public function _replyToDoOnFieldRegistration( array $aField ) { |
|
42 | 42 | return $this->doOnFieldRegistration( $aField ); |
43 | 43 | } |
44 | 44 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Defines the field type slugs used for this field type. |
23 | 23 | */ |
24 | - public $aFieldTypeSlugs = array( 'select', ); |
|
24 | + public $aFieldTypeSlugs = array( 'select',); |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Defines the default key-values of this field type. |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'select' => array( |
34 | 34 | 'size' => 1, |
35 | 35 | 'autofocusNew' => null, |
36 | - 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
36 | + 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
37 | 37 | 'required' => null, |
38 | 38 | ), |
39 | 39 | 'optgroup' => array(), |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | protected function getField( $aField ) { |
73 | 73 | |
74 | 74 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
75 | - if ( $aField[ 'is_multiple' ] ) { |
|
75 | + if ( $aField[ 'is_multiple' ] ) { |
|
76 | 76 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
77 | 77 | } |
78 | 78 | return |
79 | 79 | $aField[ 'before_label' ] |
80 | - . "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: " . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>" |
|
80 | + . "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: ".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>" |
|
81 | 81 | . "<label for='{$aField[ 'input_id' ]}'>" |
82 | 82 | . $aField[ 'before_input' ] |
83 | 83 | . $_oSelectInput->get( $aField[ 'label' ] ) |
@@ -72,7 +72,7 @@ |
||
72 | 72 | protected function getField( $aField ) { |
73 | 73 | |
74 | 74 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
75 | - if ( $aField[ 'is_multiple' ] ) { |
|
75 | + if ( $aField[ 'is_multiple' ] ) { |
|
76 | 76 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
77 | 77 | } |
78 | 78 | return |