Ejemplo n.º 1
0
    function weaverii_generate_wphead()
    {
        /* this guy does ALL the work for generating theme look - it writes out the over-rides to the standard style.css */
        global $weaverii_cur_page_ID;
        global $post;
        $weaverii_cur_page_ID = 0;
        // need this for 404 page when this is not valid
        if (is_object($post)) {
            $weaverii_cur_page_ID = get_the_ID();
        }
        // we're on a page now, so set the post id for the rest of the session
        printf("\n<!-- This site is using %s %s (%s) subtheme: %s -->\n", WEAVERII_THEMENAME, WEAVERII_VERSION, weaverii_getopt('wii_style_version'), weaverii_getopt('wii_subtheme'));
        printf("<!-- Page ID: %s -->\n", $weaverii_cur_page_ID);
        // emit Weaver II's required dynamic JavaScript
        // support for Masonry script
        // weaverii_masonry('invoke-code');
        // handle 3 stylesheet situations
        //  default: used weaver-style.css
        //  no weaver-style.css: when first installed, there will not be a weaver-style.css, so use inline instead
        //  force inline: user wants inline css
        if (weaverii_use_inline_css(weaverii_get_css_filename())) {
            // generate inline CSS
            require_once 'generatecss.php';
            // include only now at runtime.
            echo '<style type="text/css">' . "\n";
            $output = weaverii_f_open('php://output', 'w+');
            weaverii_output_style($output);
            echo "</style> <!-- end of main options style section -->\n";
        }
        if (weaverii_dev_mode() && weaverii_getopt_checked('_wii_diag_borders')) {
            ?>
<style type="text/css">
#content,#colophon,#branding,.widget,#infobar,.widget-area {border: 1px solid #F00 !important;}
#wrapper,#container,#main{border: 1px solid blue;}
</style>
<?php 
        }
        /* now head options */
        echo weaverii_getopt('_wii_althead_opts');
        echo weaverii_getopt('wii_head_opts');
        /* let the user have the last word! */
        $per_page_code = weaverii_get_per_page_value('page-head-code');
        if (!empty($per_page_code)) {
            echo $per_page_code;
        }
        weaverii_mobile_style();
        if (weaverii_is_checked_page_opt('ttw-hide-site-title')) {
            /* best to just do this inline */
            echo '<style type="text/css">#site-title,#site-description,#header-extra-html{display:none;}</style>' . "\n";
        }
        weaverii_fix_IE();
        echo "\n<!-- End of Weaver II options -->\n";
    }
Ejemplo n.º 2
0
function weaverii_trace_sidebar($msg)
{
    if (weaverii_dev_mode() && weaverii_getopt_checked('_wii_diag_trace_sidebars')) {
        $fixed = strstr($msg, '/weaver');
        if (!$fixed) {
            $fixed = $msg;
        }
        echo '<h3 style="background:#afa;color:blue;">*' . $fixed . "*</h3>\n";
    }
}
Ejemplo n.º 3
0
<?php 
}
// end if !hide_footer
if (!weaverii_getopt_checked('wii_footer_last')) {
    // normally, #colophon inside #page
    echo "</div><!-- #wrapper -->\n";
}
weaverii_inject_area('postfooter');
// and this is the end options insertion
echo "<a href=\"#page-top\" id=\"page-bottom\">&uarr;</a>\n";
if (!weaverii_getopt_checked('_wii_no_final_div')) {
    if (weaverii_getopt_checked('wii_hide_final')) {
        echo '<div id="weaver-final" class="weaver-final-normal wvr-hide-bang">';
    } else {
        echo '<div id="weaver-final" class="weaver-final-normal">';
    }
}
wp_footer();
weaverii_masonry('invoke-code');
if (!weaverii_getopt_checked('_wii_no_final_div')) {
    echo '</div> <!-- #weaver-final -->' . "\n";
}
if (weaverii_dev_mode() && weaverii_getopt_checked('_weaverii_diag_timer')) {
    global $weaverii_timer;
    $end_time = microtime(true);
    echo '<span class="wvr-timer-msg">Page generated in: ' . round($end_time - $weaverii_timer, 3) . ' seconds.</span>' . "\n";
}
?>
</body>
</html>
Ejemplo n.º 4
0
function weaverii_process_options_admin_pro()
{
    if (weaverii_submitted('backup_settings')) {
        $name = weaverii_savebackup();
        if ($name !== false) {
            weaverii_save_msg(weaverii_t_('All current main and advanced options backed up in:') . ' "' . $name . '.w2b"');
        } else {
            weaverii_save_msg(weaverii_t_('ERROR: Saving backup failed.'));
        }
    }
    if (weaverii_submitted('filesavetheme')) {
        $base = sanitize_file_name($_POST['savethemename']);
        if (weaverii_dev_mode()) {
            weaverii_setopt('wii_hide_old_weaver', 0);
        }
        $temp_url = weaverii_write_current_theme($base);
        if ($temp_url == '') {
            weaverii_save_msg(weaverii_t_('Invalid name supplied to save theme to file.'));
        } else {
            weaverii_save_msg(weaverii_t_("All current main and advanced options saved in ") . $temp_url);
        }
    }
    if (weaverii_submitted('restoretheme')) {
        $base = $_POST['wii_restorename'];
        $valid = validate_file($base);
        // make sure an ok file name
        $fn = weaverii_f_uploads_base_dir() . 'weaverii-subthemes/' . $base;
        if ($valid < 1 && weaverii_upload_theme($fn)) {
            $t = weaverii_getopt('wii_themename');
            if ($t == '') {
                $t = weaverii_getopt('wii_subtheme');
            }
            if ($t == '') {
                $t = 'Antique Ivory';
            }
            /* did we save a theme? */
            weaverii_setopt('wii_theme_filename', 'custom');
            // we have a custom theme now...
            weaverii_save_msg(weaverii_t_("Weaver II theme restored from file: ") . $t);
        } else {
            weaverii_save_msg('<em style="color:red;">' . weaverii_t_('INVALID FILE NAME PROVIDED - Try Again') . "({$fn})" . '</em>');
        }
    }
    if (weaverii_submitted('save_mobiletheme')) {
        weaverii_save_msg(weaverii_t_("Current settings saved in alternate Mobile View database entry."));
        $weaverii_opts = get_option(apply_filters('weaver_options', 'weaverii_settings'), array());
        $weaverii_opts['_wii_mobile_alt_theme'] = 'saved_mobile';
        // force  these two
        $weaverii_opts['_wii_sim_mobile'] = false;
        $weaverii_opts['_wii_inline_style'] = 'on';
        weaverii_wpupdate_option('weaverii_settings_mobile', $weaverii_opts, 'save_mobiletheme');
        $weaverii_pro_opts = get_option(apply_filters('weaver_options', 'weaverii_pro'), array());
        weaverii_wpupdate_option('weaverii_pro_mobile', $weaverii_pro_opts, 'save_mobile_theme');
    }
    if (weaverii_submitted('renametheme')) {
        $name = isset($_POST['wii_themename']) ? $_POST['wii_themename'] : '';
        $desc = isset($_POST['wii_theme_description']) ? $_POST['wii_theme_description'] : '';
        if ($name) {
            weaverii_setopt('wii_themename', $name);
        }
        if ($desc) {
            weaverii_setopt('wii_theme_description', $desc);
        }
    }
    if (weaverii_submitted('deletetheme')) {
        $myFile = isset($_POST['selectName']) ? $_POST['selectName'] : '';
        $valid = validate_file($myFile);
        if ($valid < 1 && $myFile != "None") {
            weaverii_f_delete(weaverii_f_uploads_base_dir() . 'weaverii-subthemes/' . $myFile);
            echo '<div style="background-color: rgb(255, 251, 204);" id="message" class="updated fade"><p>File: <strong>' . $myFile . '</strong> has been deleted.</p></div>';
        } else {
            echo '<div style="background-color: rgb(255, 251, 204);" id="message" class="updated fade"><p>File: <strong>' . $myFile . '</strong> invalid file name, not deleted.</p></div>';
        }
    }
}