예제 #1
0
function weaver_output_style($sout)
{
    /* This outputs the CSS overrides. It will output to a file pointer, so it can write to a .css file saved
          in the user's upload directory - just like the saved style .wvr files. It is included via a standard
          css include. It needs to be loaded only for the admin page.
       */
    // Put a options that can be overridden by the CSS option at the top!
    weaver_f_write($sout, sprintf("/* General Options */\n"));
    /*  ttw_after_header  */
    if (($optVal = weaver_getopt("ttw_after_header")) !== false) {
        weaver_f_write($sout, sprintf("#main {padding: %spx 0 0 0;}\n", $optVal));
    }
    /*  ttw_bold_menu  */
    if (weaver_getopt("ttw_bold_menu")) {
        weaver_f_write($sout, sprintf("#access, #access li ul ul > a, #access2, #access2 li ul ul > a, #access3, #access3 li ul ul > a {font-weight:bold;}\n"));
    }
    /*  ttw_contentlist_bullet  */
    $val = weaver_getopt("ttw_contentlist_bullet");
    /* add a new lsit bullet */
    if ($val && $val != '' && $val != 'default') {
        if ($val == 'none' || $val == 'circle' || $val == 'disc' || $val == 'square') {
            weaver_f_write($sout, sprintf("ul {list-style:%s;}\n", $val));
        } else {
            weaver_f_write($sout, sprintf("ul {list-style:none;list-style-image: url(%s/images/bullets/%s.gif);}\n", get_template_directory_uri(), $val));
        }
    }
    /*  ttw_content_font  */
    if (($useFont = weaver_get_font_value('ttw_content_font')) != '') {
        weaver_css_fontfamily($sout, 'body, input, textarea, .page-title span, .pingback a.url', $useFont);
    }
    /*  ttw_fadebody_bg  */
    if (weaver_getopt('ttw_fadebody_bg')) {
        $url = weaver_relative_url('images/gr.png');
        weaver_f_write($sout, sprintf("body {background-image: url(%s); background-attachment: scroll; background-repeat: repeat-x;}\n", $url));
    }
    /*  ttw_gradient_menu  */
    if (weaver_getopt('ttw_gradient_menu')) {
        $url = weaver_relative_url('images/weaver/fade.png');
        $urlup = weaver_relative_url('images/weaver/fadeup.png');
        weaver_f_write($sout, sprintf("#access, #access2, #access3 { background-image: url(%s);}\n", $url));
        weaver_f_write($sout, sprintf("#access ul ul a, #access li:hover > a, #access ul ul :hover > a { background-image: url(%s);}\n", $urlup));
        weaver_f_write($sout, sprintf("#access2 ul ul a, #access2 li:hover > a, #access2 ul ul :hover > a { background-image: url(%s);}\n", $urlup));
        weaver_f_write($sout, sprintf("#access3 ul ul a, #access3 li:hover > a, #access3 ul ul :hover > a { background-image: url(%s);}\n", $urlup));
    }
    /*  ttw_hide_post_fill  (also used in post icons) */
    if (weaver_getopt('ttw_hide_post_fill')) {
        weaver_f_write($sout, sprintf(".entry-utility-prep {display: none;}\n.meta-prep-author {display:none;}\n.meta-sep {display: none;}\n"));
    }
    /*  ttw_large_tagline  */
    if (weaver_getopt('ttw_large_tagline')) {
        weaver_f_write($sout, sprintf('#site-description {font-size:130%%; font-weight:bold;}'));
    }
    /*  ttw_list_bullet  */
    $val = weaver_getopt('ttw_list_bullet');
    /* add a new lsit bullet */
    if ($val && $val != '' && $val != 'default') {
        if ($val == 'none' || $val == 'circle' || $val == 'disc' || $val == 'square') {
            weaver_f_write($sout, sprintf(".widget-area ul ul {list-style:%s;}\n", $val));
        } else {
            $url = weaver_relative_url('images/bullets/' . $val . '.gif');
            weaver_f_write($sout, sprintf(".widget-area ul ul {list-style:none; list-style-position:inside; list-style-image: url(%s);}\n", $url));
        }
    }
    /*  ttw_post_icons  */
    if (weaver_getopt('ttw_post_icons')) {
        $leftm = '8';
        $url = weaver_relative_url('images/icons/edit-1.png');
        if (!weaver_getopt('ttw_hide_post_fill')) {
            $leftm = '0';
        }
        // no left margin if not hiding fill in
        weaver_f_write($sout, sprintf(".edit-link{ background: url(%s) no-repeat 1px;padding-top:3px;padding-left:21px;margin-left:%spx;}\n", $url, $leftm));
    }
    /*  ttw_small_content_font  */
    if (weaver_getopt('ttw_small_content_font')) {
        weaver_f_write($sout, sprintf("#content {font-size: 120%%; line-height: 125%%; }\n"));
        /* stange, but true! */
        weaver_f_write($sout, sprintf("#comments {font-size: 90%%; line-height: 90%%; }\n"));
        /* stange, but true! */
    }
    /*  ttw_title_font  */
    if (($useFont = weaver_get_font_value('ttw_title_font')) != '') {
        weaver_css_fontfamily($sout, 'h3#comments-title, h3#reply-title, #access .menu, #access div.menu ul, #access2 .menu, #access2 div.menu ul,
#access3 .menu, #access3 div.menu ul,
#cancel-comment-reply-link, .form-allowed-tags, #site-info, #site-title, #wp-calendar,
.comment-meta, .comment-body tr th, .comment-body thead th, .entry-content label, .entry-content tr th,
.entry-content thead th, .entry-meta, .entry-title, .entry-utility, #respond label, .navigation,
.page-title, .pingback p, .reply, .widget_search label, .widget-title, input[type=submit]', $useFont);
    }
    /*  ttw_useborders  */
    if (weaver_getopt('ttw_useborders')) {
        weaver_f_write($sout, sprintf("#wrapper {border: 1px solid #222222; padding-right: 20px; margin-top: 15px; margin-bottom: 15px;}\n"));
        weaver_f_write($sout, sprintf("#header {margin-top: 0px;}\n"));
        weaver_f_write($sout, sprintf("#primary, #secondary, #altleft, #altright, #altleft, #altright {border: 1px solid #222222;}\n"));
    }
    if (weaver_getopt('ttw_useborders') || weaver_getopt('ttw_useborders_topbot')) {
        weaver_f_write($sout, sprintf("#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {border: 1px solid #222222;}\n"));
    }
    /*  ttw_rounded_corners  */
    $r = 10;
    $rm = 7;
    $newr = weaver_getopt('ttw_rounded_corners_radius');
    if ($newr) {
        $r = $newr;
        if ($r >= 8) {
            $rm = (int) (0.7 * $r);
        } else {
            $rm = $r;
        }
    }
    if (weaver_getopt('ttw_rounded_corners')) {
        // not #access3
        weaver_f_write($sout, sprintf("#container, #primary, #secondary, #altleft, #altright, #ttw-top-widget, #ttw-bot-widget,\n  #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget {-moz-border-radius: %dpx; -webkit-border-radius: %dpx; border-radius: %dpx;}\n", $r, $r, $r));
        if (weaver_getopt('ttw_move_menu')) {
            weaver_f_write($sout, sprintf("#access2 {-moz-border-radius-bottomleft: %dpx; -moz-border-radius-bottomright: %dpx;\n -webkit-border-bottom-left-radius: %dpx; -webkit-border-bottom-right-radius: %dpx; border-bottom-left-radius: %dpx; border-bottom-right-radius: %dpx;}\n", $rm, $rm, $rm, $rm, $rm, $rm));
            weaver_f_write($sout, sprintf("#access {-moz-border-radius-topleft: %dpx; -moz-border-radius-topright: %dpx;\n -webkit-border-top-left-radius: %dpx; -webkit-border-top-right-radius: %dpx; border-top-left-radius: %dpx; border-top-right-radius: %dpx;}\n", $rm, $rm, $rm, $rm, $rm, $rm));
        } else {
            weaver_f_write($sout, sprintf("#access {-moz-border-radius-bottomleft: %dpx; -moz-border-radius-bottomright: %dpx;\n -webkit-border-bottom-left-radius: %dpx; -webkit-border-bottom-right-radius: %dpx;border-bottom-left-radius: %dpx; border-bottom-right-radius: %dpx;}\n", $rm, $rm, $rm, $rm, $rm, $rm));
            weaver_f_write($sout, sprintf("#access2 {-moz-border-radius-topleft: %dpx; -moz-border-radius-topright: %dpx;\n -webkit-border-top-left-radius: %dpx; -webkit-border-top-right-radius: %dpx;border-top-left-radius: %dpx; border-top-right-radius: %dpx;}\n", $rm, $rm, $rm, $rm, $rm, $rm));
        }
        weaver_f_write($sout, sprintf("#wrapper {-moz-border-radius: %dpx; -webkit-border-radius: %dpx; border-radius: %dpx; margin-top: 15px; margin-bottom: 15px;}\n", $r, $r, $r));
    }
    /*	ttw_use_superfish	*/
    if (!weaver_getopt('ttw_use_superfish')) {
        /* need to fix up access a if NOT using SuperFish */
        weaver_f_write($sout, sprintf("#access a, #access2 a, #access3 a { padding-left:10px; padding-right:10px;}\n"));
    }
    // ------------------------------------------- end of overrideable options -------------------------------
    /* Generate the sidebar CSS last since it might override some other settings */
    weaver_f_write($sout, sprintf("/* Sidebar arrangement */\n"));
    weaver_sidebar_css($sout);
    // complicated code in its own function...
    /*  ttw_title_on_header  - needs to be here... */
    weaver_f_write($sout, sprintf("/* Color and custom CSS */\n"));
    if (weaver_getopt('ttw_title_on_header')) {
        $tx = 40;
        $ty = 44;
        // default values for offsets
        $dx = 40;
        $dy = 90;
        $val = weaver_getopt('ttw_title_on_header_xy_X');
        if (!empty($val)) {
            $tx = (int) $val;
        }
        $val = weaver_getopt('ttw_title_on_header_xy_Y');
        if (!empty($val)) {
            $ty = (int) $val;
        }
        $val = weaver_getopt('ttw_title_on_header_xy_desc_X');
        if (!empty($val)) {
            $dx = (int) $val;
        }
        $val = weaver_getopt('ttw_title_on_header_xy_desc_Y');
        if (!empty($val)) {
            $dy = (int) $val;
        }
        weaver_f_write($sout, sprintf("#site-title {left:0px; position: absolute; margin-left: %dpx; margin-top: %dpx;z-index:20;}\n", $tx, $ty));
        weaver_f_write($sout, sprintf("#site-description {left:0px; width:50%%; text-align:left; clear: both; float: left; position:absolute; margin-left: %dpx; margin-top: %dpx; z-index:20;}\n", $dx, $dy));
    }
    /*  ttw_body_bgcolor  */
    if ($optVal = weaver_getopt_color('ttw_body_bgcolor')) {
        weaver_css_bgcolor($sout, 'body', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_body_bgcolor_css')) {
        weaver_css_css($sout, 'body', $optVal);
    }
    /*  ttw_container_bgcolor  */
    if ($optVal = weaver_getopt("ttw_container_bgcolor")) {
        weaver_css_bgcolor($sout, '#container', $optVal);
    }
    if ($optVal = weaver_getopt("ttw_container_bgcolor_css")) {
        weaver_css_css($sout, '#container', $optVal);
    }
    /*  ttw_content_bgcolor  */
    if ($optVal = weaver_getopt("ttw_content_bgcolor")) {
        weaver_css_bgcolor($sout, '#content', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_content_bgcolor_css')) {
        weaver_css_css($sout, '#content', $optVal);
    }
    /*  ttw_content_color  */
    if ($optVal = weaver_getopt_color('ttw_content_color')) {
        weaver_css_color($sout, '#content, #content input, #content textarea', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_content_color_css')) {
        weaver_css_css($sout, '#content, #content input, #content textarea', $optVal);
    }
    /*  ttw_desc_color  */
    if ($optVal = weaver_getopt_color('ttw_desc_color')) {
        weaver_f_write($sout, sprintf("#site-description {color: " . $optVal . ";}\n"));
    }
    if ($optVal = weaver_getopt('ttw_desc_color_css')) {
        weaver_css_css($sout, "#site-description", $optVal);
    }
    /*  ttw_excerpt_length - no CSS */
    /*  ttw_footer_bgcolor  */
    if ($optVal = weaver_getopt("ttw_footer_bgcolor")) {
        weaver_css_bgcolor($sout, '#footer', $optVal);
    }
    if ($optVal = weaver_getopt("ttw_footer_bgcolor_css")) {
        weaver_css_css($sout, '#footer', $optVal);
    }
    /*  ttw_footer_border_color  */
    if ($optVal = weaver_getopt_color('ttw_footer_border_color')) {
        weaver_f_write($sout, sprintf("#colophon { border-top: 4px solid {$optVal} ;  }\n"));
    }
    if ($optVal = weaver_getopt("ttw_footer_border_color_css")) {
        weaver_css_css($sout, '#colophon', $optVal);
    }
    /*    ttw_footer_widget_bgcolor */
    if ($optVal = weaver_getopt('ttw_footer_widget_bgcolor')) {
        weaver_css_bgcolor($sout, '#first,#second, #third, #fourth', $optVal, 'padding-left: 10px; padding-top: 10px; margin-bottom: 5px;');
    }
    if ($optVal = weaver_getopt('ttw_footer_widget_bgcolor_css')) {
        weaver_css_css($sout, '#first,#second, #third, #fourth', $optVal);
    }
    /*  ttw_force_widg_frontpage - no CSS */
    /*  ttw_header_bgcolor  */
    if ($optVal = weaver_getopt("ttw_header_bgcolor")) {
        weaver_css_bgcolor($sout, '#header', $optVal);
    }
    if ($optVal = weaver_getopt("ttw_header_bgcolor_css")) {
        weaver_css_css($sout, '#header', $optVal);
    }
    /*  ttw_header_image_height - no CSS*/
    /*  ttw_header_image_width - no CSS (used in width calculations, however)  */
    /*  ttw_header_underline  */
    $val = (int) weaver_getopt('ttw_header_underline');
    /* bar under headers */
    if ($val != '' && $val != 0) {
        $titleColor = weaver_getopt('ttw_text_color');
        weaver_f_write($sout, sprintf(".entry-title {border-bottom: {$val}" . "px solid {$titleColor};}\n"));
    }
    /*  ttw_hide_menu - no CSS */
    /*  ttw_hide_site_title - no CSS */
    /*  ttw_hide_widg_pages - no CSS */
    /*  ttw_hide_widg_posts - no CSS */
    /*  ttw_hr_color  */
    if ($optVal = weaver_getopt_color('ttw_hr_color')) {
        weaver_css_bgcolor($sout, 'hr', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_hr_color_css')) {
        weaver_css_css($sout, 'hr', $optVal);
    }
    /*  ttw_ilink_color  */
    /*  ttw_ilink_visited_color  */
    /*  ttw_ilink_hover_color  */
    if ($optVal = weaver_getopt_color("ttw_ilink_color")) {
        /* post title links */
        weaver_css_color($sout, '.page-title a:link', $optVal);
        weaver_css_color($sout, '.entry-meta a:link', $optVal);
        weaver_css_color($sout, '.entry-utility a:link', $optVal);
        weaver_css_color($sout, '.navigation a:link', $optVal);
        weaver_css_color($sout, '.comment-meta a:link', $optVal);
        weaver_css_color($sout, '.reply a:link, a.comment-edit-link:link', $optVal);
    }
    if ($optVal = weaver_getopt_color("ttw_ilink_visited_color")) {
        weaver_css_color($sout, '.page-title a:visited', $optVal);
        weaver_css_color($sout, '.entry-meta a:visited', $optVal);
        weaver_css_color($sout, '.entry-utility a:visited', $optVal);
        weaver_css_color($sout, '.navigation a:visited', $optVal);
        weaver_css_color($sout, '.comment-meta a:visited', $optVal);
        weaver_css_color($sout, '.reply a:visited, a.comment-edit-link:visited', $optVal);
    }
    if ($optVal = weaver_getopt_color("ttw_ilink_hover_color")) {
        weaver_css_color($sout, '.page-title a:active, .page-title a:hover', $optVal);
        weaver_css_color($sout, '.entry-meta a:hover, .entry-meta a:active', $optVal);
        weaver_css_color($sout, '.entry-utility a:hover, .entry-utility a:active', $optVal);
        weaver_css_color($sout, '.navigation a:active, .navigation a:hover', $optVal);
        weaver_css_color($sout, '.comment-meta a:active, .comment-meta a:hover', $optVal);
        weaver_css_color($sout, '.reply a:active, a.comment-edit-link:active, .reply a:hover, a.comment-edit-link:hover', $optVal);
    }
    if ($optVal = weaver_getopt("ttw_ilink_color_css")) {
        /* post title links */
        weaver_css_css($sout, '.page-title a:link', $optVal);
        weaver_css_css($sout, '.entry-meta a:link', $optVal);
        weaver_css_css($sout, '.entry-utility a:link', $optVal);
        weaver_css_css($sout, '.navigation a:link', $optVal);
        weaver_css_css($sout, '.comment-meta a:link', $optVal);
        weaver_css_css($sout, '.reply a:link, a.comment-edit-link:link', $optVal);
    }
    if ($optVal = weaver_getopt("ttw_ilink_visited_color_css")) {
        weaver_css_css($sout, '.page-title a:visited', $optVal);
        weaver_css_css($sout, '.entry-meta a:visited', $optVal);
        weaver_css_css($sout, '.entry-utility a:visited', $optVal);
        weaver_css_css($sout, '.navigation a:visited', $optVal);
        weaver_css_css($sout, '.comment-meta a:visited', $optVal);
        weaver_css_css($sout, '.reply a:visited, a.comment-edit-link:visited', $optVal);
    }
    if ($optVal = weaver_getopt("ttw_ilink_hover_color_css")) {
        weaver_css_css($sout, '.page-title a:active, .page-title a:hover', $optVal);
        weaver_css_css($sout, '.entry-meta a:hover, .entry-meta a:active', $optVal);
        weaver_css_css($sout, '.entry-utility a:hover, .entry-utility a:active', $optVal);
        weaver_css_css($sout, '.navigation a:active, .navigation a:hover', $optVal);
        weaver_css_css($sout, '.comment-meta a:active, .comment-meta a:hover', $optVal);
        weaver_css_css($sout, '.reply a:active, a.comment-edit-link:active, .reply a:hover, a.comment-edit-link:hover', $optVal);
    }
    /*  ttw_info_color  */
    if ($infoColor = weaver_getopt_color('ttw_info_color')) {
        weaver_css_color($sout, '#comments .pingback p', $infoColor);
        weaver_css_color($sout, '#respond label, #respond dt, #respond dd', $infoColor);
        weaver_css_color($sout, '.entry-meta, .entry-content label, .entry-utility', $infoColor);
        weaver_css_color($sout, '#content .wp-caption, #content .gallery .gallery-caption', $infoColor);
        weaver_css_color($sout, '.navigation', $infoColor);
    }
    if ($infoColor = weaver_getopt('ttw_info_color_css')) {
        weaver_css_css($sout, '#comments .pingback p', $infoColor);
        weaver_css_css($sout, '#respond label, #respond dt, #respond dd', $infoColor);
        weaver_css_css($sout, '.entry-meta, .entry-content label, .entry-utility', $infoColor);
        weaver_css_css($sout, '#content .wp-caption, #content .gallery .gallery-caption', $infoColor);
        weaver_css_css($sout, '.navigation', $infoColor);
    }
    /* ttw_post_title_color */
    if ($infoColor = weaver_getopt_color('ttw_post_title_color')) {
        weaver_css_color($sout, '.entry-format', $infoColor . '!important');
    }
    if ($infoColor = weaver_getopt('ttw_post_title_color_css')) {
        weaver_css_css($sout, '.entry-format', $infoColor);
    }
    /*  ttw_infotop_bgcolor, ttw_infobottom_bgcolor  */
    if ($optVal = weaver_getopt('ttw_infotop_bgcolor')) {
        weaver_css_bgcolor($sout, '.entry-meta', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_infotop_bgcolor_css')) {
        weaver_css_css($sout, '.entry-meta', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_infobottom_bgcolor')) {
        weaver_css_bgcolor($sout, '.entry-utility', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_infobottom_bgcolor_css')) {
        weaver_css_css($sout, '.entry-utility', $optVal);
    }
    /*  ttw_input_bgcolor  */
    if ($optVal = weaver_getopt('ttw_input_bgcolor')) {
        weaver_css_bgcolor($sout, 'input[type="text"], textarea, input[type="submit"], ins', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_input_bgcolor_css')) {
        weaver_css_css($sout, 'input[type="text"], textarea, input[type="submit"], ins', $optVal);
    }
    /*  ttw_link_color  */
    /*  ttw_link_visited_color  */
    /*  ttw_link_hover_color  */
    if ($optVal = weaver_getopt_color('ttw_link_color')) {
        weaver_css_color($sout, 'a:link', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_link_visited_color')) {
        weaver_css_color($sout, 'a:visited', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_link_hover_color')) {
        weaver_css_color($sout, 'a:active, a:hover', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_link_color_css')) {
        weaver_css_css($sout, 'a:link', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_link_visited_color_css')) {
        weaver_css_css($sout, 'a:visited', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_link_hover_color_css')) {
        weaver_css_css($sout, 'a:active, a:hover', $optVal);
    }
    /*  ttw_link_site_image - no CSS */
    /*  ttw_main_bgcolor  */
    if ($optVal = weaver_getopt('ttw_main_bgcolor')) {
        weaver_css_bgcolor($sout, '#main', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_main_bgcolor_css')) {
        weaver_css_css($sout, '#main', $optVal);
    }
    /*  ttw_caption_color  */
    if ($optVal = weaver_getopt_color('ttw_caption_color')) {
        weaver_css_color($sout, '#content .wp-caption p.wp-caption-text, #content .gallery .gallery-caption', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_caption_color_css')) {
        weaver_css_css($sout, '#content .wp-caption p.wp-caption-text, #content .gallery .gallery-caption', $optVal);
    }
    /*    ttw_media_lib_border    */
    if (($optVal = weaver_getopt('ttw_media_lib_border')) !== false) {
        weaver_f_write($sout, sprintf("#content .size-full, #content .size-large, #content .size-medium, #content .size-thumbnail,#content .size-thumbnail {background-color: %s;}\n", $optVal));
    }
    if ($optVal = weaver_getopt('ttw_media_lib_border_css')) {
        weaver_css_css($sout, '#content .size-full, #content .size-large, #content .size-medium, #content .size-thumbnail', $optVal);
    }
    /*    ttw_media_lib_captioned_border    */
    if (($optVal = weaver_getopt('ttw_media_lib_captioned_border')) !== false) {
        weaver_f_write($sout, sprintf("#content .wp-caption p.wp-caption-text,\n#content .wp-caption .size-full, #content .wp-caption .size-large, #content .wp-caption .size-medium,\n#content .wp-caption .size-thumbnail, #content .wp-caption .size-thumbnail {background-color: %s;}\n", $optVal));
    }
    if ($optVal = weaver_getopt('ttw_media_lib_captioned_border_css')) {
        weaver_css_css($sout, '#content .wp-caption p.wp-caption-text,
#content .wp-caption .size-full, #content .wp-caption .size-large, #content .wp-caption .size-medium,
#content .wp-caption .size-thumbnail, #content .wp-caption .size-thumbnail', $optVal);
    }
    /*  ttw_menubar_color  */
    if ($optVal = weaver_getopt_color('ttw_menubar_color')) {
        weaver_css_bgcolor($sout, '#access, #access2, #access3', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_menubar_color_css')) {
        weaver_css_css($sout, '#access, #access2, #access3', $optVal);
    }
    /*  ttw_menubar_curpage_color  */
    if ($optVal = weaver_getopt_color('ttw_menubar_curpage_color')) {
        weaver_css_color($sout, '#access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a, #access ul li.current-menu-parent > a', $optVal);
        weaver_css_color($sout, '#access2 ul li.current_page_item > a, #access2 ul li.current-menu-ancestor > a,
#access2 ul li.current-menu-item > a, #access2 ul li.current-menu-parent > a', $optVal);
        weaver_css_color($sout, '#access3 ul li.current_page_item > a, #access3 ul li.current-menu-ancestor > a,
#access3 ul li.current-menu-item > a, #access3 ul li.current-menu-parent > a', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_menubar_curpage_color_css')) {
        weaver_css_css($sout, '#access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a, #access ul li.current-menu-parent > a', $optVal);
        weaver_css_css($sout, '#access2 ul li.current_page_item > a, #access2 ul li.current-menu-ancestor > a,
#access2 ul li.current-menu-item > a, #access2 ul li.current-menu-parent > a', $optVal);
        weaver_css_css($sout, '#access3 ul li.current_page_item > a, #access3 ul li.current-menu-ancestor > a,
#access3 ul li.current-menu-item > a, #access3 ul li.current-menu-parent > a', $optVal);
    }
    /*  ttw_menubar_hover_color  */
    /*  ttw_menubar_hoverbg_color  */
    /*  ttw_menubar_text_color  */
    if ($optVal = weaver_getopt_color('ttw_menubar_hover_color')) {
        weaver_css_color($sout, '#access li:hover > a, #access ul ul :hover > a', $optVal);
        weaver_css_color($sout, '#access2 li:hover > a, #access2 ul ul :hover > a', $optVal);
        weaver_css_color($sout, '#access3 li:hover > a, #access3 ul ul :hover > a', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_menubar_hoverbg_color')) {
        weaver_css_bgcolor($sout, '#access ul ul a, #access li:hover > a, #access ul ul :hover > a ', $optVal);
        weaver_css_bgcolor($sout, '#access2 ul ul a, #access2 li:hover > a, #access2 ul ul :hover > a ', $optVal);
        weaver_css_bgcolor($sout, '#access3 ul ul a, #access3 li:hover > a, #access3 ul ul :hover > a ', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_menubar_text_color')) {
        weaver_css_color($sout, '#access a, #access2 a, #access3 a', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_menubar_hover_color_css')) {
        weaver_css_css($sout, '#access li:hover > a, #access ul ul :hover > a', $optVal);
        weaver_css_css($sout, '#access2 li:hover > a, #access2 ul ul :hover > a', $optVal);
        weaver_css_css($sout, '#access3 li:hover > a, #access3 ul ul :hover > a', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_menubar_hoverbg_color_css')) {
        weaver_css_css($sout, '#access ul ul a, #access li:hover > a, #access ul ul :hover > a ', $optVal);
        weaver_css_css($sout, '#access2 ul ul a, #access2 li:hover > a, #access2 ul ul :hover > a ', $optVal);
        weaver_css_css($sout, '#access3 ul ul a, #access3 li:hover > a, #access3 ul ul :hover > a ', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_menubar_text_color_css')) {
        weaver_css_css($sout, '#access a,#access2 a,#access3 a', $optVal);
    }
    /*  ttw_move_menu - no CSS (used by rounded corners) */
    /*  ttw_page_bgcolor  */
    if ($optVal = weaver_getopt('ttw_page_bgcolor')) {
        weaver_css_bgcolor($sout, '#wrapper', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_page_bgcolor_css')) {
        weaver_css_css($sout, '#wrapper', $optVal);
    }
    /*  ttw_plink_color  */
    /*  ttw_plink_visited_color  */
    /*  ttw_plink_hover_color  */
    if ($optVal = weaver_getopt_color('ttw_plink_color')) {
        /* post title links */
        weaver_css_color($sout, '.entry-title a:link', $optVal);
        weaver_css_color($sout, '.widget_rss a.rsswidget:link', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_plink_visited_color')) {
        weaver_css_color($sout, '.entry-title a:visited', $optVal);
        weaver_css_color($sout, '.widget_rss a.rsswidget:visited', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_plink_hover_color')) {
        weaver_css_color($sout, '.entry-title a:active, .entry-title a:hover', $optVal);
        weaver_css_color($sout, '.widget_rss a.rsswidget:active, .widget_rss a.rsswidget:hover', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_plink_color_css')) {
        /* post title links */
        weaver_css_css($sout, '.entry-title a:link', $optVal);
        weaver_css_css($sout, '.widget_rss a.rsswidget:link', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_plink_visited_color_css')) {
        weaver_css_css($sout, '.entry-title a:visited', $optVal);
        weaver_css_css($sout, '.widget_rss a.rsswidget:visited', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_plink_hover_color_css')) {
        weaver_css_css($sout, '.entry-title a:active, .entry-title a:hover', $optVal);
        weaver_css_css($sout, '.widget_rss a.rsswidget:active, .widget_rss a.rsswidget:hover', $optVal);
    }
    /*  ttw_post_bgcolor  */
    if ($optVal = weaver_getopt('ttw_post_bgcolor')) {
        weaver_css_bgcolor($sout, '.post', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_post_bgcolor_css')) {
        weaver_css_css($sout, '.post', $optVal);
    }
    /*  ttw_side1_bgcolor  */
    /*  ttw_side2_bgcolor  */
    /*  ttw_side3_bgcolor  */
    if ($optVal = weaver_getopt('ttw_side1_bgcolor')) {
        weaver_css_bgcolor($sout, '#primary', $optVal, 'padding-left: 10px; padding-top: 10px; margin-bottom: 5px;');
    }
    if ($optVal = weaver_getopt('ttw_side2_bgcolor')) {
        weaver_css_bgcolor($sout, '#secondary', $optVal, 'padding-left: 10px; padding-top: 10px; margin-bottom: 5px;');
    }
    if ($optVal = weaver_getopt('ttw_side3_bgcolor')) {
        weaver_css_bgcolor($sout, '#altright, #altleft', $optVal, 'padding-left: 10px; padding-top: 10px; margin-bottom: 5px;');
    }
    if ($optVal = weaver_getopt('ttw_side1_bgcolor_css')) {
        weaver_css_css($sout, '#primary', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_side2_bgcolor_css')) {
        weaver_css_css($sout, '#secondary', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_side3_bgcolor_css')) {
        weaver_css_css($sout, '#altright, #altleft', $optVal);
    }
    /*  ttw_sidebar_width  */
    /*  ttw_sidebars  */
    /* 	The CSS for sidebars is generated last because it might override some other settings  */
    $optVal = weaver_getopt('ttw_site_margins');
    if (strlen($optVal) > 0) {
        weaver_f_write($sout, sprintf("#header {padding-top: %spx;}\n#wrapper {padding: 0 %spx;}\n#footer {margin-bottom: %spx;}\n", $optVal + 10, $optVal, $optVal, $optVal));
        if (!weaver_getopt('ttw_title_on_header')) {
            weaver_f_write($sout, sprintf("#site-title{padding-left: 4px;}\n#site-title, #site-description {margin: %spx 0px 0px 0px;}\n", ($optVal + 2) / 2));
        }
    }
    /*  ttw_stickypost_bgcolor  */
    if ($optVal = weaver_getopt('ttw_stickypost_bgcolor')) {
        weaver_css_bgcolor($sout, '.home .sticky, #entry-author-info, #container.page-with-posts .sticky', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_stickypost_bgcolor_css')) {
        weaver_css_css($sout, '.home .sticky, #entry-author-info, #container.page-with-posts .sticky', $optVal);
    }
    /*  ttw_text_color  */
    if ($textColor = weaver_getopt_color('ttw_text_color')) {
        weaver_css_color($sout, '#content h1, #content h2, #content h3, #content h4, #content h5, #content h6, #content dt, #content th', $textColor);
        weaver_css_color($sout, 'h1, h2, h3, h4, h5, h6', $textColor);
        weaver_css_color($sout, '.page-title', $textColor);
        weaver_css_color($sout, '.page-link', $textColor);
        weaver_css_color($sout, '#entry-author-info h2', $textColor);
        weaver_css_color($sout, 'h3#comments-title, h3#reply-title', $textColor);
        weaver_css_color($sout, '.comment-author cite', $textColor);
        weaver_css_color($sout, '.entry-content fieldset legend', $textColor);
    }
    if ($textColor = weaver_getopt('ttw_text_color_css')) {
        weaver_css_css($sout, '#content h1, #content h2, #content h3, #content h4, #content h5, #content h6, #content dt, #content th', $textColor);
        weaver_css_css($sout, 'h1, h2, h3, h4, h5, h6', $textColor);
        weaver_css_css($sout, '.page-title', $textColor);
        weaver_css_css($sout, '.page-link', $textColor);
        weaver_css_css($sout, '#entry-author-info h2', $textColor);
        weaver_css_css($sout, 'h3#comments-title, h3#reply-title', $textColor);
        weaver_css_css($sout, '.comment-author cite', $textColor);
        weaver_css_css($sout, '.entry-content fieldset legend', $textColor);
    }
    /*  ttw_page_title_color - MUST come after ttw_text_color! */
    if ($textColor = weaver_getopt_color('ttw_page_title_color')) {
        weaver_css_color($sout, '#content .entry-title', $textColor);
    } else {
        if ($textColor = weaver_getopt_color('ttw_text_color')) {
            // this gives backward compatibility pre-1.5
            weaver_css_color($sout, '#content .entry-title', $textColor);
        }
    }
    if ($textColor = weaver_getopt('ttw_page_title_color_css')) {
        // not pre-1.5, so no worry
        weaver_css_css($sout, '#content .entry-title', $textColor);
    }
    /*  ttw_title_color  */
    if ($optVal = weaver_getopt_color('ttw_title_color')) {
        weaver_f_write($sout, sprintf("#site-title a { color: " . $optVal . "; }\n"));
    }
    if ($optVal = weaver_getopt('ttw_title_color_css')) {
        weaver_css_css($sout, '#site-title', $optVal);
    }
    /*  ttw_topbottom_bgcolor  */
    if ($optVal = weaver_getopt('ttw_topbottom_bgcolor')) {
        weaver_css_bgcolor($sout, '#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget', $optVal, 'padding-left: 10px; padding-top: 10px; margin-bottom: 10px;');
    }
    if ($optVal = weaver_getopt('ttw_topbottom_bgcolor_css')) {
        weaver_css_css($sout, '#ttw-top-widget, #ttw-bot-widget, #ttw-site-top-widget, #ttw-site-bot-widget, #per-page-widget', $optVal);
    }
    /*  ttw_weaver_tables  */
    $table = weaver_getopt('ttw_weaver_tables');
    if ($table != 'None') {
        // Need to write default style values
        weaver_f_write($sout, "table { border-collapse:collapse;border-spacing:0;}\nth { text-align:left; padding:4px 4px; }\ntd { margin:0;padding:4px 4px; }\n");
        if ($table != 'Default') {
            // Non-default styles based on Weaver table style
            weaver_f_write($sout, "#content table { border: 2px solid #AAA; text-align: left; margin: auto; margin-bottom: 5px; width: auto; }\n#content tr th, #content thead th { color: inherit; background-color: rgba(0,0,0,.1); font-size: medium;\n   font-weight: normal; line-height: normal; padding: 5px 10px; }\n#content tr td { border: 1px solid #AAA; padding: 5px 10px; }\n#content tr.odd td { background: inherit; }\n");
        }
    }
    if ($table == 'Default') {
        // make backward compatible with 1.4 and before when Twenty Ten was default
        weaver_f_write($sout, sprintf("#content table {border: 1px solid #e7e7e7;margin: 0 -1px 24px 0;text-align: left;width: 100%%;}\n#content tr th, #content thead th {color: #888;font-size: 12px;font-weight: bold;line-height: 18px;padding: 9px 24px;}\n#content tr td {border-style:none; border-top: 1px solid #e7e7e7; padding: 6px 24px;}\n#content tr.odd td {background: #f2f7fc;}\n"));
    } else {
        if ($table == 'Bold Headings') {
            weaver_f_write($sout, sprintf("#content table {border: 2px solid #888;}\n#content tr th, #content thead th {font-weight: bold;}\n#content tr td {border: 1px solid #888;}\n"));
        } else {
            if ($table == 'No Borders') {
                weaver_f_write($sout, sprintf("#content table {border-style:none;}\n#content tr th, #content thead th {font-weight: bold;border-bottom: 1px solid #888;background-color:transparent;}\n#content tr td {border-style:none;}\n"));
            } else {
                if ($table == 'Full Width') {
                    weaver_f_write($sout, sprintf("#content table {width:100%%;}\n#content tr th, #content thead th {font-weight:bold;}\n"));
                }
            }
        }
    }
    // else 'Weaver' - handled previously
    /*  ttw_wide_top_bottom - used by sidebar calcs */
    /*  ttw_widget_color  */
    if ($widgetColor = weaver_getopt_color('ttw_widget_color')) {
        weaver_css_color($sout, '.widget-area', $widgetColor);
    }
    if ($widgetColor = weaver_getopt('ttw_widget_color_css')) {
        weaver_css_css($sout, '.widget-area', $widgetColor);
    }
    /*  ttw_widget_header_underline  */
    $val = (int) weaver_getopt('ttw_widget_header_underline');
    /* bar under widget */
    if ($val != '' && $val != 0) {
        $titleColor = weaver_getopt('ttw_widget_title_color');
        weaver_f_write($sout, sprintf(".widget-title {border-bottom: {$val}" . "px solid {$titleColor}; margin-bottom:5px;}\n"));
    }
    /*  ttw_widget_item_bgcolor */
    if ($optVal = weaver_getopt('ttw_widget_item_bgcolor')) {
        weaver_css_bgcolor($sout, '.widget-container', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_widget_item_bgcolor_css')) {
        weaver_css_css($sout, '.widget-container', $optVal);
    }
    /*  ttw_widget_title_color  */
    if ($wigtitleColor = weaver_getopt_color('ttw_widget_title_color')) {
        weaver_css_color($sout, '.widget-title', $wigtitleColor);
        weaver_css_color($sout, '.widget_search label', $wigtitleColor);
        weaver_css_color($sout, '#wp-calendar caption', $wigtitleColor);
    }
    if ($wigtitleColor = weaver_getopt_color('ttw_widget_title_color_css')) {
        weaver_css_css($sout, '.widget-title', $wigtitleColor);
        weaver_css_css($sout, '.widget_search label', $wigtitleColor);
        weaver_css_css($sout, '#wp-calendar caption', $wigtitleColor);
    }
    /*  ttw_wlink_color  */
    /*  ttw_wlink_visited_color  */
    /*  ttw_wlink_hover_color  */
    if ($optVal = weaver_getopt_color('ttw_wlink_color')) {
        weaver_css_color($sout, '#primary a:link, #secondary a:link, #altleft a:link, #altright a:link, #footer-widget-area a:link', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_wlink_visited_color')) {
        weaver_css_color($sout, '#primary a:visited, #secondary a:visited, #altleft a:visited, #altright a:visited, #footer-widget-area a:visited', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_wlink_hover_color')) {
        weaver_css_color($sout, '#primary a:hover, #secondary a:hover, #altleft a:hover, #altright a:hover, #footer-widget-area a:hover', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_wlink_color_css')) {
        weaver_css_css($sout, '#primary a:link, #secondary a:link, #altleft a:link, #altright a:link, #footer-widget-area a:link', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_wlink_visited_color_css')) {
        weaver_css_css($sout, '#primary a:visited, #secondary a:visited, #altleft a:visited, #altright a:visited, #footer-widget-area a:visited', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_wlink_hover_color_css')) {
        weaver_css_css($sout, '#primary a:hover, #secondary a:hover, #altleft a:hover, #altright a:hover, #footer-widget-area a:hover', $optVal);
    }
    /*  ttw_wrap_shadow  */
    if (weaver_getopt('ttw_wrap_shadow')) {
        weaver_f_write($sout, sprintf("#wrapper {box-shadow: 0 0 3px 3px rgba(0,0,0,0.25); -webkit-box-shadow: 0 0 3px 3px rgba(0,0,0,0.25); -moz-box-shadow: 0 0 3px 3px rgba(0,0,0,0.25);}\n"));
    }
    do_action('wvrx_plus_output_style', $sout);
    $add_css = weaver_getopt('ttw_add_css');
    if (!empty($add_css)) {
        weaver_f_write($sout, weaver_getopt('ttw_add_css'));
    }
    weaver_f_write($sout, "\n/* end Weaver CSS */\n");
}
예제 #2
0
function weaver_output_editor_style($sout)
{
    /* This outputs the CSS overrides. It will output to a file pointer, so it can write to a .css file saved
          in the user's upload directory - just like the saved style .wvr files. It is included via a standard
          css include. It needs to be loaded only for the admin page.
       */
    // Put a options that can be overridden by the CSS option at the top!
    /*  ttw_contentlist_bullet  */
    $val = weaver_getopt("ttw_contentlist_bullet");
    /* add a new lsit bullet */
    if ($val && $val != '' && $val != 'default') {
        if ($val == 'none' || $val == 'circle' || $val == 'disc' || $val == 'square') {
            weaver_f_write($sout, sprintf("ul {list-style:%s;}\n", $val));
        } else {
            weaver_f_write($sout, sprintf("ul {list-style:none;list-style-image: url(%s/images/bullets/%s.gif);}\n", get_template_directory_uri(), $val));
        }
    }
    /*  ttw_content_font  */
    if (($useFont = weaver_get_font_value('ttw_content_font')) != '') {
        weaver_css_fontfamily($sout, '*', $useFont);
    }
    /*  ttw_title_font  */
    if (($useFont = weaver_get_font_value('ttw_title_font')) != '') {
        weaver_css_fontfamily($sout, 'thead th, tr th', $useFont);
    }
    /* need to handle bg color of content area - need to do the cascade ourself */
    if (($optVal = weaver_getopt("ttw_content_bgcolor")) && strcasecmp($optVal, 'transparent') != 0) {
        /* #content */
        weaver_css_bgcolor($sout, 'html .mceContentBody', $optVal);
    } else {
        if (($optVal = weaver_getopt("ttw_container_bgcolor")) && strcasecmp($optVal, 'transparent') != 0) {
            /* #container */
            weaver_css_bgcolor($sout, 'html .mceContentBody', $optVal);
        } else {
            if (($optVal = weaver_getopt('ttw_main_bgcolor')) && strcasecmp($optVal, 'transparent') != 0) {
                /* #main */
                weaver_css_bgcolor($sout, 'html .mceContentBody', $optVal);
            } else {
                if (($optVal = weaver_getopt('ttw_page_bgcolor')) && strcasecmp($optVal, 'transparent') != 0) {
                    /* #wrapper */
                    weaver_css_bgcolor($sout, 'html .mceContentBody', $optVal);
                } else {
                    if (($name = weaver_getopt('ttw_subtheme')) && strcasecmp($name, 'Transparent Dark') == 0) {
                        weaver_css_bgcolor($sout, 'html .mceContentBody', '#222');
                    } else {
                        if (($name = weaver_getopt('ttw_subtheme')) && strcasecmp($name, 'Transparent Light') == 0) {
                            weaver_css_bgcolor($sout, 'html .mceContentBody', '#ccc');
                        }
                    }
                }
            }
        }
    }
    /*  ttw_content_color  - text color of content */
    if ($optVal = weaver_getopt_color('ttw_content_color')) {
        weaver_css_color($sout, '*, table,tr td,tr th', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_content_color_css')) {
        weaver_css_css($sout, '*, table,tr td,tr th', $optVal);
    }
    /*  ttw_small_content_font  */
    if (!weaver_getopt('ttw_small_content_font')) {
        weaver_f_write($sout, sprintf("* {font-size: 16px; line-height: 1.5; }\n"));
        // write content font
        weaver_f_write($sout, sprintf("p,dl,td,th,ul,ol,blockquote {font-size: 16px; line-height: 1.5; }\n"));
        // line height styling
    }
    /*  ttw_hr_color  */
    if ($optVal = weaver_getopt_color('ttw_hr_color')) {
        weaver_css_bgcolor($sout, 'hr', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_hr_color_css')) {
        weaver_css_css($sout, 'hr', $optVal);
    }
    /*  ttw_link_color  */
    /*  ttw_link_hover_color  */
    /*  ttw_link_visited_color  */
    if ($optVal = weaver_getopt_color('ttw_link_color')) {
        weaver_css_color($sout, 'a:link', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_link_hover_color')) {
        weaver_css_color($sout, 'a:active, a:hover', $optVal);
    }
    if ($optVal = weaver_getopt_color('ttw_link_visited_color')) {
        weaver_css_color($sout, 'a:visited', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_link_color_css')) {
        weaver_css_css($sout, 'a:link', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_link_hover_color_css')) {
        weaver_css_css($sout, 'a:active, a:hover', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_link_visited_color_css')) {
        weaver_css_css($sout, 'a:visited', $optVal);
    }
    /*  ttw_caption_color  */
    if ($optVal = weaver_getopt_color('ttw_caption_color')) {
        weaver_css_color($sout, '.wp-caption, .wp-caption p.wp-caption-text', $optVal);
    }
    if ($optVal = weaver_getopt('ttw_caption_color_css')) {
        weaver_css_css($sout, '.wp-caption, .wp-caption p.wp-caption-text', $optVal);
    }
    /*    ttw_media_lib_border    */
    if ($optVal = weaver_getopt('ttw_media_lib_border')) {
        weaver_f_write($sout, sprintf(".size-full, .size-large, .size-medium, .size-thumbnail,.size-thumbnail {background-color: %s;}\n", $optVal));
    }
    if ($optVal = weaver_getopt('ttw_media_lib_border_css')) {
        weaver_css_css($sout, '.size-full, .size-large, .size-medium, .size-thumbnail', $optVal);
    }
    /*    ttw_media_lib_captioned_border    */
    if ($optVal = weaver_getopt('ttw_media_lib_captioned_border')) {
        weaver_f_write($sout, sprintf(".wp-caption, .wp-caption p.wp-caption-text,\n.wp-caption .size-full, .wp-caption .size-large, .wp-caption .size-medium,\n.wp-caption .size-thumbnail, .wp-caption .size-thumbnail {background-color: %s;}\n", $optVal));
    }
    if ($optVal = weaver_getopt('ttw_media_lib_captioned_border_css')) {
        weaver_css_css($sout, '.wp-caption, .wp-caption p.wp-caption-text,
.wp-caption .size-full, .wp-caption .size-large, .wp-caption .size-medium,
.wp-caption .size-thumbnail, .wp-caption .size-thumbnail', $optVal);
    }
    /*  ttw_text_color  */
    if ($textColor = weaver_getopt_color('ttw_text_color')) {
        weaver_css_color($sout, 'h1, h2, h3, h4, h5, h6, dt, th', $textColor);
    }
    if ($textColor = weaver_getopt('ttw_text_color_css')) {
        weaver_css_css($sout, 'h1, h2, h3, h4, h5, h6, dt, th', $textColor);
    }
    /*  ttw_weaver_tables  */
    /* based on code in wvr-generatecss - the standard not 'none' code is in editor-style.css so you
       get a reasonable display when 'None' is the style. Also have to add !important to all borders. */
    $table = weaver_getopt('ttw_weaver_tables');
    if ($table != 'None') {
        // Need to write default style values
        if ($table != 'Default') {
            // Non-default styles based on Weaver table style
            weaver_f_write($sout, "table { border: 2px solid #AAA !important; text-align: left; margin: auto; margin-bottom: 5px; width: auto; }\ntr th, thead th { color: inherit; background-color: rgba(0,0,0,.1); font-size: medium;\n   font-weight: normal; line-height: normal; padding: 5px 10px; }\ntr td { border: 1px solid #AAA !important; padding: 5px 10px; }\ntr.odd td { background: inherit; }\n");
        }
    }
    if ($table == 'Default') {
        // make backward compatible with 1.4 and before when Twenty Ten was default
        weaver_f_write($sout, sprintf("table {border: 1px solid #e7e7e7 !important;margin: 0 -1px 24px 0;text-align: left;width: 100%%;}\ntr th, thead th {color: #888;font-size: 12px;font-weight: bold;line-height: 18px;padding: 9px 24px;}\ntr td {border-style:none !important; border-top: 1px solid #e7e7e7; padding: 6px 24px;}\ntr.odd td {background: #f2f7fc;}\n"));
    } else {
        if ($table == 'Bold Headings') {
            weaver_f_write($sout, sprintf("table {border: 2px solid #888;}\ntr th, thead th {font-weight: bold;}\ntr td {border: 1px solid #888 !important;}\n"));
        } else {
            if ($table == 'No Borders') {
                weaver_f_write($sout, sprintf("table {border-style:none;}\ntr th, thead th {font-weight: bold;border-bottom: 1px solid #888 !important;background-color:transparent;}\ntr td {border-style:none !important;}\n"));
            } else {
                if ($table == 'Full Width') {
                    weaver_f_write($sout, sprintf("table {width:100%%;}\ntr th, thead th {font-weight:bold;}\n"));
                }
            }
        }
    }
    // else 'Weaver' - handled previously
    if (function_exists('weaver_plus_output_editor_style')) {
        weaver_plus_output_editor_style($sout);
    }
}