C:\xampp\htdocs\landing\wp-content\plugins\penci-framework\inc\shortcode-settings.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
<?php
/**
 * Shortcode settings base class.
 */

/**
 * Shortcode settings base class.
 */
class Penci_Shortcode_Settings {
    
/**
     * Shortcode tag
     * @var string
     */
    
protected $shortcode;

    
/**
     * Shortcode settings.
     * @var array
     */
    
protected $settings;

    
/**
     * Constructor.
     *
     * @param string $shortcode Shortcode tag.
     * @param array $settings Shortcode settings.
     */
    
public function __construct$shortcode$settings ) {
        
$this->shortcode $shortcode;
        
$this->settings  $settings;

        
add_action'vc_before_init', array( $this'init' ) );
        
//add_filter( 'vc_shortcode_output', array( $this, 'shortcode_output' ),10,3 );
    
}

    public function 
shortcode_output($output$obj$attr)  {
        
        if( 
is_admin() ) {
            return 
$output;
        }

        
$show_only         filter_inputINPUT_GET'show_only' );
        
$current_paged  Penci_Pagination::get_current_paged();

        if( !
$show_only || ! $current_paged ) {
            return 
$output;
        }

        
$base $obj->settings('base');    
        
$show = array('vc_row','vc_column','vc_row_inner','vc_column_inner','penci_container','penci_column','penci_container_inner','penci_column_inner','vc_section' );

        if( 
in_array$base$show ) ) {
            return 
$output;
        }

        
$block_id = isset( $attr['block_id'] ) ? $attr['block_id'] : '';

        if( 
$block_id != $show_only ) {
            
$output '';
        }

        return 
$output;
    }

    
/**
     * Register shortcode.
     */
    
public function init() {
        
// Default shortcode settings
        
$settings wp_parse_args$this->settings, array(
            
'base'          => "penci_{$this->shortcode}",
            
'class'         => '',
            
'icon'          => PENCI_ADDONS_URL "shortcodes/{$this->shortcode}/icon.png",
            
'category'      => 'PenNews',
            
'html_template' => PENCI_ADDONS_DIR "shortcodes/{$this->shortcode}/frontend.php",
            
'params'        => array(),
            
'name'          => '',
            
'weight'        => 700,
        ) );

        
$shortcode_name   $settings['name'];

        if( 
'sliders' == $this->shortcode ) {
            
$settings['name'] = esc_html__'Featured ''penci-framework' ) . $shortcode_name;
        }else{
            
$settings['name'] = esc_html__'Penci ''penci-framework' ) . $shortcode_name;
        }

        if( ! 
function_exists'bos_searchbox_retrieve_all_user_options' ) && 'bos_searchbox' == $this->shortcode  ) {
            return;
        }

        if( ! 
defined'MC4WP_VERSION' ) && 'mailchimp' == $this->shortcode  ) {
            return;
        }

        
$list_unseting = array( 'penci_sliders','container_inner''container''column''column_inner' );

        if ( ! 
in_array$this->shortcode$list_unseting ) ) {
            
$settings['controls'] = 'full';
            
$settings['params'][] = array(
                
'type'             => 'textfield',
                
'param_name'       => 'heading_extra_settings',
                
'heading'          => esc_html__'Extra settings''penci-framework' ),
                
'value'            => '',
                
'edit_field_class' => 'penci-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
            );
            
$settings['params'][] = vc_map_add_css_animationfalse );

            
// Always add CSS options and extra CSS class.
            
$settings['params'][] = array(
                
'type'       => 'css_editor',
                
'heading'    => esc_html__'CSS Box''penci-framework' ),
                
'param_name' => 'css',
                
'group'      => esc_html__'Design Options''penci-framework' ),
            );
            
$settings['params'][] = array(
                
'type'       => 'hidden',
                
'param_name' => 'block_id',
                
'settings'   => array( 'auto_generate' => true )
            );
        }

        
$settings['params'][] = array(
            
'type'             => 'checkbox',
            
'heading'          => esc_html__'Show on Desktop''penci-framework' ),
            
'param_name'       => 'penci_show_desk',
            
'std'              => 'Yes',
            
'edit_field_class' => 'vc_col-sm-4',
            
'group'            => esc_html__'Responsive''penci-framework' ),
            
'value'            => array( esc_html__'Yes''penci-framework' ) => true ),
        );
        
$settings['params'][] = array(
            
'type'             => 'checkbox',
            
'heading'          => esc_html__'Show on Tablet''penci-framework' ),
            
'param_name'       => 'penci_show_tablet',
            
'std'              => 'Yes',
            
'edit_field_class' => 'vc_col-sm-4',
            
'group'            => esc_html__'Responsive''penci-framework' ),
            
'value'            => array( esc_html__'Yes''penci-framework' ) => true ),
        );
        
$settings['params'][] = array(
            
'type'             => 'checkbox',
            
'heading'          => esc_html__'Show on Mobile''penci-framework' ),
            
'param_name'       => 'penci_show_mobile',
            
'std'              => 'Yes',
            
'edit_field_class' => 'vc_col-sm-4',
            
'group'            => esc_html__'Responsive''penci-framework' ),
            
'value'            => array( esc_html__'Yes''penci-framework' ) => true ),
        );

        
$settings['params'][] = array(
            
'type'        => 'textfield',
            
'heading'     => esc_html__'Extra Class''penci-framework' ),
            
'param_name'  => 'class',
            
'description' => esc_html__'Style particular content element differently - add a class name and refer to it in custom CSS.''penci-framework' ),
        );

        if ( 
$video_url self::get_link_video$this->shortcode ) ) :
            
$settings['params'][] = array(
                
'type'             => 'textfield',
                
'param_name'       => 'notification',
                
'heading'          => "<span style='display: block;'><a href='" esc_url$video_url ) . "' target='_blank' style='text-decoration: none;''>" esc_html__"Watch Video Tutorial""ultimate_vc" ) . " &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;float: right;margin-top: -5px;text-decoration: none;'></span></a></span>",
                
'value'            => "",
                
'edit_field_class' => 'penci-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
            );
        endif;

        
vc_map$settings );
    }


    
/**
     * Get link video tutorial of shortcode
     *
     * @param $shortcode
     *
     * @return string
     */
    
public static function get_link_video$shortcode ) {

        
$link 'https://www.youtube.com/watch?v=bsZ7YYusAjQ&list=PL1PBMejQ2VTwTTycCaTHQ2UTLjL9V_7ZG';

        if ( 
'portfolio' == $shortcode ) {
            
$link esc_url'https://www.youtube.com/watch?v=ZK4vU3UjMAU&list=PL1PBMejQ2VTwTTycCaTHQ2UTLjL9V_7ZG&index=4' );
        }

        return 
$link;
    }
}




x

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