示例#1
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;
    }
}
示例#2
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);
     }
 }