芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_optional/toggles.php
"off", "icon_closed" => "icon-plus", "icon_opened" => "icon-minus", // Common params "id" => "", "class" => "", "animation" => "", "css" => "", "top" => "", "bottom" => "", "left" => "", "right" => "" ), $atts))); $class .= ($class ? ' ' : '') . lorem_ipsum_books_media_store_get_css_position_as_classes($top, $right, $bottom, $left); lorem_ipsum_books_media_store_storage_set('sc_toggle_data', array( 'counter' => 0, 'show_counter' => lorem_ipsum_books_media_store_param_is_on($counter), 'icon_closed' => empty($icon_closed) || lorem_ipsum_books_media_store_param_is_inherit($icon_closed) ? "icon-plus" : $icon_closed, 'icon_opened' => empty($icon_opened) || lorem_ipsum_books_media_store_param_is_inherit($icon_opened) ? "icon-minus" : $icon_opened ) ); wp_enqueue_script('jquery-effects-slide', false, array('jquery','jquery-effects-core'), null, true); $output = '
' . do_shortcode($content) . '
'; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_toggles', $atts, $content); } add_shortcode('trx_toggles', 'lorem_ipsum_books_media_store_sc_toggles'); } if (!function_exists('lorem_ipsum_books_media_store_sc_toggles_item')) { function lorem_ipsum_books_media_store_sc_toggles_item($atts, $content=null) { if (lorem_ipsum_books_media_store_in_shortcode_blogger()) return ''; extract(lorem_ipsum_books_media_store_html_decode(shortcode_atts( array( // Individual params "title" => "", "open" => "", "icon_closed" => "", "icon_opened" => "", // Common params "id" => "", "class" => "", "css" => "" ), $atts))); lorem_ipsum_books_media_store_storage_inc_array('sc_toggle_data', 'counter'); if (empty($icon_closed) || lorem_ipsum_books_media_store_param_is_inherit($icon_closed)) $icon_closed = lorem_ipsum_books_media_store_storage_get_array('sc_toggles_data', 'icon_closed', '', "icon-plus"); if (empty($icon_opened) || lorem_ipsum_books_media_store_param_is_inherit($icon_opened)) $icon_opened = lorem_ipsum_books_media_store_storage_get_array('sc_toggles_data', 'icon_opened', '', "icon-minus"); $css .= lorem_ipsum_books_media_store_param_is_on($open) ? 'display:block;' : ''; $output = '
' . '
' . (!lorem_ipsum_books_media_store_param_is_off($icon_closed) ? '
' : '') . (!lorem_ipsum_books_media_store_param_is_off($icon_opened) ? '
' : '') . (lorem_ipsum_books_media_store_storage_get_array('sc_toggle_data', 'show_counter') ? '
'.(lorem_ipsum_books_media_store_storage_get_array('sc_toggle_data', 'counter')).'
' : '') . ($title) . '
' . '
' . do_shortcode($content) . '
' . '
'; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_toggles_item', $atts, $content); } add_shortcode('trx_toggles_item', 'lorem_ipsum_books_media_store_sc_toggles_item'); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_toggles_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_toggles_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_toggles_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_toggles", array( "title" => esc_html__("Toggles", 'trx_utils'), "desc" => wp_kses_data( __("Toggles items", 'trx_utils') ), "decorate" => true, "container" => false, "params" => array( "counter" => array( "title" => esc_html__("Counter", 'trx_utils'), "desc" => wp_kses_data( __("Display counter before each toggles title", 'trx_utils') ), "value" => "off", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('on_off') ), "icon_closed" => array( "title" => esc_html__("Icon while closed", 'trx_utils'), "desc" => wp_kses_data( __('Select icon for the closed toggles item from Fontello icons set', 'trx_utils') ), "value" => "", "type" => "icons", "options" => lorem_ipsum_books_media_store_get_sc_param('icons') ), "icon_opened" => array( "title" => esc_html__("Icon while opened", 'trx_utils'), "desc" => wp_kses_data( __('Select icon for the opened toggles item from Fontello icons set', 'trx_utils') ), "value" => "", "type" => "icons", "options" => lorem_ipsum_books_media_store_get_sc_param('icons') ), "top" => lorem_ipsum_books_media_store_get_sc_param('top'), "bottom" => lorem_ipsum_books_media_store_get_sc_param('bottom'), "left" => lorem_ipsum_books_media_store_get_sc_param('left'), "right" => lorem_ipsum_books_media_store_get_sc_param('right'), "id" => lorem_ipsum_books_media_store_get_sc_param('id'), "class" => lorem_ipsum_books_media_store_get_sc_param('class'), "animation" => lorem_ipsum_books_media_store_get_sc_param('animation'), "css" => lorem_ipsum_books_media_store_get_sc_param('css') ), "children" => array( "name" => "trx_toggles_item", "title" => esc_html__("Toggles item", 'trx_utils'), "desc" => wp_kses_data( __("Toggles item", 'trx_utils') ), "container" => true, "params" => array( "title" => array( "title" => esc_html__("Toggles item title", 'trx_utils'), "desc" => wp_kses_data( __("Title for current toggles item", 'trx_utils') ), "value" => "", "type" => "text" ), "open" => array( "title" => esc_html__("Open on show", 'trx_utils'), "desc" => wp_kses_data( __("Open current toggles item on show", 'trx_utils') ), "value" => "no", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('yes_no') ), "icon_closed" => array( "title" => esc_html__("Icon while closed", 'trx_utils'), "desc" => wp_kses_data( __('Select icon for the closed toggles item from Fontello icons set', 'trx_utils') ), "value" => "", "type" => "icons", "options" => lorem_ipsum_books_media_store_get_sc_param('icons') ), "icon_opened" => array( "title" => esc_html__("Icon while opened", 'trx_utils'), "desc" => wp_kses_data( __('Select icon for the opened toggles item from Fontello icons set', 'trx_utils') ), "value" => "", "type" => "icons", "options" => lorem_ipsum_books_media_store_get_sc_param('icons') ), "_content_" => array( "title" => esc_html__("Toggles item content", 'trx_utils'), "desc" => wp_kses_data( __("Current toggles item content", 'trx_utils') ), "rows" => 4, "value" => "", "type" => "textarea" ), "id" => lorem_ipsum_books_media_store_get_sc_param('id'), "class" => lorem_ipsum_books_media_store_get_sc_param('class'), "css" => lorem_ipsum_books_media_store_get_sc_param('css') ) ) )); } } /* Register shortcode in the VC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_toggles_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_toggles_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_toggles_reg_shortcodes_vc() { vc_map( array( "base" => "trx_toggles", "name" => esc_html__("Toggles", 'trx_utils'), "description" => wp_kses_data( __("Toggles items", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), 'icon' => 'icon_trx_toggles', "class" => "trx_sc_collection trx_sc_toggles", "content_element" => true, "is_container" => true, "show_settings_on_create" => false, "as_parent" => array('only' => 'trx_toggles_item'), "params" => array( array( "param_name" => "counter", "heading" => esc_html__("Counter", 'trx_utils'), "description" => wp_kses_data( __("Display counter before each toggles title", 'trx_utils') ), "class" => "", "value" => array("Add item numbers before each element" => "on" ), "type" => "checkbox" ), array( "param_name" => "icon_closed", "heading" => esc_html__("Icon while closed", 'trx_utils'), "description" => wp_kses_data( __("Select icon for the closed toggles item from Fontello icons set", 'trx_utils') ), "class" => "", "value" => lorem_ipsum_books_media_store_get_sc_param('icons'), "type" => "dropdown" ), array( "param_name" => "icon_opened", "heading" => esc_html__("Icon while opened", 'trx_utils'), "description" => wp_kses_data( __("Select icon for the opened toggles item from Fontello icons set", 'trx_utils') ), "class" => "", "value" => lorem_ipsum_books_media_store_get_sc_param('icons'), "type" => "dropdown" ), lorem_ipsum_books_media_store_get_vc_param('id'), lorem_ipsum_books_media_store_get_vc_param('class'), lorem_ipsum_books_media_store_get_vc_param('margin_top'), lorem_ipsum_books_media_store_get_vc_param('margin_bottom'), lorem_ipsum_books_media_store_get_vc_param('margin_left'), lorem_ipsum_books_media_store_get_vc_param('margin_right') ), 'default_content' => ' [trx_toggles_item title="' . esc_html__( 'Item 1 title', 'trx_utils') . '"][/trx_toggles_item] [trx_toggles_item title="' . esc_html__( 'Item 2 title', 'trx_utils') . '"][/trx_toggles_item] ', "custom_markup" => '
%content%
'.esc_html__("Add item", 'trx_utils').'
', 'js_view' => 'VcTrxTogglesView' ) ); vc_map( array( "base" => "trx_toggles_item", "name" => esc_html__("Toggles item", 'trx_utils'), "description" => wp_kses_data( __("Single toggles item", 'trx_utils') ), "show_settings_on_create" => true, "content_element" => true, "is_container" => true, 'icon' => 'icon_trx_toggles_item', "as_child" => array('only' => 'trx_toggles'), "as_parent" => array('except' => 'trx_toggles'), "params" => array( array( "param_name" => "title", "heading" => esc_html__("Title", 'trx_utils'), "description" => wp_kses_data( __("Title for current toggles item", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "open", "heading" => esc_html__("Open on show", 'trx_utils'), "description" => wp_kses_data( __("Open current toggle item on show", 'trx_utils') ), "class" => "", "value" => array("Opened" => "yes" ), "type" => "checkbox" ), array( "param_name" => "icon_closed", "heading" => esc_html__("Icon while closed", 'trx_utils'), "description" => wp_kses_data( __("Select icon for the closed toggles item from Fontello icons set", 'trx_utils') ), "class" => "", "value" => lorem_ipsum_books_media_store_get_sc_param('icons'), "type" => "dropdown" ), array( "param_name" => "icon_opened", "heading" => esc_html__("Icon while opened", 'trx_utils'), "description" => wp_kses_data( __("Select icon for the opened toggles item from Fontello icons set", 'trx_utils') ), "class" => "", "value" => lorem_ipsum_books_media_store_get_sc_param('icons'), "type" => "dropdown" ), lorem_ipsum_books_media_store_get_vc_param('id'), lorem_ipsum_books_media_store_get_vc_param('class'), lorem_ipsum_books_media_store_get_vc_param('css') ), 'js_view' => 'VcTrxTogglesTabView' ) ); class WPBakeryShortCode_Trx_Toggles extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeToggles {} class WPBakeryShortCode_Trx_Toggles_Item extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeTogglesItem {} } } ?>