芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_basic/columns.php
"2", "fluid" => "no", "margins" => "yes", "equalheight" => "no", // Common params "id" => "", "class" => "", "css" => "", "animation" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => "" ), $atts))); $class .= ($class ? ' ' : '') . lorem_ipsum_books_media_store_get_css_position_as_classes($top, $right, $bottom, $left); $css .= lorem_ipsum_books_media_store_get_css_dimensions_from_values($width, $height); $count = max(1, min(12, (int) $count)); lorem_ipsum_books_media_store_storage_set('sc_columns_data', array( 'counter' => 1, 'equal_selector' => '', 'after_span2' => false, 'after_span3' => false, 'after_span4' => false, 'count' => $count ) ); $content = do_shortcode($content); $output = '
' . trim($content) . '
'; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_columns', $atts, $content); } add_shortcode('trx_columns', 'lorem_ipsum_books_media_store_sc_columns'); } if (!function_exists('lorem_ipsum_books_media_store_sc_column_item')) { function lorem_ipsum_books_media_store_sc_column_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 "span" => "1", "align" => "", "color" => "", "bg_color" => "", "bg_image" => "", "bg_tile" => "no", // Common params "id" => "", "class" => "", "css" => "", "animation" => "" ), $atts))); $css .= ($align !== '' ? 'text-align:' . esc_attr($align) . ';' : '') . ($color !== '' ? 'color:' . esc_attr($color) . ';' : ''); $span = max(1, min(11, (int) $span)); if (!empty($bg_image)) { if ($bg_image > 0) { $attach = wp_get_attachment_image_src( $bg_image, 'full' ); if (isset($attach[0]) && $attach[0]!='') $bg_image = $attach[0]; } } $output = '
' . ($bg_color!=='' || $bg_image !== '' ? '
' : '') . do_shortcode($content) . ($bg_color!=='' || $bg_image !== '' ? '
' : '') . '
'; lorem_ipsum_books_media_store_storage_inc_array('sc_columns_data', 'counter', $span); lorem_ipsum_books_media_store_storage_set_array('sc_columns_data', 'after_span2', $span==2); lorem_ipsum_books_media_store_storage_set_array('sc_columns_data', 'after_span3', $span==3); lorem_ipsum_books_media_store_storage_set_array('sc_columns_data', 'after_span4', $span==4); lorem_ipsum_books_media_store_storage_set_array('sc_columns_data', 'equal_selector', $bg_color!=='' || $bg_image !== '' ? '.sc_column_item_inner' : '.sc_column_item'); return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_column_item', $atts, $content); } add_shortcode('trx_column_item', 'lorem_ipsum_books_media_store_sc_column_item'); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_columns_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_columns_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_columns_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_columns", array( "title" => esc_html__("Columns", 'trx_utils'), "desc" => wp_kses_data( __("Insert up to 5 columns in your page (post)", 'trx_utils') ), "decorate" => true, "container" => false, "params" => array( "fluid" => array( "title" => esc_html__("Fluid columns", 'trx_utils'), "desc" => wp_kses_data( __("To squeeze the columns when reducing the size of the window (fluid=yes) or to rebuild them (fluid=no)", 'trx_utils') ), "value" => "no", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('yes_no') ), "margins" => array( "title" => esc_html__("Margins between columns", 'trx_utils'), "desc" => wp_kses_data( __("Add margins between columns", 'trx_utils') ), "value" => "yes", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('yes_no') ), "width" => lorem_ipsum_books_media_store_shortcodes_width(), "height" => lorem_ipsum_books_media_store_shortcodes_height(), "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_column_item", "title" => esc_html__("Column", 'trx_utils'), "desc" => wp_kses_data( __("Column item", 'trx_utils') ), "container" => true, "params" => array( "span" => array( "title" => esc_html__("Merge columns", 'trx_utils'), "desc" => wp_kses_data( __("Count merged columns from current", 'trx_utils') ), "value" => "", "type" => "text" ), "align" => array( "title" => esc_html__("Alignment", 'trx_utils'), "desc" => wp_kses_data( __("Alignment text in the column", 'trx_utils') ), "value" => "", "type" => "checklist", "dir" => "horizontal", "options" => lorem_ipsum_books_media_store_get_sc_param('align') ), "color" => array( "title" => esc_html__("Fore color", 'trx_utils'), "desc" => wp_kses_data( __("Any color for objects in this column", 'trx_utils') ), "value" => "", "type" => "color" ), "bg_color" => array( "title" => esc_html__("Background color", 'trx_utils'), "desc" => wp_kses_data( __("Any background color for this column", 'trx_utils') ), "value" => "", "type" => "color" ), "bg_image" => array( "title" => esc_html__("URL for background image file", 'trx_utils'), "desc" => wp_kses_data( __("Select or upload image or write URL from other site for the background", 'trx_utils') ), "readonly" => false, "value" => "", "type" => "media" ), "bg_tile" => array( "title" => esc_html__("Tile background image", 'trx_utils'), "desc" => wp_kses_data( __("Do you want tile background image or image cover whole column?", 'trx_utils') ), "value" => "no", "dependency" => array( 'bg_image' => array('not_empty') ), "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('yes_no') ), "_content_" => array( "title" => esc_html__("Column item content", 'trx_utils'), "desc" => wp_kses_data( __("Current column item content", 'trx_utils') ), "divider" => true, "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'), "animation" => lorem_ipsum_books_media_store_get_sc_param('animation'), "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_columns_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_columns_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_columns_reg_shortcodes_vc() { vc_map( array( "base" => "trx_columns", "name" => esc_html__("Columns", 'trx_utils'), "description" => wp_kses_data( __("Insert columns with margins", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), 'icon' => 'icon_trx_columns', "class" => "trx_sc_columns", "content_element" => true, "is_container" => true, "show_settings_on_create" => false, "as_parent" => array('only' => 'trx_column_item'), "params" => array( array( "param_name" => "count", "heading" => esc_html__("Columns count", 'trx_utils'), "description" => wp_kses_data( __("Number of the columns in the container.", 'trx_utils') ), "admin_label" => true, "value" => "2", "type" => "textfield" ), array( "param_name" => "fluid", "heading" => esc_html__("Fluid columns", 'trx_utils'), "description" => wp_kses_data( __("To squeeze the columns when reducing the size of the window (fluid=yes) or to rebuild them (fluid=no)", 'trx_utils') ), "value" => array(esc_html__('Fluid columns', 'trx_utils') => 'yes'), "type" => "checkbox" ), array( "param_name" => "equalheight", "heading" => esc_html__("Equal height", 'trx_utils'), "description" => wp_kses_data( __("Make equal height for all columns in the row", 'trx_utils') ), "value" => array("Equal height" => "yes" ), "type" => "checkbox" ), array( "param_name" => "margins", "heading" => esc_html__("Margins between columns", 'trx_utils'), "description" => wp_kses_data( __("Add margins between columns", 'trx_utils') ), "std" => "yes", "value" => array(esc_html__('Disable margins between columns', 'trx_utils') => 'no'), "type" => "checkbox" ), 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_vc_width(), lorem_ipsum_books_media_store_vc_height(), 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_column_item][/trx_column_item] [trx_column_item][/trx_column_item] ', 'js_view' => 'VcTrxColumnsView' ) ); vc_map( array( "base" => "trx_column_item", "name" => esc_html__("Column", 'trx_utils'), "description" => wp_kses_data( __("Column item", 'trx_utils') ), "show_settings_on_create" => true, "class" => "trx_sc_collection trx_sc_column_item", "content_element" => true, "is_container" => true, 'icon' => 'icon_trx_column_item', "as_child" => array('only' => 'trx_columns'), "as_parent" => array('except' => 'trx_columns'), "params" => array( array( "param_name" => "span", "heading" => esc_html__("Merge columns", 'trx_utils'), "description" => wp_kses_data( __("Count merged columns from current", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "align", "heading" => esc_html__("Alignment", 'trx_utils'), "description" => wp_kses_data( __("Alignment text in the column", 'trx_utils') ), "class" => "", "value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('align')), "type" => "dropdown" ), array( "param_name" => "color", "heading" => esc_html__("Fore color", 'trx_utils'), "description" => wp_kses_data( __("Any color for objects in this column", 'trx_utils') ), "class" => "", "value" => "", "type" => "colorpicker" ), array( "param_name" => "bg_color", "heading" => esc_html__("Background color", 'trx_utils'), "description" => wp_kses_data( __("Any background color for this column", 'trx_utils') ), "class" => "", "value" => "", "type" => "colorpicker" ), array( "param_name" => "bg_image", "heading" => esc_html__("URL for background image file", 'trx_utils'), "description" => wp_kses_data( __("Select or upload image or write URL from other site for the background", 'trx_utils') ), "class" => "", "value" => "", "type" => "attach_image" ), array( "param_name" => "bg_tile", "heading" => esc_html__("Tile background image", 'trx_utils'), "description" => wp_kses_data( __("Do you want tile background image or image cover whole column?", 'trx_utils') ), "class" => "", 'dependency' => array( 'element' => 'bg_image', 'not_empty' => true ), "std" => "no", "value" => array(esc_html__('Tile background image', 'trx_utils') => 'yes'), "type" => "checkbox" ), 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') ), 'js_view' => 'VcTrxColumnItemView' ) ); class WPBakeryShortCode_Trx_Columns extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeColumns {} class WPBakeryShortCode_Trx_Column_Item extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeCollection {} } } ?>