| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace Flynt\Customizer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | class RangeControl extends \WP_Customize_Control | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |     public $type = 'flynt-range'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |     public $unit = ''; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |      * Refresh the parameters passed to the JavaScript via JSON. | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 12 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 13 |  |  |     public function to_json() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps | 
            
                                                                        
                            
            
                                    
            
            
                | 14 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 15 |  |  |         parent::to_json(); | 
            
                                                                        
                            
            
                                    
            
            
                | 16 |  |  |         $this->json['id'] = $this->id; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 17 |  |  |         $this->json['link'] = $this->get_link(); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 18 |  |  |         $this->json['value'] = $this->value(); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 19 |  |  |         $this->json['unit'] = $this->unit; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 20 |  |  |         $this->json['input_attrs'] = $this->input_attrs; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 21 |  |  |         $this->json['default'] = $this->default ?? $this->setting->default; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                            
                                                                                            
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |      * Don't render the control content from PHP, as it's rendered via JS on load. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |     public function render_content() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |      * Render a JS template for control display. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |     public function content_template() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |         ?> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         <# if ( data.label ) { #><label for="{{{ data.id }}}" class="customize-control-title">{{{ data.label }}} ({{{ data.unit }}})</label><# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |         <# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |         <div class="customize-control-notifications-container"></div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |         <div class="customize-control-content"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |             <div class="flynt-range-field"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |                 <input | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |                     type="range" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |                     data-change="number" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |                     value="{{{ data.value }}}" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |                     {{{ data.link }}} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |                     <# _.each(_.extend({'class': 'flynt-range flynt-range-slider'}, data.input_attrs), function(value, key) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |                         {{{ key }}}="{{ value }}" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |                     <# }); #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |                 > | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |                 <input | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |                     type="number" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |                     data-change="slider" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |                     value="{{{ data.value }}}" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |                     id="{{{ data.id }}}" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |                     {{{ data.link }}} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |                     <# _.each(_.extend({'class': 'flynt-range flynt-range-number'}, data.input_attrs), function(value, key) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |                         {{{ key }}}="{{ value }}" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |                     <# }); #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |                 > | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |                 <button type="button" class="flynt-range-reset button button-secondary" data-default="{{{ data.default }}}"><?php esc_html_e('Default', 'flynt'); ?></button> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |             </div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |         </div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |         <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 69 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 70 |  |  |  | 
            
                        
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.