/** * Define the metabox and field configurations. * * @since 1.2 * @return array */ function dynamik_lables_metabox(array $meta_boxes) { // Start with an underscore to hide fields from custom fields list $prefix = '_dyn_'; if (dynamik_get_settings('include_inpost_cpt_all')) { foreach (get_post_types(array('public' => true)) as $post_type) { $post_types[] = $post_type; } } else { $post_types = dynamik_get_settings('include_inpost_cpt_names') != '' ? explode(',', 'page,post,' . dynamik_get_settings('include_inpost_cpt_names')) : array('page', 'post'); } $labels = !get_option('dynamik_gen_custom_labels') ? array() : get_option('dynamik_gen_custom_labels'); asort($labels); $labels_array = array(); foreach ($labels as $key => $value) { $labels_array[$key] = $value['label_id']; $labels_array[$key] = $value['label_name']; } $labels_desc = $labels != array() ? 'Select labels appropriate to this page/post.' : 'No labels available. Go to ( Dynamik Custom > Labels ) to create some.'; $meta_boxes[] = array('id' => 'dynamik_labels', 'title' => 'Dynamik Labels', 'pages' => $post_types, 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => 'Select Labels', 'desc' => $labels_desc, 'id' => $prefix . 'labels', 'type' => 'multicheck', 'options' => $labels_array))); return $meta_boxes; }
/** * If the Front-end CSS Builder is active then echo the Custom CSS * and Dynamik Design media query content into the <head>. * * @since 1.0 */ function dynamik_css_builder_css_echo() { global $dynamik_css_builder_popup; if (!$dynamik_css_builder_popup) { return; } $output = ''; $custom_css = dynamik_get_custom_css('custom_css'); if ($custom_css != '') { $output .= $custom_css . "\n"; } $output = "\n\n<!-- Begin Dynamik Custom CSS -->\n<style id=\"custom-css-echo\" type=\"text/css\">\n" . $output . "</style>\n<!-- End Dynamik Custom CSS -->\n"; if (dynamik_get_settings('responsive_enabled')) { $media_query_css = ' @media only screen and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_large_cascading_content') . ' } @media only screen and (min-width: 768px) and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_large_content') . ' } @media only screen and (min-width: 480px) and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_medium_large_content') . ' } @media only screen and (max-width: 767px) { ' . dynamik_get_responsive('media_query_medium_cascading_content') . ' } @media only screen and (min-width: 480px) and (max-width: 767px) { ' . dynamik_get_responsive('media_query_medium_content') . ' } @media only screen and (max-width: 479px) { ' . dynamik_get_responsive('media_query_small_content') . ' }'; $media_query_css = "\n<!-- Begin Media Query Custom CSS -->\n<style id=\"media-query-custom-css-echo\" type=\"text/css\">" . $media_query_css . "\n</style>\n<!-- End Media Query Custom CSS -->\n\n"; } else { $media_query_css = ''; } echo stripslashes($output . $media_query_css); }
* Localization. */ load_theme_textdomain('dynamik', CHILD_DIR . '/lib/languages'); /** * Require files. */ require_once CHILD_DIR . '/lib/functions/dynamik-file-paths.php'; require_once CHILD_DIR . '/lib/functions/dynamik-options.php'; /** * Define Dynamik child theme constants. * * Note: Because this constant uses the dynamik_get_settings * function it has to be defined AFTER the dynamik-settings.php * file is called. */ $child_theme_url = dynamik_get_settings('affiliate_link') != '' ? dynamik_get_settings('affiliate_link') : 'http://dynamiktheme.com'; define('CHILD_THEME_URL', $child_theme_url); /** * Create a global to define whether or not the CSS Buidler Popup tool is active. */ $dynamik_css_builder_popup = false; if (dynamik_get_custom_css('css_builder_popup_active') && current_user_can('administrator')) { $dynamik_css_builder_popup = true; } require_once CHILD_DIR . '/lib/functions/dynamik-add-styles.php'; require_once CHILD_DIR . '/lib/functions/dynamik-functions.php'; require_once CHILD_DIR . '/lib/functions/dynamik-navbars.php'; require_once CHILD_DIR . '/lib/functions/dynamik-fonts.php'; require_once CHILD_DIR . '/lib/functions/dynamik-ez-functions.php'; if (is_admin() || $dynamik_css_builder_popup) { require_once CHILD_DIR . '/lib/functions/dynamik-option-lists.php';
/** * Build Subnav Dropdown HTML. * * @since 1.0 */ function dynamik_dropdown_nav_2() { if (!has_nav_menu('secondary_dropdown') || !dynamik_get_settings('responsive_enabled') || dynamik_get_responsive('navbar_media_query_default') != 'tablet_dropdown' && dynamik_get_responsive('navbar_media_query_default') != 'mobile_dropdown') { return; } ?> <div id="dropdown-subnav-wrap"> <!-- dropdown nav for responsive design --> <nav id="dropdown-subnav" role="navigation"> <form id="dropdown-subnav-form" action="" method="post"> <select class="subnav-chosen-select"> <option value=""><?php echo dynamik_get_responsive('dropdown_menu_2_text'); ?> </option> <?php $menu = wp_nav_menu(array('theme_location' => 'secondary_dropdown', 'echo' => false)); if (preg_match_all('#(<a [^<]+</a>)#', $menu, $matches)) { $hrefpat = '/(href *= *([\\"\']?)([^\\"\' ]+)\\2)/'; foreach ($matches[0] as $link) { if (preg_match($hrefpat, $link, $hrefs)) { $href = $hrefs[3]; } if (preg_match('#>([^<]+)<#', $link, $names)) { $name = $names[1]; } echo "<option value=\"{$href}\">{$name}</option>"; } } ?> </select> </form> </nav><!-- #dropdown-subnav --> <!-- /end dropdown subnav --> </div> <?php }
/** * Build the Custom stylesheet file. * * @since 1.0 */ function dynamik_build_custom_styles() { $css = '/* ' . __('Custom CSS', 'dynamik') . "\n" . '------------------------------------------------------------ */' . "\n"; if (dynamik_get_settings('responsive_enabled')) { $css .= dynamik_get_custom_css('custom_css'); $css .= "\n\n" . '/* ' . __('Custom Responsive CSS', 'dynamik') . "\n" . '------------------------------------------------------------ */'; $css .= ' @media only screen and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_large_cascading_content') . ' } @media only screen and (min-width: 768px) and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_large_content') . ' } @media only screen and (min-width: 480px) and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_medium_large_content') . ' } @media only screen and (max-width: 767px) { ' . dynamik_get_responsive('media_query_medium_cascading_content') . ' } @media only screen and (min-width: 480px) and (max-width: 767px) { ' . dynamik_get_responsive('media_query_medium_content') . ' } @media only screen and (max-width: 479px) { ' . dynamik_get_responsive('media_query_small_content') . ' }'; } else { $css = dynamik_get_custom_css('custom_css'); } return $css; }
/** * Build the Dynamik Design Options admin page. * * @since 1.0 */ function dynamik_design_options() { global $message; $dynamik_design_snapshot_options = get_option('dynamik_gen_design_snapshot_options'); $dynamik_font_type = dynamik_get_design('font_type'); if ($dynamik_font_type) { foreach ($dynamik_font_type as $key => $value) { $dynamik_font_type[$key] = $value; } } ?> <div class="wrap"> <div id="dynamik-design-saved" class="dynamik-update-box"></div> <?php if (!empty($_POST['action']) && $_POST['action'] == 'reset') { update_option('dynamik_gen_design_undo_options', dynamik_get_design(null, $args = array('cached' => true, 'array' => true))); update_option('dynamik_gen_responsive_undo_options', dynamik_get_responsive(null, $args = array('cached' => true, 'array' => true))); update_option('dynamik_gen_design_options', dynamik_design_options_defaults()); update_option('dynamik_gen_responsive_options', dynamik_responsive_options_defaults()); dynamik_write_files($css = true, $ez = true, $custom = false); $dynamik_font_type = dynamik_get_design('font_type'); ?> <script type="text/javascript">jQuery(document).ready(function($){ $('#dynamik-design-saved').html('Design Options Reset').center().fadeIn('slow');window.setTimeout(function(){$('#dynamik-design-saved').fadeOut( 'slow' );}, 2222); });</script> <?php } if (!empty($_POST['action']) && $_POST['action'] == 'undo') { update_option('dynamik_gen_design_options', get_option('dynamik_gen_design_undo_options')); update_option('dynamik_gen_responsive_options', get_option('dynamik_gen_responsive_undo_options')); dynamik_write_files($css = true, $ez = true, $custom = false); dynamik_get_responsive(null, $args = array('cached' => false, 'array' => false)); $dynamik_font_type = dynamik_get_design('font_type'); ?> <script type="text/javascript">jQuery(document).ready(function($){ $('#dynamik-design-saved').html('Dynamik Options Undone').center().fadeIn('slow');window.setTimeout(function(){$('#dynamik-design-saved').fadeOut( 'slow' );}, 2222); });</script> <?php } if (!empty($_GET['activetab'])) { ?> <script type="text/javascript">jQuery(document).ready(function($) { $('#<?php echo $_GET['activetab']; ?> ').click(); });</script> <?php } ?> <div id="icon-options-general" class="icon32"></div> <h2 id="dynamik-admin-heading"><?php _e('Dynamik - Design Options', 'dynamik'); ?> </h2> <div class="dynamik-css-builder-button-wrap"> <span id="show-hide-custom-css-builder" class="button"><?php _e('CSS Builder', 'dynamik'); ?> </span> </div> <?php if (dynamik_get_settings('design_options_control') == 'structure_settings') { $admin_wrap_class = ' class="dynamik-wrap-structure-settings"'; $nav_alt_id = 'alt-'; $body_display = ''; $nav_display = ' dynamik-options-display'; } elseif (dynamik_get_settings('design_options_control') == 'design_standard') { $admin_wrap_class = ' class="dynamik-wrap-design-standard"'; $nav_alt_id = ''; $body_display = ' dynamik-options-display'; $nav_display = ''; } else { $admin_wrap_class = ''; $nav_alt_id = ''; $body_display = ' dynamik-options-display'; $nav_display = ''; } ?> <div id="dynamik-admin-wrap"<?php echo $admin_wrap_class; ?> > <?php require_once CHILD_DIR . '/lib/admin/boxes/custom-css-builder.php'; ?> <form action="/" id="design-options-form" name="design-options-form"> <input type="hidden" name="action" value="dynamik_design_options_save" /> <input type="hidden" name="security" value="<?php echo wp_create_nonce('design-options'); ?> " /> <div id="dynamik-floating-save"> <img id="ajax-save-no-throb" src="<?php echo CHILD_URL . '/lib/css/images/no-throb.png'; ?> " style="margin-bottom:11px;" /><img id="ajax-save-throbber" src="<?php echo CHILD_URL . '/lib/css/images/throbber.gif'; ?> " style="display:none;margin-bottom:11px;" /><input type="image" src="<?php echo CHILD_URL . '/lib/css/images/save-changes-x2.png'; ?> " value="<?php _e('Save Changes', 'dynamik'); ?> " class="dynamik-save-button" name="Submit" alt="Save Changes" /> </div> <div class="dynamik-structure-settings-hide"> <div id="dynamik-design-options-nav1" class="dynamik-design-options-nav"> <ul> <li id="dynamik-design-options-nav-body" class="dynamik-options-nav-all dynamik-options-nav-active"><a href="#">Body</a></li><li id="dynamik-design-options-nav-wrap" class="dynamik-options-nav-all"><a href="#">Wrap</a></li><li id="dynamik-design-options-nav-header" class="dynamik-options-nav-all"><a href="#">Header</a></li><li id="dynamik-design-options-nav-nav1" class="dynamik-options-nav-all"><a href="#">Nav</a></li><li id="dynamik-design-options-nav-nav2" class="dynamik-options-nav-all"><a href="#">Subnav</a></li><li id="dynamik-design-options-nav-nav3" class="dynamik-options-nav-all"><a href="#">Header Nav</a></li><li id="dynamik-design-options-nav-content" class="dynamik-options-nav-all"><a href="#">Content</a></li><li id="dynamik-design-options-nav-comments" class="dynamik-options-nav-all"><a href="#">Comments</a></li><li id="dynamik-design-options-nav-sidebars" class="dynamik-options-nav-all"><a href="#">Sidebars</a></li><li id="dynamik-design-options-nav-footer" class="dynamik-options-nav-all"><a class="dynamik-options-nav-last" href="#">Footer</a></li> </ul> </div> <div id="dynamik-design-options-nav2" class="dynamik-design-options-nav"> <ul> <li id="dynamik-design-options-nav-widths" class="dynamik-options-nav-all dynamik-update-wrap-widths"><a href="#">Widths</a></li><li id="dynamik-design-options-nav-ez" class="dynamik-options-nav-all"><a href="#">EZ</a></li><li id="dynamik-design-options-nav-widgets" class="dynamik-options-nav-all"><a href="#">Widgets</a><li id="dynamik-design-options-nav-search" class="dynamik-options-nav-all"><a href="#">Search</a></li><li id="dynamik-design-options-nav-breadcrumbs" class="dynamik-options-nav-all"><a href="#"><?php if (dynamik_get_settings('responsive_enabled')) { ?> Crumbs<?php } else { ?> Breadcrumbs<?php } ?> </a></li><li id="dynamik-design-options-nav-taxonomy" class="dynamik-options-nav-all"><a href="#">Tax</a></li><li id="dynamik-design-options-nav-author" class="dynamik-options-nav-all"><a href="#">Author</a></li><li id="dynamik-design-options-nav-post-nav" class="dynamik-options-nav-all"><a href="#">Post Nav</a></li><?php if (dynamik_get_settings('responsive_enabled')) { ?> <li id="dynamik-design-options-nav-responsive" class="dynamik-options-nav-all dynamik-update-wrap-widths"><a href="#">Responsive</a></li><?php } ?> <li id="dynamik-design-options-nav-image-uploader" class="dynamik-options-nav-all"><a href="#"><?php if (dynamik_get_settings('responsive_enabled')) { ?> Images<?php } else { ?> Image Uploader<?php } ?> </a></li><li id="dynamik-design-options-nav-import-export" class="dynamik-options-nav-all"><a class="dynamik-options-nav-last" href="#">Import/Export</a></li> </ul> </div> </div><!-- End .dynamik-structure-settings-hide --> <div id="dynamik-design-options-nav-alt" class="dynamik-design-control-hide dynamik-structure-settings-show"> <ul> <li id="dynamik-design-options-nav-alt-nav1" class="dynamik-options-nav-all dynamik-options-nav-active"><a href="#">Nav</a></li><li id="dynamik-design-options-nav-alt-nav2" class="dynamik-options-nav-all"><a href="#">Subnav</a></li><li id="dynamik-design-options-nav-alt-ez" class="dynamik-options-nav-all"><a href="#">EZ Widget Areas</a></li><?php if (dynamik_get_settings('responsive_enabled')) { ?> <li id="dynamik-design-options-nav-alt-responsive" class="dynamik-options-nav-all"><a href="#">Responsive</a></li><?php } ?> <li id="dynamik-design-options-nav-alt-image-uploader" class="dynamik-options-nav-all"><a href="#"><?php if (dynamik_get_settings('responsive_enabled')) { ?> Images<?php } else { ?> Image Uploader<?php } ?> </a></li><li id="dynamik-design-options-nav-alt-import-export" class="dynamik-options-nav-all"><a class="dynamik-options-nav-last" href="#">Import / Export</a></li> </ul> </div> <div class="dynamik-design-options-wrap"> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-body.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-wrap.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-header.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-nav-1.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-nav-2.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-nav-3.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-content.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-comments.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-sidebars.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-footer.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-widths.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-ez.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-widgets.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-search.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-breadcrumbs.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-taxonomy.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-author.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-post-nav.php'; ?> </div> </form> <div class="dynamik-design-options-wrap"> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-responsive.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-import-export.php'; ?> </div> <?php require_once CHILD_DIR . '/lib/admin/boxes/design-image-uploader.php'; ?> <div id="dynamik-admin-footer"> <p> <a href="http://cobaltapps.com" target="_blank">CobaltApps.com</a> | <a href="https://dynamiktheme.desk.com/" target="_blank">Resources</a> | <a href="http://cobaltapps.com/my-account/" target="_blank">My Account</a> | <a href="http://cobaltapps.com/forum/" target="_blank">Community Forum</a> | <a href="http://cobaltapps.com/affiliates/" target="_blank">Affiliates</a> · <a><span id="show-options-reset" class="dynamik-custom-fonts-button button" style="margin:0; float:none !important;"><?php _e('Design Options Reset', 'dynamik'); ?> </span></a> </p> </div> <div style="display:none; position:inherit; height:25px; width:660px; margin:-11px 0 0 60px; float:left;" id="show-options-reset-box" class="dynamik-custom-fonts-box"> <form style="width:530px; float:left;" id="dynamik-reset-design-options" method="post"> <strong><?php _e('**This Will Reset ALL Your Dynamik Design Options**', 'dynamik'); ?> </strong> <input style="background:#D54E21; width:160px !important; color:#FFFFFF !important; text-shadow: 0 0 0 #fff;" type="submit" value="<?php _e('Reset Design Options', 'dynamik'); ?> " class="dynamik-reset button" name="Submit" onClick='return confirm("<?php _e('Are you sure your want to reset your Dynamik Design Options?', 'dynamik'); ?> ")'/><input type="hidden" name="action" value="reset" /> </form> <form style="width:130px; float:left;" id="dynamik-undo-design-options" method="post"> <input type="submit" value="<?php _e('Undo Last Save', 'dynamik'); ?> " class="dynamik-undo button" name="Submit" onClick='return confirm("<?php _e('Are you sure your want to undo your last Design Options Save?', 'dynamik'); ?> ")'/><input type="hidden" name="action" value="undo" /> </form> </div> </div> </div> <!-- Close Wrap --> <?php }
/** * Add scripts and HTML to the <head> that are necessary * for the front-end CSS builder to function. * * @since 1.0 */ function css_builder_popup() { ?> <script type="text/javascript"> var cssBuilderImagesUrl = 'url(<?php echo dynamik_get_stylesheet_location('url') . 'images'; ?> '; var cssBuilderLabelsUrl = '<?php echo CHILD_URL . '/lib/css/images/css-builder-element-labels'; ?> '; var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?> '; <?php if (dynamik_get_settings('html_five_active')) { ?> var cssBtabsSiteInner = '.site-inner'; var cssBtabsSiteHeader = '.site-header'; var cssBtabsNavPrimary = '.nav-primary'; var cssBtabsNavSecondary = '.nav-secondary'; var cssBtabsContent = '.content'; var cssBtabsSidebarPrimary = '.sidebar-primary'; var cssBtabsSidebarSecondary = '.sidebar-secondary'; var cssBtabsSiteFooter = '.site-footer'; <?php } else { ?> var cssBtabsSiteInner = '#inner'; var cssBtabsSiteHeader = '#header'; var cssBtabsNavPrimary = '#nav'; var cssBtabsNavSecondary = '#subnav'; var cssBtabsContent = '#content'; var cssBtabsSidebarPrimary = '#sidebar'; var cssBtabsSidebarSecondary = '#sidebar-alt'; var cssBtabsSiteFooter = '#footer'; <?php } ?> </script> <?php if (dynamik_get_custom_css('css_builder_popup_editor_only')) { echo '<span id="css-builder-custom-css-only"></span>' . "\n"; } else { echo '<span id="css-builder-custom-css"></span>' . "\n"; } echo '<span id="css-builder-editor-css"></span>' . "\n"; echo '<span id="css-builder-highlight-css"></span>' . "\n"; require_once CHILD_DIR . '/lib/admin/boxes/custom-css-builder-popup.php'; }
/** * Create all the appropriate files and content that reflect the exported Child Theme * and then zip it up and spit it out into the browser for download. * * @since 1.0 */ function child_export($child_name, $author = 'Genesis Theme', $author_uri = 'http://dynamik.catalysttheme.com/genesis/', $at_style = 'no', $include_settings = 'no', $include_design = 'yes', $include_css = 'yes', $include_functions = 'yes', $include_js = 'yes', $include_templates = 'yes', $include_labels = 'yes', $include_widget_areas = 'yes', $include_hook_boxes = 'yes') { dynamik_folders_open_permissions(); require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; $custom_functions = get_option('dynamik_gen_custom_functions'); $child_export_zip = strtolower(str_replace(' ', '-', $child_name)) . '.zip'; $tmp_path = dynamik_get_stylesheet_location('path') . 'tmp'; $tmp_child = $tmp_path . '/child'; $tmp_image_folder = $tmp_child . '/images'; $tmp_post_formats_image_folder = $tmp_image_folder . '/post-formats'; $tmp_my_templates_folder = $tmp_child . '/my-templates'; $tmp_metaboxes_folder = $tmp_child . '/metaboxes'; $tmp_js_folder = $tmp_child . '/js'; $dollar_sign = '$'; $new_line = '"\\n"'; $single_quote = "'"; $image_folder = dynamik_get_stylesheet_location('path') . 'images'; $dynamik_image_folder = dynamik_get_stylesheet_location('path') . 'default-images'; $dynamik_post_formats_image_folder = dynamik_get_stylesheet_location('path') . 'default-images/post-formats'; $dynamik_my_templates_folder = CHILD_DIR . '/my-templates'; $dynamik_metaboxes_folder = CHILD_DIR . '/lib/admin/metaboxes'; if (!is_dir($tmp_path)) { @mkdir($tmp_path, 0755, true); } if (!is_dir($tmp_child)) { @mkdir($tmp_child, 0755, true); } if (!is_dir($tmp_image_folder)) { @mkdir($tmp_image_folder, 0755, true); } if (!is_dir($tmp_post_formats_image_folder) && dynamik_get_settings('post_formats_active')) { @mkdir($tmp_post_formats_image_folder, 0755, true); } if (!is_dir($tmp_my_templates_folder) && $include_templates == 'yes') { @mkdir($tmp_my_templates_folder, 0755, true); } if ($include_labels == 'yes' && get_option('dynamik_gen_custom_labels') != array()) { if (!is_dir($tmp_metaboxes_folder)) { @mkdir($tmp_metaboxes_folder, 0755, true); } if (!is_dir($tmp_metaboxes_folder . '/js')) { @mkdir($tmp_metaboxes_folder . '/js', 0755, true); } if (!is_dir($tmp_metaboxes_folder . '/images')) { @mkdir($tmp_metaboxes_folder . '/images', 0755, true); } } if (!is_dir($tmp_js_folder)) { @mkdir($tmp_js_folder, 0755, true); } $style_css = '/* Theme Name: ' . $child_name . ' Theme URI: http: //studiopress.com/ Description: A Genesis Child Theme Author: ' . $author . ' Author URI: ' . $author_uri . ' Template: genesis Version: 1.0 */ '; if ($at_style == 'yes') { $style_css .= ' /* Import Genesis Parent Styles ------------------------------------------------------------ */ @import url(../genesis/style.css); '; } if ($include_design == 'yes') { $style_css .= dynamik_build_design_styles('yes'); } if ($include_css == 'yes' && dynamik_get_custom_css('custom_css') != '') { $custom_css_prefix = "\n\n" . '/* ' . __('Custom CSS', 'dynamik') . "\n" . '------------------------------------------------------------ */' . "\n\n"; $custom_css = dynamik_get_custom_css('custom_css') . "\n"; if ($include_design == 'yes' && dynamik_get_settings('responsive_enabled')) { $custom_mq_css_prefix = "\n" . '/* ' . __('Custom Responsive CSS', 'dynamik') . "\n" . '------------------------------------------------------------ */' . "\n"; $media_query_css = ' @media only screen and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_large_cascading_content') . ' } @media only screen and (min-width: 768px) and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_large_content') . ' } @media only screen and (min-width: 480px) and (max-width: ' . dynamik_get_responsive('media_wrap_width') . 'px) { ' . dynamik_get_responsive('media_query_medium_large_content') . ' } @media only screen and (max-width: 767px) { ' . dynamik_get_responsive('media_query_medium_cascading_content') . ' } @media only screen and (min-width: 480px) and (max-width: 767px) { ' . dynamik_get_responsive('media_query_medium_content') . ' } @media only screen and (max-width: 479px) { ' . dynamik_get_responsive('media_query_small_content') . ' }'; } else { $custom_mq_css_prefix = ''; $media_query_css = ''; } $style_css .= $custom_css_prefix . $custom_css . $custom_mq_css_prefix . $media_query_css; } $nav_placement_comment = "\n/**\n * Manage the placement of navbars.\n */\n"; if (dynamik_get_settings('responsive_enabled') && dynamik_get_responsive('navbar_media_query_default') == 'vertical_toggle') { if (dynamik_get_design('nav1_location') == "Above Header") { $nav_1_action = "add_action( 'genesis_before_header', 'child_mobile_nav_1' );\nremove_action( 'genesis_after_header', 'genesis_do_nav' );\nadd_action( 'genesis_before_header', 'genesis_do_nav' );\n"; } elseif (dynamik_get_design('nav1_location') == "Below Header") { $nav_1_action = "add_action( 'genesis_after_header', 'child_mobile_nav_1', 9 );\n"; } if (dynamik_get_design('nav2_location') == "Above Header") { $nav_2_action = "add_action( 'genesis_before_header', 'child_mobile_nav_2' );\nremove_action( 'genesis_after_header', 'genesis_do_subnav' );\nadd_action( 'genesis_before_header', 'genesis_do_subnav' );\n"; } elseif (dynamik_get_design('nav2_location') == "Below Header") { $nav_2_action = "add_action( 'genesis_after_header', 'child_mobile_nav_2', 9 );\n"; } $mobile_nav_functions = ' /** * Build Nav Mobile Menu HTML. * * @since 1.0 */ function child_mobile_nav_1() { if ( ! has_nav_menu( ' . $single_quote . 'primary' . $single_quote . ' ) ) return; ?> <h3 class="mobile-primary-toggle">' . dynamik_get_responsive("dropdown_menu_1_text") . '</h3> <?php } /** * Build Subnav Mobile Menu HTML. * * @since 1.0 */ function child_mobile_nav_2() { if ( ! has_nav_menu( ' . $single_quote . 'secondary' . $single_quote . ' ) ) return; ?> <h3 class="mobile-secondary-toggle">' . dynamik_get_responsive("dropdown_menu_2_text") . '</h3> <?php } '; $dropdown_menu_register = ''; $nav_dropdown_functions = ''; } elseif (dynamik_get_settings('responsive_enabled') && (dynamik_get_responsive('navbar_media_query_default') == 'tablet_dropdown' || dynamik_get_responsive('navbar_media_query_default') == 'mobile_dropdown')) { if (dynamik_get_design('nav1_location') == "Above Header") { $nav_1_action = "remove_action( 'genesis_after_header', 'genesis_do_nav' );\nadd_action( 'genesis_before_header', 'genesis_do_nav' ); add_action( 'genesis_before_header', 'child_dropdown_nav_1' );\n"; } elseif (dynamik_get_design('nav1_location') == "Below Header") { $nav_1_action = "add_action( 'genesis_after_header', 'child_dropdown_nav_1' );\n"; } if (dynamik_get_design('nav2_location') == "Above Header") { $nav_2_action = "remove_action( 'genesis_after_header', 'genesis_do_subnav' );\nadd_action( 'genesis_before_header', 'genesis_do_subnav' ); add_action( 'genesis_before_header', 'child_dropdown_nav_2' );\n"; } elseif (dynamik_get_design('nav2_location') == "Below Header") { $nav_2_action = "add_action( 'genesis_after_header', 'child_dropdown_nav_2' );\n"; } $mobile_nav_functions = ''; $dropdown_menu_register = "\n/**\n * Register the additional Responsive Dropdown Menus.\n */\nadd_theme_support( 'genesis-menus', array( 'primary' => __( 'Primary Navigation Menu', 'dynamik' ), 'secondary' => __( 'Secondary Navigation Menu', 'dynamik' ), 'primary_dropdown' => __( 'Responsive Dropdown 1', 'dynamik' ), 'secondary_dropdown' => __( 'Responsive Dropdown 2', 'dynamik' ) ) );\n"; $nav_dropdown_functions = ' /** * Build Nav Dropdown HTML. * * @since 1.0 */ function child_dropdown_nav_1() { if ( ! has_nav_menu( ' . $single_quote . 'primary_dropdown' . $single_quote . ' ) ) return; ?> <div id="dropdown-nav-wrap"> <!-- dropdown nav for responsive design --> <nav id="dropdown-nav" role="navigation"> <form id="dropdown-nav-form" action="" method="post"> <select class="nav-chosen-select"> <option value="">' . dynamik_get_responsive("dropdown_menu_1_text") . '</option> <?php $menu = wp_nav_menu( array( ' . $single_quote . 'theme_location' . $single_quote . ' => ' . $single_quote . 'primary_dropdown' . $single_quote . ', ' . $single_quote . 'echo' . $single_quote . ' => false ) ); if ( preg_match_all( "#(<a [^<]+</a>)#", $menu,$matches ) ) { $hrefpat = ' . $single_quote . '/(href *= *([\\"\\' . $single_quote . ']?)([^\\"\\' . $single_quote . ' ]+)\\2)/' . $single_quote . '; foreach ( $matches[0] as $link ) { if ( preg_match( $hrefpat, $link,$hrefs ) ) $href = $hrefs[3]; if( preg_match( "#>([^<]+)<#", $link,$names ) ) $name = $names[1]; echo "<option value=\\"$href\\">$name</option>"; } } ?> </select> </form> </nav><!-- #dropdown-nav --> <!-- /end dropdown nav --> </div> <?php } /** * Build Subnav Dropdown HTML. * * @since 1.0 */ function child_dropdown_nav_2() { if ( ! has_nav_menu( ' . $single_quote . 'secondary_dropdown' . $single_quote . ' ) ) return; ?> <div id="dropdown-subnav-wrap"> <!-- dropdown nav for responsive design --> <nav id="dropdown-subnav" role="navigation"> <form id="dropdown-subnav-form" action="" method="post"> <select class="subnav-chosen-select"> <option value="">' . dynamik_get_responsive("dropdown_menu_2_text") . '</option> <?php $menu = wp_nav_menu( array( ' . $single_quote . 'theme_location' . $single_quote . ' => ' . $single_quote . 'secondary_dropdown' . $single_quote . ', ' . $single_quote . 'echo' . $single_quote . ' => false ) ); if ( preg_match_all( "#(<a [^<]+</a>)#", $menu,$matches ) ) { $hrefpat = ' . $single_quote . '/(href *= *([\\"\\' . $single_quote . ']?)([^\\"\\' . $single_quote . ' ]+)\\2)/' . $single_quote . '; foreach ( $matches[0] as $link ) { if( preg_match( $hrefpat, $link,$hrefs ) ) $href = $hrefs[3]; if( preg_match( "#>([^<]+)<#", $link,$names ) ) $name = $names[1]; echo "<option value=\\"$href\\">$name</option>"; } } ?> </select> </form> </nav><!-- #dropdown-subnav --> <!-- /end dropdown subnav --> </div> <?php } '; } else { if (dynamik_get_design('nav1_location') == "Above Header") { $nav_1_action = "remove_action( 'genesis_after_header', 'genesis_do_nav' );\nadd_action( 'genesis_before_header', 'genesis_do_nav' );\n"; } elseif (dynamik_get_design('nav1_location') == "Below Header") { $nav_1_action = ""; } if (dynamik_get_design('nav2_location') == "Above Header") { $nav_2_action = "remove_action( 'genesis_after_header', 'genesis_do_subnav' );\nadd_action( 'genesis_before_header', 'genesis_do_subnav' );\n"; } elseif (dynamik_get_design('nav2_location') == "Below Header") { $nav_2_action = ""; } if (dynamik_get_design('nav1_location') == "Below Header" && dynamik_get_design('nav2_location') == "Below Header") { $nav_placement_comment = ""; } $mobile_nav_functions = ''; $dropdown_menu_register = ''; $nav_dropdown_functions = ''; } if (dynamik_get_settings('responsive_enabled')) { $responsive_viewport_meta = '<meta name="viewport" content="' . dynamik_get_responsive('viewport_meta_content') . '"/>'; $responsive_viewport = "\nadd_action( 'genesis_meta', 'child_responsive_viewport' );\n/**\n * Add viewport meta tag to the genesis_meta hook\n * to force 'real' scale of site when viewed in mobile devices.\n *\n * @since 1.0\n */\nfunction child_responsive_viewport() {\necho '{$responsive_viewport_meta}' . {$new_line};\n}"; $responsive_js_enqueue = "\nadd_action( 'get_header', 'child_enqueue_responsive_scripts' );\n/**\n * Enqueue Responsive Design javascript code.\n *\n * @since 1.0\n */\nfunction child_enqueue_responsive_scripts() {\t\n\twp_enqueue_script( 'responsive', CHILD_URL . '/js/responsive.js', false, CHILD_THEME_VERSION, true );\n}"; } else { $responsive_viewport_meta = ''; $responsive_viewport = ''; $responsive_js_enqueue = ''; } if ($include_js == 'yes' && file_exists(dynamik_get_custom_js_path()) && 0 != filesize(dynamik_get_custom_js_path())) { $custom_js = get_option('dynamik_gen_custom_js'); if (!empty($custom_js['custom_js_in_head'])) { $in_footer = 'false'; } else { $in_footer = 'true'; } $custom_js_enqueue = "\nadd_action( 'get_header', 'child_enqueue_custom_scripts' );\n/**\n * Enqueue Custom javascript code.\n *\n * @since 1.0\n */\nfunction child_enqueue_custom_scripts() {\t\n\twp_enqueue_script( 'custom-scripts', CHILD_URL . '/js/custom-scripts.js', false, CHILD_THEME_VERSION, " . $in_footer . " );\n}"; } else { $custom_js_enqueue = ''; } if ($include_settings == 'yes') { if (dynamik_get_settings('custom_image_size_one_mode') != '') { if (dynamik_get_settings('custom_image_size_one_mode') != '') { $custom_image_size_one_crop = dynamik_get_settings('custom_image_size_one_mode') == 'crop' ? 'true' : 'false'; $custom_image_size_one = "\n\n/**\n * Add custom thumbnail sizes.\n */\nadd_image_size( 'custom-thumb-1', " . dynamik_get_settings('custom_image_size_one_width') . ", " . dynamik_get_settings('custom_image_size_one_height') . ", " . $custom_image_size_one_crop . " );"; } else { $custom_image_size_one = ''; } if (dynamik_get_settings('custom_image_size_two_mode') != '') { $custom_image_size_two_crop = dynamik_get_settings('custom_image_size_two_mode') == 'crop' ? 'true' : 'false'; $custom_image_size_two = "\nadd_image_size( 'custom-thumb-2', " . dynamik_get_settings('custom_image_size_two_width') . ", " . dynamik_get_settings('custom_image_size_two_height') . ", " . $custom_image_size_two_crop . " );"; } else { $custom_image_size_two = ''; } if (dynamik_get_settings('custom_image_size_three_mode') != '') { $custom_image_size_three_crop = dynamik_get_settings('custom_image_size_three_mode') == 'crop' ? 'true' : 'false'; $custom_image_size_three = "\nadd_image_size( 'custom-thumb-3', " . dynamik_get_settings('custom_image_size_three_width') . ", " . dynamik_get_settings('custom_image_size_three_height') . ", " . $custom_image_size_three_crop . " );"; } else { $custom_image_size_three = ''; } if (dynamik_get_settings('custom_image_size_four_mode') != '') { $custom_image_size_four_crop = dynamik_get_settings('custom_image_size_four_mode') == 'crop' ? 'true' : 'false'; $custom_image_size_four = "\nadd_image_size( 'custom-thumb-4', " . dynamik_get_settings('custom_image_size_four_width') . ", " . dynamik_get_settings('custom_image_size_four_height') . ", " . $custom_image_size_four_crop . " );"; } else { $custom_image_size_four = ''; } if (dynamik_get_settings('custom_image_size_five_mode') != '') { $custom_image_size_five_crop = dynamik_get_settings('custom_image_size_five_mode') == 'crop' ? 'true' : 'false'; $custom_image_size_five = "\nadd_image_size( 'custom-thumb-5', " . dynamik_get_settings('custom_image_size_five_width') . ", " . dynamik_get_settings('custom_image_size_five_height') . ", " . $custom_image_size_five_crop . " );"; } else { $custom_image_size_five = ''; } } $post_title_hook = dynamik_get_settings('html_five_active') ? 'genesis_entry_header' : 'genesis_post_title'; if (dynamik_get_settings('remove_all_page_titles')) { $remove_page_titles = "\n\t\t\t\nadd_action( 'get_header', 'child_remove_page_titles' );\n/**\n * Remove all page titles.\n *\n * @since 1.0\n */\nfunction child_remove_page_titles() {\n if ( is_page() && ! is_page_template( 'page_blog.php' ) )\n remove_action( '" . $post_title_hook . "', 'genesis_do_post_title' );\n}"; } elseif (dynamik_get_settings('remove_page_titles_ids') != '') { $remove_page_titles = "\n\t\t\t\nadd_action( 'get_header', 'child_remove_page_titles' );\n/**\n * Remove specific page titles.\n *\n * @since 1.0\n */\nfunction child_remove_page_titles() {\n\tglobal " . $dollar_sign . "post;\n\t" . $dollar_sign . "page_ids = explode( ',', '" . dynamik_get_settings('remove_page_titles_ids') . "' );\n\tif ( is_page() && ! is_page_template( 'page_blog.php' ) ) {\n\t\tforeach ( " . $dollar_sign . "page_ids as " . $dollar_sign . "page_id ) {\n\t\t\tif ( " . $dollar_sign . "post->ID == " . $dollar_sign . "page_id )\n\t\t\t\tremove_action( '" . $post_title_hook . "', 'genesis_do_post_title' );\n\t\t}\n\t}\n}"; } else { $remove_page_titles = ''; } if (dynamik_get_settings('include_inpost_cpt_all')) { $include_inpost_cpt_names = "\n\nadd_action( 'init', 'child_add_post_type_support' );\n/**\n * Add Genesis In-Post options into ALL Custom Post Types.\n *\n * @since 1.0\n */\nfunction child_add_post_type_support() {\n\tforeach( get_post_types( array( 'public' => true ) ) as " . $dollar_sign . "post_type ) {\n\t\tadd_post_type_support( " . $dollar_sign . "post_type, array( 'genesis-seo', 'genesis-scripts', 'genesis-layouts' ) );\n\t}\n}"; } elseif (dynamik_get_settings('include_inpost_cpt_names') != '') { $include_inpost_cpt_names = "\n\nadd_action( 'init', 'child_add_post_type_support' );\n/**\n * Add Genesis In-Post options into specified Custom Post Types.\n *\n * @since 1.0\n */\nfunction child_add_post_type_support() {\n\t" . $dollar_sign . "post_types = explode( ',', '" . dynamik_get_settings('include_inpost_cpt_names') . "' );\n\t\n\tforeach ( " . $dollar_sign . "post_types as " . $dollar_sign . "post_type ) {\n\t\tadd_post_type_support( " . $dollar_sign . "post_type, array( 'genesis-seo', 'genesis-scripts', 'genesis-layouts' ) );\n\t}\n}"; } else { $include_inpost_cpt_names = ''; } if (dynamik_get_settings('post_formats_active')) { $post_formats = "\n\n/**\n * Enable Custom Post Format functionality.\n */\nadd_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) );\nadd_theme_support( 'genesis-post-format-images' );"; } else { $post_formats = ''; } if (dynamik_get_settings('html_five_active')) { $html_five = "\n\n/**\n * Add support for Genesis HTML5 Markup.\n */\nadd_theme_support( 'html5' );"; } else { $html_five = ''; } if (dynamik_get_settings('html_five_active') && dynamik_get_settings('fancy_dropdowns_active')) { $fancy_dropdowns = "\n\n/**\n * Add support for Genesis 'Fancy Dropdowns'.\n */\nadd_filter( 'genesis_superfish_enabled', '__return_true' );"; } else { $fancy_dropdowns = ''; } } $conditional_functions = "\n\n/**\n * This is altered version of the genesis_get_custom_field() function\n * which includes the additional ability to work with array() values.\n *\n * @since 1.0\n */\nfunction dynamik_get_custom_field( " . $dollar_sign . "field, " . $dollar_sign . "single = true, " . $dollar_sign . "explode = false )\n{\n\tif( null === get_the_ID() )\n\t\treturn '';\n\n\t" . $dollar_sign . "custom_field = get_post_meta( get_the_ID(), " . $dollar_sign . "field, " . $dollar_sign . "single );\n\n\tif( !" . $dollar_sign . "custom_field )\n\t\treturn '';\n\n\tif( !" . $dollar_sign . "single )\n\t{\n\t\t" . $dollar_sign . "custom_field_string = implode( ',', " . $dollar_sign . "custom_field );\n\t\tif( " . $dollar_sign . "explode )\n\t\t{\n\t\t\t" . $dollar_sign . "custom_field_array_pre = explode( ',', " . $dollar_sign . "custom_field_string );\n\t\t\tforeach( " . $dollar_sign . "custom_field_array_pre as " . $dollar_sign . "key => " . $dollar_sign . "value )\n\t\t\t{\n\t\t\t\t" . $dollar_sign . "custom_field_array[" . $dollar_sign . "value] = " . $dollar_sign . "value;\n\t\t\t}\n\t\t\treturn " . $dollar_sign . "custom_field_array;\n\t\t}\n\t\treturn " . $dollar_sign . "custom_field_string;\n\t}\n\n\treturn is_array( " . $dollar_sign . "custom_field ) ? stripslashes_deep( " . $dollar_sign . "custom_field ) : stripslashes( wp_kses_decode_entities( " . $dollar_sign . "custom_field ) );\n}\n\n/**\n * Create a Dynamik Label conditional tag which\n * allows content to be conditionally placed on pages and posts\n * that have specific Dynamik Labels assigned to them.\n *\n * @since 1.0\n */\nfunction dynamik_has_label( " . $dollar_sign . "label = 'label' )\n{\n\t" . $dollar_sign . "labels_meta_array = dynamik_get_custom_field( '_dyn_labels', false, true ) != '' ? dynamik_get_custom_field( '_dyn_labels', false, true ) : array();\n\n\tif( is_singular() )\n\t{\n\t\tif( in_array( " . $dollar_sign . "label, " . $dollar_sign . "labels_meta_array ) ) return true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Create a Genesis Simple Sidebars conditional tag which\n * allows content to be conditionally placed on pages and posts\n * that have specific simple sidebars assigned to them.\n *\n * @since 1.0\n */\nfunction dynamik_is_ss( " . $dollar_sign . "sidebar_id = 'sb-id' )\n{\n\tif( !defined( 'SS_SETTINGS_FIELD' ) )\n\t\treturn false;\n\n\tstatic " . $dollar_sign . "taxonomies = null;\n\n\tif( is_singular() )\n\t{\n\t\tif( " . $dollar_sign . "sidebar_id == genesis_get_custom_field( '_ss_sidebar' ) ) return true;\n\t}\n\n\tif( is_category() )\n\t{\n\t\t" . $dollar_sign . "term = get_term( get_query_var( 'cat' ), 'category' );\n\t\tif( isset( " . $dollar_sign . "term->meta['_ss_sidebar'] ) && " . $dollar_sign . "sidebar_id == " . $dollar_sign . "term->meta['_ss_sidebar'] ) return true;\n\t}\n\n\tif( is_tag() )\n\t{\n\t\t" . $dollar_sign . "term = get_term( get_query_var( 'tag_id' ), 'post_tag' );\n\t\tif( isset( " . $dollar_sign . "term->meta['_ss_sidebar'] ) && " . $dollar_sign . "sidebar_id == " . $dollar_sign . "term->meta['_ss_sidebar'] ) return true;\n\t}\n\n\tif( is_tax() )\n\t{\n\t\tif ( null === " . $dollar_sign . "taxonomies )\n\t\t\t" . $dollar_sign . "taxonomies = ss_get_taxonomies();\n\n\t\tforeach ( " . $dollar_sign . "taxonomies as " . $dollar_sign . "tax )\n\t\t{\n\t\t\tif ( 'post_tag' == " . $dollar_sign . "tax || 'category' == " . $dollar_sign . "tax )\n\t\t\t\tcontinue;\n\n\t\t\tif ( is_tax( " . $dollar_sign . "tax ) )\n\t\t\t{\n\t\t\t\t" . $dollar_sign . "obj = get_queried_object();\n\t\t\t\t" . $dollar_sign . "term = get_term( " . $dollar_sign . "obj->term_id, " . $dollar_sign . "tax );\n\t\t\t\tif( isset( " . $dollar_sign . "term->meta['_ss_sidebar'] ) && " . $dollar_sign . "sidebar_id == " . $dollar_sign . "term->meta['_ss_sidebar'] ) return true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n"; $do_shortcode_text_widget = "\n/**\n * Enable Shortcodes in Text Widgets.\n */\nadd_filter( 'widget_text', 'do_shortcode' );"; if ($include_labels == 'yes' && get_option('dynamik_gen_custom_labels') != array()) { if (dynamik_get_settings('include_inpost_cpt_all')) { foreach (get_post_types(array('public' => true)) as $post_type) { $post_types[] = $post_type; } } else { $post_types = dynamik_get_settings('include_inpost_cpt_names') != '' ? explode(',', 'page,post,' . dynamik_get_settings('include_inpost_cpt_names')) : array('page', 'post'); } $post_type_string = implode(',', $post_types); $labels = get_option('dynamik_gen_custom_labels'); asort($labels); $labels_array = ''; foreach ($labels as $key => $value) { $labels_array .= "'" . $value['label_id'] . "' => '" . $value['label_name'] . "',"; } $custom_labels = "\n\nif( is_admin() )\n{\n\tadd_filter( 'cmb_meta_boxes', 'child_lables_metabox' );\n\t/**\n\t * Define the metabox and field configurations.\n\t *\n\t * @since 1.0\n\t * @return array\n\t */\n\tfunction child_lables_metabox( array " . $dollar_sign . "meta_boxes )\n\t{\n\t\t// Start with an underscore to hide fields from custom fields list\n\t\t" . $dollar_sign . "prefix = '_dyn_';\n\t\t" . $dollar_sign . "post_type_array = explode( ',', '" . $post_type_string . "' );\n\n\t\t" . $dollar_sign . "meta_boxes[] = array(\n\t\t\t'id' => 'dynamik_labels',\n\t\t\t'title' => 'Dynamik Labels',\n\t\t\t'pages' => " . $dollar_sign . "post_type_array, // Post type\n\t\t\t'context' => 'normal',\n\t\t\t'priority' => 'high',\n\t\t\t'show_names' => true, // Show field names on the left\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Select Labels',\n\t\t\t\t\t'desc' => 'Select labels appropriate to this page/post.',\n\t\t\t\t\t'id' => " . $dollar_sign . "prefix . 'labels',\n\t\t\t\t\t'type' => 'multicheck',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t" . $labels_array . "\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn " . $dollar_sign . "meta_boxes;\n\t}\n\n\tadd_action( 'init', 'child_initialize_cmb_meta_boxes', 9999 );\n\t/**\n\t * Initialize the metabox class.\n\t * @since 1.0\n\t */\n\tfunction child_initialize_cmb_meta_boxes()\n\t{\n\t\tif( !class_exists( 'cmb_Meta_Box' ) )\n\t\t\trequire_once CHILD_DIR . '/metaboxes/init.php';\n\t}\n}"; $custom_labels_classes = "\n\n\tif( is_singular() && dynamik_get_custom_field( '_dyn_labels', false, true ) != '' )\n\t{\n\t\tforeach ( dynamik_get_custom_field( '_dyn_labels', false, true ) as " . $dollar_sign . "key => " . $dollar_sign . "value )\n\t\t{\n\t\t\t" . $dollar_sign . "classes[] = 'label-' . " . $dollar_sign . "key;\n\t\t}\n\t}"; } else { $custom_labels = ''; $custom_labels_classes = ''; } /** * Build the EZ Structures file if it exists. */ if (file_exists(dynamik_get_ez_structure_path()) && (dynamik_get_design_alt('dynamik_homepage_type') == 'static_home' || dynamik_get_design_alt('ez_home_slider_display') || dynamik_get_design_alt('ez_feature_top_select') != 'disabled' || dynamik_get_design_alt('ez_fat_footer_select') != 'disabled')) { $ez_structures = substr(file_get_contents(dynamik_get_ez_structure_path()), 67, -64) . "\n"; } else { $ez_structures = ''; } /** * EZ Static Homepage. */ if ($ez_structures != '' && dynamik_get_design('dynamik_homepage_type') == 'static_home') { $ez_home_structure_classes = '$classes[] = "ez-home";'; $ez_home_code = "\n/**\n * Hook the EZ Home Structure function into the 'dynamik_hook_home' Hook.\n */\nadd_action( 'dynamik_hook_home', 'ez_home' );\n"; } else { $ez_home_structure_classes = ""; $ez_home_code = ""; } /** * EZ Home Sidebar. */ if ($ez_structures != '' && dynamik_get_design('dynamik_homepage_type') == 'static_home' && dynamik_get_design('ez_static_home_sb_display')) { $ez_home_sidebar_active_classes = '$classes[] = "ez-home-sidebar";'; if (dynamik_get_design('ez_static_home_sb_location') == 'left') { $ez_home_sidebar_left_classes = '$classes[] = "home-sidebar-left";'; } else { $ez_home_sidebar_left_classes = ""; } $ez_home_sidebar_code = "\n/**\n * Hook the Homepage Sidebar Structure function into the 'dynamik_hook_home' Hook.\n */\nadd_action( 'dynamik_hook_home', 'ez_home_sidebar' );\n"; } else { $ez_home_sidebar_active_classes = ""; $ez_home_sidebar_left_classes = ""; $ez_home_sidebar_code = ""; } if ($ez_structures != '' && dynamik_get_design('ez_home_slider_display')) { $ez_home_slider_active_classes = '$classes[] = "ez-home-slider";'; /** * Determine where to hook in the Home Image Slider based on * whether or not the Static Homepage is active. */ if (dynamik_get_design('dynamik_homepage_type') == 'default_home') { /** * Determine where to hook in the Home Image Slider based on * Home Slider Layout option setting. */ if (dynamik_get_design('ez_home_slider_location') == 'outside') { $ez_home_slider_inside_classes = ''; $ez_home_slider_code = "\n/**\n * Hook the Home Slider structure function into the 'genesis_before_content_sidebar_wrap' Hook.\n */\nadd_action( 'genesis_before_content_sidebar_wrap', 'ez_home_slider' );\n"; } else { $ez_home_slider_inside_classes = '$classes[] = "slider-inside";'; $ez_home_slider_code = "\n/**\n * Hook the Home Slider structure function into the 'genesis_before_loop' Hook.\n */\nadd_action( 'genesis_before_loop', 'ez_home_slider' );\n"; } } else { /** * Determine where to hook in the Home Image Slider based on * Home Slider Layout option setting. */ if (dynamik_get_design('ez_home_slider_location') == 'outside') { $ez_home_slider_inside_classes = ''; $ez_home_slider_code = "\n/**\n * Hook the Home Slider structure function into the 'dynamik_hook_home' Hook.\n */\nadd_action( 'dynamik_hook_home', 'ez_home_slider', 6 );\n"; } else { $ez_home_slider_inside_classes = '$classes[] = "slider-inside";'; $ez_home_slider_code = "\n/**\n * Hook the Home Slider structure function into the 'dynamik_hook_before_ez_home' Hook.\n */\nadd_action( 'dynamik_hook_before_ez_home', 'ez_home_slider' );\n"; } } } else { $ez_home_slider_active_classes = ''; $ez_home_slider_inside_classes = ''; $ez_home_slider_code = ""; } /** * EZ Feature Top. */ if (!dynamik_get_design('ez_feature_top_display_front_page')) { $ez_feature_top_front_page = 'if ( is_front_page() ) { return; }'; } else { $ez_feature_top_front_page = ''; } if (!dynamik_get_design('ez_feature_top_display_posts')) { $ez_feature_top_posts = 'if ( is_single() ) { return; }'; } else { $ez_feature_top_posts = ''; } if (!dynamik_get_design('ez_feature_top_display_pages')) { $ez_feature_top_pages = "if ( ( is_page() || is_404() ) && ! is_front_page() && ! is_page_template( 'page_blog.php' ) ) { return; }"; } else { $ez_feature_top_pages = ''; } if (!dynamik_get_design('ez_feature_top_display_archives')) { $ez_feature_top_archives = 'if ( is_archive() || is_search() ) { return; }'; } else { $ez_feature_top_archives = ''; } if (!dynamik_get_design('ez_feature_top_display_blog')) { $ez_feature_top_blog = "if ( is_page_template( 'page_blog.php' ) ) { return; }"; } else { $ez_feature_top_blog = ''; } if (dynamik_get_design('ez_feature_top_position') == 'outside_inner') { $ez_feature_top_add_action = "add_action( 'genesis_after_header', 'ez_feature_top' );"; } elseif (dynamik_get_design('dynamik_homepage_type') != 'static_home' && dynamik_get_design('ez_feature_top_position') == 'inside_inner') { $ez_feature_top_add_action = "add_action( 'genesis_before_content_sidebar_wrap', 'ez_feature_top', 5 );"; } else { $ez_feature_top_add_action = "is_front_page() ? add_action( 'dynamik_hook_home', 'ez_feature_top', 5 ) : add_action( 'genesis_before_content_sidebar_wrap', 'ez_feature_top', 5 );"; } if ($ez_structures != '' && dynamik_get_design('ez_feature_top_select') != 'disabled') { $ez_feature_top_classes = dynamik_get_design('ez_feature_top_position') == 'outside_inner' ? '$classes[] = "feature-top-outside";' : ''; $ez_feature_top_code = "\n/**\n * Hook the Feature Top Structure function into the 'wp_head' Hook.\n */\nadd_action( 'wp_head', 'child_feature_top' );\n\n/**\n * Determine where NOT to display the Feature Top section before hooking it in.\n *\n * @since 1.0\n */\nfunction child_feature_top() {\n\t/**\n\t * Add conditional tags to control where the Feature Top Widget Area displays.\n\t */\n\tif ( is_page_template( 'landing.php' ) ) { return; }\n\t" . $ez_feature_top_front_page . " " . $ez_feature_top_posts . " " . $ez_feature_top_pages . " " . $ez_feature_top_archives . " " . $ez_feature_top_blog . "\n\t\n\t/**\n\t * Hook the Feature Top Structure function into the appropriate Genesis Hook.\n\t */\n\t" . $ez_feature_top_add_action . "\n}\n"; } else { $ez_feature_top_classes = ""; $ez_feature_top_code = ""; } /** * EZ Fat Footer. */ if (!dynamik_get_design('ez_fat_footer_display_front_page')) { $ez_fat_footer_front_page = 'if ( is_front_page() ) { return; }'; } else { $ez_fat_footer_front_page = ''; } if (!dynamik_get_design('ez_fat_footer_display_posts')) { $ez_fat_footer_posts = 'if ( is_single() ) { return; }'; } else { $ez_fat_footer_posts = ''; } if (!dynamik_get_design('ez_fat_footer_display_pages')) { $ez_fat_footer_pages = "if ( ( is_page() || is_404() ) && ! is_front_page() && ! is_page_template( 'page_blog.php' ) ) { return; }"; } else { $ez_fat_footer_pages = ''; } if (!dynamik_get_design('ez_fat_footer_display_archives')) { $ez_fat_footer_archives = 'if ( is_archive() || is_search() ) { return; }'; } else { $ez_fat_footer_archives = ''; } if (!dynamik_get_design('ez_fat_footer_display_blog')) { $ez_fat_footer_blog = "if ( is_page_template( 'page_blog.php' ) ) { return; }"; } else { $ez_fat_footer_blog = ''; } if (dynamik_get_design('ez_fat_footer_position') == 'outside_inner') { $ez_fat_footer_add_action = "add_action( 'genesis_before_footer', 'ez_fat_footer' );"; } elseif (dynamik_get_design('dynamik_homepage_type') != 'static_home' && dynamik_get_design('ez_fat_footer_position') == 'inside_inner') { $ez_fat_footer_add_action = "add_action( 'genesis_after_content_sidebar_wrap', 'ez_fat_footer' );"; } else { $ez_fat_footer_add_action = "is_front_page() ? add_action( 'dynamik_hook_home', 'ez_fat_footer' ) : add_action( 'genesis_after_content_sidebar_wrap', 'ez_fat_footer' );"; } if ($ez_structures != '' && dynamik_get_design('ez_fat_footer_select') != 'disabled') { $ez_fat_footer_classes = dynamik_get_design('ez_fat_footer_position') == 'inside_inner' ? '$classes[] = \'fat-footer-inside\';' : ''; $ez_fat_footer_code = "\n/**\n * Hook the Fat Footer Structure function into the 'wp_head' Hook.\n */\nadd_action( 'wp_head', 'child_fat_footer' );\n\n/**\n * Determine where NOT to display the Fat Footer section before hooking it in.\n *\n * @since 1.0\n */\nfunction child_fat_footer() {\n\t/**\n\t * Add conditional tags to control where the Fat Footer Widget Area displays.\n\t */\n\tif ( is_page_template( 'landing.php' ) ) { return; }\n\t" . $ez_fat_footer_front_page . " " . $ez_fat_footer_posts . " " . $ez_fat_footer_pages . " " . $ez_fat_footer_archives . " " . $ez_fat_footer_blog . "\n\t\n\t/**\n\t * Hook the Fat Footer Structure function into the appropriate Genesis Hook.\n\t */\n\t" . $ez_fat_footer_add_action . "\n}\n"; } else { $ez_fat_footer_classes = ''; $ez_fat_footer_code = ''; } if (dynamik_get_design('wrap_structure') == 'fluid') { $site_fluid_classes = '$classes[] = \'site-fluid\';'; } else { $site_fluid_classes = ''; } $custom_fucntions_content = $include_functions == 'yes' ? substr(stripslashes(wp_kses_decode_entities($custom_functions['custom_functions'])), 64) : ''; $custom_widget_areas = $include_widget_areas == 'yes' ? substr(file_get_contents(dynamik_get_custom_widget_areas_register_path()), 5) . substr(file_get_contents(dynamik_get_custom_widget_areas_path()), 5) : ''; $custom_hook_boxes = $include_hook_boxes == 'yes' ? substr(file_get_contents(dynamik_get_custom_hook_boxes_path()), 5) : ''; $functions_php = "<?php\n/**\n * Define and require all the necessary 'bits and pieces'\n * and build all necessary Static Homepage and Featured area functions.\n *\n * @package Dynamik\n */\n\n/**\n * Call Genesis's core functions.\n */\nrequire_once( get_template_directory() . '/lib/init.php' );\n\n/**\n * Define child theme constants.\n */\ndefine( 'CHILD_THEME_NAME', '" . $child_name . "' );\ndefine( 'CHILD_THEME_URL', '" . $author_uri . "' );\ndefine( 'CHILD_THEME_VERSION', '1.0' );\n\nadd_filter( 'avatar_defaults', 'child_default_avatar' );\n/**\n * Display a Custom Avatar if one exists with the correct name\n * and in the correct images directory.\n *\n * @since 1.0\n * @return custom avatar.\n */\nfunction child_default_avatar( {$dollar_sign}avatar_defaults )\n{\n\t{$dollar_sign}custom_avatar_image = '';\n\tif( file_exists( CHILD_DIR . '/images/custom-avatar.png' ) )\n\t\t{$dollar_sign}custom_avatar_image = CHILD_URL . '/images/custom-avatar.png';\n\telseif( file_exists( CHILD_DIR . '/images/custom-avatar.jpg' ) )\n\t\t{$dollar_sign}custom_avatar_image = CHILD_URL . '/images/custom-avatar.jpg';\n\telseif( file_exists( CHILD_DIR . '/images/custom-avatar.gif' ) )\n\t\t{$dollar_sign}custom_avatar_image = CHILD_URL . '/images/custom-avatar.gif';\n\telseif( file_exists( CHILD_DIR . '/images/custom-avatar.jpg' ) )\n\t\t{$dollar_sign}custom_avatar_image = CHILD_URL . '/images/custom-avatar.jpg';\n\n\t{$dollar_sign}custom_avatar = apply_filters( 'child_custom_avatar_path', {$dollar_sign}custom_avatar_image );\n\t{$dollar_sign}avatar_defaults[{$dollar_sign}custom_avatar] = 'Custom Avatar';\n\t\n\treturn {$dollar_sign}avatar_defaults;\n}\n{$nav_placement_comment}{$nav_1_action}{$nav_2_action}{$mobile_nav_functions}{$dropdown_menu_register}{$nav_dropdown_functions}{$responsive_viewport}{$custom_image_size_one}{$custom_image_size_two}{$custom_image_size_three}{$custom_image_size_four}{$custom_image_size_five}{$remove_page_titles}{$include_inpost_cpt_names}{$post_formats}{$html_five}{$fancy_dropdowns}{$conditional_functions}{$do_shortcode_text_widget}{$custom_labels}\n{$ez_home_code}{$ez_home_sidebar_code}{$ez_home_slider_code}{$ez_feature_top_code}{$ez_fat_footer_code}{$ez_structures}{$custom_widget_areas}{$custom_hook_boxes}\n/**\n * Filter in specific body classes based on option values.\n */\nadd_filter( 'body_class', 'child_body_classes' );\n/**\n * Determine which classes will be filtered into the body class.\n *\n * @since 1.0\n * @return array of all classes to be filtered into the body class.\n */\nfunction child_body_classes( {$dollar_sign}classes ) {\n\tif ( is_front_page() ) {\n\t\t{$ez_home_structure_classes}\n\t\t{$ez_home_sidebar_active_classes}\n\t\t{$ez_home_sidebar_left_classes}\n\t\t{$ez_home_slider_active_classes}\n\t\t{$ez_home_slider_inside_classes}\n\t}\n\t\n\t{$ez_feature_top_classes}\n\t{$ez_fat_footer_classes}\n\t{$site_fluid_classes}\n\t{$custom_labels_classes}\n\n\t{$dollar_sign}classes[] = 'override';\n\t\n\treturn {$dollar_sign}classes;\n}\n\n{$responsive_js_enqueue}\n{$custom_js_enqueue}\n{$custom_fucntions_content}\n\n//end functions.php"; if (dynamik_get_settings('responsive_enabled')) { $responsive_js = file_get_contents(CHILD_DIR . '/lib/js/dynamik-responsive.js'); } if ($include_js == 'yes' && file_exists(dynamik_get_custom_js_path()) && 0 != filesize(dynamik_get_custom_js_path())) { $custom_js = file_get_contents(dynamik_get_stylesheet_location('url') . 'custom-scripts.js'); } $home_php = '<?php /** * Build the basic structural wrap for the EZ Static Homepage. * * @package Dynamik */ get_header(); ?> <div id="home-hook-wrap" class="clearfix"> <?php do_action( ' . $single_quote . 'dynamik_hook_home' . $single_quote . ' ); ?> </div><!-- end #home-hook-wrap --> <?php get_footer(); //end home.php'; $style_file = $tmp_child . '/style.css'; $make_style = fopen($style_file, 'x'); fwrite($make_style, $style_css); fclose($make_style); $functions_file = $tmp_child . '/functions.php'; $make_functions = fopen($functions_file, 'x'); fwrite($make_functions, $functions_php); fclose($make_functions); if (dynamik_get_settings('responsive_enabled')) { $responsive_js_file = $tmp_js_folder . '/responsive.js'; $make_responsive_js = fopen($responsive_js_file, 'x'); fwrite($make_responsive_js, $responsive_js); fclose($make_responsive_js); } if ($include_js == 'yes' && file_exists(dynamik_get_custom_js_path()) && 0 != filesize(dynamik_get_custom_js_path())) { $custom_js_file = $tmp_js_folder . '/custom-scripts.js'; $make_custom_js = fopen($custom_js_file, 'x'); fwrite($make_custom_js, $custom_js); fclose($make_custom_js); } else { $custom_js_file = ''; } if (dynamik_get_design('dynamik_homepage_type') == 'static_home') { $home_file = $tmp_child . '/home.php'; $make_home = fopen($home_file, 'x'); fwrite($make_home, $home_php); fclose($make_home); } else { $home_file = ''; } $handle = opendir($image_folder); while (false !== ($file = readdir($handle))) { $ext = strtolower(substr(strrchr($file, '.'), 1)); if ($ext == 'jpg' || $ext == 'gif' || $ext == 'png') { if ($file != 'screenshot.png') { copy($image_folder . '/' . $file, $tmp_image_folder . '/' . $file); } else { $screenshot = $file; copy($image_folder . '/' . $file, $tmp_child . '/' . $file); } } } closedir($handle); $handle2 = opendir($dynamik_image_folder); while (false !== ($file = readdir($handle2))) { $ext = strtolower(substr(strrchr($file, '.'), 1)); if ($ext == 'jpg' || $ext == 'gif' || $ext == 'png') { if ($file != 'screenshot.png') { copy($dynamik_image_folder . '/' . $file, $tmp_image_folder . '/' . $file); } elseif ($file == 'screenshot.png' && empty($screenshot)) { copy($dynamik_image_folder . '/' . $file, $tmp_child . '/' . $file); } } } closedir($handle2); if (dynamik_get_settings('post_formats_active')) { $handle3 = opendir($dynamik_post_formats_image_folder); while (false !== ($file = readdir($handle3))) { $ext = strtolower(substr(strrchr($file, '.'), 1)); if ($ext == 'jpg' || $ext == 'gif' || $ext == 'png') { copy($dynamik_post_formats_image_folder . '/' . $file, $tmp_post_formats_image_folder . '/' . $file); } } closedir($handle3); } if ($include_templates == 'yes') { $handle4 = opendir($dynamik_my_templates_folder); while (false !== ($file = readdir($handle4))) { if ($file !== "." && $file !== "..") { copy($dynamik_my_templates_folder . '/' . $file, $tmp_my_templates_folder . '/' . $file); } } closedir($handle4); $handle5 = opendir(CHILD_DIR); while (false !== ($file = readdir($handle5))) { $ext = strtolower(substr(strrchr($file, '.'), 1)); if ($ext == 'php' && $file != 'functions.php' && $file != 'home.php') { $wp_templates_files = true; copy(CHILD_DIR . '/' . $file, $tmp_child . '/' . $file); $wp_template_files_array[] = $tmp_child . '/' . $file; } } closedir($handle5); } if ($include_labels == 'yes' && get_option('dynamik_gen_custom_labels') != array()) { $handle6 = opendir($dynamik_metaboxes_folder); while (false !== ($file = readdir($handle6))) { $ext = strtolower(substr(strrchr($file, '.'), 1)); if ($ext == 'php' || $ext == 'css' || $ext == 'md') { copy($dynamik_metaboxes_folder . '/' . $file, $tmp_metaboxes_folder . '/' . $file); } } closedir($handle6); $handle7 = opendir($dynamik_metaboxes_folder . '/js'); while (false !== ($file = readdir($handle7))) { if ($file !== "." && $file !== "..") { copy($dynamik_metaboxes_folder . '/js/' . $file, $tmp_metaboxes_folder . '/js/' . $file); } } closedir($handle7); $handle8 = opendir($dynamik_metaboxes_folder . '/images'); while (false !== ($file = readdir($handle8))) { if ($file !== "." && $file !== "..") { copy($dynamik_metaboxes_folder . '/images/' . $file, $tmp_metaboxes_folder . '/images/' . $file); } } closedir($handle8); } $export_files = array($style_file, $functions_file, $responsive_js_file, $custom_js_file, $home_file, $dat_file, $tmp_image_folder); if (count(scandir($tmp_my_templates_folder)) > 2) { $export_files[] = $tmp_my_templates_folder; } if (true == $wp_templates_files) { foreach ($wp_template_files_array as $key => $value) { $export_files[] = $value; } } if ($include_labels == 'yes' && get_option('dynamik_gen_custom_labels') != array()) { $export_files[] = $tmp_metaboxes_folder; } if (!empty($screenshot)) { $export_files[] = $tmp_child . '/' . $screenshot; } else { $export_files[] = $tmp_child . '/screenshot.png'; } $dynamik_pclzip = new PclZip($tmp_child . '/' . $child_export_zip); $dynamik_zipped = $dynamik_pclzip->create($export_files, PCLZIP_OPT_REMOVE_PATH, $tmp_child); if ($dynamik_zipped == 0) { die("Error : " . $dynamik_pclzip->errorInfo(true)); } if (ob_get_level()) { ob_end_clean(); } header("Cache-Control: public, must-revalidate"); header("Pragma: hack"); header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename={$child_export_zip}"); readfile($tmp_child . '/' . $child_export_zip); dynamik_delete_dir($tmp_child); dynamik_folders_close_permissions(); exit; }
</div> </div> </div> </div> <div id="dynamik-fancy-dropdowns-active-box" class="dynamik-optionbox-outer-2col" style="display:none;"> <div class="dynamik-optionbox-inner-2col"> <h4><?php _e('Genesis "Fancy Dropdowns"', 'dynamik'); ?> </h4> <div class="bg-box"> <p> <input type="checkbox" id="dynamik-fancy-dropdowns-active" name="dynamik[fancy_dropdowns_active]" value="1" <?php if (checked(1, dynamik_get_settings('fancy_dropdowns_active'))) { } ?> /> <?php _e('Enable Genesis Menu "Fancy Dropdowns"', 'dynamik'); ?> <span id="fancy-dropdowns-tooltip" class="tooltip-mark tooltip-top-left">[?]</span> </p> <div class="tooltip tooltip-500"> <p> <?php _e('With this feature enabled your Primary and Secondary Genesis menus, where sub-menus are present, will include sub-indicators as well as the "fancy dropdown" effect.', 'dynamik'); ?> </p>
<?php _e('<strong>Effect of Default styles:</strong> <strong>1st trigger point</strong> = Footer text will center, accommodating narrower screens.', 'dynamik'); ?> </p> <h5><?php _e('Default Code:', 'dynamik'); ?> </h5> <p> <?php _e('1st trigger point:', 'dynamik'); ?> <br /> <?php if (dynamik_get_settings('html_five_active')) { _e('<textarea style="width:100%; min-height:50px; margin:0;">.site-footer .creds, .site-footer .gototop { width: 100%; text-align: center; float: none; }</textarea>', 'dynamik'); } else { _e('<textarea style="width:100%; min-height:50px; margin:0;">#footer .creds, #footer .gototop { width: 100%; text-align: center; float: none; }</textarea>', 'dynamik'); } ?> </p> </div> </div> <div style="clear:both;"></div> <div style="display:none;" id="dynamik-display-dropdown-menu-text-box"> <div class="bg-box" style="width:364px; margin-right:0; float:left;"> <p>
/** * Enqueue various bits of javascript. * * @since 1.0 */ function dynamik_enqueue_scripts() { global $dynamik_css_builder_popup; if ($dynamik_css_builder_popup && !is_admin()) { wp_enqueue_script('css-builder-popup', CHILD_URL . '/lib/js/dynamik-custom-css-builder-popup.js', false, CHILD_THEME_VERSION, true); wp_enqueue_script('js-color-popup', CHILD_URL . '/lib/js/jscolor/jscolor-popup.js', false, CHILD_THEME_VERSION, true); wp_enqueue_script('jquery-ui-draggable'); } if (dynamik_get_settings('responsive_enabled')) { wp_enqueue_script('responsive', CHILD_URL . '/lib/js/dynamik-responsive.js', false, CHILD_THEME_VERSION, true); } $custom_js = get_option('dynamik_gen_custom_js'); if (!empty($custom_js['custom_js_in_head'])) { $in_footer = false; } else { $in_footer = true; } if (file_exists(dynamik_get_custom_js_path()) && 0 != filesize(dynamik_get_custom_js_path())) { wp_enqueue_script('custom-scripts', dynamik_get_stylesheet_location('url') . 'custom-scripts.js', false, CHILD_THEME_VERSION, $in_footer); } }
/** * Build the Dynamik Theme Settings admin page. * * @since 1.0 */ function dynamik_theme_settings() { $user = wp_get_current_user(); ?> <div class="wrap"> <div id="dynamik-settings-saved" class="dynamik-update-box"></div> <?php if (!empty($_POST['action']) && $_POST['action'] == 'reset') { update_option('dynamik_gen_theme_settings', dynamik_theme_settings_defaults()); dynamik_write_files($css = true, $ez = false, $custom = false); dynamik_get_settings(null, $args = array('cached' => false, 'array' => false)); ?> <script type="text/javascript">jQuery(document).ready(function($){ $('#dynamik-settings-saved').html('Theme Settings Reset').center().fadeIn('slow');window.setTimeout(function(){$('#dynamik-settings-saved').fadeOut( 'slow' );}, 2222); });</script> <?php } if (!empty($_GET['activetab'])) { ?> <script type="text/javascript">jQuery(document).ready(function($) { $('#<?php echo $_GET['activetab']; ?> ').click(); });</script> <?php } ?> <div id="icon-options-general" class="icon32"></div> <h2 id="dynamik-admin-heading"><?php _e('Dynamik - Theme Settings', 'dynamik'); ?> </h2> <div id="dynamik-admin-wrap"> <form action="/" id="theme-settings-form" name="theme-settings-form"> <input type="hidden" name="action" value="dynamik_theme_settings_save" /> <input type="hidden" name="security" value="<?php echo wp_create_nonce('theme-settings'); ?> " /> <div id="dynamik-floating-save"> <img id="ajax-save-no-throb" src="<?php echo CHILD_URL . '/lib/css/images/no-throb.png'; ?> " style="margin-bottom:11px;" /><img id="ajax-save-throbber" src="<?php echo CHILD_URL . '/lib/css/images/throbber.gif'; ?> " style="display:none;margin-bottom:11px;" /><input type="image" src="<?php echo CHILD_URL . '/lib/css/images/save-changes-x2.png'; ?> " value="<?php _e('Save Changes', 'dynamik'); ?> " class="dynamik-save-button" name="Submit" alt="Save Changes" /> </div> <div id="dynamik-theme-settings-nav"> <ul> <li id="dynamik-theme-settings-nav-info" class="dynamik-options-nav-all dynamik-options-nav-active"><a href="#">Child Theme Info</a></li><li id="dynamik-theme-settings-nav-general" class="dynamik-options-nav-all"><a href="#">General Settings</a></li><li id="dynamik-theme-settings-nav-import-export" class="dynamik-options-nav-all"><a class="dynamik-options-nav-last" href="#">Import / Export</a></li> </ul> </div> <div class="dynamik-theme-settings-wrap"> <?php require_once CHILD_DIR . '/lib/admin/boxes/settings-general.php'; ?> </div> </form> <div class="dynamik-theme-settings-wrap"> <?php require_once CHILD_DIR . '/lib/admin/boxes/settings-theme-info.php'; ?> <?php require_once CHILD_DIR . '/lib/admin/boxes/settings-import-export.php'; ?> </div> <div id="dynamik-admin-footer"> <p> <a href="http://cobaltapps.com" target="_blank">CobaltApps.com</a> | <a href="https://dynamiktheme.desk.com/" target="_blank">Resources</a> | <a href="http://cobaltapps.com/my-account/" target="_blank">My Account</a> | <a href="http://cobaltapps.com/forum/" target="_blank">Community Forum</a> | <a href="http://cobaltapps.com/affiliates/" target="_blank">Affiliates</a> · <a><span id="show-options-reset" class="dynamik-custom-fonts-button button" style="margin:0; float:none !important;"><?php _e('Theme Settings Reset', 'dynamik'); ?> </span></a> </p> </div> <div style="display:none; position:inherit; height:25px; width:520px; margin:-11px 0 0 135px; float:left;" id="show-options-reset-box" class="dynamik-custom-fonts-box"> <form style="width:520px; float:left;" id="dynamik-reset-theme-settings" method="post"> <strong><?php _e('**This Will Reset ALL Your Dynamik Theme Settings**', 'dynamik'); ?> </strong> <input style="background:#D54E21; width:160px !important; color:#FFFFFF !important; text-shadow: 0 0 0 #fff;" type="submit" value="<?php _e('Reset Theme Settings', 'dynamik'); ?> " class="dynamik-reset button" name="Submit" onClick='return confirm("<?php _e('Are you sure your want to reset your Dynamik Theme Settings?', 'dynamik'); ?> ")'/><input type="hidden" name="action" value="reset" /> </form> </div> </div> </div> <!-- Close Wrap --> <?php }