function dslc_downloads_module_init() { if (!dslc_is_module_active('DSLC_Downloads', true)) { return; } $capability = dslc_get_option('lc_min_capability_downloads_m', 'dslc_plugin_options_access_control'); if (!$capability) { $capability = 'publish_posts'; } // With Front $with_front = dslc_get_option('with_front', 'dslc_plugin_options_cpt_slugs'); if (empty($with_front)) { $with_front = 'disabled'; } if ($with_front == 'enabled') { $with_front = true; } else { $with_front = false; } /** * Custom Post Type */ register_post_type('dslc_downloads', array('menu_icon' => 'dashicons-download', 'labels' => array('name' => __('Downloads', 'dslc_string'), 'singular_name' => __('Download Item', 'dslc_string'), 'add_new' => __('Add Download Item', 'dslc_string'), 'add_new_item' => __('Add Download Item', 'dslc_string'), 'edit' => __('Edit', 'dslc_string'), 'edit_item' => __('Edit Download Item', 'dslc_string'), 'new_item' => __('New Download Item', 'dslc_string'), 'view' => __('View Download Item', 'dslc_string'), 'view_item' => __('View Download Item', 'dslc_string'), 'search_items' => __('Search Download Item', 'dslc_string'), 'not_found' => __('No Download Item found', 'dslc_string'), 'not_found_in_trash' => __('No Download Item found in Trash', 'dslc_string'), 'parent' => __('Parent Download Item', 'dslc_string')), 'public' => true, 'rewrite' => array('slug' => dslc_get_option('downloads_slug', 'dslc_plugin_options_cpt_slugs'), 'with_front' => $with_front), 'supports' => array('title', 'custom-fields', 'excerpt', 'editor', 'author', 'thumbnail', 'comments'), 'capabilities' => array('publish_posts' => $capability, 'edit_posts' => $capability, 'edit_others_posts' => $capability, 'delete_posts' => $capability, 'delete_others_posts' => $capability, 'read_private_posts' => $capability, 'edit_post' => $capability, 'delete_post' => $capability, 'read_post' => $capability))); /** * Custom Taxonomies */ register_taxonomy('dslc_downloads_cats', 'dslc_downloads', array('labels' => array('name' => __('Downloads Categories', 'dslc_string'), 'singular_name' => __('Category', 'dslc_string'), 'search_items' => __('Search Categories', 'dslc_string'), 'all_items' => __('All Categories', 'dslc_string'), 'parent_item' => __('Parent Category', 'dslc_string'), 'parent_item_colon' => __('Parent Category:', 'dslc_string'), 'edit_item' => __('Edit Category', 'dslc_string'), 'update_item' => __('Update Category', 'dslc_string'), 'add_new_item' => __('Add New Category', 'dslc_string'), 'new_item_name' => __('New Category Name', 'dslc_string'), 'menu_name' => __('Categories', 'dslc_string')), 'hierarchical' => true, 'public' => true, 'rewrite' => array('slug' => dslc_get_option('downloads_cats_slug', 'dslc_plugin_options_cpt_slugs'), 'with_front' => $with_front), 'capabilities' => array('manage_terms' => $capability, 'edit_terms' => $capability, 'delete_terms' => $capability, 'assign_terms' => $capability))); register_taxonomy('dslc_downloads_tags', 'dslc_downloads', array('labels' => array('name' => __('Downloads Tags', 'dslc_string'), 'singular_name' => __('Tag', 'dslc_string'), 'search_items' => __('Search Tags', 'dslc_string'), 'all_items' => __('All Tags', 'dslc_string'), 'parent_item' => __('Parent Tag', 'dslc_string'), 'parent_item_colon' => __('Parent Tag:', 'dslc_string'), 'edit_item' => __('Edit Tag', 'dslc_string'), 'update_item' => __('Update Tag', 'dslc_string'), 'add_new_item' => __('Add New Tag', 'dslc_string'), 'new_item_name' => __('New Tag Name', 'dslc_string'), 'menu_name' => __('Tags', 'dslc_string')), 'hierarchical' => false, 'public' => true, 'rewrite' => array('slug' => dslc_get_option('downloads_tags_slug', 'dslc_plugin_options_cpt_slugs'), 'with_front' => $with_front), 'capabilities' => array('manage_terms' => $capability, 'edit_terms' => $capability, 'delete_terms' => $capability, 'assign_terms' => $capability))); /** * Post Options */ global $dslc_var_post_options; $dslc_var_post_options['dslc-downloads-module-options'] = array('title' => 'Download Options', 'show_on' => 'dslc_downloads', 'options' => array(array('label' => 'Downloadable File - Self Hosted', 'descr' => 'If you want the file hosted on your server you can upload and choose it here.', 'std' => '', 'id' => 'dslc_download_file', 'type' => 'file'), array('label' => 'Downloadable File - URL', 'descr' => 'If the file is already hosted somewhere else you can set the URL to it here.', 'std' => '', 'id' => 'dslc_download_url', 'type' => 'text'))); }
function lbmn_footer_custom_css() { global $dslc_active; global $dslc_css_style; global $content_width; global $dslc_googlefonts_array; global $dslc_post_types; $composer_code = ''; $template_code = ''; $lc_width = dslc_get_option('lc_max_width', 'dslc_plugin_options'); if (empty($lc_width)) { $lc_width = $content_width . 'px'; } else { if (strpos($lc_width, 'px') === false && strpos($lc_width, '%') === false) { $lc_width = $lc_width . 'px'; } } echo "\n<!-- Custom Footer Styles -->\n"; echo '<style type="text/css">'; // Get composer code $post_id = get_the_ID(); $footer_post_id = lbmn_get_footerid_by_pageid($post_id); $composer_code .= get_post_meta($footer_post_id, 'dslc_code', true); // If no home page set and blog posts listed on the front // output LiveComposer CSS for front page too if (is_front_page() && get_option('page_on_front', 0) == 0) { $template_post_id = get_theme_mod('lbmn_systempage_frontpage_posts', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_FRONTPAGE_POSTS_DEFAULT, 'lbmn_archive')); $composer_code .= get_post_meta($template_post_id, 'dslc_code', true); } // If composer not used on this page stop execution if ($composer_code) { // Replace shortcode names $composer_code = str_replace('dslc_modules_section', 'dslc_modules_section_gen_css', $composer_code); $composer_code = str_replace('dslc_modules_area', 'dslc_modules_area_gen_css', $composer_code); $composer_code = str_replace('[dslc_module]', '[dslc_module_gen_css]', $composer_code); $composer_code = str_replace('[/dslc_module]', '[/dslc_module_gen_css]', $composer_code); // Do CSS shortcode do_shortcode($composer_code); // Google Fonts Import $googlefonts_output = ''; foreach ($dslc_googlefonts_array as $googlefont) { $googlefont = str_replace(' ', '+', $googlefont); if ($googlefont != '') { $googlefonts_output .= '@import url("//fonts.googleapis.com/css?family=' . $googlefont . ':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext"); '; } } echo $googlefonts_output; } // Wrapper width echo '.dslc-modules-section-wrapper, .dslca-add-modules-section { width : ' . $lc_width . '; } '; // Echo CSS style if (!$dslc_active && $composer_code) { // $dslc_css_style = str_replace('#dslc-content', '#site-footer', $dslc_css_style); echo $dslc_css_style; } echo '</style>'; }
/** * Register Menus * * @since 1.1 */ function dslc_nav_menus() { $menus = dslc_get_option('menus', 'dslc_plugin_options_navigation_m'); if ($menus !== '') { $menus_array = explode(',', substr($menus, 0, -1)); foreach ($menus_array as $menu) { $menu_ID = 'dslc_' . strtolower(str_replace(' ', '_', $menu)); register_nav_menu($menu_ID, $menu); } } }
function dslc_sidebars() { $sidebars = dslc_get_option('sidebars', 'dslc_plugin_options_widgets_m'); if ($sidebars !== '') { $sidebars_array = explode(',', substr($sidebars, 0, -1)); foreach ($sidebars_array as $sidebar) { $sidebar_ID = 'dslc_' . strtolower(str_replace(' ', '_', $sidebar)); register_sidebar(array('name' => $sidebar, 'id' => $sidebar_ID, 'before_widget' => '<div id="%1$s" class="dslc-widget dslc-col %2$s"><div class="dslc-widget-wrap">', 'after_widget' => '</div></div>', 'before_title' => apply_filters('dslc_sidebar_before_title', '<h3 class="dslc-widget-title"><span class="dslc-widget-title-inner">'), 'after_title' => apply_filters('dslc_sidebar_after_title', '</span></h3>'))); } } }
/** * Register hidden page in WP Admin used as a wrapper for LC editing. * * Create /wp-admin/admin.php?page=livecomposer_editor&page_id=XX page. * Page has no menu item in WP Admin Panel. * * @since 1.1 */ function dslc_editing_screen() { global $dslc_plugin_options; $capability = dslc_get_option('lc_min_capability_page', 'dslc_plugin_options_access_control'); if (!$capability) { $capability = 'publish_posts'; } // Base 64 encoded SVG image. $icon_svg = dslc_get_menu_svg(); add_menu_page(__('Live Composer Editing', 'live-composer-page-builder'), __('Live Composer Editing', 'live-composer-page-builder'), $capability, 'livecomposer_editor', 'dslc_editing_screen_content', $icon_svg, '99'); remove_menu_page('livecomposer_editor', 'livecomposer_editor'); }
function lbmn_footer_custom_css() { global $dslc_active; global $dslc_css_style; global $content_width; global $dslc_googlefonts_array; global $dslc_post_types; $composer_code = ''; $template_code = ''; $lc_width = dslc_get_option('lc_max_width', 'dslc_plugin_options'); if (empty($lc_width)) { $lc_width = $content_width . 'px'; } else { if (strpos($lc_width, 'px') === false && strpos($lc_width, '%') === false) { $lc_width = $lc_width . 'px'; } } // echo "\n<!-- Custom Footer Styles -->\n"; // echo '<style type="text/css">'; // Get composer code $post_id = get_the_ID(); $footer_post_id = lbmn_get_footerid_by_pageid($post_id); $composer_code .= get_post_meta($footer_post_id, 'dslc_code', true); // If no home page set and blog posts listed on the front // output LiveComposer CSS for front page too if (is_front_page() && get_option('page_on_front', 0) == 0) { $template_post_id = get_theme_mod('lbmn_systempage_frontpage_posts', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_FRONTPAGE_POSTS_DEFAULT, 'lbmn_archive')); $composer_code .= get_post_meta($template_post_id, 'dslc_code', true); } // If composer not used on this page stop execution if ($composer_code) { // Urge the Live Composer to generate CSS code add_filter('dslc_generate_custom_css', 'lbmn_enable_custom_css_generation'); function lbmn_enable_custom_css_generation() { return true; } // Replace shortcode names $composer_code = str_replace('dslc_modules_section', 'dslc_modules_section_gen_css', $composer_code); $composer_code = str_replace('dslc_modules_area', 'dslc_modules_area_gen_css', $composer_code); $composer_code = str_replace('[dslc_module]', '[dslc_module_gen_css]', $composer_code); $composer_code = str_replace('[dslc_module ', '[dslc_module_gen_css ', $composer_code); $composer_code = str_replace('[/dslc_module]', '[/dslc_module_gen_css]', $composer_code); // Do CSS shortcode do_shortcode($composer_code); add_action('wp_footer', 'dslc_custom_css'); } if (is_front_page() && get_option('page_on_front', 0) == 0) { // dslc_dynamic_css_hook(); } }
/** * "st" in function names stands for "single template", that's what the functions are related to */ function dslc_st_init() { $capability = dslc_get_option('lc_min_capability_page', 'dslc_plugin_options_access_control'); if (!$capability) { $capability = 'publish_posts'; } register_post_type('dslc_templates', array('menu_icon' => 'dashicons-admin-page', 'labels' => array('name' => __('Templates', 'dslc_string'), 'singular_name' => __('Template', 'dslc_string'), 'add_new' => __('Add Template', 'dslc_string'), 'add_new_item' => __('Add Template', 'dslc_string'), 'edit' => __('Edit', 'dslc_string'), 'edit_item' => __('Edit Template', 'dslc_string'), 'new_item' => __('New Template', 'dslc_string'), 'view' => __('View Templates', 'dslc_string'), 'view_item' => __('View Template', 'dslc_string'), 'search_items' => __('Search Templates', 'dslc_string'), 'not_found' => __('No Templates found', 'dslc_string'), 'not_found_in_trash' => __('No Templates found in Trash', 'dslc_string'), 'parent' => __('Parent Template', 'dslc_string')), 'public' => true, 'supports' => array('title', 'custom-fields', 'thumbnail'), 'capabilities' => array('publish_posts' => $capability, 'edit_posts' => $capability, 'edit_others_posts' => $capability, 'delete_posts' => $capability, 'delete_others_posts' => $capability, 'read_private_posts' => $capability, 'edit_post' => $capability, 'delete_post' => $capability, 'read_post' => $capability))); global $dslc_var_post_options; // Generate the choices global $dslc_var_templates_pt; $pt_choices = array(); foreach ($dslc_var_templates_pt as $pt_id => $pt_label) { $pt_choices[] = array('label' => $pt_label, 'value' => $pt_id); } $dslc_var_post_options['dslc-templates-opts'] = array('title' => 'Template Options', 'show_on' => 'dslc_templates', 'options' => array(array('label' => __('Post Type', 'dslc_string'), 'descr' => __('Which post type is this template for?', 'dslc_string'), 'std' => '', 'id' => 'dslc_template_for', 'type' => 'select', 'choices' => $pt_choices), array('label' => __('Base', 'dslc_string'), 'descr' => __('If set to <strong>theme template</strong> the template will be appeneded to the regular single post template ( ex. If the theme shows thumbnail and title in it\'s template they will still be there ). If set to <strong>plugin template</strong> everything will be stripped and only the content from this template shown.', 'dslc_string'), 'std' => 'theme', 'id' => 'dslc_template_base', 'type' => 'select', 'choices' => array(array('label' => 'Theme Template', 'value' => 'theme'), array('label' => 'Custom Template', 'value' => 'custom'))), array('label' => __('Type', 'dslc_string'), 'std' => 'regular', 'descr' => __('<strong>Default</strong> template will be used as the default for all the posts. <strong>Regular</strong> template is an additional template that you can set to specific posts.', 'dslc_string'), 'id' => 'dslc_template_type', 'type' => 'radio', 'choices' => array(array('label' => 'Regular', 'value' => 'regular'), array('label' => 'Default', 'value' => 'default'))))); }
/** * Display modal for the tutorial * * @since 1.0 */ function dslc_tut_modal() { $tut_ch_one = dslc_get_option('lc_tut_chapter_one', 'dslc_plugin_options_tuts'); $tut_ch_two = dslc_get_option('lc_tut_chapter_two', 'dslc_plugin_options_tuts'); $tut_ch_three = dslc_get_option('lc_tut_chapter_three', 'dslc_plugin_options_tuts'); $tut_ch_four = dslc_get_option('lc_tut_chapter_four', 'dslc_plugin_options_tuts'); $tut_ids = array($tut_ch_one, $tut_ch_two, $tut_ch_three, $tut_ch_four); if (is_singular() && isset($_GET['dslc']) && $_GET['dslc'] == 'active' && in_array(get_the_ID(), $tut_ids)) { $tut_ch_two_link = add_query_arg(array('dslc' => 'active'), get_permalink($tut_ch_two)); $tut_ch_three_link = add_query_arg(array('dslc' => 'active'), get_permalink($tut_ch_three)); $tut_ch_four_link = add_query_arg(array('dslc' => 'active'), get_permalink($tut_ch_four)); ?> <input type="hidden" name="dslc_tut_settings" id="dslc_tut_settings" data-post-id="<?php echo get_the_ID(); ?> " /> <input type="hidden" name="dslc_tut_ch_one" id="dslc_tut_ch_one" data-post-id="<?php echo $tut_ch_one; ?> " /> <input type="hidden" name="dslc_tut_ch_two" id="dslc_tut_ch_two" data-post-id="<?php echo $tut_ch_two; ?> " /> <input type="hidden" name="dslc_tut_ch_three" id="dslc_tut_ch_three" data-post-id="<?php echo $tut_ch_three; ?> " /> <input type="hidden" name="dslc_tut_ch_four" id="dslc_tut_ch_four" data-post-id="<?php echo $tut_ch_four; ?> " /> <input type="hidden" name="dslc_tut_ch_two_link" id="dslc_tut_ch_two_link" data-url="<?php echo $tut_ch_two_link; ?> " /> <input type="hidden" name="dslc_tut_ch_three_link" id="dslc_tut_ch_three_link" data-url="<?php echo $tut_ch_three_link; ?> " /> <input type="hidden" name="dslc_tut_ch_four_link" id="dslc_tut_ch_four_link" data-url="<?php echo $tut_ch_four_link; ?> " /> <?php } }
/** * Apply per page content width * * @since 1.0 */ function sklc_ppcw_apply($lc_width) { // Post types that support templates global $dslc_post_types; $new_width = $lc_width; $post_ID = false; // If single, load template if (is_singular($dslc_post_types)) { $post_ID = dslc_st_get_template_ID(get_the_ID()); } // If archive, load template if (is_archive() && !is_author() && !is_search()) { $post_ID = dslc_get_option(get_post_type(), 'dslc_plugin_options_archives'); } // If author archives if (is_author()) { $post_ID = dslc_get_option('author', 'dslc_plugin_options_archives'); } // If search results page if (is_search()) { $post_ID = dslc_get_option('search_results', 'dslc_plugin_options_archives'); } // If 404 page if (is_404()) { $post_ID = dslc_get_option('404_page', 'dslc_plugin_options_archives'); } // If a page or post template if (is_singular(array('page', 'dslc_templates'))) { $post_ID = get_the_ID(); } // If we have a post ID if ($post_ID) { // Get custom width $custom_width = get_post_meta($post_ID, 'sklc_ppcw_content_width', true); // If custom width set if ($custom_width) { // Set new width $new_width = $custom_width; // If px or % not included add px if (strpos($new_width, 'px') === false && strpos($new_width, '%') === false) { $new_width = $new_width . 'px'; } } } return $new_width; }
function options() { $sidebars = dslc_get_option('sidebars', 'dslc_plugin_options_widgets_m'); $sidebars_choices = array(); $sidebars_choices[] = array('label' => __('Choose sidebar', 'live-composer-page-builder'), 'value' => 'not_set'); if ($sidebars !== '') { $sidebars_array = explode(',', substr($sidebars, 0, -1)); foreach ($sidebars_array as $sidebar) { $sidebar_ID = 'dslc_' . strtolower(str_replace(' ', '_', $sidebar)); $sidebars_choices[] = array('label' => $sidebar, 'value' => $sidebar_ID); } } $dslc_options = array(array('label' => __('Show On', 'live-composer-page-builder'), 'id' => 'css_show_on', 'std' => 'desktop tablet phone', 'type' => 'checkbox', 'choices' => array(array('label' => __('Desktop', 'live-composer-page-builder'), 'value' => 'desktop'), array('label' => __('Tablet', 'live-composer-page-builder'), 'value' => 'tablet'), array('label' => __('Phone', 'live-composer-page-builder'), 'value' => 'phone'))), array('label' => __('Widgets', 'live-composer-page-builder'), 'id' => 'sidebar', 'std' => 'not_set', 'type' => 'select', 'choices' => $sidebars_choices, 'help' => __('You can register sidebars for this module in <br>WP Admin > Live Composer > Widgets Module.', 'live-composer-page-builder')), array('label' => __('Widgets Per Row', 'live-composer-page-builder'), 'id' => 'columns', 'std' => '3', 'type' => 'select', 'choices' => $this->shared_options('posts_per_row_choices')), array('label' => __('BG Color', 'live-composer-page-builder'), 'id' => 'css_widgets_bg_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'background-color', 'section' => 'styling'), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_widgets_border_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'border-color', 'section' => 'styling'), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_widgets_border_width', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Borders', 'live-composer-page-builder'), 'id' => 'css_widgets_border_trbl', 'std' => 'top right bottom left', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'border-style', 'section' => 'styling'), array('label' => __('Border Radius - Top', 'live-composer-page-builder'), 'id' => 'css_widgets_border_radius_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'border-top-left-radius,border-top-right-radius', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Border Radius - Bottom', 'live-composer-page-builder'), 'id' => 'css_widgets_border_radius_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'border-bottom-left-radius,border-bottom-right-radius', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Margin Left', 'live-composer-page-builder'), 'id' => 'css_margin_left', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'margin-left', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_margin_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Minimum Height', 'live-composer-page-builder'), 'id' => 'css_min_height', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'min-height', 'section' => 'styling', 'ext' => 'px', 'min' => 0, 'max' => 1000, 'increment' => 5), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_widgets_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'ext' => 'px'), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_widgets_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px'), array('label' => __('BG Color', 'live-composer-page-builder'), 'id' => 'css_widget_bg_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_widget_border_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_widget_border_width', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Borders', 'live-composer-page-builder'), 'id' => 'css_widget_border_trbl', 'std' => 'top right bottom left', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'border-style', 'section' => 'styling', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Border Radius - Top', 'live-composer-page-builder'), 'id' => 'css_widget_border_radius_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'border-top-left-radius,border-top-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Border Radius - Bottom', 'live-composer-page-builder'), 'id' => 'css_widget_border_radius_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'border-bottom-left-radius,border-bottom-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_widget_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'ext' => 'px', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_widget_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Spacing', 'live-composer-page-builder'), 'id' => 'css_widget_margin_bottom', 'std' => '30', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'styling', 'ext' => 'px', 'tab' => __('widget', 'live-composer-page-builder')), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_title_border_color', 'std' => '#e5e5e5', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'border-bottom-color', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder')), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_title_border_width', 'std' => '1', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'border-bottom-width', 'section' => 'styling', 'ext' => 'px', 'tab' => __('Title', 'live-composer-page-builder')), array('label' => __('Color', 'live-composer-page-builder'), 'id' => 'css_title_color', 'std' => '#222222', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder')), array('label' => __('Font Size', 'live-composer-page-builder'), 'id' => 'title_font_size', 'std' => '15', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'font-size', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Font Weight', 'live-composer-page-builder'), 'id' => 'css_title_font_weight', 'std' => '600', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'font-weight', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder'), 'ext' => '', 'min' => 100, 'max' => 900, 'increment' => 100), array('label' => __('Font Family', 'live-composer-page-builder'), 'id' => 'css_title_font_family', 'std' => 'Open Sans', 'type' => 'font', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'font-family', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder')), array('label' => __('Letter Spacing', 'live-composer-page-builder'), 'id' => 'css_title_letter_spacing', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'letter-spacing', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder'), 'ext' => 'px', 'min' => -50, 'max' => 50), array('label' => __('Line Height', 'live-composer-page-builder'), 'id' => 'css_title_line_height', 'std' => '15', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'line-height', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_title_margin', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Bottom', 'live-composer-page-builder'), 'id' => 'css_title_padding', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'padding-bottom', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Text Align', 'live-composer-page-builder'), 'id' => 'css_title_text_align', 'std' => 'left', 'type' => 'text_align', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'text-align', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder')), array('label' => __('Text Transform', 'live-composer-page-builder'), 'id' => 'css_title_text_transform', 'std' => 'none', 'type' => 'select', 'choices' => array(array('label' => __('None', 'live-composer-page-builder'), 'value' => 'none'), array('label' => __('Capitalize', 'live-composer-page-builder'), 'value' => 'capitalize'), array('label' => __('Uppercase', 'live-composer-page-builder'), 'value' => 'uppercase'), array('label' => __('Lowercase', 'live-composer-page-builder'), 'value' => 'lowercase')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'text-transform', 'section' => 'styling', 'tab' => __('Title', 'live-composer-page-builder')), array('label' => __('BG Color', 'live-composer-page-builder'), 'id' => 'css_title_inner_bg_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Border Color', 'live-composer-page-builder'), 'id' => 'css_title_inner_border_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Border Width', 'live-composer-page-builder'), 'id' => 'css_title_inner_border_width', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Borders', 'live-composer-page-builder'), 'id' => 'css_title_inner_border_trbl', 'std' => 'top right bottom left', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'border-style', 'section' => 'styling', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Border Radius - Top', 'live-composer-page-builder'), 'id' => 'css_title_inner_border_radius_top', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'border-top-left-radius,border-top-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Border Radius - Bottom', 'live-composer-page-builder'), 'id' => 'css_title_inner_border_radius_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'border-bottom-left-radius,border-bottom-right-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_title_inner_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'ext' => 'px', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_title_inner_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title-inner', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px', 'tab' => __('title inner', 'live-composer-page-builder')), array('label' => __('Color', 'live-composer-page-builder'), 'id' => 'css_main_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder')), array('label' => __('Font Size', 'live-composer-page-builder'), 'id' => 'css_main_font_size', 'std' => '13', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'font-size', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Font Weight', 'live-composer-page-builder'), 'id' => 'css_main_font_weight', 'std' => '400', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'font-weight', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder'), 'ext' => '', 'min' => 100, 'max' => 900, 'increment' => 100), array('label' => __('Font Family', 'live-composer-page-builder'), 'id' => 'css_main_font_family', 'std' => 'Open Sans', 'type' => 'font', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'font-family', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder')), array('label' => __('Line Height', 'live-composer-page-builder'), 'id' => 'css_main_line_height', 'std' => '22', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'line-height', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Link - Color', 'live-composer-page-builder'), 'id' => 'css_link_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget a', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder')), array('label' => __('Link - Hover - Color', 'live-composer-page-builder'), 'id' => 'css_link_color_hover', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget a:hover', 'affect_on_change_rule' => 'color', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder')), array('label' => __('Link - Font Weight', 'live-composer-page-builder'), 'id' => 'css_link_font_weight', 'std' => '400', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget a', 'affect_on_change_rule' => 'font-weight', 'section' => 'styling', 'tab' => __('content', 'live-composer-page-builder'), 'ext' => '', 'min' => 100, 'max' => 900, 'increment' => 100), array('label' => __('Text Align', 'live-composer-page-builder'), 'id' => 'css_main_text_align', 'std' => 'left', 'type' => 'text_align', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'text-align', 'section' => 'styling', 'tab' => __('Content', 'live-composer-page-builder')), array('label' => __('Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_ul_margin_bottom', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Margin Left', 'live-composer-page-builder'), 'id' => 'css_ul_margin_left', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul', 'affect_on_change_rule' => 'margin-left', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_ul_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_ul_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px', 'tab' => __('content lists', 'live-composer-page-builder')), array('label' => __('Style', 'live-composer-page-builder'), 'id' => 'css_ul_style', 'std' => 'disc', 'type' => 'select', 'choices' => array(array('label' => __('Armenian', 'live-composer-page-builder'), 'value' => 'armenian'), array('label' => __('Circle', 'live-composer-page-builder'), 'value' => 'circle'), array('label' => __('cjk-ideographic', 'live-composer-page-builder'), 'value' => 'cjk-ideographic'), array('label' => __('Decimal', 'live-composer-page-builder'), 'value' => 'decimal'), array('label' => __('Decimal Leading Zero', 'live-composer-page-builder'), 'value' => 'decimal-leading-zero'), array('label' => __('Hebrew', 'live-composer-page-builder'), 'value' => 'hebrew'), array('label' => __('Hiragana', 'live-composer-page-builder'), 'value' => 'hiragana'), array('label' => __('Hiragana Iroha', 'live-composer-page-builder'), 'value' => 'hiragana-iroha'), array('label' => __('Katakana', 'live-composer-page-builder'), 'value' => 'katakana'), array('label' => __('Katakana Iroha', 'live-composer-page-builder'), 'value' => 'katakana-iroha'), array('label' => __('Lower Alpha', 'live-composer-page-builder'), 'value' => 'lower-alpha'), array('label' => __('Lower Greek', 'live-composer-page-builder'), 'value' => 'lower-greek'), array('label' => __('Lower Latin', 'live-composer-page-builder'), 'value' => 'lower-latin'), array('label' => __('Lower Roman', 'live-composer-page-builder'), 'value' => 'lower-roman'), array('label' => __('None', 'live-composer-page-builder'), 'value' => 'none'), array('label' => __('Upper Alpha', 'live-composer-page-builder'), 'value' => 'upper-alpha'), array('label' => __('Upper Latin', 'live-composer-page-builder'), 'value' => 'upper-latin'), array('label' => __('Upper Roman', 'live-composer-page-builder'), 'value' => 'upper-roman'), array('label' => __('Inherit', 'live-composer-page-builder'), 'value' => 'inherit')), 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder'), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul', 'affect_on_change_rule' => 'list-style-type'), array('label' => __('Item - BG Color', 'live-composer-page-builder'), 'id' => 'css_ul_li_bg_color', 'std' => 'rgba( 255, 255, 255, 0 )', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget li', 'affect_on_change_rule' => 'background-color', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder')), array('label' => __('Item - Border Color', 'live-composer-page-builder'), 'id' => 'css_ul_li_border_color', 'std' => '', 'type' => 'color', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget li', 'affect_on_change_rule' => 'border-color', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder')), array('label' => __('Item - Border Width', 'live-composer-page-builder'), 'id' => 'css_ul_li_border_width', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget li', 'affect_on_change_rule' => 'border-width', 'section' => 'styling', 'ext' => 'px', 'tab' => __('content lists', 'live-composer-page-builder')), array('label' => __('Item - Borders', 'live-composer-page-builder'), 'id' => 'css_ul_li_borders', 'std' => 'top right bottom left', 'type' => 'checkbox', 'choices' => array(array('label' => __('Top', 'live-composer-page-builder'), 'value' => 'top'), array('label' => __('Right', 'live-composer-page-builder'), 'value' => 'right'), array('label' => __('Bottom', 'live-composer-page-builder'), 'value' => 'bottom'), array('label' => __('Left', 'live-composer-page-builder'), 'value' => 'left')), 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget li', 'affect_on_change_rule' => 'border-style', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder')), array('label' => __('Item - Border Radius', 'live-composer-page-builder'), 'id' => 'css_ul_li_bradius', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget li', 'affect_on_change_rule' => 'border-radius', 'section' => 'styling', 'ext' => 'px', 'tab' => __('content lists', 'live-composer-page-builder')), array('label' => __('Item - Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_ul_li_margin_bottom', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul li', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Item - Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_ul_li_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul li', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'styling', 'tab' => __('content lists', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Item - Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_ul_li_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget ul li', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'styling', 'ext' => 'px', 'tab' => __('content lists', 'live-composer-page-builder')), array('label' => __('Responsive Styling', 'live-composer-page-builder'), 'id' => 'css_res_t', 'std' => 'disabled', 'type' => 'select', 'choices' => array(array('label' => __('Disabled', 'live-composer-page-builder'), 'value' => 'disabled'), array('label' => __('Enabled', 'live-composer-page-builder'), 'value' => 'enabled')), 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder')), array('label' => __('Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_res_t_margin_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_res_t_widgets_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_res_t_widgets_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Widget - Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_res_t_widget_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Widget - Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_res_t_widget_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Font Size', 'live-composer-page-builder'), 'id' => 'css_res_t_title_font_size', 'std' => '15', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'font-size', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Line Height', 'live-composer-page-builder'), 'id' => 'css_res_t_title_line_height', 'std' => '15', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'line-height', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_res_t_title_margin', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Padding Bottom', 'live-composer-page-builder'), 'id' => 'css_res_t_title_padding', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'padding-bottom', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Content - Font Size', 'live-composer-page-builder'), 'id' => 'css_res_t_main_font_size', 'std' => '13', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'font-size', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Content - Line Height', 'live-composer-page-builder'), 'id' => 'css_res_t_main_line_height', 'std' => '22', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'line-height', 'section' => 'responsive', 'tab' => __('tablet', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Responsive Styling', 'live-composer-page-builder'), 'id' => 'css_res_p', 'std' => 'disabled', 'type' => 'select', 'choices' => array(array('label' => __('Disabled', 'live-composer-page-builder'), 'value' => 'disabled'), array('label' => __('Enabled', 'live-composer-page-builder'), 'value' => 'enabled')), 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder')), array('label' => __('Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_res_p_margin_bottom', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_res_p_widgets_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_res_p_widgets_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widgets-wrap', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Widget - Padding Vertical', 'live-composer-page-builder'), 'id' => 'css_res_p_widget_padding_vertical', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'padding-top,padding-bottom', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Widget - Padding Horizontal', 'live-composer-page-builder'), 'id' => 'css_res_p_widget_padding_horizontal', 'std' => '0', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-wrap', 'affect_on_change_rule' => 'padding-left,padding-right', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Font Size', 'live-composer-page-builder'), 'id' => 'css_res_p_title_font_size', 'std' => '15', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'font-size', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Line Height', 'live-composer-page-builder'), 'id' => 'css_res_p_title_line_height', 'std' => '15', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'line-height', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Margin Bottom', 'live-composer-page-builder'), 'id' => 'css_res_p_title_margin', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'margin-bottom', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Title - Padding Bottom', 'live-composer-page-builder'), 'id' => 'css_res_p_title_padding', 'std' => '10', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget-title', 'affect_on_change_rule' => 'padding-bottom', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Content - Font Size', 'live-composer-page-builder'), 'id' => 'css_res_p_main_font_size', 'std' => '13', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'font-size', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px'), array('label' => __('Content - Line Height', 'live-composer-page-builder'), 'id' => 'css_res_p_main_line_height', 'std' => '22', 'type' => 'slider', 'refresh_on_change' => false, 'affect_on_change_el' => '.dslc-widget', 'affect_on_change_rule' => 'line-height', 'section' => 'responsive', 'tab' => __('phone', 'live-composer-page-builder'), 'ext' => 'px')); $dslc_options = array_merge($dslc_options, $this->shared_options('animation_options', array('hover_opts' => false))); $dslc_options = array_merge($dslc_options, $this->presets_options()); return apply_filters('dslc_module_options', $dslc_options, $this->module_id); }
/** * Register Post Types and Taxonomies * * @since 1.0 */ function dslc_partners_module_cpt() { // If module not active return if (!dslc_is_module_active('DSLC_Partners', true)) { return; } // Get capability $capability = dslc_get_option('lc_min_capability_partners_m', 'dslc_plugin_options_access_control'); if (!$capability) { $capability = 'publish_posts'; } // With Front $with_front = dslc_get_option('with_front', 'dslc_plugin_options_cpt_slugs'); if (empty($with_front)) { $with_front = 'disabled'; } if ($with_front == 'enabled') { $with_front = true; } else { $with_front = false; } /** * Register Post Type */ // Arguments $cpt_args = array('menu_icon' => 'dashicons-groups', 'labels' => array('name' => __('Partners', 'live-composer-page-builder'), 'singular_name' => __('Partner', 'live-composer-page-builder'), 'add_new' => __('Add Partner', 'live-composer-page-builder'), 'add_new_item' => __('Add Partner', 'live-composer-page-builder'), 'edit' => __('Edit', 'live-composer-page-builder'), 'edit_item' => __('Edit Partner', 'live-composer-page-builder'), 'new_item' => __('New Partner', 'live-composer-page-builder'), 'view' => __('View Partner', 'live-composer-page-builder'), 'view_item' => __('View Partner', 'live-composer-page-builder'), 'search_items' => __('Search Partner', 'live-composer-page-builder'), 'not_found' => __('No Partner found', 'live-composer-page-builder'), 'not_found_in_trash' => __('No Partner found in Trash', 'live-composer-page-builder'), 'parent' => __('Parent Partner', 'live-composer-page-builder')), 'public' => true, 'rewrite' => array('slug' => dslc_get_option('partners_slug', 'dslc_plugin_options_cpt_slugs'), 'with_front' => $with_front), 'supports' => array('title', 'custom-fields', 'excerpt', 'editor', 'author', 'thumbnail', 'comments'), 'capabilities' => array('publish_posts' => $capability, 'edit_posts' => $capability, 'edit_others_posts' => $capability, 'delete_posts' => $capability, 'delete_others_posts' => $capability, 'read_private_posts' => $capability, 'edit_post' => $capability, 'delete_post' => $capability, 'read_post' => $capability)); // Apply filters $cpt_args = apply_filters('dslc_partners_cpt_args', $cpt_args); // Register post type register_post_type('dslc_partners', $cpt_args); /** * Register Taxonomy ( Category ) */ // Arguments $cats_args = array('labels' => array('name' => __('Partners Categories', 'live-composer-page-builder'), 'singular_name' => __('Category', 'live-composer-page-builder'), 'search_items' => __('Search Categories', 'live-composer-page-builder'), 'all_items' => __('All Categories', 'live-composer-page-builder'), 'parent_item' => __('Parent Category', 'live-composer-page-builder'), 'parent_item_colon' => __('Parent Category:', 'live-composer-page-builder'), 'edit_item' => __('Edit Category', 'live-composer-page-builder'), 'update_item' => __('Update Category', 'live-composer-page-builder'), 'add_new_item' => __('Add New Category', 'live-composer-page-builder'), 'new_item_name' => __('New Category Name', 'live-composer-page-builder'), 'menu_name' => __('Categories', 'live-composer-page-builder')), 'hierarchical' => true, 'public' => true, 'rewrite' => array('slug' => dslc_get_option('partners_cats_slug', 'dslc_plugin_options_cpt_slugs'), 'with_front' => $with_front)); // Apply filters $cats_args = apply_filters('dslc_partners_cats_args', $cats_args); // Register taxonomy register_taxonomy('dslc_partners_cats', 'dslc_partners', $cats_args); }
function dslc_timeline_module_cpt() { if (!dslc_is_module_active('AS_Timeline', true)) { return; } $capability = dslc_get_option('lc_min_capability_timeline_m', 'dslc_plugin_options_access_control'); if (!$capability) { $capability = 'publish_posts'; } // With Front $with_front = dslc_get_option('with_front', 'dslc_plugin_options_cpt_slugs'); if (empty($with_front)) { $with_front = 'disabled'; } if ($with_front == 'enabled') { $with_front = true; } else { $with_front = false; } register_post_type('dslc_timeline', array('menu_icon' => 'dashicons-feedback', 'labels' => array('name' => __('Timeline', 'dslc_string'), 'singular_name' => __('Timeline', 'dslc_string'), 'add_new' => __('Add Timeline', 'dslc_string'), 'add_new_item' => __('Add Timeline', 'dslc_string'), 'edit' => __('Edit', 'dslc_string'), 'edit_item' => __('Edit Timeline', 'dslc_string'), 'new_item' => __('New Timeline', 'dslc_string'), 'view' => __('View Timeline', 'dslc_string'), 'view_item' => __('View Timeline', 'dslc_string'), 'search_items' => __('Search Timeline', 'dslc_string'), 'not_found' => __('No Timeline found', 'dslc_string'), 'not_found_in_trash' => __('No Timeline found in Trash', 'dslc_string'), 'parent' => __('Parent Timeline', 'dslc_string')), 'public' => true, 'rewrite' => array('slug' => dslc_get_option('timeline_slug', 'dslc_plugin_options_cpt_slugs'), 'with_front' => $with_front), 'supports' => array('title', 'custom-fields', 'excerpt', 'editor', 'author', 'thumbnail', 'comments'), 'capabilities' => array('publish_posts' => $capability, 'edit_posts' => $capability, 'edit_others_posts' => $capability, 'delete_posts' => $capability, 'delete_others_posts' => $capability, 'read_private_posts' => $capability, 'edit_post' => $capability, 'delete_post' => $capability, 'read_post' => $capability))); register_taxonomy('dslc_timeline_cats', 'dslc_timeline', array('labels' => array('name' => __('Timeline Categories', 'dslc_string'), 'singular_name' => __('Category', 'dslc_string'), 'search_items' => __('Search Categories', 'dslc_string'), 'all_items' => __('All Categories', 'dslc_string'), 'parent_item' => __('Parent Category', 'dslc_string'), 'parent_item_colon' => __('Parent Category:', 'dslc_string'), 'edit_item' => __('Edit Category', 'dslc_string'), 'update_item' => __('Update Category', 'dslc_string'), 'add_new_item' => __('Add New Category', 'dslc_string'), 'new_item_name' => __('New Category Name', 'dslc_string'), 'menu_name' => __('Categories', 'dslc_string')), 'hierarchical' => true, 'public' => true, 'rewrite' => array('slug' => dslc_get_option('timeline_cats_slug', 'dslc_plugin_options_cpt_slugs'), 'with_front' => $with_front), 'capabilities' => array('manage_terms' => $capability, 'edit_terms' => $capability, 'delete_terms' => $capability, 'assign_terms' => $capability))); }
/** * Check if module is active */ function dslc_is_module_active($module_id, $check_registered = false) { global $dslc_var_modules; if ('disabled' === dslc_get_option($module_id, 'dslc_plugin_options_features')) { return false; } elseif (true === $check_registered && !isset($dslc_var_modules[$module_id])) { return false; } else { return true; } }
include DS_LIVE_COMPOSER_ABS . '/includes/ajax.php'; include DS_LIVE_COMPOSER_ABS . '/includes/shortcodes.php'; include DS_LIVE_COMPOSER_ABS . '/includes/scripts.php'; include DS_LIVE_COMPOSER_ABS . '/includes/post-options-framework/post-options-framework.php'; include DS_LIVE_COMPOSER_ABS . '/includes/plugin-options-framework/plugin-options-framework.php'; include DSLC_ST_FRAMEWORK_ABS . '/single-templates-framework.php'; include DS_LIVE_COMPOSER_ABS . '/includes/access-control.php'; include DS_LIVE_COMPOSER_ABS . '/includes/performance.php'; include DS_LIVE_COMPOSER_ABS . '/includes/archive-templates.php'; include DS_LIVE_COMPOSER_ABS . '/includes/tutorials/tutorial.php'; include DS_LIVE_COMPOSER_ABS . '/includes/styling-presets.php'; include DS_LIVE_COMPOSER_ABS . '/includes/header-footer.php'; include DS_LIVE_COMPOSER_ABS . '/includes/search-filter.php'; include DS_LIVE_COMPOSER_ABS . '/includes/post-templates.php'; include DS_LIVE_COMPOSER_ABS . '/includes/other.php'; $cap_page = dslc_get_option('lc_min_capability_page', 'dslc_plugin_options_access_control'); if (!$cap_page) { $cap_page = 'publish_posts'; } define('DS_LIVE_COMPOSER_CAPABILITY', $cap_page); define('DS_LIVE_COMPOSER_CAPABILITY_SAVE', $cap_page); /** * Include Modules */ include DS_LIVE_COMPOSER_ABS . '/includes/class.module.php'; include DS_LIVE_COMPOSER_ABS . '/modules/posts/module.php'; include DS_LIVE_COMPOSER_ABS . '/modules/blog/module.php'; include DS_LIVE_COMPOSER_ABS . '/modules/projects/module.php'; include DS_LIVE_COMPOSER_ABS . '/modules/galleries/module.php'; include DS_LIVE_COMPOSER_ABS . '/modules/infobox/module.php'; include DS_LIVE_COMPOSER_ABS . '/modules/staff/module.php';
function dslc_dynamic_css_hook() { $dynamic_css_location = dslc_get_option('lc_css_position', 'dslc_plugin_options'); if (!$dynamic_css_location) { $dynamic_css_location = 'head'; } if ($dynamic_css_location == 'head') { add_action('wp_head', 'dslc_custom_css'); } else { add_action('wp_footer', 'dslc_custom_css'); } }
/** * Display module options * * @since 1.0 */ function dslc_ajax_display_module_options($atts) { // Allowed to do this? if (is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) { // The array we'll pass back to the AJAX call $response = array(); // This will hold the output $response['output'] = ''; $response['output_tabs'] = ''; // The ID of the module $module_id = $_POST['dslc_module_id']; // Instanciate the module class $module_instance = new $module_id(); // Get the module options $module_options = $module_instance->options(); // Tabs $tabs = array(); ob_start(); // Go through each option, generate the option HTML and append to output foreach ($module_options as $module_option) { $curr_value = $module_option['std']; if (isset($_POST[$module_option['id']])) { $curr_value = $_POST[$module_option['id']]; } /** * Visibility */ if (isset($module_option['visibility'])) { $visibility = false; } else { $visibility = true; } if ($module_option['type'] == 'checkbox' && count($module_option['choices']) < 2) { $visibility = false; } /** * Refresh on change */ if (isset($module_option['refresh_on_change'])) { if ($module_option['refresh_on_change']) { $refresh_on_change = 'active'; } else { $refresh_on_change = 'inactive'; } } else { $refresh_on_change = 'active'; } // Force refresh on change for images ( due to the URL -> ID change ) if ($module_option['type'] == 'image') { $refresh_on_change = 'active'; } /** * Section (functionality and styling) */ if (isset($module_option['section'])) { $section = $module_option['section']; } else { $section = 'functionality'; } /** * Tab */ if (!isset($module_option['tab'])) { if ($section == 'functionality') { $tabs['general_functionality'] = array('title' => __('General', 'dslc_string'), 'id' => 'general_functionality', 'section' => 'functionality'); } else { $tabs['general_styling'] = array('title' => __('General', 'dslc_string'), 'id' => 'general_styling', 'section' => 'styling'); } $tab_ID = 'general_' . $section; } if (isset($module_option['tab'])) { // Lowercase it $tab_ID = strtolower($module_option['tab']); // Replace spaces with _ $tab_ID = str_replace(' ', '_', $tab_ID); // Add section ID append $tab_ID .= '_' . $section; // If not already in the tabs array if (!in_array($tab_ID, $tabs)) { // Add it to the tabs array $tabs[$tab_ID] = array('title' => $module_option['tab'], 'id' => $tab_ID, 'section' => $section); } } $ext = ' '; if (isset($module_option['ext'])) { $ext = $module_option['ext']; } $affect_on_change_append = ''; if (isset($module_option['affect_on_change_el']) && isset($module_option['affect_on_change_rule'])) { $affect_on_change_append = 'data-affect-on-change-el="' . $module_option['affect_on_change_el'] . '" data-affect-on-change-rule="' . $module_option['affect_on_change_rule'] . '"'; } ?> <div class="dslca-module-edit-option dslca-module-edit-option-<?php echo $module_option['type']; ?> dslca-module-edit-option-<?php echo $module_option['id']; ?> <?php if (!$visibility) { echo 'dslca-module-edit-option-hidden'; } ?> " data-id="<?php echo $module_option['id']; ?> " data-refresh-on-change="<?php echo $refresh_on_change; ?> " data-section="<?php echo $section; ?> " data-tab="<?php echo $tab_ID; ?> "> <?php if (isset($module_option['help'])) { ?> <div class="dslca-module-edit-field-ttip-content"><?php echo $module_option['help']; ?> </div> <?php } ?> <span class="dslca-module-edit-label"> <?php echo $module_option['label']; ?> <?php if ($module_option['type'] == 'icon') { ?> <span class="dslca-module-edit-field-icon-ttip-hook"><span class="dslca-icon dslc-icon-info"></span></span> <?php } ?> <?php if (isset($module_option['help'])) { ?> <span class="dslca-module-edit-field-ttip-hook"><span class="dslca-icon dslc-icon-info"></span></span> <?php } ?> </span> <?php if ($module_option['type'] == 'text') { ?> <input type="text" class="dslca-module-edit-field" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " data-starting-val="<?php echo $curr_value; ?> " <?php echo $affect_on_change_append; ?> /> <?php } elseif ($module_option['type'] == 'textarea') { ?> <textarea class="dslca-module-edit-field" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " <?php echo $affect_on_change_append; ?> ><?php echo stripslashes($curr_value); ?> </textarea> <?php } elseif ($module_option['type'] == 'select') { ?> <select class="dslca-module-edit-field" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " <?php echo $affect_on_change_append; ?> > <?php foreach ($module_option['choices'] as $select_option) { ?> <option value="<?php echo $select_option['value']; ?> " <?php if ($curr_value == $select_option['value']) { echo 'selected="selected"'; } ?> ><?php echo $select_option['label']; ?> </option> <?php } ?> </select> <?php } elseif ($module_option['type'] == 'checkbox') { ?> <?php // Current Value Array if (empty($curr_value)) { $curr_value = array(); } else { $curr_value = explode(' ', trim($curr_value)); } // Determined brakepoints $chck_amount = count($module_option['choices']); $chck_breakpoint = ceil($chck_amount / 1); $chck_count = 0; ?> <div class="dslca-module-edit-option-checkbox-wrapper"> <?php foreach ($module_option['choices'] as $checkbox_option) { $chck_count++; ?> <div class="dslca-module-edit-option-checkbox-single"> <span class="dslca-module-edit-option-checkbox-hook"><span class="dslca-icon <?php if (in_array($checkbox_option['value'], $curr_value)) { echo 'dslc-icon-check'; } else { echo 'dslc-icon-check-empty'; } ?> "></span><?php echo $checkbox_option['label']; ?> </span> <input type="checkbox" class="dslca-module-edit-field dslca-module-edit-field-checkbox" data-id="<?php echo $module_option['id']; ?> " name="<?php echo $module_option['id']; ?> " value="<?php echo $checkbox_option['value']; ?> " <?php if (in_array($checkbox_option['value'], $curr_value)) { echo 'checked="checked"'; } ?> <?php echo $affect_on_change_append; ?> /> </div><!-- .dslca-module-edit-option-checkbox-single --> <?php if ($chck_count == $chck_breakpoint) { echo '<br>'; $chck_count = 0; } ?> <?php } ?> </div><!-- .dslca-module-edit-option-checkbox-wrapper --> <?php } elseif ($module_option['type'] == 'radio') { ?> <div class="dslca-module-edit-option-radio-wrapper"> <?php foreach ($module_option['choices'] as $checkbox_option) { ?> <div class="dslca-module-edit-option-radio-single"> <input type="radio" class="dslca-module-edit-field" data-id="<?php echo $module_option['id']; ?> " name="<?php echo $module_option['id']; ?> " value="<?php echo $checkbox_option['value']; ?> " /> <?php echo $checkbox_option['label']; ?> <br> </div><!-- .dslca-module-edit-option-radio-single --> <?php } ?> </div><!-- .dslca-module-edit-option-radio-wrapper --> <?php } elseif ($module_option['type'] == 'color') { ?> <?php $default_value = false; if (isset($module_option['std'])) { $default_value = $module_option['std']; } ?> <input type="text" class="dslca-module-edit-field dslca-module-edit-field-colorpicker" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " data-affect-on-change-el="<?php echo $module_option['affect_on_change_el']; ?> " data-affect-on-change-rule="<?php echo $module_option['affect_on_change_rule']; ?> " <?php if ($default_value) { ?> data-default="<?php echo $default_value; ?> " <?php } ?> /> <?php } elseif ($module_option['type'] == 'slider') { ?> <?php $slider_min = 0; $slider_max = 100; $slider_increment = 1; if (isset($module_option['min'])) { $slider_min = $module_option['min']; } if (isset($module_option['max'])) { $slider_max = $module_option['max']; } if (isset($module_option['increment'])) { $slider_increment = $module_option['increment']; } $numeric_option_type = dslc_get_option('lc_numeric_opt_type', 'dslc_plugin_options_other'); if (empty($numeric_option_type)) { $numeric_option_type = 'slider'; } ?> <?php if ($numeric_option_type == 'slider') { ?> <div class="dslca-module-edit-field-slider"></div> <span class="dslca-module-edit-field-slider-tooltip"><?php echo $curr_value; ?> </span> <input type="hidden" class="dslca-module-edit-field" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " data-affect-on-change-el="<?php echo $module_option['affect_on_change_el']; ?> " data-affect-on-change-rule="<?php echo $module_option['affect_on_change_rule']; ?> " data-min="<?php echo $slider_min; ?> " data-max="<?php echo $slider_max; ?> " data-ext="<?php echo $ext; ?> " data-increment="<?php echo $slider_increment; ?> " /> <?php } else { ?> <div class="dslca-module-edit-field-numeric-wrap"> <input type="text" class="dslca-module-edit-field dslca-module-edit-field-numeric" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " data-starting-val="<?php echo $curr_value; ?> " data-ext="<?php echo $ext; ?> " <?php echo $affect_on_change_append; ?> /> <span class="dslca-module-edit-field-numeric-ext"><?php echo $module_option['ext']; ?> </span> </div> <?php } ?> <?php } elseif ($module_option['type'] == 'font') { ?> <div class="dslca-module-edit-field-font-wrapper"> <input type="text" class="dslca-module-edit-field dslca-module-edit-field-font" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " <?php echo $affect_on_change_append; ?> /> <span class="dslca-module-edit-field-font-suggest"></span> </div> <span class="dslca-module-edit-field-font-prev"><span class="dslca-icon dslc-icon-chevron-left"></span></span> <span class="dslca-module-edit-field-font-next"><span class="dslca-icon dslc-icon-chevron-right"></span></span> <?php } elseif ($module_option['type'] == 'icon') { ?> <div class="dslca-module-edit-field-icon-wrapper"> <input type="text" class="dslca-module-edit-field dslca-module-edit-field-icon" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " <?php echo $affect_on_change_append; ?> /> <span class="dslca-module-edit-field-icon-suggest"></span> </div> <span class="dslca-module-edit-field-icon-prev"><span class="dslca-icon dslc-icon-chevron-left"></span></span> <span class="dslca-module-edit-field-icon-next"><span class="dslca-icon dslc-icon-chevron-right"></span></span> <?php } elseif ($module_option['type'] == 'image') { ?> <span class="dslca-module-edit-field-image-add-hook" <?php if ($curr_value != '') { echo 'style="display: none;"'; } ?> ><span class="dslca-icon dslc-icon-cloud-upload"></span><?php _e('Upload Image', 'dslc_string'); ?> </span> <span class="dslca-module-edit-field-image-remove-hook" <?php if ($curr_value == '') { echo 'style="display: none;"'; } ?> ><span class="dslca-icon dslc-icon-remove"></span><?php _e('Remove Image', 'dslc_string'); ?> </span> <input type="hidden" class="dslca-module-edit-field dslca-module-edit-field-image" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " <?php echo $affect_on_change_append; ?> /> <?php } elseif ($module_option['type'] == 'text_align') { ?> <div class="dslca-module-edit-option-text-align-wrapper"> <div class="dslca-module-edit-option-text-align-single dslca-module-edit-option-text-align-hook <?php if ($curr_value == 'inherit') { echo 'dslca-active'; } ?> " data-val="inherit"> <span class="dslca-icon dslc-icon-remove"></span> </div> <div class="dslca-module-edit-option-text-align-single dslca-module-edit-option-text-align-hook <?php if ($curr_value == 'left') { echo 'dslca-active'; } ?> " data-val="left"> <span class="dslca-icon dslc-icon-align-left"></span> </div> <div class="dslca-module-edit-option-text-align-single dslca-module-edit-option-text-align-hook <?php if ($curr_value == 'center') { echo 'dslca-active'; } ?> " data-val="center"> <span class="dslca-icon dslc-icon-align-center"></span> </div> <div class="dslca-module-edit-option-text-align-single dslca-module-edit-option-text-align-hook <?php if ($curr_value == 'right') { echo 'dslca-active'; } ?> " data-val="right"> <span class="dslca-icon dslc-icon-align-right"></span> </div> <div class="dslca-module-edit-option-text-align-single dslca-module-edit-option-text-align-hook <?php if ($curr_value == 'justify') { echo 'dslca-active'; } ?> " data-val="justify"> <span class="dslca-icon dslc-icon-align-justify"></span> </div> </div> <input type="hidden" class="dslca-module-edit-field dslca-module-edit-field-text-align" name="<?php echo $module_option['id']; ?> " data-id="<?php echo $module_option['id']; ?> " value="<?php echo $curr_value; ?> " <?php echo $affect_on_change_append; ?> /> <?php } else { ?> <?php do_action('dslc_custom_option_type_' . $module_option['type'], $module_option, $curr_value, $affect_on_change_append); ?> <?php } ?> </div><!-- .dslc-module-edit-option --> <?php } $output_fields = ob_get_contents(); ob_end_clean(); // Output Start $output_start = '<div class="dslca-module-edit-options-wrapper dslc-clearfix">'; // Output End $output_end = '</div>'; // Output Tabs $output_tabs = ''; foreach ($tabs as $tab) { $output_tabs .= '<span class="dslca-module-edit-options-tab-hook" data-section="' . $tab['section'] . '" data-id="' . $tab['id'] . '">' . $tab['title'] . '</span>'; } // Combine output $response['output_tabs'] .= $output_tabs; $response['output'] .= $output_start; $response['output'] .= $output_fields; $response['output'] .= $output_end; // Encode response $response_json = json_encode($response); // Send the response header("Content-Type: application/json"); echo $response_json; // Auf wiedersehen exit; } }
/** * Fixes 404 on pagination caused when regular WP query has no more post * * @since 1.0 */ function dslc_archive_template_404_fix($query) { if ($query->is_author() && $query->is_archive() && $query->is_main_query()) { $template = dslc_get_option('author', 'dslc_plugin_options_archives'); if (!$template || $template == 'none') { /* nothing */ } else { $query->set('posts_per_page', 1); } } return $query; }
function lbmn_dslc_custom_css() { // use original 'dslc_custom_css()' for singular posts if (is_singular()) { return; } if (is_404() || is_archive() || is_search() || is_home()) { global $dslc_active; global $dslc_css_style; global $content_width; global $dslc_googlefonts_array; global $dslc_post_types; $composer_code = ''; $template_code = ''; $lc_width = dslc_get_option('lc_max_width', 'dslc_plugin_options'); if (empty($lc_width)) { $lc_width = $content_width . 'px'; } else { if (strpos($lc_width, 'px') === false && strpos($lc_width, '%') === false) { $lc_width = $lc_width . 'px'; } } // Get the service page (archive, 404, search results) template id // that is set by user using Theme Customizer ('System Page Templates') $template_post_id = ''; if (is_search()) { $template_post_id = get_theme_mod('lbmn_systempage_searchresults', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_SEARCHRESULTS_DEFAULT, 'lbmn_archive')); if (!have_posts()) { $template_post_id = get_theme_mod('lbmn_systempage_nosearchresults', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_NOSEARCHRESULTS_DEFAULT, 'lbmn_archive')); } } if (is_404()) { $template_post_id = get_theme_mod('lbmn_systempage_404', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_404_DEFAULT, 'lbmn_archive')); } if (is_archive()) { if (is_category()) { $template_post_id = get_theme_mod('lbmn_systempage_category', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_CATEGORY_DEFAULT, 'lbmn_archive')); } elseif (is_tag()) { $template_post_id = get_theme_mod('lbmn_systempage_tag', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_TAG_DEFAULT, 'lbmn_archive')); } elseif (is_date()) { $template_post_id = get_theme_mod('lbmn_systempage_date', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_DATE_DEFAULT, 'lbmn_archive')); } elseif (is_author()) { $template_post_id = get_theme_mod('lbmn_systempage_authors', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_AUTHORS_DEFAULT, 'lbmn_archive')); } } // if the current page is the blog home page if (is_home()) { // get 'dslc_code' from the blog home page $template_post_id = get_option('page_for_posts'); // if it's not available use template set for 'frontpage_posts' if (!get_post_meta($template_post_id, 'dslc_code', true)) { $template_post_id = get_theme_mod('lbmn_systempage_frontpage_posts', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_FRONTPAGE_POSTS_DEFAULT, 'lbmn_archive')); } } echo '<style type="text/css">'; // Get composer code // $post_id = get_the_ID(); $composer_code .= get_post_meta($template_post_id, 'dslc_code', true); // If composer not used on this page stop execution if ($composer_code) { // Replace shortcode names $composer_code = str_replace('dslc_modules_section', 'dslc_modules_section_gen_css', $composer_code); $composer_code = str_replace('dslc_modules_area', 'dslc_modules_area_gen_css', $composer_code); $composer_code = str_replace('[dslc_module]', '[dslc_module_gen_css]', $composer_code); $composer_code = str_replace('[/dslc_module]', '[/dslc_module_gen_css]', $composer_code); // Do CSS shortcode do_shortcode($composer_code); // Google Fonts Import $googlefonts_output = ''; foreach ($dslc_googlefonts_array as $googlefont) { $googlefont = str_replace(' ', '+', $googlefont); if ($googlefont != '') { $googlefonts_output .= '@import url("//fonts.googleapis.com/css?family=' . $googlefont . ':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext"); '; } } echo $googlefonts_output; } // Wrapper width echo '.dslc-modules-section-wrapper, .dslca-add-modules-section { width : ' . $lc_width . '; } '; // Echo CSS style if (!$dslc_active && $composer_code) { echo $dslc_css_style; } echo '</style>'; } }
<?php get_header(); ?> <?php $args = array('page_id' => dslc_get_option('404_page', 'dslc_plugin_options_archives'), 'post_type' => 'any', 'ignore_sticky_posts' => true); $adslc_query = new WP_Query($args); if ($adslc_query->have_posts()) { while ($adslc_query->have_posts()) { $adslc_query->the_post(); the_content(); } } wp_reset_query(); ?> <?php get_footer();
/** * Check if module is active */ function dslc_is_module_active($module_ID, $check_registered = false) { global $dslc_var_modules; if (dslc_get_option($module_ID, 'dslc_plugin_options_features') == 'disabled') { return false; } elseif ($check_registered == true && !isset($dslc_var_modules[$module_ID])) { return false; } else { return true; } }
function dslc_row_display_options() { // Global var containing options global $dslc_var_row_options; // If empty return if (empty($dslc_var_row_options)) { return; } foreach ($dslc_var_row_options as $row_option) { $css_rule_output = ''; if (isset($row_option['affect_on_change_rule'])) { $css_rule_output = 'data-css-rule="' . $row_option['affect_on_change_rule'] . '"'; } $css_element_output = ''; if (isset($row_option['affect_on_change_el'])) { $css_element_output = 'data-css-element="' . $row_option['affect_on_change_el'] . '"'; } $extra_class = ''; if ($row_option['type'] == 'image' || $row_option['type'] == 'video') { $extra_class = 'dslca-modules-section-edit-option-upload'; } if ($row_option['type'] == 'border_checkbox' || $row_option['type'] == 'checkbox') { $extra_class = 'dslca-modules-section-edit-option-checkbox'; } if (!isset($row_option['ext'])) { $row_option['ext'] = ''; } if (!isset($row_option['min'])) { $row_option['min'] = 0; } if (!isset($row_option['max'])) { $row_option['max'] = 100; } if (!isset($row_option['increment'])) { $row_option['increment'] = 1; } ?> <div class="dslca-modules-section-edit-option <?php echo $extra_class; ?> " data-id="<?php echo $row_option['id']; ?> "> <span class="dslca-modules-section-edit-label"><?php echo $row_option['label']; ?> </span> <?php if ($row_option['type'] == 'text') { ?> <input type="text" class="dslca-modules-section-edit-field" data-id="<?php echo $row_option['id']; ?> " <?php echo $css_element_output . ' ' . $css_rule_output; ?> /> <?php } elseif ($row_option['type'] == 'select') { ?> <select type="text" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-select" data-id="<?php echo $row_option['id']; ?> " <?php echo $css_element_output . ' ' . $css_rule_output; ?> > <?php foreach ($row_option['choices'] as $choice) { ?> <option value="<?php echo $choice['value']; ?> "><?php echo $choice['label']; ?> </option> <?php } ?> </select> <?php } elseif ($row_option['type'] == 'color') { ?> <input type="text" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-colorpicker" data-id="<?php echo $row_option['id']; ?> " <?php echo $css_element_output . ' ' . $css_rule_output; ?> /> <?php } elseif ($row_option['type'] == 'image') { ?> <span class="dslca-modules-section-edit-field-image-add-hook"><span class="dslca-icon dslc-icon-cloud-upload"></span><?php _e('Upload Image', 'live-composer-page-builder'); ?> </span> <span class="dslca-modules-section-edit-field-image-remove-hook"><span class="dslca-icon dslc-icon-remove"></span><?php _e('Remove Image', 'live-composer-page-builder'); ?> </span> <input type="hidden" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-upload" data-id="<?php echo $row_option['id']; ?> " <?php echo $css_element_output . ' ' . $css_rule_output; ?> /> <?php } elseif ($row_option['type'] == 'video') { ?> <span class="dslca-modules-section-edit-field-image-add-hook"><span class="dslca-icon dslc-icon-cloud-upload"></span><?php _e('Upload Video', 'live-composer-page-builder'); ?> </span> <span class="dslca-modules-section-edit-field-image-remove-hook"><span class="dslca-icon dslc-icon-remove"></span><?php _e('Remove Video', 'live-composer-page-builder'); ?> </span> <input type="hidden" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-upload" data-id="<?php echo $row_option['id']; ?> " <?php echo $css_element_output . ' ' . $css_rule_output; ?> /> <?php } elseif ($row_option['type'] == 'slider') { ?> <?php $numeric_option_type = dslc_get_option('lc_numeric_opt_type', 'dslc_plugin_options_other'); if (empty($numeric_option_type)) { $numeric_option_type = 'slider'; } ?> <?php if ($numeric_option_type == 'slider') { ?> <div class="dslca-modules-section-edit-field-slider" data-ext="<?php echo $row_option['ext']; ?> " data-min="<?php echo $row_option['min']; ?> " data-max="<?php echo $row_option['max']; ?> " data-incr="<?php echo $row_option['increment']; ?> "></div> <span class="dslca-modules-section-edit-field-slider-tooltip"></span> <input type="hidden" class="dslca-modules-section-edit-field" data-id="<?php echo $row_option['id']; ?> " <?php echo $css_element_output . ' ' . $css_rule_output; ?> /> <?php } else { ?> <div class="dslca-modules-section-edit-field-numeric-wrap"> <input type="text" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-numeric" data-id="<?php echo $row_option['id']; ?> " data-ext="<?php echo $row_option['ext']; ?> " <?php echo $css_element_output . ' ' . $css_rule_output; ?> /> <span class="dslca-modules-section-edit-field-numeric-ext"><?php echo $row_option['ext']; ?> </span> </div> <?php } ?> <?php } elseif ($row_option['type'] == 'border_checkbox') { ?> <div class="dslca-modules-section-edit-option-checkbox-wrapper"> <div class="dslca-modules-section-edit-option-checkbox-single"> <span class="dslca-modules-section-edit-option-checkbox-hook"><span class="dslca-icon dslc-icon-check-empty"></span><?php _e('Top', 'live-composer-page-builder'); ?> </span> <input type="checkbox" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-checkbox" data-id="border-top" data-css-rule="border-width"> </div> <div class="dslca-modules-section-edit-option-checkbox-single"> <span class="dslca-modules-section-edit-option-checkbox-hook"><span class="dslca-icon dslc-icon-check-empty"></span><?php _e('Right', 'live-composer-page-builder'); ?> </span> <input type="checkbox" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-checkbox" data-id="border-right" data-css-rule="border-width"> </div> <div class="dslca-modules-section-edit-option-checkbox-single"> <span class="dslca-modules-section-edit-option-checkbox-hook"><span class="dslca-icon dslc-icon-check-empty"></span><?php _e('Bottom', 'live-composer-page-builder'); ?> </span> <input type="checkbox" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-checkbox" data-id="border-bottom" data-css-rule="border-width"> </div> <div class="dslca-modules-section-edit-option-checkbox-single"> <span class="dslca-modules-section-edit-option-checkbox-hook"><span class="dslca-icon dslc-icon-check-empty"></span><?php _e('Left', 'live-composer-page-builder'); ?> </span> <input type="checkbox" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-checkbox" data-id="border-left" data-css-rule="border-width"> </div> </div> <?php } elseif ($row_option['type'] == 'checkbox') { ?> <div class="dslca-modules-section-edit-option-checkbox-wrapper"> <?php foreach ($row_option['choices'] as $choices) { ?> <div class="dslca-modules-section-edit-option-checkbox-single"> <span class="dslca-modules-section-edit-option-checkbox-hook"><span class="dslca-icon dslc-icon-check-empty"></span><?php echo $choices['label']; ?> </span> <input type="checkbox" class="dslca-modules-section-edit-field dslca-modules-section-edit-field-checkbox" data-val="<?php echo $choices['value']; ?> " data-id="<?php echo $row_option['id']; ?> "> </div> <?php } ?> </div> <?php } ?> </div><!-- .dslca-modules-section-edit-option --> <?php } }
/** * Generate module CSS * * Worker function. Used by dslc_generate_custom_css. * * @since 1.0 */ function dslc_generate_module_css($module_structure, $module_settings, $restart = false) { $css_output = ''; global $dslc_googlefonts_array; $regular_fonts = array('Georgia', 'Times', 'Arial', 'Lucida Sans Unicode', 'Tahoma', 'Trebuchet MS', 'Verdana', 'Helvetica'); $organized_array = array(); global $dslc_css_fonts; global $dslc_css_style; $important_append = ''; $force_important = dslc_get_option('lc_force_important_css', 'dslc_plugin_options'); if ('enabled' === $force_important) { $important_append = ' !important'; } if (isset($_GET['dslc'])) { $important_append = ''; } if (true === $restart) { $dslc_css_fonts = ''; $dslc_css_style = ''; } // Go through array of options. foreach ($module_structure as $option_arr) { // Fix for "alter_defaults" and responsive tablet state. if ('css_res_t' === $option_arr['id'] && 'enabled' === $option_arr['std'] && !isset($module_settings['css_res_t'])) { $module_settings['css_res_t'] = 'enabled'; } // Fix for "alter_defaults" and responsive phone state. if ('css_res_p' === $option_arr['id'] && 'enabled' === $option_arr['std'] && !isset($module_settings['css_res_p'])) { $module_settings['css_res_p'] = 'enabled'; } // If option type is CSS-based and option is set. if (isset($option_arr['affect_on_change_el']) && isset($option_arr['affect_on_change_rule'])) { // Default. if (!isset($module_settings[$option_arr['id']])) { $module_settings[$option_arr['id']] = $option_arr['std']; } // Extension for the input control (px, %, em...). $ext = ' '; if (isset($option_arr['ext'])) { $ext = $option_arr['ext']; } // Prepend. $prepend = ''; if (isset($option_arr['prepend'])) { $prepend = $option_arr['prepend']; } // Append. $append = ''; if (isset($option_arr['append'])) { $append = $option_arr['append']; } if ('image' === $option_arr['type']) { $prepend = 'url("'; $append = '")'; } // Get element and CSS rule. $affect_rule_raw = $option_arr['affect_on_change_rule']; $affect_rules_arr = explode(',', $affect_rule_raw); // Affect Element. $affect_el = ''; $affect_els_arr = explode(',', $option_arr['affect_on_change_el']); $count = 0; foreach ($affect_els_arr as $affect_el_arr) { $count++; if ($count > 1) { $affect_el .= ','; } // Removed #dslc-content from the line for better CSS optimization. $affect_el .= '#dslc-module-' . $module_settings['module_instance_id'] . ' ' . $affect_el_arr; } // Checkbox ( CSS ). if ('checkbox' === $option_arr['type'] && false === $option_arr['refresh_on_change']) { $checkbox_val = ''; if ('' === $module_settings[$option_arr['id']]) { $checkbox_val = ''; } else { $checkbox_arr = explode(' ', trim($module_settings[$option_arr['id']])); if (in_array('top', $checkbox_arr, true)) { $checkbox_val .= 'solid '; } else { $checkbox_val .= 'none '; } if (in_array('right', $checkbox_arr, true)) { $checkbox_val .= 'solid '; } else { $checkbox_val .= 'none '; } if (in_array('bottom', $checkbox_arr, true)) { $checkbox_val .= 'solid '; } else { $checkbox_val .= 'none '; } if (in_array('left', $checkbox_arr, true)) { $checkbox_val .= 'solid '; } else { $checkbox_val .= 'none '; } if ('none none none none ' === $checkbox_val) { $checkbox_val = 'none'; } } $module_settings[$option_arr['id']] = $checkbox_val; } // Colors (transparent if empty ). if ('' === $module_settings[$option_arr['id']] && ('background' === $option_arr['affect_on_change_rule'] || 'background-color' === $option_arr['affect_on_change_rule'])) { $module_settings[$option_arr['id']] = ''; } foreach ($affect_rules_arr as $affect_rule) { if ('' !== $module_settings[$option_arr['id']]) { $organized_array[$affect_el][$affect_rule] = $prepend . $module_settings[$option_arr['id']] . $ext . $append; } } } // If option type is font? if ('font' === $option_arr['type']) { if (!in_array($module_settings[$option_arr['id']], $dslc_googlefonts_array, true) && !in_array($module_settings[$option_arr['id']], $regular_fonts, true)) { $dslc_googlefonts_array[] = $module_settings[$option_arr['id']]; } } } if (count($organized_array) > 0) { foreach ($organized_array as $el => $rules) { $do_css_output = false; $css_output_el = ''; // Var for temporary output of current el. $do_css_output_background = false; $css_output_el_background = ''; // Process background CSS properties separately. // Remove double spaces form css element address. $el = preg_replace('/ {2,}/', ' ', $el); // Do not output empty CSS blocks. if (count($rules) && strlen($el) > 2) { $css_output_el .= $el . '{'; foreach ($rules as $rule => $value) { $css_output_rule = ''; $rule = trim($rule); $value = trim($value); // Basic CSS rule name validation. if ('' !== $value && 'url(" ")' !== $value && !preg_match("/([\\[\\];<>]+)/", $value) && preg_match("/([-a-z@]{3,60})/", $rule)) { // Output all the background properties only if background-image is set. if ('background-image' === $rule) { $do_css_output_background = true; } // Adjust font-family output. if ('font-family' === $rule) { $font_families = array(); $font_families = explode(',', $value); $value = ''; foreach ($font_families as $font) { $font = trim($font); $font = '"' . $font . '",'; $value .= $font; } $value = rtrim($value, ','); } $css_output_rule .= $rule . ':' . $value . $important_append . ';'; if (stristr($rule, 'background-') && 'background-color' !== $rule) { $css_output_el_background .= $css_output_rule; } elseif ('max-width' === $rule && ('0px' === $value || '0' === $value || '1400px' === $value)) { // Min-width = 0 is empty. $css_output_el .= ''; } else { $css_output_el .= $css_output_rule; } $do_css_output = true; } } if ($do_css_output_background) { $css_output_el .= $css_output_el_background; } $css_output_el = trim($css_output_el); $css_output_el .= '} '; } if ($do_css_output) { $css_output .= $css_output_el; } } } return $css_output; }
/** * Get the header and footer IDs of a specific post/page * * @since 1.0 * * @param int $post_ID ID of the post/page. Default false ( Automatically finds ID ). * @return array The IDs of the header and footer associated with the post/page. False if none. */ function dslc_hf_get_ID($post_ID = false) { // If theme does not define header/footer compatibility return false if (!defined('DS_LIVE_COMPOSER_HF') || !DS_LIVE_COMPOSER_HF) { return array('header' => false, 'footer' => false); } // If current page is actually header/footer post, return false if (is_singular('dslc_hf')) { return array('header' => false, 'footer' => false); } // Global vars global $dslc_post_types; // If post ID not supplied, figure it out if (!$post_ID) { // If currently showing a singular post of a post type that supports "post templates" if (is_singular($dslc_post_types)) { $post_ID = dslc_st_get_template_ID(get_the_ID()); // If currently showing a category archive page } elseif (is_archive() && !is_author() && !is_search()) { $post_ID = dslc_get_option(get_post_type(), 'dslc_plugin_options_archives'); // If currently showing an author archive page } elseif (is_author()) { $post_ID = dslc_get_option('author', 'dslc_plugin_options_archives'); // If currently showing a search results page } elseif (is_search()) { $post_ID = dslc_get_option('search_results', 'dslc_plugin_options_archives'); // If currently showina 404 page } elseif (is_404()) { $post_ID = dslc_get_option('404_page', 'dslc_plugin_options_archives'); // Otherwise just get the ID } else { $post_ID = get_the_ID(); } } // Get header/footer template $header_tpl = get_post_meta($post_ID, 'dslc_header', true); $footer_tpl = get_post_meta($post_ID, 'dslc_footer', true); // If no header template set, make it "default" if (!$header_tpl) { $header_tpl = 'default'; } // If no footer template set make it "default" if (!$footer_tpl) { $footer_tpl = 'default'; } // Default header template supplied, find it and return the ID if ($header_tpl == 'default') { // Query for default template $args = array('post_type' => 'dslc_hf', 'post_status' => 'publish', 'posts_per_page' => 1, 'meta_query' => array(array('key' => 'dslc_hf_for', 'value' => 'header', 'compare' => '='), array('key' => 'dslc_hf_type', 'value' => 'default', 'compare' => '=')), 'order' => 'DESC'); $tpls = get_posts($args); // If default template found set the ID if not make it false if ($tpls) { $header_tpl_ID = $tpls[0]->ID; } else { $header_tpl_ID = false; } // Specific template supplied, return the ID } elseif ($header_tpl && $header_tpl != '_disabled_') { $header_tpl_ID = $header_tpl; } elseif ($header_tpl && $header_tpl == '_disabled_') { $header_tpl_ID = false; } // Default footer template supplied, find it and return the ID if ($footer_tpl == 'default') { // Query for default template $args = array('post_type' => 'dslc_hf', 'post_status' => 'publish', 'posts_per_page' => 1, 'meta_query' => array(array('key' => 'dslc_hf_for', 'value' => 'footer', 'compare' => '='), array('key' => 'dslc_hf_type', 'value' => 'default', 'compare' => '=')), 'order' => 'DESC'); $tpls = get_posts($args); // If default template found set the ID if not make it false if ($tpls) { $footer_tpl_ID = $tpls[0]->ID; } else { $footer_tpl_ID = false; } // Specific template supplied, return the ID } elseif ($footer_tpl && $footer_tpl != '_disabled_') { $footer_tpl_ID = $footer_tpl; } elseif ($footer_tpl && $footer_tpl == '_disabled_') { $footer_tpl_ID = false; } // Return the template ID return array('header' => $header_tpl_ID, 'footer' => $footer_tpl_ID); }