Beispiel #1
0
/**
 * function thesis_generate_css()
 *
 * Builds layout.css content then writes it to the file.
 *
 * @uses Thesis_CSS
 */
function thesis_generate_css()
{
    if (is_writable(THESIS_LAYOUT_CSS)) {
        $thesis_css = new Thesis_CSS();
        $thesis_css->build();
        $lid = @fopen(THESIS_LAYOUT_CSS, 'w');
        @fwrite($lid, $thesis_css->css);
        @fclose($lid);
    }
}
Beispiel #2
0
    function options_page()
    {
        $css = new Thesis_CSS();
        $css->baselines();
        $css->widths();
        $this->optimal_width = $css->widths['container'] - $css->base['page_padding'] * 2;
        $this->process();
        $rtl = get_bloginfo('text_direction') == 'rtl' ? ' rtl' : '';
        #wp
        echo "<div id=\"thesis_options\" class=\"wrap{$rtl}\">\n";
        thesis_version_indicator();
        thesis_options_title(__('Thesis Header Image', 'thesis'), false);
        thesis_options_nav();
        if ($this->updated) {
            echo "<div id=\"updated\" class=\"updated fade\">\n\t<p>" . __('Header image updated!', 'thesis') . ' <a href="' . get_bloginfo('url') . '/">' . __('Check out your site &rarr;', 'thesis') . "</a></p>\n</div>\n";
        } elseif ($this->removed) {
            echo "<div id=\"updated\" class=\"updated fade\">\n\t<p>" . __('Header image removed!', 'thesis') . ' <a href="' . get_bloginfo('url') . '/">' . __('Check out your site &rarr;', 'thesis') . "</a></p>\n</div>\n";
        } elseif ($this->error) {
            echo "<div class=\"warning\"><p>" . __('<strong>Whoops!</strong> You tried to upload an unrecognized file type. The header image uploader only accepts <code>.jpg</code>, <code>.png</code>, or <code>.gif</code> files.', 'thesis') . "</p></div>";
        }
        if ($this->header) {
            echo "<div id=\"header_preview\">\n\t<img src=\"{$this->header['url']}\" width=\"{$this->header['width']}\" height=\"{$this->header['height']}\" alt=\"header image preview\" title=\"header image preview\" />\n\t<a href=\"" . wp_nonce_url(admin_url('admin.php?page=thesis-header-image&remove=true'), 'thesis-remove-header') . "\" title=\"" . __('Click here to remove this header image', 'thesis') . "\">" . __('Remove Image', 'thesis') . "</a>\n</div>\n";
        }
        ?>
	<div class="one_col">
		<div class="control_area">
			<p><?php 
        printf(__('Based on your <a href="%1$s">current layout settings</a>, the optimal header image width is <strong>%2$d pixels</strong>. If your image is wider than this, don&#8217;t worry&#8212;Thesis will automatically resize it for you!', 'thesis'), admin_url('admin.php?page=thesis-design-options#layout-constructor'), $this->optimal_width);
        ?>
</p>
			<form enctype="multipart/form-data" id="upload-form" method="post" action="<?php 
        echo admin_url('admin.php?page=thesis-header-image');
        ?>
">
				<p class="remove_bottom_margin">
					<label for="upload"><?php 
        _e('Choose an image from your computer:', 'thesis');
        ?>
</label>
					<input type="file" class="text" id="upload" name="import" />
					<?php 
        wp_nonce_field('thesis-header-upload', '_wpnonce-thesis-header-upload');
        ?>
					<input type="submit" class="ui_button positive" name="upload" value="<?php 
        esc_attr_e('Upload', 'thesis');
        ?>
" />
				</p>
			</form>
		</div>
	</div>
<?php 
        echo "</div>\n";
    }
Beispiel #3
0
/**
 * function thesis_max_post_image_width()
 *
 * Return the max width that our post image may be.
 */
function thesis_max_post_image_width($frame = false)
{
    global $thesis_design;
    $thesis_css = new Thesis_CSS();
    $thesis_css->baselines();
    return $frame ? $thesis_design->layout['widths']['content'] - $thesis_css->line_heights['content'] : $thesis_design->layout['widths']['content'];
}
Beispiel #4
0
 function conditional_styles()
 {
     global $thesis_design;
     if ($thesis_design['multimedia_box']['status'] && !thesis_show_multimedia_box()) {
         $css = new Thesis_CSS();
         $css->baselines();
         $padding = round($css->line_heights['content'] / $styles->base['num'], 1);
         $conditional_styles['mm_box'] = '<style type="text/css">#sidebars .sidebar ul.sidebar_list { padding-top: ' . $padding . 'em; }</style>';
     } elseif (!$thesis_design['multimedia_box']['status'] && thesis_show_multimedia_box()) {
         $conditional_styles['mm_box'] = '<style type="text/css">#sidebars .sidebar ul.sidebar_list { padding-top: 0; }</style>';
     }
     if ($conditional_styles) {
         $this->conditional_styles = $conditional_styles;
     }
 }