芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_optional/accordion.php
"1", "counter" => "off", "icon_closed" => "icon-plus", "icon_opened" => "icon-minus", // Common params "id" => "", "class" => "", "css" => "", "animation" => "", "top" => "", "bottom" => "", "left" => "", "right" => "" ), $atts))); $class .= ($class ? ' ' : '') . lorem_ipsum_books_media_store_get_css_position_as_classes($top, $right, $bottom, $left); $initial = max(0, (int) $initial); lorem_ipsum_books_media_store_storage_set('sc_accordion_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-ui-accordion', false, array('jquery','jquery-ui-core'), null, true); $output = '
' . do_shortcode($content) . '
'; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_accordion', $atts, $content); } add_shortcode('trx_accordion', 'lorem_ipsum_books_media_store_sc_accordion'); } if (!function_exists('lorem_ipsum_books_media_store_sc_accordion_item')) { function lorem_ipsum_books_media_store_sc_accordion_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 "icon_closed" => "", "icon_opened" => "", "title" => "", // Common params "id" => "", "class" => "", "css" => "" ), $atts))); lorem_ipsum_books_media_store_storage_inc_array('sc_accordion_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_accordion_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_accordion_data', 'icon_opened', '', "icon-minus"); $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_accordion_data', 'show_counter') ? '
'.(lorem_ipsum_books_media_store_storage_get_array('sc_accordion_data', 'counter')).'
' : '') . ($title) . '
' . '
' . do_shortcode($content) . '
' . '
'; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_accordion_item', $atts, $content); } add_shortcode('trx_accordion_item', 'lorem_ipsum_books_media_store_sc_accordion_item'); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_accordion_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_accordion_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_accordion_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_accordion", array( "title" => esc_html__("Accordion", 'trx_utils'), "desc" => wp_kses_data( __("Accordion 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 accordion title", 'trx_utils') ), "value" => "off", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('on_off') ), "initial" => array( "title" => esc_html__("Initially opened item", 'trx_utils'), "desc" => wp_kses_data( __("Number of initially opened item", 'trx_utils') ), "value" => 1, "min" => 0, "type" => "spinner" ), "icon_closed" => array( "title" => esc_html__("Icon while closed", 'trx_utils'), "desc" => wp_kses_data( __('Select icon for the closed accordion 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 accordion 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_accordion_item", "title" => esc_html__("Item", 'trx_utils'), "desc" => wp_kses_data( __("Accordion item", 'trx_utils') ), "container" => true, "params" => array( "title" => array( "title" => esc_html__("Accordion item title", 'trx_utils'), "desc" => wp_kses_data( __("Title for current accordion item", 'trx_utils') ), "value" => "", "type" => "text" ), "icon_closed" => array( "title" => esc_html__("Icon while closed", 'trx_utils'), "desc" => wp_kses_data( __('Select icon for the closed accordion 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 accordion 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__("Accordion item content", 'trx_utils'), "desc" => wp_kses_data( __("Current accordion 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_accordion_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_accordion_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_accordion_reg_shortcodes_vc() { vc_map( array( "base" => "trx_accordion", "name" => esc_html__("Accordion", 'trx_utils'), "description" => wp_kses_data( __("Accordion items", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), 'icon' => 'icon_trx_accordion', "class" => "trx_sc_collection trx_sc_accordion", "content_element" => true, "is_container" => true, "show_settings_on_create" => false, "as_parent" => array('only' => 'trx_accordion_item'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma) "params" => array( array( "param_name" => "counter", "heading" => esc_html__("Counter", 'trx_utils'), "description" => wp_kses_data( __("Display counter before each accordion title", 'trx_utils') ), "class" => "", "value" => array("Add item numbers before each element" => "on" ), "type" => "checkbox" ), array( "param_name" => "initial", "heading" => esc_html__("Initially opened item", 'trx_utils'), "description" => wp_kses_data( __("Number of initially opened item", 'trx_utils') ), "class" => "", "value" => 1, "type" => "textfield" ), array( "param_name" => "icon_closed", "heading" => esc_html__("Icon while closed", 'trx_utils'), "description" => wp_kses_data( __("Select icon for the closed accordion 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 accordion 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('animation'), lorem_ipsum_books_media_store_get_vc_param('css'), 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_accordion_item title="' . esc_html__( 'Item 1 title', 'trx_utils') . '"][/trx_accordion_item] [trx_accordion_item title="' . esc_html__( 'Item 2 title', 'trx_utils') . '"][/trx_accordion_item] ', "custom_markup" => '
%content%
'.esc_html__("Add item", 'trx_utils').'
', 'js_view' => 'VcTrxAccordionView' ) ); vc_map( array( "base" => "trx_accordion_item", "name" => esc_html__("Accordion item", 'trx_utils'), "description" => wp_kses_data( __("Inner accordion item", 'trx_utils') ), "show_settings_on_create" => true, "content_element" => true, "is_container" => true, 'icon' => 'icon_trx_accordion_item', "as_child" => array('only' => 'trx_accordion'), // Use only|except attributes to limit parent (separate multiple values with comma) "as_parent" => array('except' => 'trx_accordion'), "params" => array( array( "param_name" => "title", "heading" => esc_html__("Title", 'trx_utils'), "description" => wp_kses_data( __("Title for current accordion item", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "icon_closed", "heading" => esc_html__("Icon while closed", 'trx_utils'), "description" => wp_kses_data( __("Select icon for the closed accordion 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 accordion 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' => 'VcTrxAccordionTabView' ) ); class WPBakeryShortCode_Trx_Accordion extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeAccordion {} class WPBakeryShortCode_Trx_Accordion_Item extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeAccordionItem {} } } ?>