Пример #1
0
 function raindrops_gradient_single($i, $order = "asc")
 {
     return apply_filters("raindrops_gradient_single", raindrops_gradient_single_clone($i, $order));
 }
Пример #2
0
/**
 * Declaration Calculator
 *
 *
 *
 *
 */
function raindrops_design_output($name = 'dark')
{
    global $raindrops_show_theme_option, $raindrops_automatic_color;
    $uploads = wp_upload_dir();
    $raindrops_header_image = raindrops_warehouse_clone('raindrops_header_image');
    $raindrops_hd_image_path = $uploads['path'] . '/' . $raindrops_header_image;
    if (file_exists($raindrops_hd_image_path)) {
        $raindrops_hd_images_path = $uploads['url'] . '/';
    } else {
        $raindrops_hd_images_path = get_stylesheet_directory_uri() . '/images/';
    }
    if (!file_exists(get_stylesheet_directory() . '/images/')) {
        $raindrops_hd_images_path = get_template_directory_uri() . '/images/';
    }
    $raindrops_hd_image_path = apply_filters('raindrops_hd_image_path', $raindrops_hd_images_path);
    $raindrops_images_path = get_stylesheet_directory_uri() . '/images/';
    if (!file_exists(get_stylesheet_directory() . '/images/')) {
        $raindrops_images_path = get_template_directory_uri() . '/images/';
    }
    $raindrops_images_path = apply_filters('raindrops_images_path', $raindrops_images_path);
    $navigation_title_img = raindrops_warehouse_clone('raindrops_heading_image');
    $raindrops_header_color = raindrops_warehouse_clone('raindrops_default_fonts_color');
    $raindrops_footer_image = raindrops_warehouse_clone('raindrops_footer_image');
    $raindrops_footer_color = raindrops_warehouse_clone('raindrops_footer_color');
    $raindrops_footer_link_color = raindrops_warehouse_clone('raindrops_footer_link_color');
    if (empty($name)) {
        $name = 'dark';
    }
    $c_border = raindrops_colors(0, 'background');
    if ('#' == $c_border) {
        $rgba_border = 'rgba(203,203,203, 0.8)';
    } else {
        $rgba_border = raindrops_hex2rgba($c_border, 0.5);
    }
    if ('light' == $name) {
        if ('#' == $c_border) {
            $rgba_border = 'rgba(203,203,203, 0.4)';
        } else {
            $rgba_border = raindrops_hex2rgba($c_border, 0.2);
        }
    }
    $c1 = raindrops_colors(0);
    $c1 = raindrops_colors(1);
    $c2 = raindrops_colors(2);
    $c3 = raindrops_colors(3);
    $c4 = raindrops_colors(4);
    $c5 = raindrops_colors(5);
    $c_1 = raindrops_colors(-1);
    $c_2 = raindrops_colors(-2);
    $c_3 = raindrops_colors(-3);
    $c_4 = raindrops_colors(-4);
    $c_5 = raindrops_colors(-5);
    $position_y = raindrops_warehouse_clone('raindrops_heading_image_position');
    $y = $position_y * 26;
    $y = '-' . $y . 'px';
    switch ($position_y) {
        case 0:
            $h_position_rsidebar_h2 = "background-position:0 0;";
            break;
        case 1:
            $h_position_rsidebar_h2 = "background-position:0 {$y};";
            break;
        case 2:
            $h_position_rsidebar_h2 = "background-position:0 {$y};";
            break;
        case 3:
            $h_position_rsidebar_h2 = "background-position:0 {$y};";
            break;
        case 4:
            $h_position_rsidebar_h2 = "background-position:0 {$y};";
            break;
        case 5:
            $h_position_rsidebar_h2 = "background-position:0 {$y};";
            break;
        case 6:
            $h_position_rsidebar_h2 = "background-position:0 {$y};";
            break;
        case 7:
            $h_position_rsidebar_h2 = "background-position:0 {$y};";
            break;
        default:
            $h_position_rsidebar_h2 = "background-position:0 208px;";
            break;
    }
    if ($raindrops_show_theme_option == true) {
        if (file_exists(get_template_directory() . '/images/' . $navigation_title_img) || file_exists(get_stylesheet_directory() . '/images/' . $navigation_title_img)) {
            $image_exists = true;
        } else {
            $image_exists = false;
        }
        $h2_w3standard_background = "background:" . raindrops_colors(5, 'background') . ' ';
        if (true == $image_exists) {
            $h2_w3standard_background .= "url({$raindrops_images_path}{$navigation_title_img});";
        } else {
            $h2_w3standard_background .= ";";
        }
        $h2_w3standard_background .= "color:" . raindrops_colors(4, 'color') . ';';
        $h2_dark_background = "background:" . raindrops_colors(-3, 'background') . ' ';
        if (true == $image_exists) {
            $h2_dark_background .= "url({$raindrops_images_path}{$navigation_title_img});";
        } else {
            $h2_dark_background .= ";";
        }
        $h2_dark_background .= "color:" . raindrops_colors(-3, 'color') . ';';
        $h2_light_background = "background:" . raindrops_colors(5, 'background') . ' ';
        if (true == $image_exists) {
            $h2_light_background .= "url({$raindrops_images_path}{$navigation_title_img});";
        } else {
            $h2_light_background .= ";";
        }
        $h2_light_background .= "color:" . raindrops_colors(4, 'color') . ';';
    }
    $raindrops_has_indivisual_notation = raindrops_has_indivisual_notation();
    // else color is only notation default
    switch ($name) {
        case "w3standard":
            $custom_dark_bg = raindrops_colors(3, 'background');
            $custom_light_bg = raindrops_colors(1, 'background');
            $custom_color = raindrops_colors('1', 'color');
            if (!empty($raindrops_footer_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_footer_color = $raindrops_footer_color;
            } else {
                $raindrops_footer_color = '#000';
            }
            if (!empty($raindrops_footer_link_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_footer_link_color = $raindrops_footer_link_color;
            } else {
                $raindrops_footer_link_color = '#555';
            }
            if (!empty($raindrops_header_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_header_color = $raindrops_header_color;
            } else {
                $raindrops_header_color = '#000';
            }
            $gradient = raindrops_gradient_clone();
            break;
        case "dark":
            /**
             * dark
             */
            $custom_dark_bg = apply_filters('raindrops_dark_dark_bg', -1);
            $custom_dark_bg = raindrops_colors($custom_dark_bg, 'background');
            $custom_light_bg = apply_filters('raindrops_dark_light_bg', -4);
            $custom_light_bg = raindrops_colors($custom_light_bg, 'background');
            $custom_color = apply_filters('raindrops_dark_color', -3);
            $custom_color = raindrops_colors($custom_color, 'color');
            if (!empty($raindrops_footer_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_footer_color = $raindrops_footer_color;
            } else {
                $raindrops_footer_color = '#fff';
            }
            if (!empty($raindrops_footer_link_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_footer_link_color = $raindrops_footer_link_color;
            } else {
                $raindrops_footer_link_color = '#fff';
            }
            if (!empty($raindrops_header_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_header_color = $raindrops_header_color;
            } else {
                $raindrops_header_color = '#fff';
            }
            $gradient = raindrops_gradient_clone();
            break;
        case "light":
            /**
             * light
             */
            $custom_dark_bg = apply_filters('raindrops_light_dark_bg', 5);
            $custom_dark_bg = raindrops_colors($custom_dark_bg, 'background');
            $custom_light_bg = apply_filters('raindrops_light_light_bg', 4);
            $custom_light_bg = raindrops_colors($custom_light_bg, 'background');
            $custom_color = apply_filters('raindrops_light_color', 3);
            $custom_color = raindrops_colors($custom_color, 'color');
            $base_gradient = raindrops_gradient_single_clone(3, "asc");
            if (!empty($raindrops_footer_color)) {
                $raindrops_footer_color = $raindrops_footer_color;
            } else {
                $raindrops_footer_color = '#333';
            }
            if (!empty($raindrops_footer_link_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_footer_link_color = $raindrops_footer_link_color;
            } else {
                $raindrops_footer_link_color = '#fff';
            }
            if (!empty($raindrops_header_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_header_color = $raindrops_header_color;
            } else {
                $raindrops_header_color = '#333';
            }
            $gradient = raindrops_gradient_clone();
            break;
        default:
            $custom_dark_bg = apply_filters('raindrops_default_dark_bg', 3);
            $custom_dark_bg = raindrops_colors($custom_dark_bg, 'background');
            $custom_light_bg = apply_filters('raindrops_default_light_bg', 1);
            $custom_light_bg = raindrops_colors($custom_light_bg, 'background');
            $custom_color = apply_filters('raindrops_default_color', 1);
            $custom_color = raindrops_colors($custom_color, 'color');
            if (!empty($raindrops_footer_color)) {
                $raindrops_footer_color = $raindrops_footer_color;
            } else {
                $raindrops_footer_color = '#000';
            }
            if (!empty($raindrops_footer_link_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_footer_link_color = $raindrops_footer_link_color;
            } else {
                $raindrops_footer_link_color = '#555';
            }
            if (!empty($raindrops_header_color) && false == $raindrops_has_indivisual_notation && false == $raindrops_automatic_color) {
                $raindrops_header_color = $raindrops_header_color;
            } else {
                $raindrops_header_color = '#000';
            }
            $gradient = raindrops_gradient_clone();
            break;
    }
    $function_name = 'raindrops_indv_css_' . $name;
    if (function_exists($function_name)) {
        $content = $function_name();
        foreach (explode(' ', $content, -1) as $line) {
            preg_match_all('|%([a-z0-9_-]+)?%|si', $line, $regs, PREG_SET_ORDER);
            foreach ($regs as $reg) {
                if (isset(${$reg}[1])) {
                    $content = str_replace($reg[0], ${$reg}[1], $content);
                } else {
                    $content = str_replace($reg[0], '/*cannot bind data [%' . $reg[1] . '%]*/', $content);
                }
            }
        }
    }
    if (isset($content)) {
        return $content;
    } else {
        return false;
    }
}
Пример #3
0
    /**
     *
     *
     */
    function raindrops_the_event_calendar_css($main_css)
    {
        if ('yes' == get_theme_mod('raindrops_the_events_calendar_status') && 'yes' == raindrops_warehouse_clone('raindrops_plugin_presentation_the_events_calendar')) {
            $color_type = raindrops_warehouse('raindrops_style_type');
            $border_rgba = '52,52,52,1';
            switch ($color_type) {
                case 'dark':
                    $color_type_value = -3;
                    $color_type_value_hover = 3;
                    $border_rgba = '222,222,222,0.3';
                    break;
                case 'light':
                    $color_type_value = 4;
                    $color_type_value_hover = -3;
                    $border_rgba = '52,52,52,0.2';
                    break;
                default:
                    $color_type_value = false;
                    break;
            }
            if ($color_type_value !== false) {
                $raindrops_gradient = raindrops_gradient_single_clone($color_type_value);
                $custom_color = raindrops_colors_clone($color_type_value, 'color');
                $custom_background = raindrops_colors_clone($color_type_value, 'background');
                $custom_color_hover = raindrops_colors_clone($color_type_value_hover, 'color');
                $custom_background_hover = raindrops_colors_clone($color_type_value_hover, 'background');
            } else {
                $raindrops_gradient = '';
                $custom_color = '#000';
                $custom_background = '#fff';
                $custom_color_hover = '#fff';
                $custom_background_hover = '#000';
            }
            $raindrops_event_calendar_css = '@media screen and (max-width : 920px){
					div#tribe-bar-collapse-toggle{color:' . $custom_color . '; background:' . $custom_background . '}
				}
			.tribe-events-loop .tribe-events-list .tribe-events-event-cost span{ color:red;}
			.datepicker{ width:280px;max-width:100%;}
			.tribe-events-list-widget li{padding:0 10px 20px;}
			.tribe-events-list-widget ol li{margin:10px 0;}
			.events-archive .entry-title,.icon-link-no-title,
			.events-single .entry-title{display:none;}
			.events-archive.events-gridview #tribe-events-content table .vevent .entry-title{display:block;margin:0;text-align:left;background:transparent;}
			.events-archive.events-gridview #tribe-events-content table .vevent .tribe-events-month-event-title:hover + .tribe-events-tooltip .entry-title{color:#000;}
			.events-archive.events-gridview #tribe-events-content  .vevent .entry-title,
			.events-list #tribe-events-content a, 
			.events-list .tribe-events-event-meta a,
			.events-archive #tribe-events-bar .tribe-bar-views-inner label,
			.tribe-events-day .tribe-events-day-time-slot h5,
			.tribe-bar-views-inner,
			#tribe-bar-form,
			.datepicker.dropdown-menu,
			.tribe-events-list .tribe-events-event-cost span,
			.tribe-events-list-separator-month span,
			#tribe-events-content .tribe-events-calendar td.tribe-events-othermonth,
			.single-tribe_events .tribe-events-event-meta{color:' . $custom_color . '; background:' . $custom_background . '}
			.datepicker thead tr:first-child th:hover, .datepicker tfoot tr th:hover,.datepicker.dropdown-menu td span:hover{color:' . $custom_color_hover . '; background:' . $custom_background_hover . '}
			.tribe-events-list-widget-events,
			.events-archive .tribe-events-calendar td.tribe-events-future div[id*="tribe-events-daynum-"],
			.events-archive .tribe-events-calendar td.tribe-events-future div[id*="tribe-events-daynum-"] > a,
			.events-archive .tribe-events-calendar td.tribe-events-past div[id*="tribe-events-daynum-"],
			.events-archive .tribe-events-calendar td.tribe-events-past div[id*="tribe-events-daynum-"] > a,
			.events-archive #tribe-events, .events-archive #tribe-events-content-wrapper,
			.single-tribe_events #tribe-events, .single-tribe_events #tribe-events-content-wrapper{' . $raindrops_gradient . '}
			.rd-type-minimal .tribe-events-calendar td.tribe-events-past div[id*="tribe-events-daynum-"],
			.rd-type-minimal .tribe-events-calendar td.tribe-events-past div[id*="tribe-events-daynum-"] > a,
			.rd-type-w3standard .tribe-events-calendar td.tribe-events-past div[id*="tribe-events-daynum-"],
			.rd-type-w3standard .tribe-events-calendar td.tribe-events-past div[id*="tribe-events-daynum-"] > a{
				color:#000; background:#eee:}
			.single-tribe_events .tribe-events-event-meta,
			#tribe-events-content .tribe-events-calendar td{border:1px solid rgba(' . $border_rgba . ');}
			.single-tribe_events #tribe-events-footer,
			.tribe-events-day #tribe-events-footer,
			.events-list #tribe-events-footer,
			.tribe-events-map #tribe-events-footer,
			.tribe-events-photo #tribe-events-footer{border-top:1px solid rgba(' . $border_rgba . ');}
			#tribe-events .tribe-events-notices li{background:#d9edf7; color:#000;}
			#tribe-bar-views .tribe-bar-views-list .tribe-bar-views-option a:hover{background:#fff;color:#000;}
			.tribe-events-list-widget .tribe-events-widget-link a{margin:1em;
			background:' . $custom_background . '; text-align:center; padding:1em;display:inline-block;box-sizing:border-box;border:1px solid rgba(' . $border_rgba . ');}
			.tribe-events-list-widget .tribe-events-widget-link a,
			.tribe-events-list-widget .tribe-events-list-widget-events .entry-title{font-size:108%;}
			.tribe-events-list-widget ol li{margin-bottom:10px;}
			#tribe-bar-collapse-toggle,
			.tribe-events-sub-nav{background:transparent!important;}
			#tribe-events-content .tribe-events-calendar td:hover{background:' . $custom_background . '}';
            if (WP_DEBUG !== true) {
                $raindrops_event_calendar_css = str_replace(array("\n", "\r", "\t", '"', '--', '\\"'), array("", "", "", '"', '', '"'), $raindrops_event_calendar_css);
            }
            wp_add_inline_style('tribe-events-calendar-style', $raindrops_event_calendar_css);
        }
    }
Пример #4
0
 function raindrops_design_output_clone($name = 'dark')
 {
     /* Header banner line image , footer background image */
     $raindrops_header_image = raindrops_warehouse_clone('raindrops_header_image');
     $raindrops_footer_image = raindrops_warehouse_clone('raindrops_footer_image');
     if (empty($name)) {
         $name = 'dark';
     }
     $c_border = raindrops_colors_clone(0, 'background');
     if ('#' == $c_border) {
         $rgba_border = 'rgba( 203,203,203, 0.8 )';
     } else {
         $rgba_border = raindrops_hex2rgba($c_border, 0.5);
     }
     $c1 = raindrops_colors_clone(0);
     $c1 = raindrops_colors_clone(1);
     $c2 = raindrops_colors_clone(2);
     $c3 = raindrops_colors_clone(3);
     $c4 = raindrops_colors_clone(4);
     $c5 = raindrops_colors_clone(5);
     $c_1 = raindrops_colors_clone(-1);
     $c_2 = raindrops_colors_clone(-2);
     $c_3 = raindrops_colors_clone(-3);
     $c_4 = raindrops_colors_clone(-4);
     $c_5 = raindrops_colors_clone(-5);
     $position_y = raindrops_warehouse_clone('raindrops_heading_image_position');
     $y = $position_y * 26;
     $y = '-' . $y . 'px';
     switch ($position_y) {
         case 0:
             $h_position_rsidebar_h2 = "background-position:0 0;";
             break;
         case 1:
             $h_position_rsidebar_h2 = "background-position:0 {$y};";
             break;
         case 2:
             $h_position_rsidebar_h2 = "background-position:0 {$y};";
             break;
         case 3:
             $h_position_rsidebar_h2 = "background-position:0 {$y};";
             break;
         case 4:
             $h_position_rsidebar_h2 = "background-position:0 {$y};";
             break;
         case 5:
             $h_position_rsidebar_h2 = "background-position:0 {$y};";
             break;
         case 6:
             $h_position_rsidebar_h2 = "background-position:0 {$y};";
             break;
         case 7:
             $h_position_rsidebar_h2 = "background-position:0 {$y};";
             break;
         default:
             $h_position_rsidebar_h2 = "background-position:0 208px;";
             break;
     }
     $h2_w3standard_background = raindrops_default_colors_clone($name, 'h2_w3standard_background');
     $h2_dark_background = raindrops_default_colors_clone($name, 'h2_dark_background');
     $h2_light_background = raindrops_default_colors_clone($name, 'h2_light_background');
     $custom_dark_bg = raindrops_default_colors_clone($name, 'custom_dark_bg');
     $custom_light_bg = raindrops_default_colors_clone($name, 'custom_light_bg');
     $custom_color = raindrops_default_colors_clone($name, 'custom_color');
     $raindrops_footer_color = raindrops_default_colors_clone($name, 'raindrops_footer_color');
     $raindrops_header_color = raindrops_default_colors_clone($name, 'raindrops_header_color');
     $gradient = raindrops_gradient_clone();
     switch ($name) {
         case "light":
             /**
              * light
              */
             $base_gradient = raindrops_gradient_single_clone(3, "asc");
             break;
     }
     $function_name = 'raindrops_indv_css_' . $name;
     if (function_exists($function_name)) {
         $content = $function_name();
         foreach (explode(' ', $content, -1) as $line) {
             preg_match_all('|%([a-z0-9_-]+)?%|si', $line, $regs, PREG_SET_ORDER);
             foreach ($regs as $reg) {
                 if (isset(${$reg}[1])) {
                     $content = str_replace($reg[0], ${$reg}[1], $content);
                 } else {
                     $content = str_replace($reg[0], '/*cannot bind data [%' . $reg[1] . '%]*/', $content);
                 }
             }
         }
         return apply_filters("raindrops_colors", $content);
     }
 }