Ejemplo n.º 1
0
 public static function init_data()
 {
     global $color_options, $theme_less_vars;
     $theme_less_vars = get_theme_options_less_vars();
     // Theme path
     $theme_path = get_stylesheet_directory_uri();
     // Google Font Options
     include_once file_require(ADMIN_PATH . 'functions/google-fonts.php');
     $google_fonts = get_google_webfonts();
     $google_webfonts = array();
     $google_webfonts["default"] = "Default (Helvetica, Arial, sans-serif)";
     foreach ($google_fonts as $font) {
         $google_webfonts[$font['family']] = $font['family'];
     }
     $font_sizes = array();
     for ($i = 8; $i < 73; $i++) {
         $font_sizes = array_merge($font_sizes, array($i . 'px' => $i . 'px'));
     }
     $transparent_percent = array('10' => '10%', '20' => '20%', '30' => '30%', '40' => '40%', '50' => '50%', '60' => '60%', '70' => '70%', '80' => '80%', '90' => '90%', '100' => '100%');
     $header_heights = array();
     for ($i = 0; $i < 501; $i++) {
         $header_heights = array_merge($header_heights, array($i . 'px' => $i . 'px'));
     }
     $topbar_heights = array();
     for ($i = 0; $i < 100; $i++) {
         $topbar_heights = array_merge($topbar_heights, array($i . 'px' => $i . 'px'));
     }
     $color_options = array(array('id' => 'general_options', 'title' => 'Theme: General Option', 'description' => 'You can set site general layouts, options.', 'items' => array(array('id' => 'general-layout', 'label' => 'Container Layout', 'default' => 'full', 'type' => 'select', 'choices' => array('full' => 'Fullwidth Layout', 'boxed' => 'Boxed Layout')), array('id' => 'general-top-space', 'label' => 'Site Top Space', 'default' => '0px', 'type' => 'text'), array('id' => 'general-bottom-space', 'label' => 'Site Bottom Space', 'default' => '0px', 'type' => 'text'), array('id' => 'general-bg-image', 'label' => 'Background Image', 'default' => '', 'type' => 'image'), array('id' => 'general-bg-repeat', 'label' => 'Background Repeat', 'default' => 'no-repeat', 'type' => 'select', 'choices' => array('no-repeat' => 'No Repeat', 'repeat' => 'Tile', 'repeat-x' => 'Tile Horizontally', 'repeat-y' => 'Tile Vertically')), array('id' => 'general-bg-position', 'label' => 'Background Position (x,y)', 'default' => 'left top', 'type' => 'select', 'choices' => array('left top' => 'Left Top', 'left center' => 'Left Middle', 'left bottom' => 'Left Bottom', 'center top' => 'Center Top', 'center center' => 'Center Middle', 'center bottom' => 'Center Bottom', 'right top' => 'Right Top', 'right center' => 'Right Middle', 'right bottom' => 'Right Bottom')), array('id' => 'general-bg-attach', 'label' => 'Background Attachment', 'default' => 'scroll', 'type' => 'select', 'choices' => array('scroll' => 'Scroll', 'fixed' => 'Fixed')))), array('id' => 'header_options', 'title' => 'Theme: Header Option', 'description' => '', 'items' => array(array('id' => 'top-bar-height', 'label' => 'Topbar Height', 'default' => getLessValue('top-bar-height'), 'type' => 'select', 'choices' => $topbar_heights), array('id' => 'logo', 'label' => 'Logo Image', 'default' => $theme_path . "/assets/images/logo.png", 'type' => 'image'), array('id' => 'logo-height', 'label' => 'Logo Height', 'default' => getLessValue('logo-height'), 'type' => 'text'), array('id' => 'logo-width', 'label' => 'Logo Width', 'default' => getLessValue('logo-width'), 'type' => 'text'), array('id' => 'logo_retina', 'label' => 'Retina Logo Image', 'default' => $theme_path . "/assets/images/logo@2x.png", 'type' => 'image'), array('id' => 'icon_favicon', 'label' => 'Favicon ( 16x16, PNG/ICO/JPG )', 'default' => $theme_path . "/assets/images/favicon.png", 'type' => 'image'), array('id' => 'logo_admin', 'label' => 'Login Page Logo (up to 274x95px)', 'default' => $theme_path . "/assets/images/logo-admin.png", 'type' => 'image'), array('id' => 'header-height', 'label' => 'Header Height (higher than logo!)', 'default' => getLessValue('header-height'), 'type' => 'select', 'choices' => $header_heights), array('id' => 'fixed_menu', 'label' => 'Header Fixed at Top', 'default' => 1, 'type' => 'checkbox'), array('id' => 'search_box', 'label' => 'Enable Search Box', 'default' => 1, 'type' => 'checkbox'), array('id' => 'menu_alignment', 'label' => 'Menu Alignment', 'default' => 'right', 'type' => 'select', 'choices' => array('right' => 'Right', 'center' => 'Center', 'left' => 'Left')), array('id' => 'header_transparent', 'label' => 'Header Transparent (removes top bar)', 'default' => 0, 'type' => 'checkbox'), array('id' => 'header-transparent-opacity', 'label' => 'Header Opacity', 'default' => (int) getLessValue('header-transparent-opacity') . '%', 'type' => 'select', 'choices' => $transparent_percent))), array('id' => 'title_options', 'title' => 'Theme: Title Area Option', 'description' => 'You can control page title section here', 'items' => array(array('id' => 'title-padding', 'label' => 'Title Area Space', 'default' => getLessValue('title-padding'), 'type' => 'text'), array('id' => 'title-bg-image', 'label' => 'Background Image', 'default' => '', 'type' => 'image'), array('id' => 'title-bg-repeat', 'label' => 'Background Repeat', 'default' => 'no-repeat', 'type' => 'select', 'choices' => array('no-repeat' => 'No Repeat', 'repeat' => 'Tile', 'repeat-x' => 'Tile Horizontally', 'repeat-y' => 'Tile Vertically')), array('id' => 'title-bg-position', 'label' => 'Background Position (x,y)', 'default' => 'left top', 'type' => 'select', 'choices' => array('left top' => 'Left Top', 'left center' => 'Left Middle', 'left bottom' => 'Left Bottom', 'center top' => 'Center Top', 'center center' => 'Center Middle', 'center bottom' => 'Center Bottom', 'right top' => 'Right Top', 'right center' => 'Right Middle', 'right bottom' => 'Right Bottom')), array('id' => 'title-bg-attach', 'label' => 'Background Attachment', 'default' => 'scroll', 'type' => 'select', 'choices' => array('scroll' => 'Scroll', 'fixed' => 'Fixed')))), array('id' => 'color_general', 'title' => 'Theme: Color Options', 'description' => '', 'items' => array(array('id' => 'brand-primary', 'label' => 'Primary Color', 'default' => getLessValue('brand-primary')), array('id' => 'text-color', 'label' => 'Text Color', 'default' => getLessValue('text-color')), array('id' => 'body-bg', 'label' => 'Body Background Color (for boxed)', 'default' => getLessValue('body-bg')), array('id' => 'title-background', 'label' => 'Title Background Color', 'default' => getLessValue('title-background')), array('id' => 'primary-background', 'label' => 'Content Background Color', 'default' => getLessValue('primary-background')), array('id' => 'top-bar-background', 'label' => 'Top Bar Background Color', 'default' => getLessValue('top-bar-background')), array('id' => 'header-background', 'label' => 'Header Background Color', 'default' => getLessValue('header-background')), array('id' => 'footer-background', 'label' => 'Footer Background Color', 'default' => getLessValue('footer-background')), array('id' => 'brand-success', 'label' => 'Brand Success', 'default' => getLessValue('brand-success')), array('id' => 'brand-info', 'label' => 'Brand Info', 'default' => getLessValue('brand-info')), array('id' => 'brand-warning', 'label' => 'Brand Warning', 'default' => getLessValue('brand-warning')), array('id' => 'brand-danger', 'label' => 'Brand Danger', 'default' => getLessValue('brand-danger')))), array('id' => 'font_options', 'title' => 'Theme : Font Options', 'description' => '', 'items' => array(array('id' => 'base-font-body', 'label' => 'General Font Family', 'default' => getLessValue('base-font-body'), 'type' => 'select', 'choices' => $google_webfonts), array('id' => 'font-size-base', 'label' => 'General Font Size', 'default' => getLessValue('font-size-base'), 'type' => 'select', 'choices' => $font_sizes), array('id' => 'font-weight-base', 'label' => 'General Font Weight', 'default' => getLessValue('font-weight-base'), 'type' => 'select', 'choices' => array('100' => '100', '200' => '200', '300' => '300', '400' => '400', '500' => '500', '600' => '600', '700' => '700')), array('id' => 'base-font-menu', 'label' => 'Menu Font Family', 'default' => getLessValue('base-font-menu'), 'type' => 'select', 'choices' => $google_webfonts), array('id' => 'menu-font-size', 'label' => 'Menu Font Size', 'default' => getLessValue('menu-font-size'), 'type' => 'select', 'choices' => $font_sizes), array('id' => 'top-bar-font-size', 'label' => 'Topbar Font Size', 'default' => getLessValue('top-bar-font-size'), 'type' => 'select', 'choices' => $font_sizes), array('id' => 'base-font-heading', 'label' => 'Heading Font Family', 'default' => getLessValue('base-font-heading'), 'type' => 'select', 'choices' => $google_webfonts), array('id' => 'font-size-h1', 'label' => 'H1 Size', 'default' => (int) ((int) getLessValue('font-size-base') * 2.25 + 1) . 'px', 'type' => 'select', 'choices' => $font_sizes), array('id' => 'font-size-h2', 'label' => 'H2 Size', 'default' => (int) ((int) getLessValue('font-size-base') * 1.75 + 1) . 'px', 'type' => 'select', 'choices' => $font_sizes), array('id' => 'font-size-h3', 'label' => 'H3 Size', 'default' => (int) ((int) getLessValue('font-size-base') * 1.5 + 1) . 'px', 'type' => 'select', 'choices' => $font_sizes), array('id' => 'font-size-h4', 'label' => 'H4 Size', 'default' => (int) ((int) getLessValue('font-size-base') * 1.25 + 1) . 'px', 'type' => 'select', 'choices' => $font_sizes), array('id' => 'font-size-h5', 'label' => 'H5 Size', 'default' => getLessValue('font-size-base'), 'type' => 'select', 'choices' => $font_sizes), array('id' => 'font-size-h6', 'label' => 'H6 Size', 'default' => (int) ((int) getLessValue('font-size-base') * 0.85 + 1) . 'px', 'type' => 'select', 'choices' => $font_sizes))));
 }
Ejemplo n.º 2
0
 function of_options()
 {
     //Access the WordPress Categories via an Array
     $of_categories = $of_categories_pure = array();
     $of_categories_obj = get_categories('hide_empty=0');
     foreach ($of_categories_obj as $of_cat) {
         $of_categories[$of_cat->cat_ID] = $of_cat->cat_name;
     }
     $of_categories_pure = $of_categories;
     $categories_tmp = array_unshift($of_categories, "Select a category:");
     //Access the WordPress Pages via an Array
     $of_pages = array();
     $of_pages_obj = get_pages('sort_column=post_parent,menu_order');
     foreach ($of_pages_obj as $of_page) {
         $of_pages[$of_page->ID] = $of_page->post_name;
     }
     $of_pages_tmp = array_unshift($of_pages, "Select a page:");
     //Stylesheets Reader
     $alt_stylesheet_path = LAYOUT_PATH;
     $alt_stylesheets = array();
     if (is_dir($alt_stylesheet_path)) {
         if ($alt_stylesheet_dir = opendir($alt_stylesheet_path)) {
             while (($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false) {
                 if (stristr($alt_stylesheet_file, ".css") !== false) {
                     $alt_stylesheets[] = $alt_stylesheet_file;
                 }
             }
         }
     }
     //Background Images Reader
     $bg_images_path = get_stylesheet_directory() . '/images/bg/';
     // change this to where you store your bg images
     $bg_images_url = get_template_directory_uri() . '/images/bg/';
     // change this to where you store your bg images
     $bg_images = array();
     if (is_dir($bg_images_path)) {
         if ($bg_images_dir = opendir($bg_images_path)) {
             while (($bg_images_file = readdir($bg_images_dir)) !== false) {
                 if (stristr($bg_images_file, ".png") !== false || stristr($bg_images_file, ".jpg") !== false) {
                     $bg_images[] = $bg_images_url . $bg_images_file;
                 }
             }
         }
     }
     include_once file_require(ADMIN_PATH . 'functions/google-fonts.php');
     $google_fonts = get_google_webfonts();
     $google_webfonts["default"] = "Default (Helvetica, Arial, sans-serif)";
     foreach ($google_fonts as $font) {
         $google_webfonts[$font['family']] = $font['family'];
     }
     /* ----------------------------------------------------------------------------------- */
     /* TO DO: Add options/functions that use these */
     /* ----------------------------------------------------------------------------------- */
     //More Options
     $uploads_arr = wp_upload_dir();
     $all_uploads_path = $uploads_arr['path'];
     $all_uploads = get_option('of_uploads');
     $other_entries = array("Select a number:", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19");
     $body_repeat = array("no-repeat", "repeat-x", "repeat-y", "repeat");
     $body_pos = array("top left", "top center", "top right", "center left", "center center", "center right", "bottom left", "bottom center", "bottom right");
     // Image Alignment radio box
     $of_options_thumb_align = array("alignleft" => "Left", "alignright" => "Right", "aligncenter" => "Center");
     // Image Links to Options
     $of_options_image_link_to = array("image" => "The Image", "post" => "The Post");
     /* ----------------------------------------------------------------------------------- */
     /* The Options Array */
     /* ----------------------------------------------------------------------------------- */
     global $of_options, $tt_social_icons, $tt_sidebars;
     $of_options = array();
     $url = ADMIN_IMAGES;
     /* General settings
      ***********************************************************************/
     $of_options[] = array("name" => "General Settings", "type" => "heading");
     $of_options[] = array("name" => "CSS Tips!", "std" => "<div style='font-size:14px;'>Please visit the <a target='_blank' href='" . admin_url() . "customize.php'>Site Customize</a> page and change your site's <strong>Logo</strong>, <strong>Color scheme</strong> and <strong>Font options</strong> . And if you don't want to use those changes any more, you should reset them with following options and turn theme back to default.</div>", "icon" => true, "type" => "info");
     $of_options[] = array("name" => "Tracking Code", "desc" => "Add your <a href='http://analytics.google.com' target='_blank'>Google Analytics</a> or other tracking code here. This will be added into the footer of your site.", "id" => "site_analytics", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "Remove Heart Likes", "desc" => "If you don't need any heart/like section on post and widget section, please turn this option ON.", "id" => "remove_heart", "std" => 0, "type" => "switch");
     /* Page builder settings 
      ***********************************************************************/
     $of_options[] = array("name" => "Page Builder", "type" => "info", "std" => "<h3>Page Builder</h3>");
     $of_options[] = array("name" => "", "desc" => "For Posts", "id" => "pb_posts", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "", "desc" => "For Pages", "id" => "pb_pages", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "", "desc" => "For Portfolio", "id" => "pb_port", "std" => 1, "type" => "switch");
     /*
     $of_options[] = array("name" => "For all other post types",
         "desc" => "Controls page builder range on your custom post types.",
         "id" => "pb_other",
         "std" => 0,
         "type" => "switch"
     );
     */
     /* Top Bar settings 
      ***********************************************************************/
     $of_options[] = array("name" => "Top Bar", "type" => "heading");
     $topBarOptions = array('none' => 'Select Item', 'text1' => 'Text 1', 'text2' => 'Text 2', 'shop' => 'Shop cart', 'lang' => 'Language widget of WPML', 'social' => 'Social icons', 'login' => 'Login link', 'menu' => 'Custom menu');
     $of_options[] = array("name" => "Enable Top Bar", "desc" => "", "id" => "top_bar", "std" => 1, "folds" => 1, "type" => "switch");
     $of_options[] = array("name" => "Top Bar (Left)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "top_bar_left_select", "std" => '', "fold" => "top_bar", "type" => "select", "multiple" => false, "options" => $topBarOptions);
     $of_options[] = array("name" => "Top Bar (Left)", "desc" => "", "id" => "top_bar_left", "std" => "text1", "type" => "text");
     $of_options[] = array("name" => "Top Bar (Right)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "top_bar_right_select", "std" => '', "fold" => "top_bar", "type" => "select", "multiple" => false, "options" => $topBarOptions);
     $of_options[] = array("name" => "Top Bar (Right)", "desc" => "", "id" => "top_bar_right", "std" => "login,social,shop", "type" => "text");
     $of_options[] = array("name" => "Text content 1", "desc" => "Please add text content for your top bar.", "id" => "top_bar_text1", "std" => 'Hey there! Welcome to the new site :)', "fold" => "top_bar", "type" => "textarea");
     $of_options[] = array("name" => "Text content 2", "desc" => "Please add text content for your top bar.", "id" => "top_bar_text2", "std" => 'text', "fold" => "top_bar", "type" => "textarea");
     $of_options[] = array("name" => "Social Profiles on Top Bar", "id" => "social_addresses", "fold" => "top_bar", "std" => "<h3>Social Profiles on Top Bar</h3>", "type" => "info");
     foreach ($tt_social_icons as $id => $value) {
         $of_options[] = array("name" => "", "desc" => ucfirst($id) . " address", "id" => "social_" . $id, "fold" => "top_bar", "std" => "", "type" => "text");
     }
     $of_options[] = array("name" => "social_tip", "std" => "<h3 style='margin: 0 0 10px'>Add Custom Social Profile</h3>\n                Here I've added some popular socials. If your familiar social site doesn't have here, you can extend those as following.\n                <p> Please open up the <em>framework/common-functions.php</em> file from theme directory and find <strong>tt_social_icons</strong> array which locates at the top of the file.\n                This is a very popular array that saves social list for above options and widget socials too. So now we need to extend it with our new socials same as their structure (as Name and Icon code). You should find a proper icon for your new social from <a href='http://fortawesome.github.io/Font-Awesome/cheatsheet/' target='_blank'>FontAwesome library</a>.\n                </p>\n                <p>Also you can <strong>reorder</strong> those there.</p>", "icon" => true, "type" => "info");
     /* Post options
      ***********************************************************************/
     $of_options[] = array("name" => "Post And Page", "type" => "heading");
     $of_options[] = array("name" => "Post Options", "std" => "<h3>Post Options</h3>", "type" => "info");
     $of_options[] = array("name" => "Post Format in Single", "desc" => "If you turned this option OFF, post format content won't show on single post pages.", "id" => "show_post_format", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Related Posts", "desc" => "Related posts on bottom of post content in single post page.", "id" => "related_posts", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Author box on Posts", "desc" => "", "id" => "post_author", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Comment on Posts", "desc" => "WordPress has its own way to disable comments in a Post. But you should turn this option OFF if you want to remove comments for all your posts.", "id" => "post_comment", "std" => 1, "type" => "switch");
     /* Page settings
      ***********************************************************************/
     $of_options[] = array("name" => "Page Options", "std" => "<h3>Page Options</h3>", "type" => "info");
     $of_options[] = array("name" => "Author box on Pages", "desc" => "", "id" => "page_author", "std" => 0, "type" => "switch");
     $of_options[] = array("name" => "Comment on Pages", "desc" => "WordPress has its own way to disable comments in a Page. But you should turn this option OFF if you want to remove comments for all your pages.", "id" => "page_comment", "std" => 1, "type" => "switch");
     /* Portfolio
      ***********************************************************************/
     $of_options[] = array("name" => "Portfolio Options", "type" => "heading");
     $of_options[] = array("name" => "Portfolio Slug", "type" => "text", "id" => "portfolio_slug", "desc" => "Portfolio slug that should be show at url for portfolio single items.", "std" => "portfolio-item");
     $of_options[] = array("name" => "Portfolio Columns", "desc" => "Item column on Taxonomy / Category page. You can select 2, 3 and 4 columns layout.", "id" => "portfolio_layout", "std" => "grid3", "type" => "images", "options" => array('grid2' => $url . 'blog-grid2.png', 'grid3' => $url . 'blog-grid3.png', 'grid4' => $url . 'blog-grid4.png'));
     $sidebar_layouts = array('right' => $url . '2cr.png', 'left' => $url . '2cl.png', 'full' => $url . '1col.png');
     $of_options[] = array("name" => "Portolio Sidebar Type", "desc" => "", "id" => "portfolio_sidebar_type", "std" => "full", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Portfolio Sidebar", "desc" => "", "id" => "portfolio_sidebar", "std" => "portfolio-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Single Layout", "desc" => "", "id" => "portfolio_single_layout", "std" => "full", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Single Sidebar", "desc" => "", "id" => "portfolio_single_sidebar", "std" => "portfolio-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Comment on Portfolio item page", "desc" => "WordPress has its own way to disable comments in a Page. But you should turn this option OFF if you want to remove comments for all your pages.", "id" => "port_comment", "std" => 0, "type" => "switch");
     $of_options[] = array("name" => "Portfolio Next Prev Links at Top", "desc" => "You can turn off <a href='http://d.pr/i/SK3g' target='_blank'>Next Preview and Main page links</a> at right bottom on single portfolio page.", "id" => "port_next_prev_links", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Main Portfolio Page", "desc" => "A page which shows when click on View all button from single portfolio item.", "id" => "portfolio_page", "std" => "", "type" => "select", "options" => $of_pages);
     $of_options[] = array("name" => "Portfolio Related Posts at Bottom", "desc" => "Portfolio Related Posts at bottom of your portfolio item page.", "id" => "port_related", "std" => 1, "type" => "switch");
     /* Archive and Category layout
      ***********************************************************************/
     $of_options[] = array("name" => "Archive Category Tags", "type" => "heading");
     $of_options[] = array("name" => "", "std" => "<h3>Category Layout</h3>", "type" => "info");
     $loop_layouts = array('regular' => $url . 'blog-regular.png', 'grid2' => $url . 'blog-grid2.png', 'grid3' => $url . 'blog-grid3.png', 'grid4' => $url . 'blog-grid4.png', 'masonry2' => $url . 'blog-masonry2.png', 'masonry3' => $url . 'blog-masonry3.png', 'masonry4' => $url . 'blog-masonry4.png');
     $of_options[] = array("name" => "", "desc" => "", "id" => "category_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Category Sidebar Type", "desc" => "", "id" => "category_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Category Sidebar", "desc" => "", "id" => "category_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Archive Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "Archive Layout", "desc" => "", "id" => "archive_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Archive Sidebar Type", "desc" => "", "id" => "archive_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Archive Sidebar", "desc" => "", "id" => "archive_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Tag Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "Tag Layout", "desc" => "", "id" => "tag_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Tag Sidebar Type", "desc" => "", "id" => "tag_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Tag Sidebar", "desc" => "", "id" => "tag_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Search Result Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "", "desc" => "", "id" => "search_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Search Sidebar Type", "desc" => "", "id" => "search_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Search Sidebar", "desc" => "", "id" => "search_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Author Page Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "", "desc" => "", "id" => "author_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Sidebar Type on Author Page", "desc" => "", "id" => "author_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Author Sidebar", "desc" => "", "id" => "author_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     /* WooCommerce Options
      ***********************************************************************/
     $of_options[] = array("name" => "WooCommerce", "type" => "heading");
     $of_options[] = array("name" => "WooCommerce Page Layout", "desc" => "", "id" => "woo_layout", "std" => "full", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "WooCommerce Sidebar", "desc" => "", "id" => "woo_sidebar", "std" => "woocommerce-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Product Single Layout", "desc" => "", "id" => "product_layout", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Product Single Sidebar", "desc" => "", "id" => "product_sidebar", "std" => "woocommerce-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Product Overlay Transition", "desc" => "Choose whether you would like the product overlay transition to be enabled.", "id" => "woo_overlay", "std" => 1, "type" => "switch");
     /* Social Options
      ***********************************************************************/
     $of_options[] = array("name" => "Share and Socials", "type" => "heading");
     $share_buttons = array("facebook" => "Facebook", "twitter" => "Twitter", "googleplus" => "Google+", "pinterest" => "Pinterest", 'email' => 'Email');
     $of_options[] = array("name" => "Share Buttons", "desc" => "", "id" => "share_buttons", "std" => array('facebook', 'twitter', 'googleplus', 'pinterest', 'email'), "type" => "multicheck", "options" => $share_buttons);
     $share_visibility = array("share_posts" => "On Posts", "share_pages" => "On Pages", "share_port" => "On Portfolio entries");
     $of_options[] = array("name" => "Visibility of Share Buttons", "desc" => "", "id" => "share_visibility", "std" => 1, "type" => "multicheck", "options" => $share_visibility);
     /* Sidebar Options
      ***********************************************************************/
     $of_options[] = array("name" => "Custom Sidebar", "type" => "heading");
     $of_options[] = array("name" => "Custom sidebar", "desc" => "You can create unlimited siderbars for your site. You should add widgets on <strong>Appearance=><a href='widgets.php'>Widgets</a></strong> after you have added new sidebar here.", "id" => "custom_sidebar", "type" => "sidebar", "std" => "");
     /* Footer Options
      ***********************************************************************/
     $of_options[] = array("name" => "Footer Options", "type" => "heading");
     $of_options[] = array("name" => "Enable Footer", "desc" => "", "id" => "footer", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Footer Layout", "desc" => "Those are general footer layouts. If you need more creative footer area there, you should select Footer layout #1 and add your layout content there. It is possible to add page layout shortcode in here with text widget.", "id" => "footer_layout", "std" => "6", "type" => "images", "options" => array('1' => $url . 'footer1.png', '2' => $url . 'footer2.png', '3' => $url . 'footer3.png', '4' => $url . 'footer4.png', '5' => $url . 'footer5.png', '6' => $url . 'footer6.png'));
     $of_options[] = array("name" => "Footer Background Image", "desc" => "Select a background image or pattern.", "id" => "footer_bg_image", "std" => "", "type" => "media");
     $of_options[] = array("name" => "", "desc" => "Repeat", "id" => "footer_bg_repeat", "std" => "", "type" => "select", "options" => $body_repeat);
     $of_options[] = array("name" => "", "desc" => "Position", "id" => "footer_bg_position", "std" => "", "type" => "select", "options" => $body_pos);
     $of_options[] = array("name" => "", "desc" => "Fixed or Scroll", "id" => "footer_bg_fixed", "std" => "scroll", "type" => "select", "options" => array('scroll', 'fixed'));
     /* Footer Bar options
      ***********************************************************************/
     $of_options[] = array("name" => "Footer Bar", "type" => "heading");
     $of_options[] = array("name" => "Footer Bar", "desc" => "", "id" => "sub_footer", "std" => 1, "folds" => 1, "type" => "switch");
     $footerBarOptions = array('none' => 'Select item', 'text1' => 'Text 1', 'text2' => 'Text 2', 'lang' => 'Language widget', 'social' => 'Social icons', 'menu' => 'Custom menu');
     $of_options[] = array("name" => "Footer Bar (Left)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "sub_footer_left_select", "std" => 'text1', "fold" => "sub_footer", "type" => "select", "options" => $footerBarOptions);
     $of_options[] = array("name" => "Footer Bar (Left)", "desc" => "", "id" => "sub_footer_left", "std" => "text1", "type" => "text");
     $of_options[] = array("name" => "Footer Bar (Right)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "sub_footer_right_select", "std" => '', "fold" => "sub_footer", "type" => "select", "options" => $footerBarOptions);
     $of_options[] = array("name" => "Footer Bar (Right)", "desc" => "", "id" => "sub_footer_right", "std" => "text2", "type" => "text");
     $of_options[] = array("name" => "Footer Text 1", "desc" => "", "id" => "footer_bar_text1", "fold" => "sub_footer", "std" => "Powered by WordPress. Developed by <a href='http://themeton.com'>ThemeTon</a>.", "type" => "textarea");
     $of_options[] = array("name" => "Footer Text 2", "desc" => "", "id" => "footer_bar_text2", "fold" => "sub_footer", "std" => "Copyright &copy; 2014.", "type" => "textarea");
     $of_options[] = array("name" => "", "std" => "<h3>Social Profiles on Sub Footer Bar</h3>", "type" => "info");
     $of_options[] = array("name" => "", "desc" => "", "id" => "social_addresses_f", "fold" => "sub_footer", "std" => "", "type" => "");
     foreach ($tt_social_icons as $id => $value) {
         $of_options[] = array("name" => "", "desc" => ucfirst($id) . " address", "id" => "footer_social_" . $id, "fold" => "sub_footer", "std" => "", "type" => "text");
     }
     /* CUSTOM CSS
      ***********************************************************************/
     $of_options[] = array("name" => "LESS", "type" => "heading");
     /* Restore theme options */
     $less_theme_variables_opt = get_theme_mod("less_theme_variables");
     $tmp_arr = array();
     if (!empty($less_theme_variables_opt)) {
         $tmp = unserialize(base64_decode($less_theme_variables_opt));
         if (is_array($tmp)) {
             $tmp_arr = $tmp;
         }
     }
     if (count($tmp_arr) < 1 && get_theme_mod('less-brand-primary') != "") {
         $lessvars = get_less_variables();
         $restored_vars = array();
         foreach ($lessvars as $opt) {
             if ($opt['variable'] != 'less-heading') {
                 $vl = get_theme_mod('less-' . $opt['variable']);
                 remove_theme_mod('less-' . $opt['variable']);
                 $val = $opt['value'];
                 if (!empty($vl) && $vl != $opt['value']) {
                     $val = $vl;
                 }
                 $restored_vars = array_merge($restored_vars, array($opt['variable'] => $val));
             }
         }
         // Save LESS Variables
         if (!empty($restored_vars)) {
             $encoded_str = base64_encode(serialize($restored_vars));
             set_theme_mod("less_theme_variables", $encoded_str);
         }
     } elseif (count($tmp_arr) < 1) {
         $less_vars = array();
         $less_options = get_less_variables();
         foreach ($less_options as $opt) {
             if ($opt['variable'] != 'less-heading' && !empty($opt['variable']) && !empty($opt['value'])) {
                 $less_vars = array_merge($less_vars, array($opt['variable'] => $opt['value']));
             }
             $encoded_str = base64_encode(serialize($less_vars));
             set_theme_mod("less_theme_variables", $encoded_str);
         }
     }
     /* Reformating Theme Option Less Editor */
     $less_content_data = get_less_editor_content($less_theme_variables_opt);
     if (isset($smof_data['less_editor'])) {
         $smof_data['less_editor'] = $less_content_data;
     }
     set_theme_mod('less_editor', $less_content_data);
     $of_options[] = array("name" => "LESS Editor", "desc" => "LESS Code Editor", "id" => "less_editor", "std" => $less_content_data, "type" => "textarea");
     /* CUSTOM CSS
      ***********************************************************************/
     $of_options[] = array("name" => "Custom CSS", "type" => "heading");
     $of_options[] = array("name" => "CSS Tips!", "std" => "<h3 style=\"margin: 0 0 10px;\">Tips, Before customizing</h3>\n                Control everything is impossible with options. Therefore we have to use custom styling for our sites if we have deep changes. \n                You can make your changes in css files but it doesn't safe and probably you lose those for next version updates of the theme. Then I suggest you to use following options. It is a safe place :)\n\n                <p>If you don't have enough experience with CSS and selectors, you should visit following links\n                <ul style='margin-left:20px'>\n                    <li> - Learn about <a href='http://www.w3schools.com/cssref/css_selectors.asp' target='_blank'>CSS selectors</a></li>\n                    <li> - Learn about <a href='http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/' target='_blank'>CSS selectors</a> by Jeffrey Way</li>\n                    <li> - How to use <a href='http://www.youtube.com/watch?v=nOEw9iiopwI' target='_blank'>Chrome Inspector</a></li>\n                    <li> - How to use <a href='http://www.youtube.com/watch?v=3KdNRZS-uSg' target='_blank'>Mozilla Firebug</a> for editing css</li>\n                </ul>\n                </p>", "icon" => true, "type" => "info");
     $of_options[] = array("name" => "Custom CSS (General)", "desc" => "", "id" => "custom_css", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "For Tablets", "desc" => "Screen width between 768px and 985px", "id" => "tablet_css", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "For Wide Phones", "desc" => "Screen width between 480px and 767px", "id" => "wide_phone_css", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "For Phone", "desc" => "Screen width up to 479px", "id" => "phone_css", "std" => "", "type" => "textarea");
     /* Backup and Restore
      ***********************************************************************/
     $of_options[] = array("name" => "Backup Options", "type" => "heading");
     $of_options[] = array("name" => "Backup and Restore Options", "id" => "of_backup", "std" => "", "type" => "backup", "desc" => 'You can use the two buttons below to backup your current options, and then restore it back at a later time. This is useful if you want to experiment on the options but would like to keep the old settings in case you need it back.');
     $of_options[] = array("name" => "Transfer Theme Options Data", "id" => "of_transfer", "std" => "", "type" => "transfer", "desc" => 'You can tranfer the saved options data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click "Import Options".');
 }
Ejemplo n.º 3
0
function get_post_type_options_page()
{
    global $smof_data, $tt_sidebars, $tt_sliders, $post;
    // init One Page menus
    $onepages_for_navs = array();
    $onepage_with_templates = get_pages(array('meta_key' => '_wp_page_template', 'meta_value' => 'page-one-page.php'));
    foreach ($onepage_with_templates as $page) {
        $onepage_menu = array();
        $onepage_menu['onepage_nav' . $page->ID] = $page->post_title;
        $onepages_for_navs = array_merge($onepages_for_navs, $onepage_menu);
    }
    // add_action('after_setup_theme', 'onepage_menu_setup');
    // function onepage_menu_setup() {
    //     global $onepages_for_navs;
    //     register_nav_menus($onepages_for_navs);
    // }
    // Google Font Options
    include_once file_require(ADMIN_PATH . 'functions/google-fonts.php');
    $google_fonts = get_google_webfonts();
    $google_webfonts = array();
    $google_webfonts["default"] = "Default (Helvetica, Arial, sans-serif)";
    foreach ($google_fonts as $font) {
        $google_webfonts[$font['family']] = $font['family'];
    }
    // Less Options
    $smof_vars = get_theme_options_less_vars();
    $less_options_orig = get_less_variables();
    $less_options = array();
    foreach ($less_options_orig as $opt) {
        if ($opt['variable'] != 'less-heading') {
            $page_vars = get_page_options_less_vars();
            $opt_value = tt_getmeta('less_' . $opt['variable']);
            if (isset($page_vars[$opt['variable']]) && !empty($page_vars[$opt['variable']])) {
                $opt_value = $page_vars[$opt['variable']];
            } elseif (!empty($opt_value)) {
                $opt_value = $opt_value;
            } elseif (isset($smof_vars[$opt['variable']]) && !empty($smof_vars[$opt['variable']])) {
                $opt_value = $smof_vars[$opt['variable']];
            } else {
                $opt_value = $opt['value'];
            }
            //$less_options[] = array( $opt['variable']=>$opt_value );
            $less_options = array_merge($less_options, array($opt['variable'] => $opt_value));
        }
    }
    global $post;
    $less_content = "";
    if (isset($post->ID)) {
        $less_vars = tt_getmeta("less_page_variables", $post->ID);
        $brand_primary = tt_getmeta("less_brand-primary", $post->ID);
        if ($less_vars == "" && $brand_primary != "") {
            $less_arr = array();
            foreach ($less_options as $key => $val) {
                if ($key != 'less-heading') {
                    $current_val = tt_getmeta('less_' . $key, $post->ID);
                    $current_val = $current_val != "" ? $current_val : $val;
                    $less_arr = array_merge($less_arr, array($key => $current_val));
                }
            }
            $encoded_arr = base64_encode(serialize($less_arr));
            if (count(get_post_meta($post->ID, "_less_page_variables")) == 0) {
                add_post_meta($post->ID, "_less_page_variables", $encoded_arr, true);
            } else {
                update_post_meta($post->ID, "_less_page_variables", $encoded_arr);
            }
        }
        $encoded_str = tt_getmeta("less_page_variables", $post->ID);
        $less_content = get_less_editor_content($encoded_str);
        update_post_meta($post->ID, "_up_less_editor", $less_content);
    }
    $url = ADMIN_IMAGES;
    $tmp_arr = array('onepage' => array('label' => 'One Page Options', 'post_type' => 'page', 'items' => array(array('name' => 'onepages', 'type' => 'onepage', 'label' => 'Pages for One Page Template', 'desc' => 'Build page with Multi pages', 'default' => ''), array('name' => 'onepages_names', 'type' => 'text', 'label' => 'Pages Names', 'default' => ''), array('name' => 'onepages_links', 'type' => 'text', 'label' => 'Pages Links', 'default' => ''), array('name' => 'onepage_menu', 'type' => 'checkbox', 'label' => 'Use One Page Menu', 'desc' => 'If you check this option, current pages menu would be selected pages titles.'))), 'page' => array('label' => 'Page Options', 'post_type' => 'page', 'items' => array(array('name' => 'slider', 'type' => 'select', 'label' => 'Top slider', 'option' => $tt_sliders, 'desc' => 'Select a slider that you\'ve created on LayerSlider and Revolution Slider. This slider shows up between header and page title.'), array('type' => 'checkbox', 'name' => 'slider_top', 'label' => 'Slider at the top of Page', 'default' => '0', 'desc' => 'If you wanna show fullscreen slider, hope you like this option.'), array('type' => 'checkbox', 'name' => 'hide_topbar', 'label' => 'Hide top bar', 'default' => '0', 'desc' => 'If you wanna hide top bar when Topbar enabled in theme option.'), array('name' => 'page_layout', 'type' => 'thumbs', 'label' => 'Page Layout', 'default' => 'full', 'option' => array('full' => ADMIN_DIR . 'assets/images/1col.png', 'right' => ADMIN_DIR . 'assets/images/2cr.png', 'left' => ADMIN_DIR . 'assets/images/2cl.png'), 'desc' => 'Select Page Layout (Fullwidth | Right Sidebar | Left Sidebar)'), array('name' => 'sidebar', 'type' => 'select', 'label' => 'Page Sidebar', 'default' => 'page-sidebar', 'option' => $tt_sidebars, 'desc' => 'You should select a sidebar If you\'ve chosen page layout with sidebar. And if you need an unique sidebar for this page, you have to create new one on Theme Options => <b>Custom Sidebar</b> and then add your Appearence => <b>Widgets</b>. Later on select it here.'), array('type' => 'checkbox', 'name' => 'title_show', 'label' => 'Title (show/hide)', 'default' => '1'), array('type' => 'start_group', 'name' => 'title_options', 'visible' => true), array('type' => 'select', 'name' => 'title_align', 'label' => 'Title align', 'default' => 'left', 'option' => array('left' => 'Left', 'center' => 'Center', 'right' => 'Right'), 'desc' => 'Title alignment'), array('name' => 'title_padding', 'type' => 'text', 'label' => 'Title Spacing from Top', 'default' => '', 'desc' => 'Page Title Sections padding-top size (px)'), array('name' => 'title_padding_bottom', 'type' => 'text', 'label' => 'Title Spacing from Bottom', 'default' => '', 'desc' => 'Page Title Sections padding-bottom size (px)'), array('name' => 'teaser', 'type' => 'textarea', 'label' => 'Teaser text', 'default' => '', 'desc' => 'Add description text which shows up at bottom of Page Title.'), array('type' => 'checkbox', 'name' => 'title_color', 'label' => 'Title text invert color ?', 'default' => '0', 'desc' => 'If this option not active, text color is default color'), array('type' => 'colorpicker', 'name' => 'title_bg_color', 'label' => 'Title background color', 'default' => get_theme_mod('title_bg_color'), 'desc' => 'Page Title Section Background Color'), array('type' => 'background', 'name' => 'title_bg', 'label' => 'Title Background Image', 'default' => '', 'desc' => 'If you want to show your title area beautiful, this option exactly you need.'), array('type' => 'colorpicker', 'name' => 'title_overlay_color', 'label' => 'Overlay Color', 'default' => '', 'desc' => 'It needs when use background image'), array('name' => 'title_overlay_opacity', 'type' => 'text', 'label' => 'Overlay Opacity', 'default' => '', 'desc' => 'Overlay opacity value: [0, 0.1, ..1]'), array('name' => 'title_options', 'type' => 'end_group'))), 'ultimate_page' => array('label' => 'Ultimate Page Options', 'post_type' => 'page', 'items' => array(array('type' => 'select', 'name' => 'up_layout', 'label' => 'Container Layout', 'default' => 'full', 'option' => array('full' => 'Full (Wide) Layout', 'boxed' => 'Boxed Layout')), array('name' => 'up_margin_top', 'type' => 'number', 'label' => 'Site Top Spacing', 'default' => '0', 'desc' => 'Please set site top margin space. Number value in pixels. Note: This style appects only on large screens (>1200px).'), array('name' => 'up_margin_bottom', 'type' => 'number', 'label' => 'Site Bottom Spacing', 'default' => '0', 'desc' => 'Please set site bottom margin space. Number value in pixels. Note: This style appects only on large screens (>1200px).'), array('type' => 'background', 'name' => 'up_background_img', 'label' => 'Background Image', 'default' => '', 'desc' => 'Add here your body background image. Image and custom pattern are acceptable.'), array('name' => 'up_logo', 'type' => 'image', 'label' => 'Logo', 'default' => '', 'desc' => 'If you wanna use custom logo on this page, you should use it.'), array('type' => 'checkbox', 'name' => 'up_header', 'label' => 'Enable Header', 'default' => '1'), array('type' => 'start_group', 'name' => 'up_header_group', 'visible' => true), array('type' => 'checkbox', 'name' => 'up_topbar', 'label' => 'Enable Topbar', 'default' => '0'), array('type' => 'checkbox', 'name' => 'up_fixed_menu', 'label' => 'Navigation Fixed at Top', 'default' => '0', 'desc' => 'Navigation menu stays fixed at top of your site when you scroll down.'), array('type' => 'checkbox', 'name' => 'up_enable_logo', 'label' => 'Enable Logo', 'default' => '1', 'desc' => 'You can remove logo.'), array('type' => 'checkbox', 'name' => 'up_enable_search', 'label' => 'Enable Search Box', 'default' => '1', 'desc' => 'You can remove search box at next of your main menu.'), array('type' => 'select', 'name' => 'up_menu_align', 'label' => 'Menu Alignment', 'default' => 'center', 'option' => array('left' => 'Left', 'center' => 'Center', 'right' => 'Right'), 'desc' => 'Menu alignment (left, center, right).'), array('type' => 'checkbox', 'name' => 'up_header_transparent', 'label' => 'Enable Header Transparent', 'default' => '0', 'desc' => 'If you enable this option, header is transparent.'), array('name' => 'up_header_height', 'type' => 'number', 'label' => 'Header Height', 'default' => isset($smof_vars['header-height']) ? (int) $smof_vars['header-height'] : '80', 'desc' => 'Default : 80px'), array('name' => 'up_header_group', 'type' => 'end_group'), array('type' => 'checkbox', 'name' => 'up_footer', 'label' => 'Enable Footer', 'default' => '1'), array('type' => 'checkbox', 'name' => 'up_footer_bar', 'label' => 'Enable Footer Bar', 'default' => '1'), array('type' => 'select', 'name' => 'up_menu_font', 'label' => 'Menu Font', 'default' => isset($smof_vars['base-font-menu']) ? str_replace("'", '', str_replace('"', '', $smof_vars['base-font-menu'])) : 'default', 'option' => $google_webfonts, 'desc' => 'Menu link font including sub menu links and description texts.'), array('type' => 'select', 'name' => 'up_heading_font', 'label' => 'Heading Font', 'default' => isset($smof_vars['base-font-heading']) ? str_replace("'", '', str_replace('"', '', $smof_vars['base-font-heading'])) : 'default', 'option' => $google_webfonts, 'desc' => 'All heading tags (H1 through H6) font incluing Post title and Widget title etc.'), array('type' => 'select', 'name' => 'up_body_font', 'label' => 'Body Font', 'default' => isset($smof_vars['base-font-body']) ? str_replace("'", '', str_replace('"', '', $smof_vars['base-font-body'])) : 'default', 'option' => $google_webfonts, 'desc' => 'Main body text.'))), 'less_option' => array('label' => 'Less Options (Current Page)', 'post_type' => 'page', 'items' => array(array('name' => 'up_less_editor', 'type' => 'textarea', 'label' => 'LESS Editor', 'default' => $less_content))));
    return $tmp_arr;
}
Ejemplo n.º 4
0
function import_google_fonts()
{
    global $post;
    global $smof_data;
    $fonts = array();
    // Load them option fonts
    $font_options = array('base-font-body', 'base-font-menu', 'base-font-heading');
    $theme_less_vars = get_theme_options_less_vars();
    foreach ($font_options as $option) {
        $font = isset($theme_less_vars[$option]) ? trim($theme_less_vars[$option]) : '';
        if ($font != '' && $font != 'default') {
            $fonts[] = $font;
        }
    }
    // load ultimate page fonts
    if (isset($post->ID) && get_post_meta($post->ID, '_wp_page_template', true) == 'page-ultimate.php') {
        $up_fonts = array('up_menu_font', 'up_heading_font', 'up_body_font');
        foreach ($up_fonts as $upfont) {
            $font = trim(tt_getmeta($upfont, $post->ID));
            if ($font != '' && $font != 'default') {
                $fonts[] = $font;
            }
        }
    }
    $protocol = is_ssl() ? 'https' : 'http';
    include_once file_require(ADMIN_PATH . 'functions/google-fonts.php');
    $google_fonts = get_google_webfonts();
    foreach ($fonts as $font) {
        $var = str_replace("'", '', trim($font));
        $var = str_replace('"', '', $var);
        $var = str_replace(' ', '-', $var);
        $val = str_replace("'", '', trim($font));
        $val = str_replace('"', '', $val);
        $val = str_replace(' ', '+', $val);
        $variants = $subsets = '';
        foreach ($google_fonts as $key => $current) {
            if (trim($current['family']) == trim($font)) {
                $variants = implode(',', $current['variants']);
                $subsets = '&subset=' . implode(',', $current['subsets']);
                break;
            }
        }
        wp_enqueue_style("themeton-google-font-" . strtolower($var), "{$protocol}://fonts.googleapis.com/css?family=" . $val . ":" . $variants . $subsets);
    }
}