/**
 * Prepares the contents of the export file.
 *
 * @author Gary Jones
 * @since 0.9.6
 * @return array $output multi-dimensional array holding CSS data
 * @uses prose_get_mapping()
 * @version 1.0
 */
function prose_prepare_export()
{
    $mapping = prose_get_mapping();
    foreach ($mapping as $selector => $declaration) {
        if (!is_array($declaration)) {
            $output[$selector] = prose_get_design_option($declaration);
        } else {
            foreach ($declaration as $property => $value) {
                if (!is_array($value)) {
                    $output[$selector][$property] = prose_get_design_option($value);
                } else {
                    foreach ($value as $index => $composite_value) {
                        $val = $composite_value[0];
                        $type = $composite_value[1];
                        if ('fixed_string' == $type) {
                            $output[$selector][$property][$index]['value'] = $val;
                        } else {
                            $output[$selector][$property][$index]['value'] = prose_get_design_option($val);
                        }
                        $output[$selector][$property][$index]['type'] = $type;
                    }
                }
            }
        }
    }
    // Add in contents of custom stylesheet
    $css = file_get_contents(prose_get_custom_stylesheet_path());
    $output['custom_css'] = $css;
    return apply_filters('prose_prepare_export', $output);
}
function prose_register_settings()
{
    register_setting(PROSE_SETTINGS_FIELD, PROSE_SETTINGS_FIELD);
    add_option(PROSE_SETTINGS_FIELD, prose_settings_defaults(), '', 'yes');
    if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'design-settings') {
        return;
    }
    if (prose_get_design_option('reset')) {
        update_option(PROSE_SETTINGS_FIELD, prose_settings_defaults());
        wp_redirect(admin_url('admin.php?page=design-settings&reset=true'));
        exit;
    }
}
/**
 * Styling included at the top of the custom-header admin page.
 * 
 * @author StudioPress
 */
function prose_custom_header_admin_style()
{
    $background_color = 'hex' == prose_get_design_option('header_background_color_select') ? prose_get_design_option('header_background_color') : prose_get_design_option('header_background_color_select');
    ?>
<style type="text/css">
#headimg {
    background-repeat:no-repeat;
    background-color: <?php 
    echo $background_color;
    ?>
;
    width: 940px;
    height: <?php 
    echo prose_get_design_option('header_image_height');
    ?>
px;
}
#headimg h1 {
    font-family: Georgia, serif;
    font-size: 30px;
    font-weight: normal;
    line-height: 36px;
    margin: 0; 
    padding: <?php 
    echo prose_get_design_option('header_top_padding');
    ?>
px 0 0 <?php 
    echo prose_get_design_option('header_left_padding');
    ?>
px;
}
#headimg h1 a {
    color:#333333;
    text-decoration:none;
}
#headimg #desc {
    color: #999999;
    font-family: Georgia, serif;
    font-size: 15px;
    font-style: italic;
    font-weight: normal;
    margin: 0; 
    padding: <?php 
    echo prose_get_design_option('header_tagline_top_padding');
    ?>
px 0 0 <?php 
    echo prose_get_design_option('header_tagline_left_padding');
    ?>
px;
}
</style>
<?php 
}
Ejemplo n.º 4
0
/**
 * Displays the notice that the design settings were successfully updated to the
 * latest version.
 *
 * @since 1.5.0
 *
 * @uses prose_get_design_option()
 *
 * @return null Returns early if not on the Design Settings page.
 */
function prose_updated_notice()
{
    if (!genesis_is_menu_page('design-settings')) {
        return;
    }
    if (isset($_REQUEST['upgraded']) && 'true' == $_REQUEST['upgraded']) {
        echo '<div id="message" class="updated highlight" id="message"><p><strong>' . sprintf(__('Congratulations! You are now rocking Prose %s', 'prose'), prose_get_design_option('theme_version')) . '</strong></p></div>';
    }
}