Esempio n. 1
0
function cuttz_scss_compile()
{
    if (!current_user_can('update_themes')) {
        return;
    }
    $scss = new scssc();
    $scss->setFormatter('scss_formatter');
    if (file_exists(CHILD_DIR . '/lib/stylesheet-core/style.scss')) {
        if (filemtime(CHILD_DIR . '/lib/stylesheet-core/style.scss') > filemtime(CHILD_DIR . '/style.css')) {
            $css = "@charset \"UTF-8\"; \n\n/*S********************************************************************************\n******************** Make all your changes to themes/cuttz/lib/stylesheet-core/style.scss **************************\n**** This file will be overwritten by style.scss and your changes will be lost ****\n**********************************************************************************/\n\n";
            $css = '';
            $css .= $scss->compile('@import "' . CHILD_DIR . '/lib/stylesheet-core/style.scss' . '"');
            file_put_contents(CHILD_DIR . '/style.css', $css);
            if (function_exists('w3tc_browsercache_flush')) {
                //check if W3Total cache is installed and active
                w3tc_browsercache_flush();
                //flush the w3tc browser cache to fetch the new css
            }
        }
    }
    if (file_exists(cuttz_current_skin_path() . '/style.scss')) {
        if (filemtime(cuttz_current_skin_path() . '/style.scss') > @filemtime(cuttz_current_skin_path() . '/autogenerated.css')) {
            $css = "@charset \"UTF-8\"; \n\n/*D*********************************************************************************\n******************** Make all your changes to style.scss **************************\n**** This file will be overwritten by style.scss and your changes will be lost ****\n**********************************************************************************/\n\n";
            $css .= $scss->compile('@import "' . cuttz_current_skin_path() . '/style.scss' . '"');
            file_put_contents(cuttz_current_skin_path() . '/autogenerated.css', $css);
            if (function_exists('w3tc_browsercache_flush')) {
                //check if W3Total cache is installed and active
                w3tc_browsercache_flush();
                //flush the w3tc browser cache to fetch the new css
            }
        }
    }
    $user_dir = cuttz_get_res('dir');
    if (file_exists($user_dir . 'style.scss')) {
        if (filemtime($user_dir . 'style.scss') > @filemtime($user_dir . 'autogenerated.css')) {
            $css = "@charset \"UTF-8\"; \n\n/*U********************************************************************************\n******************** Make all your changes to style.scss **************************\n**** This file will be overwritten by style.scss and your changes will be lost ****\n**********************************************************************************/\n\n";
            $css .= $scss->compile('@import "' . $user_dir . 'style.scss' . '"');
            file_put_contents($user_dir . 'autogenerated.css', $css);
            if (function_exists('w3tc_browsercache_flush')) {
                //check if W3Total cache is installed and active
                w3tc_browsercache_flush();
                //flush the w3tc browser cache to fetch the new css
            }
        }
    }
}
 /**
  * @brief Handles logo and favicon uploads.
  * @details [long description]
  * @return [description]
  */
 function upload()
 {
     if (!isset($_REQUEST['cuttz-branding-upload'])) {
         return;
     }
     check_admin_referer(CHILD_SETTINGS_FIELD_BRANDING);
     $res = '';
     $usr_img_dir = cuttz_get_res('dir') . 'img';
     cuttz_init_path($usr_img_dir);
     $tmp_icon = $_FILES['cuttz-icon']['tmp_name'];
     if (is_uploaded_file($tmp_icon)) {
         $file_parts = pathinfo($_FILES['cuttz-icon']['name']);
         $ext = $file_parts['extension'];
         $dest = $usr_img_dir . '/' . 'favicon.' . $ext;
         if (in_array($ext, cuttz_favicon_types())) {
             cuttz_remove_favicons();
             $res = move_uploaded_file($tmp_icon, $dest);
             if ($res) {
                 $favurl = cuttz_get_res('dirurl') . 'img/favicon.' . $ext;
                 wp_cache_flush();
                 $res = __('Favicon updated. Old favicon purged.', 'cuttz-framework');
             } else {
                 $res = __('Couldn\'t move file.', 'cuttz-framework');
                 if (!is_writable($dest)) {
                     $res .= __(' Destination is not writable.', 'cuttz-framework');
                 }
             }
         } else {
             $res .= ' ' . __('File type not allowed', 'cuttz-framework');
         }
     } else {
         //$res .= ' '.__('File could not be uploaded.','cuttz-framework');
     }
     $tmp_logo = $_FILES['cuttz-logo']['tmp_name'];
     if (is_uploaded_file($tmp_logo)) {
         $file_parts = pathinfo($_FILES['cuttz-logo']['name']);
         $ext = $file_parts['extension'];
         $dest = $usr_img_dir . '/' . 'logo.' . $ext;
         if (in_array($ext, cuttz_logo_types())) {
             cuttz_remove_logos();
             $res = move_uploaded_file($tmp_logo, $dest);
             if ($res) {
                 $favurl = cuttz_get_res('dirurl') . 'img/logo.' . $ext;
                 wp_cache_flush();
                 $res = __('Logo updated. Old logo purged.', 'cuttz-framework');
             } else {
                 $res = __('Couldn\'t move file.', 'cuttz-framework');
                 if (!is_writable($dest)) {
                     $res .= ' ' . __('Destination is not writable.', 'cuttz-framework');
                 }
             }
         } else {
             $res .= ' ' . __('File type not allowed', 'cuttz-framework');
         }
     } else {
         //$res .= ' '. __('File could not be uploaded.','cuttz-framework');
     }
     echo '<div id="message" class="updated"><p><strong>' . $res . '</strong></p></div>';
 }
Esempio n. 3
0
/**
 * Generates and write or return CSS as per the design settings. Generates dynamic media queries.
 * @param array $settings (Design Settings)
 * @param bool $writecss 
 * @return string CSS or none
 * @since 1.0
 */
function cuttz_generate_css($settings = array(), $writecss = true)
{
    $writecss = (bool) $writecss;
    if (!is_array($settings) || $settings == false || empty($settings)) {
        /* In case there is no settings passed which is the case when doing after_theme_switch, Cuttz should check for the skin that is set in the admin settings field. Get it's settings and use them instead of dumbing back to vanilla
         */
        $skin = get_option(cuttz_get_skin_page_id());
        // try to get the settings of the current skin
        if (!$skin) {
            // If no settings exist/first-run then get the default settings.
            $skin = cuttz_skin_defaults();
        }
        $settings = cuttz_back_compat($skin);
    }
    // Global $cuttz_skin_defaults;
    $layout = $settings['layout'];
    $padding = (int) $settings['col-spacing'];
    $content_w_1col = (int) $settings['column-content-1col'];
    $content_w_2col = (int) $settings['column-content-2col'];
    $sb1_w_2col = (int) $settings['sidebar-one-2col'];
    $content_w_3col = (int) $settings['column-content-3col'];
    $sb1_w_3col = (int) $settings['sidebar-one-3col'];
    $sb2_w_3col = (int) $settings['sidebar-two-3col'];
    $site_bg_color = $settings['site-background-color'];
    $page_bg_color = $settings['page-background-color'];
    $primary_text_color = $settings['primary-text-color'];
    $form_text_color = $settings['form-text-color'];
    $primary_link_color = $settings['primary-link-color'];
    $primary_link_hover_color = $settings['primary-link-hover-color'];
    $form_font_family = $settings['form-font-family'];
    $form_font_family = cuttz_get_font_family($form_font_family);
    $body_font_family = $settings['body-font-family'];
    $body_font_family = cuttz_get_font_family($body_font_family);
    $body_font_weight = cuttz_get_font_weight($settings['body-font-weight']);
    $body_font_style = $settings['body-font-weight'];
    $nav_menu_font_family = $settings['nav-menu-font-family'];
    $nav_menu_font_family = cuttz_get_font_family($nav_menu_font_family);
    $nav_menu_font_weight = cuttz_get_font_weight($settings['nav-menu-font-weight']);
    $nav_menu_font_style = cuttz_get_font_style($settings['nav-menu-font-weight']);
    $subnav_menu_font_family = $settings['subnav-menu-font-family'];
    $subnav_menu_font_family = cuttz_get_font_family($subnav_menu_font_family);
    $subnav_menu_font_weight = cuttz_get_font_weight($settings['subnav-menu-font-weight']);
    $subnav_menu_font_style = cuttz_get_font_style($settings['subnav-menu-font-weight']);
    $site_title_font_family = $settings['site-title-font-family'];
    $site_title_font_family = cuttz_get_font_family($site_title_font_family);
    $site_title_font_weight = cuttz_get_font_weight($settings['site-title-font-weight']);
    $site_title_font_style = cuttz_get_font_style($settings['site-title-font-weight']);
    $site_description_font_family = $settings['site-description-font-family'];
    $site_description_font_family = cuttz_get_font_family($site_description_font_family);
    $site_description_font_weight = cuttz_get_font_weight($settings['site-description-font-weight']);
    $site_description_font_style = cuttz_get_font_style($settings['site-description-font-weight']);
    $headline_font_family = $settings['headline-font-family'];
    $headline_font_family = cuttz_get_font_family($headline_font_family);
    $headline_font_weight = cuttz_get_font_weight($settings['headline-font-weight']);
    $headline_font_style = cuttz_get_font_style($settings['headline-font-weight']);
    $headline_subhead_font_family = $settings['headline-subhead-font-family'];
    $headline_subhead_font_family = cuttz_get_font_family($headline_subhead_font_family);
    $headline_subhead_font_weight = cuttz_get_font_weight($settings['headline-subhead-font-weight']);
    $headline_subhead_font_style = cuttz_get_font_style($settings['headline-subhead-font-weight']);
    $byline_font_family = $settings['byline-font-family'];
    $byline_font_family = cuttz_get_font_family($byline_font_family);
    $byline_font_weight = cuttz_get_font_weight($settings['byline-font-weight']);
    $byline_font_style = cuttz_get_font_style($settings['byline-font-weight']);
    $sidebar_heading_font_family = $settings['sidebar-heading-font-family'];
    $sidebar_heading_font_family = cuttz_get_font_family($sidebar_heading_font_family);
    $sidebar_heading_font_weight = cuttz_get_font_weight($settings['sidebar-heading-font-weight']);
    $sidebar_heading_font_style = cuttz_get_font_style($settings['sidebar-heading-font-weight']);
    $sidebar_font_family = $settings['sidebar-font-family'];
    $sidebar_font_family = cuttz_get_font_family($sidebar_font_family);
    $sidebar_font_weight = cuttz_get_font_weight($settings['sidebar-font-weight']);
    $sidebar_font_style = cuttz_get_font_style($settings['sidebar-font-weight']);
    $footer_widgets_font_family = $settings['footer-widgets-font-family'];
    $footer_widgets_font_family = cuttz_get_font_family($footer_widgets_font_family);
    $footer_widgets_font_weight = cuttz_get_font_weight($settings['footer-widgets-font-weight']);
    $footer_widgets_font_style = cuttz_get_font_style($settings['footer-widgets-font-weight']);
    $footer_widgets_heading_font_family = $settings['footer-widgets-heading-font-family'];
    $footer_widgets_heading_font_family = cuttz_get_font_family($footer_widgets_heading_font_family);
    $footer_widgets_heading_font_weight = cuttz_get_font_weight($settings['footer-widgets-heading-font-weight']);
    $footer_widgets_heading_font_style = cuttz_get_font_style($settings['footer-widgets-heading-font-weight']);
    $footer_font_family = $settings['footer-font-family'];
    $footer_font_family = cuttz_get_font_family($footer_font_family);
    $footer_font_weight = cuttz_get_font_weight($settings['footer-font-weight']);
    $footer_font_style = cuttz_get_font_style($settings['footer-font-weight']);
    $body_font_size = (int) $settings['body-font-size'];
    $form_font_size = (int) $settings['form-font-size'];
    $nav_menu_font_size = (int) $settings['nav-menu-font-size'];
    $nav_menu_link_text_color = $settings['nav-menu-link-text-color'];
    $nav_menu_link_text_hover_color = $settings['nav-menu-link-text-hover-color'];
    $nav_menu_current_link_text_color = $settings['nav-menu-current-link-text-color'];
    $nav_menu_current_parent_link_text_color = $settings['nav-menu-current-parent-link-text-color'];
    $nav_menu_link_bg_color = $settings['nav-menu-link-bg-color'];
    $nav_menu_hover_bg_color = $settings['nav-menu-hover-bg-color'];
    $nav_menu_current_bg_color = $settings['nav-menu-current-bg-color'];
    $nav_menu_current_parent_bg_color = $settings['nav-menu-current-parent-bg-color'];
    $nav_menu_border_width = $settings['nav-menu-border-width'];
    $nav_menu_border_color = $settings['nav-menu-border-color'];
    $nav_menu_submenu_width = $settings['nav-menu-submenu-width'];
    $subnav_menu_font_size = (int) $settings['subnav-menu-font-size'];
    $subnav_menu_link_text_color = $settings['subnav-menu-link-text-color'];
    $subnav_menu_link_text_hover_color = $settings['subnav-menu-link-text-hover-color'];
    $subnav_menu_current_link_text_color = $settings['subnav-menu-current-link-text-color'];
    $subnav_menu_current_parent_link_text_color = $settings['subnav-menu-current-parent-link-text-color'];
    $subnav_menu_link_bg_color = $settings['subnav-menu-link-bg-color'];
    $subnav_menu_hover_bg_color = $settings['subnav-menu-hover-bg-color'];
    $subnav_menu_current_bg_color = $settings['subnav-menu-current-bg-color'];
    $subnav_menu_current_parent_bg_color = $settings['subnav-menu-current-parent-bg-color'];
    $subnav_menu_border_width = $settings['subnav-menu-border-width'];
    $subnav_menu_border_color = $settings['subnav-menu-border-color'];
    $subnav_menu_submenu_width = $settings['subnav-menu-submenu-width'];
    $site_title_font_size = (int) $settings['site-title-font-size'];
    $site_title_font_color = $settings['site-title-font-color'];
    $site_description_font_size = (int) $settings['site-description-font-size'];
    $site_description_font_color = $settings['site-description-font-color'];
    $headline_font_size = (int) $settings['headline-font-size'];
    $headline_font_color = $settings['headline-font-color'];
    $headline_subhead_font_color = $settings['headline-subhead-font-color'];
    $byline_font_size = (int) $settings['byline-font-size'];
    $byline_font_color = $settings['byline-font-color'];
    $sidebar_font_size = (int) $settings['sidebar-font-size'];
    $sidebar_font_color = $settings['sidebar-font-color'];
    $sidebar_heading_font_size = (int) $settings['sidebar-heading-font-size'];
    $sidebar_heading_font_color = $settings['sidebar-heading-font-color'];
    $footer_font_size = (int) $settings['footer-font-size'];
    $footer_font_color = $settings['footer-font-color'];
    $footer_widgets_font_size = (int) $settings['footer-widgets-font-size'];
    $footer_widgets_font_color = $settings['footer-widgets-font-color'];
    $footer_widgets_heading_font_size = (int) $settings['footer-widgets-heading-font-size'];
    $footer_widgets_heading_font_color = $settings['footer-widgets-heading-font-color'];
    if ($nav_menu_font_family == '0') {
        $nav_menu_font_family = $body_font_family;
    }
    if ($site_title_font_family == '0') {
        $site_title_font_family = $body_font_family;
    }
    if ($site_description_font_family == '0') {
        $site_description_font_family = $site_title_font_family;
    }
    if ($headline_font_family == '0') {
        $headline_font_family = $body_font_family;
    }
    if ($headline_subhead_font_family == '0') {
        $headline_subhead_font_family = $headline_font_family;
    }
    if ($sidebar_font_family == '0') {
        $sidebar_font_family = $body_font_family;
    }
    if ($sidebar_heading_font_family == '0') {
        $sidebar_heading_font_family = $sidebar_font_family;
    }
    if ($footer_font_family == '0') {
        $footer_font_family = $body_font_family;
    }
    $widths['three-two'] = $content_w_3col + $sb1_w_3col + $sb2_w_3col + $padding * 4 - 1;
    $widths['three-one'] = $content_w_3col + $sb1_w_3col + $padding * 3 - 1;
    $widths['three-zero'] = $content_w_3col + $padding * 2 - 1;
    $widths['two-one'] = $content_w_2col + $sb1_w_2col + $padding * 3 - 1;
    $widths['two-zero'] = $content_w_2col + $padding * 2 - 1;
    $widths['one-zero'] = $content_w_1col + $padding * 2 - 1;
    $widths['min-width'] = min($widths['three-zero'], $widths['two-zero'], $widths['one-zero']);
    $site_container_css = '.pagewidth .site-container {
	/* box-shadow:0 0 15px rgba(0,0,0,0.15); */
	margin:2.618em auto;
	}
	.fullwidth .site-container {
	margin:0 auto;
	}';
    $site_container_one_col = ".pagewidth.full-width-content .site-container {\n\twidth:" . ($widths['one-zero'] + 1) . "px;\n\t} ";
    $site_container_two_col = ".pagewidth.content-sidebar .site-container,\n\t.pagewidth.sidebar-content .site-container {\n\twidth:" . ($widths['two-one'] + 1) . "px;\n\t}";
    $site_container_three_col = ".pagewidth.content-sidebar-sidebar .site-container,\n\t.pagewidth.sidebar-sidebar-content .site-container,\n\t.pagewidth.sidebar-content-sidebar .site-container{\n\twidth:" . ($widths['three-two'] + 1) . "px;\n\t}";
    $site_container_three_two = '
	.pagewidth.content-sidebar-sidebar .site-container,
	.pagewidth.sidebar-sidebar-content .site-container,
	.pagewidth.sidebar-content-sidebar .site-container {
	width:' . ($widths['three-one'] + 1) . 'px;
	}';
    $site_container_three_one = '.pagewidth.content-sidebar-sidebar .site-container,
	.pagewidth.sidebar-sidebar-content .site-container,
	.pagewidth.sidebar-content-sidebar .site-container {
	width:' . ($widths['three-zero'] + 1) . 'px;
	}';
    $site_container_three_zero = '.pagewidth.content-sidebar-sidebar .site-container,
	.pagewidth.sidebar-sidebar-content .site-container,
	.pagewidth.sidebar-content-sidebar .site-container {
	width:auto;
	}';
    $site_container_two_one = '.pagewidth.sidebar-content .site-container,
	.pagewidth.content-sidebar .site-container {
	width:' . ($widths['two-zero'] + 1) . 'px;
	}';
    $site_container_two_zero = '.pagewidth.sidebar-content .site-container,
	.pagewidth.content-sidebar .site-container {
	width:auto;
	}';
    $site_container_one_zero = '.pagewidth.full-width-content .site-container {
	width:auto;
	}';
    $css = "\n\tinput, select, textarea {\n\tcolor: " . $form_text_color . ";\n\tfont-family:" . $form_font_family . ";\n\tfont-size:" . $form_font_size . "px;\n}\n\n/*! Layout */\n" . $site_container_css . "\n/*! 1 COL WIDTHS */\n" . $site_container_one_col . "\n\n.full-width-content .wrap {\n\tpadding-left:" . $padding . "px;\n\tpadding-right:" . $padding . "px;\n\twidth:" . ($content_w_1col + $padding * 2) . "px;\n}\n\n.full-width-content .content-sidebar-wrap,\n.full-width-content .content {\n\tfloat:none;\n}\n\n/*! 2 COL WIDTHS */\n\n" . $site_container_two_col . "\n\n.content-sidebar .wrap,\n.sidebar-content .wrap {\n\twidth:" . ($content_w_2col + $sb1_w_2col + $padding * 3) . "px;\n\tpadding-left:" . $padding . "px;\n\tpadding-right:" . $padding . "px;\n}\n\n.content-sidebar .content,\n.sidebar-content .content {\n\twidth:" . $content_w_2col . "px;\n}\n\n.content-sidebar .sidebar-primary,\n.sidebar-content .sidebar-primary {\n\twidth:" . $sb1_w_2col . "px;\n}\n\n/*! 3 COL WIDTHS */\n\n" . $site_container_three_col . "\n\n\n.content-sidebar-sidebar .wrap,\n.sidebar-sidebar-content .wrap,\n.sidebar-content-sidebar .wrap {\n\twidth:" . ($padding * 4 + $content_w_3col + $sb1_w_3col + $sb2_w_3col) . "px;\n\tpadding-left:" . $padding . "px;\n\tpadding-right:" . $padding . "px;\n}\n\n.content-sidebar-sidebar .content-sidebar-wrap,\n.sidebar-sidebar-content .content-sidebar-wrap,\n.sidebar-content-sidebar .content-sidebar-wrap {\n\twidth:" . ($content_w_3col + $sb1_w_3col + $padding) . "px; /* padding for content + sidebar */\n}\n\n.content-sidebar-sidebar .content,\n.sidebar-sidebar-content .content,\n.sidebar-content-sidebar .content {\n\twidth:" . $content_w_3col . "px; /* padding for content + sidebar */\n}\n\n.content-sidebar-sidebar .sidebar-primary,\n.sidebar-sidebar-content .sidebar-primary,\n.sidebar-content-sidebar .sidebar-primary {\n\twidth:" . $sb1_w_3col . "px; /* padding for content + sidebar */\n}\n\n.content-sidebar-sidebar .sidebar-secondary,\n.sidebar-sidebar-content .sidebar-secondary,\n.sidebar-content-sidebar .sidebar-secondary {\n\twidth:" . $sb2_w_3col . "px; /* padding for content + sidebar */\n}\n\n/*! BODY FONT-SZ */\nbody {\n\tbackground-color:" . $site_bg_color . ";\n\tfont-family:" . $body_font_family . ";\n\tcolor:" . $primary_text_color . ";\n\tfont-size:" . $body_font_size . "px;\n\tfont-weight:" . $body_font_weight . ";\n\tfont-style:" . $body_font_weight . ";\n}\n\n/*! PAGE BG */\n.wrap {\n\tbackground-color:" . $page_bg_color . ";\n}\n\n/*! LINKS  */\n\na {\n\tcolor:" . $primary_link_color . ";\n}\n\n/*! Pagination */\n\n.archive-pagination li a:hover, .archive-pagination li.active a, .woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li span.current {\n\tbackground-color:" . $primary_link_color . ";\n}\n\n.widget-wrap > :not(.widget-title) a,\n.comment-content a {\n\ttext-decoration: underline;\n}\n\n.entry-content a:hover,\n.landing-section a:hover,\n.widget-wrap > :not(.widget-title) a:hover,\n.comment-content a:hover {\n\ttext-decoration: none;\n}\n\na:hover,\n.entry-title a:hover {\n\tcolor:" . $primary_link_hover_color . ";\n}\n\n.comment-content a {\n\tborder-bottom: none;\n}\n\n/*! SITE TITLE */\n.site-title {\n\tfont-family:" . $site_title_font_family . ";\n\tfont-size:" . $site_title_font_size . "px;\n\tfont-weight:" . $site_title_font_weight . ";\n\tfont-style:" . $site_title_font_style . ";\n}\n\n.site-title a {\n\tcolor:" . $site_title_font_color . ";\n}\n\n.site-description {\n\tfont-family:" . $site_description_font_family . ";\n\tfont-size:" . $site_description_font_size . "px;\n\tfont-weight:" . $site_description_font_weight . ";\n\tfont-style:" . $site_description_font_style . ";\n\tcolor:" . $site_description_font_color . ";\n}\n\n.entry-title,\n.archive-title,\n.woocommerce .page-title {\n\tfont-family: " . $headline_font_family . ";\n\tfont-size: " . $headline_font_size . "px;\n\tfont-weight: " . $headline_font_weight . ";\n\tfont-style: " . $headline_font_style . ";\n\tcolor:" . $headline_font_color . ";\n }\n\n.entry-title a {\n\tcolor:" . $headline_font_color . ";\n}\n\n.entry-content h1,\n.landing-section h1,\n.entry-content h2,\n.landing-section h2,\n.entry-content h3,\n.landing-section h3,\n.entry-content h4,\n.landing-section h4,\n.entry-content h5,\n.landing-section h5,\n.entry-content h6,\n.landing-section h6  {\n\tfont-family:" . $headline_subhead_font_family . ";\n\tcolor:" . $headline_subhead_font_color . ";\n\tfont-weight:" . $headline_subhead_font_weight . ";\n\tfont-style:" . $headline_subhead_font_style . ";\n}\n\n/*! NAV */\n\n.menu-primary {\n\tborder-bottom:" . $nav_menu_border_width . "px solid " . $nav_menu_border_color . ";\n\tborder-top:" . $nav_menu_border_width . "px solid " . $nav_menu_border_color . ";\n}\n\n.menu-primary .sub-menu {\n\tborder-left:" . ($nav_menu_border_width == 0 ? 0 : $nav_menu_border_width) . "px solid " . $nav_menu_border_color . ";\n\tmargin-left:-" . ($nav_menu_border_width == 0 ? 0 : $nav_menu_border_width) . "px;\n\tpadding-bottom:" . ($nav_menu_border_width == 0 ? 0 : $nav_menu_border_width) . "px;\n\tborder-top:" . $nav_menu_border_width . "px solid " . $nav_menu_border_color . ";\n}\n\n.rtl .menu-primary .sub-menu {\n\tborder-right:" . ($nav_menu_border_width == 0 ? 0 : $nav_menu_border_width) . "px solid " . $nav_menu_border_color . ";\n\tborder-left:0;\n\tmargin-right:-" . ($nav_menu_border_width == 0 ? 0 : $nav_menu_border_width) . "px;\n\tmargin-left:auto;\n}\n\n.menu-primary  li {\n\tfont-size:" . $nav_menu_font_size . "px;\n}\n\n.menu-primary a,\n.menu-toggle {\n\tfont-family:" . $nav_menu_font_family . ";\n\tfont-size:" . $nav_menu_font_size . "px;\n\tfont-weight:" . $nav_menu_font_weight . ";\n\tfont-style:" . $nav_menu_font_style . ";\n\tcolor:" . $nav_menu_link_text_color . ";\n\tbackground-color:" . $nav_menu_link_bg_color . ";\n}\n\n/*! redundant */\n.cuttz .genesis-nav-menu > .right {\n\tcolor:" . $nav_menu_link_text_color . ";\n\tfont-size:" . $nav_menu_font_size . "px;\n}\n\n.menu-primary .sub-menu {\n\t-webkit-box-shadow:  1px 3px 5px 0px rgba(0, 0, 0, .2);\n\t-webkit-box-shadow:  2px 2px 2px 0px rgba(0, 0, 0, .2);\n\tbox-shadow:  1px 3px 5px 0px rgba(0, 0, 0, .2);\n\tbox-shadow:  2px 2px 2px 0px rgba(0, 0, 0, .2);\n}\n\n/*! parent or parents parent/grandparent etc */\n.menu-primary .current-menu-ancestor > a {\n\tcolor:" . $nav_menu_current_parent_link_text_color . ";\n\tbackground-color:" . $nav_menu_current_parent_bg_color . ";\n}\n\n.menu-primary .current-menu-item > a {\n\tcolor:" . $nav_menu_current_link_text_color . ";\n\tbackground-color:" . $nav_menu_current_bg_color . ";\n}\n\n.menu-primary .sub-menu {\n\twidth:" . $nav_menu_submenu_width . "px;\n}\n\n.menu-primary a:hover {\n\tcolor:" . $nav_menu_link_text_hover_color . ";\n\tbackground-color:" . $nav_menu_hover_bg_color . ";\n}\n\n.nav-secondary {\n\tbackground-color:" . $subnav_menu_link_bg_color . ";\n\tborder-bottom:" . $subnav_menu_border_width . "px solid " . $subnav_menu_border_color . ";\n}\n\n.nav-secondary .wrap {\n\tbackground-color: transparent;\n}\n\n.menu-secondary .sub-menu {\n\tborder-left:" . ($subnav_menu_border_width == 0 ? 0 : $subnav_menu_border_width) . "px solid " . $subnav_menu_border_color . ";\n\tmargin-left:-" . ($subnav_menu_border_width == 0 ? 0 : $subnav_menu_border_width) . "px;\n\tpadding-bottom:" . ($subnav_menu_border_width == 0 ? 0 : $subnav_menu_border_width) . "px;\n\tborder-top:" . $subnav_menu_border_width . "px solid " . $subnav_menu_border_color . ";\n}\n\n.rtl .menu-secondary .sub-menu {\n\tborder-right:" . ($subnav_menu_border_width == 0 ? 0 : $subnav_menu_border_width) . "px solid " . $subnav_menu_border_color . ";\n\tborder-left:0;\n\tmargin-right:-" . ($subnav_menu_border_width == 0 ? 0 : $subnav_menu_border_width) . "px;\n\tmargin-left:0;\n}\n\n.menu-secondary  li {\n\tfont-size:" . $subnav_menu_font_size . "px;\n}\n\n.menu-secondary a,\n.menu-toggle {\n\tfont-family:" . $subnav_menu_font_family . ";\n\tfont-size:" . $subnav_menu_font_size . "px;\n\tfont-weight:" . $subnav_menu_font_weight . ";\n\tfont-style:" . $subnav_menu_font_style . ";\n\tcolor:" . $subnav_menu_link_text_color . ";\n\tbackground-color:" . $subnav_menu_link_bg_color . ";\n}\n\n.menu-secondary .sub-menu {\n\t-webkit-box-shadow:  1px 3px 5px 0px rgba(0, 0, 0, .2);\n\t-webkit-box-shadow:  2px 2px 2px 0px rgba(0, 0, 0, .2);\n\tbox-shadow:  1px 3px 5px 0px rgba(0, 0, 0, .2);\n\tbox-shadow:  2px 2px 2px 0px rgba(0, 0, 0, .2);\n}\n\n.menu-secondary .current-menu-ancestor > a {\n\tcolor:" . $subnav_menu_current_parent_link_text_color . ";\n\tbackground-color:" . $subnav_menu_current_parent_bg_color . ";\n}\n\n.menu-secondary .current-menu-item > a {\n\tcolor:" . $subnav_menu_current_link_text_color . ";\n\tbackground-color:" . $subnav_menu_current_bg_color . ";\n}\n\n.menu-secondary .sub-menu {\n\twidth:" . $subnav_menu_submenu_width . "px;\n}\n\n.rtl .menu-secondary .sub-menu .sub-menu {\n\tmargin-left: 0;\n}\n\n.menu-secondary a:hover {\n\tcolor:" . $subnav_menu_link_text_hover_color . ";\n\tbackground-color:" . $subnav_menu_hover_bg_color . ";\n}\n\n.menu-toggle {\n\tborder:" . $nav_menu_border_width . "px solid " . $nav_menu_border_color . ";\n\t}\n\n/*! BYLINES */\n.entry-meta,\n.entry-comments .comment-meta {\n\tfont-family:" . $byline_font_family . ";\n\tfont-size:" . $byline_font_size . "px;\n\tfont-weight:" . $byline_font_weight . ";\n\tfont-style:" . $byline_font_style . ";\n\tcolor:" . $byline_font_color . ";\n}\n\n/* */\n.entry-meta a,\n.entry-comments .comment-meta a {\n\tcolor:" . $byline_font_color . ";\n}\n\n\n.entry-meta a:hover {\n\tcolor:inherit;\n}\n\n/*! SB Widget Body */\n\n.widget-wrap {\n\tfont-family:" . $sidebar_font_family . ";\n\tfont-size:" . $sidebar_font_size . "px;\n\tfont-weight:" . $sidebar_font_weight . ";\n\tfont-style:" . $sidebar_font_style . ";\n\tcolor:" . $sidebar_font_color . ";\n}\n\n/*! SB Widget Title */\n.widget-title, .widgettitle {\n\tfont-family:" . $sidebar_heading_font_family . ";\n\tfont-size:" . $sidebar_heading_font_size . "px;\n\tfont-weight:" . $sidebar_heading_font_weight . ";\n\tfont-style:" . $sidebar_heading_font_style . ";\n\tcolor:" . $sidebar_heading_font_color . ";\n}\n\n.widget-title a, .widgettitle a {\n\tcolor:" . $sidebar_heading_font_color . ";\n}\n\n/*! Footer Widget Body */\n.footer-widgets .widget-wrap {\n\tfont-family:" . $footer_widgets_font_family . ";\n\tfont-size:" . $footer_widgets_font_size . "px;\n\tfont-weight:" . $footer_widgets_font_weight . ";\n\tfont-style:" . $footer_widgets_font_style . ";\n\tcolor:" . $footer_widgets_font_color . ";\n\t/* line-height:1.618em;  core */\n}\n\n/*! Footer Widgets Titles */\n.footer-widgets .widgettitle {\n\tfont-family:" . $footer_widgets_heading_font_family . ";\n\tfont-size:" . $footer_widgets_heading_font_size . "px;\n\tfont-weight:" . $footer_widgets_heading_font_weight . ";\n\tfont-style:" . $footer_widgets_heading_font_style . ";\n\tcolor:" . $footer_widgets_heading_font_color . ";\n}\n\n/*! Footer */\n.site-footer,\n#footer {\n\tfont-family:" . $footer_font_family . ";\n\tfont-size:" . $footer_font_size . "px;\n\tfont-weight:" . $footer_font_weight . ";\n\tfont-style:" . $footer_font_style . ";\n\tcolor:" . $footer_font_color . ";\n}\n\n.site-footer a,\n.site-footer a:hover {\n\tcolor:" . $footer_font_color . ";\n\tborder-bottom:1px solid " . $footer_font_color . ";\n\ttext-decoration:none;\n}\n\n.site-footer a:hover {\n\tborder-bottom-color: transparent;\n}\n\n.site-footer .cuttz-nav-footer a:hover {\n\tborder-bottom-color: " . $footer_font_color . ";\n}\n\n.full-width-content .content .sticky {\n\t_margin-left:-" . $padding . "px;\n\t_margin-right:-" . $padding . "px;\n\tpadding-left:" . $padding . "px;\n\tpadding-right:" . $padding . "px;\n\tpadding-top: " . $padding . "px;\n}\n\n.content-sidebar .content .sticky,\n.content-sidebar-sidebar .content .sticky {\n\tpadding-left:" . $padding . "px;\n\tpadding-right:" . $padding . "px;\n\t_margin-left:-" . $padding . "px;\n\tpadding-top: " . $padding . "px;\n}\n\n.rtl.content-sidebar .content .sticky,\n.rtl.content-sidebar-sidebar .content .sticky{\n\tmargin-left: initial;\n\t_margin-right:-" . $padding . "px;\n}\n\n.sidebar-content-sidebar .content .sticky {\n\tpadding-left:" . $padding . "px;\n\tpadding-right:" . $padding . "px;\n}\n\n.sidebar-content .content .sticky,\n.sidebar-sidebar-content .content .sticky {\n\tpadding-left:" . $padding . "px;\n\tpadding-right:" . $padding . "px;\n\t_margin-right:-" . $padding . "px;\n}\n\n.rtl.sidebar-content .content .sticky,\n.rtl.sidebar-sidebar-content .content .sticky {\n\t_margin-left:-" . $padding . "px;\n\tmargin-right: initial;\n}\n";
    $resp_css['three-two'] = '
		' . $site_container_three_two . '

		.content-sidebar-sidebar .wrap,
		.sidebar-content-sidebar .wrap,
		.sidebar-sidebar-content .wrap {
			width:' . ($content_w_3col + $sb1_w_3col + $padding * 3) . 'px;
		}
		.content-sidebar-sidebar .sidebar-secondary,
		.sidebar-content-sidebar .sidebar-secondary,
		.sidebar-sidebar-content .sidebar-secondary {
			float: none;
			clear: both;
			width: auto;
		}';
    $resp_css['three-one'] = '
		' . $site_container_three_one . '

		.content-sidebar-sidebar .wrap,
		.sidebar-content-sidebar .wrap,
		.sidebar-sidebar-content .wrap {
			width:' . ($content_w_3col + $padding * 2) . 'px;
			width: auto;
		}
		.content-sidebar-sidebar .wrap .content-sidebar-wrap,
		.sidebar-content-sidebar .wrap .content-sidebar-wrap,
		.sidebar-sidebar-content .wrap .content-sidebar-wrap {
			width:' . $content_w_3col . 'px;
			width: 100%;
		}
		.content-sidebar-sidebar .content,
		.sidebar-sidebar-content .content,
		.sidebar-content-sidebar .content {
			width: 100%;

		}
		.content-sidebar-sidebar .sidebar-primary,
		.sidebar-content-sidebar .sidebar-primary,
		.sidebar-sidebar-content .sidebar-primary {
			float: none;
			clear: both;
			width: auto;
		}
		.content-sidebar-sidebar .footer-widgets .widget-area,
		.sidebar-content-sidebar .footer-widgets .widget-area,
		.sidebar-sidebar-content .footer-widgets .widget-area {
			float: none;
			clear: both;
			display: block;
			width: auto;
		}';
    $resp_css['three-zero'] = '
		' . $site_container_three_zero . '
		.content-sidebar-sidebar .wrap,
		.sidebar-content-sidebar .wrap,
		.sidebar-sidebar-content .wrap {
			width:auto;
		}
		.content-sidebar-sidebar .wrap .content-sidebar-wrap,
		.sidebar-content-sidebar .wrap .content-sidebar-wrap,
		.sidebar-sidebar-content .wrap .content-sidebar-wrap {
			width:100%;
		}
		.content-sidebar-sidebar .content,
		.sidebar-content-sidebar .content,
		.sidebar-sidebar-content .content {
			width:100%;
		}
		.content-sidebar-sidebar .site-container,
		.sidebar-content-sidebar .site-container,
		.sidebar-sidebar-content .site-container{
			background-color:' . $page_bg_color . ';
		}
		.content-sidebar-sidebar .title-area,
		.sidebar-content-sidebar .title-area,
		.sidebar-sidebar-content .title-area {
			text-align: center;
		}
		.content-sidebar-sidebar .footer-widgets .widget-area,
		.sidebar-content-sidebar .footer-widgets .widget-area,
		.sidebar-sidebar-content .footer-widgets .widget-area {
			float: none;
			clear: both;
			display: block;
			width: auto;
		}';
    $resp_css['two-one'] = '
		' . $site_container_two_one . '

		.sidebar-content .wrap,
		.content-sidebar .wrap {
			width:' . ($content_w_2col + $padding * 2) . 'px;
			width: auto;
		}
		.sidebar-content .wrap .content-sidebar-wrap,
		.content-sidebar .wrap .content-sidebar-wrap {
			width:' . $content_w_2col . 'px;
			width: auto;

		}
		.content-sidebar .content,
		.sidebar-content .content {
			width: 100%;
		}
		.sidebar-content .sidebar-primary,
		.content-sidebar .sidebar-primary {
			float: none;
			clear: both;
			width: auto;
		}
		.sidebar-content .footer-widgets .widget-area,
		.content-sidebar .footer-widgets .widget-area {
			float: none;
			clear: both;
			width: auto;
			display: block;
		}';
    $resp_css['two-zero'] = '
		' . $site_container_two_zero . '
		.sidebar-content .wrap,
		.content-sidebar .wrap {
			width:auto;
		}
		.sidebar-content .wrap .content-sidebar-wrap,
		.content-sidebar .wrap .content-sidebar-wrap {
			width:100%;
		}
		.sidebar-content .content,
		.content-sidebar .content {
			width:100%;
		}
		.sidebar-content .site-container,
		.content-sidebar .site-container {
			background-color:' . $page_bg_color . ';
		}
		.sidebar-content .title-area,
		.content-sidebar .title-area {
			text-align: center;
		}
		.sidebar-content .footer-widgets .widget-area,
		.content-sidebar .footer-widgets .widget-area {
			float: none;
			clear: both;
			width: auto;
			display: block;
		}';
    $resp_css['one-zero'] = '
		' . $site_container_one_zero . '
		.full-width-content .wrap {
			width:auto;
		}
		.full-width-content .wrap .content-sidebar-wrap {
			width:100%;
		}
		.full-width-content .content {
			width:100%;
		}
		.full-width-content .site-container{
			background-color:' . $page_bg_color . ';
		}
		.full-width-content .title-area {
			text-align:center;
		}
		.full-width-content .footer-widgets .widget-area {
			float: none;
			clear: both;
			width: auto;
			display: block;
		}';
    $resp_css['min-width'] = '
		.content-sidebar-sidebar .wrap,
		.sidebar-content-sidebar .wrap,
		.sidebar-sidebar-content .wrap,
		.content-sidebar-sidebar .wrap,
		.sidebar-content-sidebar .wrap,
		.sidebar-sidebar-content .wrap,
		.sidebar-content .wrap,
		.content-sidebar .wrap,
		.sidebar-content .wrap,
		.content-sidebar .wrap,
		.full-width-content .wrap,
		.full-width-content .wrap {
			padding-left: 35px;
			padding-right: 35px;
		}
		.content-sidebar-sidebar .nav-primary .wrap,
		.sidebar-content-sidebar .nav-primary .wrap,
		.sidebar-sidebar-content .nav-primary .wrap,
		.content-sidebar-sidebar .nav-secondary .wrap,
		.sidebar-content-sidebar .nav-secondary .wrap,
		.sidebar-sidebar-content .nav-secondary .wrap,
		.sidebar-content .nav-primary .wrap,
		.content-sidebar .nav-primary .wrap,
		.sidebar-content .nav-secondary .wrap,
		.content-sidebar .nav-secondary .wrap,
		.full-width-content .nav-primary .wrap,
		.full-width-content .nav-secondary .wrap {
			padding: 0 0 0 0;
		}
		.nav-primary,
		.nav-secondary {
			margin-left: 35px;
			margin-right: 35px;
			display: none;
		}
		.genesis-nav-menu li,
		.site-header ul.genesis-nav-menu {
			float: none;
		}
		.menu-toggle,
		.sub-menu-toggle {
			display: block;
			visibility: visible;
		}
		.genesis-nav-menu .sub-menu {
			width: auto;
			box-shadow: none;
		}
		.genesis-nav-menu .sub-menu a {
			border-left:1px solid ' . $nav_menu_border_color . ';
		}
		.genesis-nav-menu .sub-menu li:first-child a {
			border-top: none;
		}
		.menu-toggle {
			margin-left: 35px;
			margin-right: 35px;
		}
		.menu-toggle:before {
			content: "\\2261\\00a0Menu";
		}
		.menu-toggle.activated:before {
			content: "\\2191\\00a0Menu";
		}
		.sub-menu-toggle:before {
			content: "+";
		}
		.sub-menu-toggle.activated:before {
			content: "-";
		}
		.genesis-nav-menu .menu-item {
			position: relative;
			display: block;
		}
		.nav-primary .genesis-nav-menu .sub-menu,
		.nav-secondary .genesis-nav-menu .sub-menu {
			display: none;
			opacity: 1;
			position: static;
			border-left: none;
		}
		.genesis-nav-menu .sub-menu .sub-menu {
			margin: 0;
		}
		.nav-primary .menu .sub-menu,
		.nav-secondary .menu .sub-menu {
			padding-left: 1.618em;
		}';
    $responsive = '';
    $media_queries_css = '';
    $resp_css = apply_filters('cuttz_media_queries', $resp_css, $widths, $settings);
    arsort($widths);
    $resp_css = sortArrayByArray($resp_css, $widths);
    foreach ($widths as $layout_css => $width) {
        $media_queries_css .= '@media only screen and (max-width: ' . $width . 'px) {' . "\n";
        $media_queries_css .= $resp_css[$layout_css];
        $media_queries_css .= '}' . "\n";
    }
    $css = apply_filters('cuttz_settings_css', $css, $settings, $widths);
    $css = $css . $media_queries_css;
    if (!$writecss) {
        return $css;
    }
    $layoutfile = cuttz_get_res('file', 'settingscss');
    touch($layoutfile);
    if (is_writable($layoutfile)) {
        $contents = cuttz_clean_css($css);
        $contents = apply_filters('cuttz_settings', $contents);
        $res = @fopen($layoutfile, 'w');
        if (is_resource($res)) {
            fwrite($res, $contents);
            fclose($res);
            wp_cache_flush();
        }
    } else {
        printf(__('<p>Cuttz Notice: The %s file is not writable.</p>', 'cuttz-framework'), $layoutfile);
    }
    $cuttz_debug = cuttz_get_res('dir') . 'debug.css';
    file_put_contents($cuttz_debug, apply_filters('cuttz_settings', $css));
    //llog($css);
}
Esempio n. 4
0
    function debug_settings_box()
    {
        $master_functions_path = cuttz_get_res(false, 'userphp');
        //echo $master_functions_path;
        $master_functions_exists = '';
        if (!file_exists($master_functions_path)) {
            $master_functions_exists = 'hidden';
        }
        $master_scss_path = cuttz_get_res(false, 'usersass');
        //echo($master_scss_path);
        $master_scss_exists = '';
        if (!file_exists($master_scss_path)) {
            $master_scss_exists = 'hidden';
        }
        if (defined('SKIN_FUNCTIONS') && SKIN_FUNCTIONS) {
            $current_skin_functions_path = SKIN_FUNCTIONS;
        }
        if (defined('SKIN_SASS') && SKIN_SASS) {
            $current_skin_scss_path = SKIN_SASS;
        }
        ?>
			<div class="gl-section">
			  <div class="gl-desc">
				<table class="gl-col-table">
					<tr>
					<td colspan="2">
							<p class="l-desc"><?php 
        _e('For troubleshooting and debugging purposes, you can enable or disable certain functionality from right here.', 'cuttz-framework');
        ?>
</p>
					</td>
					</tr>
					
					<tr>
					<td class="gl-label">
						<p><label for="<?php 
        echo $this->settings_field . '[widget-default-content-enabled]';
        ?>
"><?php 
        _e('Show default content in empty widget areas.', 'cuttz-framework');
        ?>
</label></p>
					</td>
					<td class="gl-checkbox">
						<p><input id="<?php 
        echo $this->settings_field . '[widget-default-content-enabled]';
        ?>
" name="<?php 
        echo $this->settings_field . '[widget-default-content-enabled]';
        ?>
" type="checkbox" value="1" <?php 
        checked(genesis_get_option('widget-default-content-enabled', $this->settings_field, false), '1');
        ?>
 title="<?php 
        _e('Uncheck to hide default content inside empty widget areas.', 'cuttz-framework');
        ?>
" /></p>
					</td>
					</tr>
					
					<tr class="gl-rule"><td class="gl-rule" colspan="3"></td></tr>
					
					<tr class="<?php 
        echo $master_functions_exists == 'hidden' && $master_scss_exists == 'hidden' ? 'hidden' : '';
        ?>
">
					<td colspan="2"><strong>Global Customizations</strong></td>
					</tr>
					
					<tr class="<?php 
        echo $master_functions_exists;
        ?>
">
					<td class="gl-label">
					<p>
					<label for="<?php 
        echo $this->settings_field . '[custom-functions-enabled]';
        ?>
" title="<?php 
        if (!empty($master_functions_path)) {
            printf(__('Uncheck to disable user functions stored in %s.', 'cuttz-framework'), $master_functions_path);
        }
        ?>
"><?php 
        _e('Enable master &ldquo;functions.php&rdquo;.', 'cuttz-framework');
        ?>
</label>
					</p>
					</td>
					<td class="gl-checkbox">
						<p>
						<input id="<?php 
        echo $this->settings_field . '[custom-functions-enabled]';
        ?>
" name="<?php 
        echo $this->settings_field . '[custom-functions-enabled]';
        ?>
"  type="checkbox" value="1" <?php 
        checked(genesis_get_option('custom-functions-enabled', $this->settings_field, false), '1');
        ?>
 title="<?php 
        if (!empty($master_functions_path)) {
            printf(__('Uncheck to disable user functions stored in %s.', 'cuttz-framework'), $master_functions_path);
        }
        ?>
" />
						</p>
					</td>
					</tr>
					
					<tr class="<?php 
        echo $master_scss_exists;
        ?>
">
					<td class="gl-label">
						<p>
						<label for="<?php 
        echo $this->settings_field . '[custom-style-enabled]';
        ?>
" title="<?php 
        if (!empty($master_scss_path)) {
            printf(__('Uncheck to disable user styles stored in %s.', 'cuttz-framework'), $master_scss_path);
        }
        ?>
"><?php 
        _e('Enable master &ldquo;style.scss&rdquo;.', 'cuttz-framework');
        ?>
</label>
						</p>
					</td>
					<td class="gl-checkbox">
						<p>
						<input id="<?php 
        echo $this->settings_field . '[custom-style-enabled]';
        ?>
" name="<?php 
        echo $this->settings_field . '[custom-style-enabled]';
        ?>
" type="checkbox" value="1" <?php 
        checked(genesis_get_option('custom-style-enabled', $this->settings_field, false), '1');
        ?>
 title="<?php 
        if (!empty($master_scss_path)) {
            printf(__('Uncheck to disable user styles stored in %s.', 'cuttz-framework'), $master_scss_path);
        }
        ?>
" />
						</p>
					</td>
					</tr>
					
					<tr class="gl-rule"><td class="gl-rule" colspan="3"></td></tr>
					
					<tr>
					<td colspan="2"><strong>Skin Customizations</strong></td>
					</tr>

					<tr class="<?php 
        echo defined('SKIN_FUNCTIONS') ? '' : 'hidden';
        ?>
">
					<td class="gl-label">
						<p>
						<label for="<?php 
        echo $this->settings_field . '[current-skin-functions-enabled]';
        ?>
" title="<?php 
        if (!empty($current_skin_functions_path)) {
            printf(__(esc_attr('Uncheck to disable user functions stored in %s.'), 'cuttz-framework'), $current_skin_functions_path);
        }
        ?>
"><?php 
        _e('Enable skin specific &ldquo;functions.php&ldquo;.', 'cuttz-framework');
        ?>
</label>
						</p>
					</td>
					<td class="gl-checkbox">
						<p>
						<input id="<?php 
        echo $this->settings_field . '[current-skin-functions-enabled]';
        ?>
" name="<?php 
        echo $this->settings_field . '[current-skin-functions-enabled]';
        ?>
"  type="checkbox" value="1" <?php 
        checked(genesis_get_option('current-skin-functions-enabled', $this->settings_field, false), '1');
        ?>
 title="<?php 
        if (!empty($current_skin_functions_path)) {
            printf(__(esc_attr('Uncheck to disable user functions stored in %s.'), 'cuttz-framework'), $current_skin_functions_path);
        }
        ?>
"/>
						</p>
					</td>
					</tr>

					<tr class="<?php 
        echo defined('SKIN_SASS') ? '' : 'hidden';
        ?>
" >
					<td class="gl-label">
						<p>
						<label for="<?php 
        echo $this->settings_field . '[current-skin-style-enabled]';
        ?>
" title="<?php 
        if (!empty($current_skin_scss_path)) {
            printf(__(esc_attr('Uncheck to disable user styles stored in %s.'), 'cuttz-framework'), $current_skin_scss_path);
        }
        ?>
"><?php 
        _e('Enable skin specific &ldquo;style.scss&rdquo;.', 'cuttz-framework');
        ?>
</label>
						</p>
					</td>
					<td class="gl-checkbox">
						<p>
						<input id="<?php 
        echo $this->settings_field . '[current-skin-style-enabled]';
        ?>
" name="<?php 
        echo $this->settings_field . '[current-skin-style-enabled]';
        ?>
" type="checkbox" value="1" <?php 
        checked(genesis_get_option('current-skin-style-enabled', $this->settings_field, false), '1');
        ?>
 title="<?php 
        if (!empty($current_skin_scss_path)) {
            printf(__(esc_attr('Uncheck to disable user styles stored in %s.'), 'cuttz-framework'), $current_skin_scss_path);
        }
        ?>
" />
						</p>
					</td>
					</tr>
					
				</table>
			  </div>
			</div>
		<?php 
    }
Esempio n. 5
0
/**
 * Returns the Logo/headerimage path or hooks the entire header CSS to front-end.
 * @param bool $return 
 * @return none/string
 * @since 1.0
 */
function cuttz_logo($return = true)
{
    $cuttz_logo;
    $cuttz_logo_path = '';
    $logo_types = cuttz_logo_types();
    $logo_dest = cuttz_get_res('dir') . 'img/logo.';
    foreach ($logo_types as $ext) {
        if (file_exists($logo_dest . $ext)) {
            $cuttz_logo = cuttz_get_res('dirurl') . 'img/logo.' . $ext;
            $cuttz_logo_path = $logo_dest . $ext;
        }
    }
    if (!isset($cuttz_logo)) {
        $cuttz_logo = CHILD_URL . '/images/logo.svg';
    }
    if ($return) {
        return $cuttz_logo;
    }
    if (file_exists($cuttz_logo_path)) {
        $logo_info = getimagesize($cuttz_logo);
        $logo_height = 'min-height:' . 0.5 * $logo_info[1] . 'px';
        $cuttz_logo_css = '.cuttz.header-image .site-header .wrap {' . $logo_height . ';background-image :url(' . $cuttz_logo . '); background-repeat: no-repeat; background-position: left center; background-size: contain;}' . '.header-image .site-title a{' . $logo_height . ';}';
        echo '<style type="text/css">' . $cuttz_logo_css . '</style>';
    }
}