芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/Ultimate_VC_Addons/params/Ultimate_Radio_Image.php
'radio_image_box', * 'options' => array( * 'image-1' => plugins_url('../assets/images/patterns/01.png',__FILE__), * 'image-2' => plugins_url('../assets/images/patterns/12.png',__FILE__), * ), * 'useextension' => false, // if false it will use key as value instead file name. Eg - "image-1" instead "01.png" * 'css' => array( * 'width' => '40px', * 'height' => '35px', * 'background-repeat' => 'repeat', * 'background-size' => 'cover' * ), * ) * * @package Ultimate_VC_Addons_Radio_Image_Param. */ if ( ! class_exists( 'Ultimate_VC_Addons_Radio_Image_Param' ) ) { /** * Class Ultimate_VC_Addons_Radio_Image_Param * * @class Ultimate_VC_Addons_Radio_Image_Param. */ class Ultimate_VC_Addons_Radio_Image_Param { /** * Initiator __construct. */ public function __construct() { if ( defined( 'WPB_VC_VERSION' ) && version_compare( WPB_VC_VERSION, 4.8 ) >= 0 ) { if ( function_exists( 'vc_add_shortcode_param' ) ) { vc_add_shortcode_param( 'radio_image_box', array( &$this, 'radio_image_settings_field' ) ); } } else { if ( function_exists( 'add_shortcode_param' ) ) { add_shortcode_param( 'radio_image_box', array( &$this, 'radio_image_settings_field' ) ); } } } /** * Radio_image_settings_field. * * @param array $settings Settings. * @param string $value Value. */ public function radio_image_settings_field( $settings, $value ) { $default_css = array( 'width' => '25px', 'height' => '25px', 'background-repeat' => 'repeat', 'background-size' => 'cover', ); $dependency = ''; $param_name = isset( $settings['param_name'] ) ? $settings['param_name'] : ''; $type = isset( $settings['type'] ) ? $settings['type'] : ''; $options = isset( $settings['options'] ) ? $settings['options'] : ''; $css = isset( $settings['css'] ) ? $settings['css'] : $default_css; $class = isset( $settings['class'] ) ? $settings['class'] : ''; $useextension = ( isset( $settings['useextension'] ) && '' != $settings['useextension'] ) ? $settings['useextension'] : 'true'; $default = isset( $settings['default'] ) ? $settings['default'] : 'transperant'; $uni = uniqid(); $output = ''; $hide_it = 'display:none'; $output = '
'; $output .= '
'; if ( 'transperant' == $value ) { $checked = 'checked'; } else { $checked = ''; } $transperant_bg = 'background:transperant'; $output .= '
'; foreach ( $options as $key => $img_url ) { if ( $value == $key ) { $checked = 'checked'; } else { $checked = ''; } if ( 'true' != $useextension ) { $temp = pathinfo( $key ); $temp_filename = $temp['filename']; $key = $temp_filename; } $output .= '
'; } $output .= '
'; $output .= ''; $output .= ''; return $output; } } } if ( class_exists( 'Ultimate_VC_Addons_Radio_Image_Param' ) ) { $ultimate_radio_image_param = new Ultimate_VC_Addons_Radio_Image_Param(); }