Пример #1
0
        {
            echo '<div id="update-nag">';
            printf(__('<strong>Genesis Extender & Dynamik Website Builder Are Currently Active!</strong> If you are <a href="%s">transferring settings</a> then do so now, otherwise deactivate <a href="%s">Genesis Extender</a> or <a href="%s">Dynamik Website Builder</a>.', 'dynamik'), admin_url('admin.php?page=dynamik-settings'), admin_url('plugins.php'), admin_url('themes.php'));
            echo '</div>';
        }
    }
    require_once CHILD_DIR . '/lib/admin/build-menu.php';
    require_once CHILD_DIR . '/lib/admin/dynamik-theme-settings.php';
    require_once CHILD_DIR . '/lib/admin/dynamik-design-options.php';
    require_once CHILD_DIR . '/lib/admin/dynamik-custom-options.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-user-meta.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-build-styles.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-write-files.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-image-uploader.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-update.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-import-export.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-ez-structures.php';
    require_once CHILD_DIR . '/lib/admin/metaboxes/dynamik-metaboxes.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-templates.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-labels.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-conditionals.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-widget-areas.php';
    require_once CHILD_DIR . '/lib/functions/dynamik-hook-boxes.php';
}
/**
 * Run if Dynamik was just activated.
 */
if (is_admin() && isset($_GET['activated']) && $pagenow == "themes.php") {
    dynamik_activate();
}
//end lib/init.php
Пример #2
0
/**
 * Perform Dynamik updates based on current version number.
 *
 * @since 1.0
 */
function dynamik_update()
{
    // Don't do anything if we're on the latest version.
    if (version_compare(get_option('dynamik_gen_version_number'), CHILD_THEME_VERSION, '>=')) {
        return;
    }
    // Update to Dynamik 1.0.1
    if (version_compare(get_option('dynamik_gen_version_number'), '1.0.1', '<')) {
        $dynamik_settings = get_option('dynamik_gen_theme_settings');
        $new_dynamik_settings = array('custom_image_size_one_mode' => '', 'custom_image_size_one_width' => '', 'custom_image_size_one_height' => '', 'custom_image_size_two_mode' => '', 'custom_image_size_two_width' => '', 'custom_image_size_two_height' => '', 'custom_image_size_three_mode' => '', 'custom_image_size_three_width' => '', 'custom_image_size_three_height' => '', 'custom_image_size_four_mode' => '', 'custom_image_size_four_width' => '', 'custom_image_size_four_height' => '', 'custom_image_size_five_mode' => '', 'custom_image_size_five_width' => '', 'custom_image_size_five_height' => '');
        $dynamik_settings = wp_parse_args($new_dynamik_settings, $dynamik_settings);
        update_option('dynamik_gen_theme_settings', $dynamik_settings);
        update_option('dynamik_gen_version_number', '1.0.1');
    }
    // Update to Dynamik 1.0.2
    if (version_compare(get_option('dynamik_gen_version_number'), '1.0.2', '<')) {
        $custom_functions = get_option('dynamik_gen_custom_functions');
        $new_custom_functions = array('custom_functions_effect_admin' => 0);
        $custom_functions = wp_parse_args($new_custom_functions, $custom_functions);
        update_option('dynamik_gen_custom_functions', $custom_functions);
        update_option('dynamik_gen_version_number', '1.0.2');
    }
    // Update to Dynamik 1.0.3
    if (version_compare(get_option('dynamik_gen_version_number'), '1.0.3', '<')) {
        $dynamik_design_settings = get_option('dynamik_gen_design_options');
        $new_dynamik_settings = array('comment_author_link_color' => '0D72C7', 'comment_author_link_hover_color' => '0D72C7', 'comment_author_link_underline' => 'On Hover', 'comment_author_link_u' => 1);
        $dynamik_design_settings = wp_parse_args($new_dynamik_settings, $dynamik_design_settings);
        update_option('dynamik_gen_design_options', $dynamik_design_settings);
        update_option('dynamik_gen_version_number', '1.0.3');
    }
    // Update to Dynamik 1.0.4
    if (version_compare(get_option('dynamik_gen_version_number'), '1.0.4', '<')) {
        update_option('dynamik_gen_version_number', '1.0.4');
    }
    // Update to Dynamik 1.1
    if (version_compare(get_option('dynamik_gen_version_number'), '1.1', '<')) {
        $dynamik_settings = get_option('dynamik_gen_theme_settings');
        $new_dynamik_settings = array('fancy_dropdowns_active' => 1, 'html_five_active' => 0);
        $dynamik_settings = wp_parse_args($new_dynamik_settings, $dynamik_settings);
        update_option('dynamik_gen_theme_settings', $dynamik_settings);
        $dynamik_design_settings = get_option('dynamik_gen_design_options');
        $new_dynamik_design_settings = array('comment_form_allowed_tags_font_size' => '14', 'comment_form_allowed_tags_font_color' => '888888', 'comment_form_allowed_tags_font_css' => '', 'comment_form_allowed_tags_bg_type' => 'color', 'comment_form_allowed_tags_bg_no_color' => !$defaults && !empty($import['comment_form_allowed_tags_bg_no_color']) ? 1 : 0, 'comment_form_allowed_tags_bg_color' => 'F5F5F5', 'comment_form_allowed_tags_bg_image' => '', 'comment_form_allowed_tags_border_thickness' => '1', 'comment_form_allowed_tags_border_style' => 'solid', 'comment_form_allowed_tags_border_color' => 'DDDDDD', 'comment_form_allowed_tags_margin_top' => '10', 'comment_form_allowed_tags_margin_bottom' => '20', 'comment_form_allowed_tags_padding_top' => '20', 'comment_form_allowed_tags_padding_right' => '20', 'comment_form_allowed_tags_padding_bottom' => '20', 'comment_form_allowed_tags_padding_left' => '20', 'comment_form_allowed_tags_font_u' => 'u', 'comment_form_allowed_tags_px_em' => 'px');
        $dynamik_design_settings = wp_parse_args($new_dynamik_design_settings, $dynamik_design_settings);
        update_option('dynamik_gen_design_options', $dynamik_design_settings);
        $new_font_type_settings = array('comment_form_allowed_tags' => 'Arial, sans-serif');
        $dynamik_design_settings['font_type'] = wp_parse_args($new_font_type_settings, $dynamik_design_settings['font_type']);
        update_option('dynamik_gen_version_number', '1.1');
    }
    // Update to Dynamik 1.2
    if (version_compare(get_option('dynamik_gen_version_number'), '1.2', '<')) {
        $dynamik_settings = get_option('dynamik_gen_theme_settings');
        $new_dynamik_settings = array('include_inpost_cpt_all' => 0);
        $dynamik_settings = wp_parse_args($new_dynamik_settings, $dynamik_settings);
        update_option('dynamik_gen_theme_settings', $dynamik_settings);
        $dynamik_responsive_settings = get_option('dynamik_gen_responsive_options');
        $new_dynamik_responsive_settings = array('vertical_toggle_button_styles' => '.mobile-primary-toggle,
.mobile-secondary-toggle {
	width: 70px;
	margin: 0 auto;
	padding: 6px 10px;
	padding: 0.428571429rem 0.714285714rem;
	font-size: 11px;
	font-size: 0.785714286rem;
	line-height: 1.428571429;
	font-weight: normal;
	color: #7c7c7c;
	text-align: center;
	background-color: #e6e6e6;
	background-repeat: repeat-x;
	background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
	background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6);
	background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6);
	background-image: -o-linear-gradient(top, #f4f4f4, #e6e6e6);
	background-image: linear-gradient(top, #f4f4f4, #e6e6e6);
	border: 1px solid #d2d2d2;
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1);
	cursor: pointer;
	display: none;
}
.mobile-primary-toggle:hover,
.mobile-secondary-toggle:hover {
	color: #5e5e5e;
	background-color: #ebebeb;
	background-repeat: repeat-x;
	background-image: -moz-linear-gradient(top, #f9f9f9, #ebebeb);
	background-image: -ms-linear-gradient(top, #f9f9f9, #ebebeb);
	background-image: -webkit-linear-gradient(top, #f9f9f9, #ebebeb);
	background-image: -o-linear-gradient(top, #f9f9f9, #ebebeb);
	background-image: linear-gradient(top, #f9f9f9, #ebebeb);
}
.mobile-primary-toggle:active,
.mobile-secondary-toggle:active {
	color: #757575;
	background-color: #e1e1e1;
	background-repeat: repeat-x;
	background-image: -moz-linear-gradient(top, #ebebeb, #e1e1e1);
	background-image: -ms-linear-gradient(top, #ebebeb, #e1e1e1);
	background-image: -webkit-linear-gradient(top, #ebebeb, #e1e1e1);
	background-image: -o-linear-gradient(top, #ebebeb, #e1e1e1);
	background-image: linear-gradient(top, #ebebeb, #e1e1e1);
	box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4;
	border: none;
}');
        $dynamik_responsive_settings = wp_parse_args($new_dynamik_responsive_settings, $dynamik_responsive_settings);
        update_option('dynamik_gen_responsive_options', $dynamik_responsive_settings);
        $do_shortcode_find = array('[', ']');
        $do_shortcode_replace = array('&lt;?php echo do_shortcode( \'[', ']\' ); ?&gt;');
        $updated_dynamik_hook_boxes = array();
        $dynamik_hook_boxes = get_option('dynamik_gen_custom_hook_boxes');
        foreach ($dynamik_hook_boxes as $key => $value) {
            $value['hook_textarea'] = str_replace($do_shortcode_find, $do_shortcode_replace, $value['hook_textarea']);
            $updated_dynamik_hook_boxes[$key] = $value;
        }
        update_option('dynamik_gen_custom_hook_boxes', $updated_dynamik_hook_boxes);
        update_option('dynamik_gen_version_number', '1.2');
    }
    // Update to Dynamik 1.2.1
    if (version_compare(get_option('dynamik_gen_version_number'), '1.2.1', '<')) {
        update_option('dynamik_gen_version_number', '1.2.1');
    }
    // Update to Dynamik 1.2.2
    if (version_compare(get_option('dynamik_gen_version_number'), '1.2.2', '<')) {
        update_option('dynamik_gen_version_number', '1.2.2');
    }
    // Finish the update sequence.
    delete_transient('dynamik-gen-update');
    dynamik_activate();
    wp_redirect(admin_url('admin.php?page=dynamik-settings&updated=dynamik-gen'));
}