C:\xampp\htdocs\landing\wp-content\updraft\plugins-old\penci-framework\widgets\general-fields.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?php
if ( ! defined'ABSPATH' ) ) {
    exit;
}

if ( ! 
class_exists'PenciFW_Widget_General_Fields' ) ):
    class 
PenciFW_Widget_General_Fields {
        function 
__construct() {
            if ( 
is_admin() ) {
                
add_action'in_widget_form', array( $this'in_widget_form' ), 5);
                
add_filter'widget_update_callback', array( $this'widget_update' ), 100);
            } else {
                
add_filter'dynamic_sidebar_params', array( $this'dynamic_sidebar_params' ), 100);
            }


        }

        public function 
dynamic_sidebar_params$params ) {
            global 
$wp_registered_widgets;

            
$widget_id = isset( $params[0]['widget_id'] ) ? $params[0]['widget_id'] : '';

            if ( isset( 
$wp_registered_widgets$widget_id ]['callback'][0] ) && is_object$wp_registered_widgets$widget_id ]['callback'][0] ) ) {
                
$settings    $wp_registered_widgets$widget_id ]['callback'][0]->get_settings();
                
$setting_key substr$widget_idstrrpos$widget_id'-' ) + );
                
$instance    = isset( $settings$setting_key ] ) ? $settings$setting_key ] : array();

                
$css_custom $this->widget_custom_css$instance$widget_id );
                if ( 
$css_custom ) {
                    
$params[0]['after_widget'] .= '<style>' $css_custom '</style>';
                }
            }

            return 
$params;
        }

        public function 
widget_custom_css$instance$widget_id ) {

            
$atts wp_parse_args$instance, array(
                
'title_color'            => '',
                
'title_hover_color'      => '',
                
'background_title_color' => '',
                
'bordertop_color'        => '',
                
'borderbt_color'         => '',
                
'borderleft_color'       => '',
                
'borderright_color'      => '',
                
'title_line_color'       => '',
                
'penci_widget_id'        => '',
                
'background_w_color'     => '',
            ) );

            
extract$atts );

            
$css '';
            
$id  = ! $widget_id '.' $atts['penci_widget_id'] : '#' $widget_id;


            if ( 
$atts['title_color'] ) {
                
$title_temp '%s .penci-block__title a, %s .penci-block__title span{ color:%s !important; } %s .penci-block-heading:after{ background-color:%s !important; }';
                
$css        .= sprintf$title_temp$id$id$atts['title_color'], $id$atts['title_color'] );
            }
            if ( 
$atts['title_hover_color'] ) {
                
$css .= sprintf'%s .penci-block__title a:hover{ color:%s !important; }'$id$atts['title_hover_color'] );
            }

            if ( 
$atts['background_title_color'] ) {
                
$css .= $id '.style-title-13 .penci-block-heading,';
                
$css .= $id '.style-title-9 .penci-block-heading,';
                
$css .= $id '.style-title-4 .penci-block__title a,';
                
$css .= $id '.style-title-4 .penci-block__title span,';
                
$css .= $id '.style-title-2 .penci-block__title a,';
                
$css .= $id '.style-title-2 .penci-block__title span{';
                
$css .= 'background-color:' esc_attr$atts['background_title_color'] ) . ' !important;';
                
$css .= '}';

                
$css .= $id '.style-title-13 .penci-block__title:after{ border-color: ' esc_attr$atts['background_title_color'] ) . ' transparent transparent transparent  !important; }';
            }

            if ( 
$atts['bordertop_color'] ) {
                
$css .= $id '.style-title-10 .penci-block-heading,';
                
$css .= $id '.style-title-11:not(.footer-widget) .penci-block__title:before,';
                
$css .= $id '.style-title-8:not(.footer-widget) .penci-block__title:before,';
                
$css .= $id '.style-title-1:not(.footer-widget) .penci-block__title:before{';
                
$css .= 'border-top-color: ' esc_attr$atts['bordertop_color'] ) . ' !important;';
                
$css .= '}';
            }

            if ( 
$atts['borderbt_color'] ) {
                
$css .= $id '.style-title-12 .penci-block-heading,';
                
$css .= $id '.style-title-10 .penci-block-heading,';
                
$css .= $id '.style-title-4 .penci-block-heading,';
                
$css .= $id '.style-title-1 .penci-block-heading,';
                
$css .= $id '.style-title-3 .penci-block-heading{';
                
$css .= 'border-bottom-color:' esc_attr$atts['borderbt_color'] ) . ';';
                
$css .= '}';

                
$css .= $id '.style-title-5 .penci-block-heading:after{';
                
$css .= 'background-color:' esc_attr$atts['borderbt_color'] ) . ' !important;';
                
$css .= '}';
            }

            if ( 
$atts['borderleft_color'] ) {
                
$css .= $id '.style-title-10.penci-block-heading:after,';
                
$css .= $id '.style-title-10 .penci-block-heading,';
                
$css .= $id '.style-title-9 .penci-block-heading{';
                
$css .= 'border-left-color:' esc_attr$atts['borderleft_color'] ) . ';';
                
$css .= '}';
            }

            if ( 
$atts['borderright_color'] ) {
                
$css .= $id '.style-title-10.penci-block-heading:after,';
                
$css .= $id '.style-title-10 .penci-block-heading,';
                
$css .= $id '.style-title-9 .penci-block-heading{';
                
$css .= 'border-right-color:' esc_attr$atts['borderright_color'] ) . ';';
                
$css .= '}';
            }

            if ( 
$atts['title_line_color'] ) {

                
$css .= $id '.style-title-6 .penci-block__title a:before,';
                
$css .= $id '.style-title-6 .penci-block__title a:after,';
                
$css .= $id '.style-title-6 .penci-block__title span:before,';
                
$css .= $id '.style-title-6 .penci-block__title span:after {';
                
$css .= 'border-top-color: ' esc_attr$atts['title_line_color'] ) . ' !important;';
                
$css .= '}';

                
$css .= $id '.style-title-11 .penci-block__title:after{';
                
$css .= 'background-color: ' esc_attr$atts['title_line_color'] ) . ' !important;';
                
$css .= '}';
            }

            if ( 
$atts['background_w_color'] ) {
                
$css .= $id '.penci-widget-sidebar{';
                
$css .= 'background-color:' esc_attr$atts['background_w_color'] ) . ';';
                
$css .= '}';
            }

            return 
$css;
        }

        public function 
in_widget_form$__this$return$instance ) {

            
$id_base = isset( $__this->id_base ) ? $__this->id_base '';

            
$instance wp_parse_args( (array) $instance, array(
                
'title_color'            => '',
                
'title_hover_color'      => '',
                
'background_title_color' => '',
                
'bordertop_color'        => '',
                
'borderbt_color'         => '',
                
'borderleft_color'       => '',
                
'borderright_color'      => '',
                
'title_line_color'       => '',
                
'background_w_color'     => '',
            ) );


            
$list_options = array(
                
'title_color'            => __'Title text color''pennews' ),
                
'title_hover_color'      => __'Title text hover color''pennews' ),
                
'background_title_color' => __'Background text block color for style 2,4,9,13''pennews' ),
                
'bordertop_color'        => __'Border top color for style 1,8,10''pennews' ),
                
'borderbt_color'         => __'Border bottom color for style 1,3,4,10,12''pennews' ),
                
'borderleft_color'       => __'Border left color for style 9,10''pennews' ),
                
'borderright_color'      => __'Border right color for style 9,10''pennews' ),
                
'title_line_color'       => __'Custom Line Color For Style 6,11''pennews' ),
            );
            
?>
            <div class="penci-metabox-wrap">
                <div class="penci-metabox-fields">
                    <div class="penci-accordion-name">
                        <h3><?php esc_html_e'Widget General Color Options''PENCI_SNORLAX_FW' ); ?></h3><span class="handle-repeater"></span>
                    </div>
                    <div class="penci-panel-accordion" style="min-height: 0px;">
                        <p class="penci-field-item">
                            <label style="font-weight: normal;"><?php esc_html_e'Widget background color''pennews' ); ?></label>
                            <span class="penci-picker-container">
                            <input id="<?php echo esc_attr$__this->get_field_id'background_w_color' ) ); ?>" class="widefat penci-color-picker" type="text" name="<?php echo esc_attr$__this->get_field_name'background_w_color' ) ); ?>" value="<?php echo $instance['background_w_color']; ?>" / >
                            </span>
                        </p>
                        <p class="penci-field-item penci-param-heading-wrapper no-top-margin vc_column vc_col-sm-12">
                            <label>Title widget</label>
                        </p>
                        <?php foreach ( $list_options as $option_id => $option_label ): ?>
                            <p class="penci-field-item">
                                <label for="widget-penci-widget-block7-2-ptitle_color" style="font-weight: normal;"><?php echo ( $option_label ); ?></label>
                                <span class="penci-picker-container">
                            <input id="<?php echo esc_attr$__this->get_field_id$option_id ) ); ?>" class="widefat penci-color-picker" type="text" name="<?php echo esc_attr$__this->get_field_name$option_id ) ); ?>" value="<?php echo $instance$option_id ]; ?>" / >
                            </span>
                            </p>
                        <?php endforeach; ?>
                    </div>
                </div>
            </div>
            <?php
        
}

        public function 
widget_update$instance$new_instance ) {
            
$list_options = array(
                
'title_color'            => '',
                
'title_hover_color'      => '',
                
'background_title_color' => '',
                
'bordertop_color'        => '',
                
'borderbt_color'         => '',
                
'borderleft_color'       => '',
                
'borderright_color'      => '',
                
'title_line_color'       => '',
                
'background_w_color'     => '',
            );

            foreach ( 
$list_options as $param_name => $param_value ) {
                
$instance$param_name ] = isset( $new_instance$param_name ] ) ? $new_instance$param_name ] : '';
            }

            return 
$instance;
        }
    }

    new 
PenciFW_Widget_General_Fields;
endif;
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586