Пример #1
0
/**
 * Options compatibility check
 *
 * @param array $options
 * @return array
 */
function fastblog_compatibility($options)
{
    if ($options['_build'] < 1) {
        if (isset($options['logo'])) {
            $options['header']['logo'] = $options['logo'];
        }
        if (isset($options['contact'])) {
            $options['header']['contact'] = $options['contact'];
        }
    }
    if ($options['_build'] < 2) {
        if (isset($options['cufon']) && is_string($options['cufon'])) {
            $options['cufon'] = array('font' => "myriad_pro.{$options['cufon']}.font.js");
        }
    }
    if ($options['_build'] < 3) {
        if (isset($options['cufon']['font']) && ($fontfamily = tb_cufon_font_get_name(TEMPLATEPATH . '/js/fonts/' . $options['cufon']['font']))) {
            $font = $options['cufon']['font'] . '|' . $fontfamily;
            $options['typography']['fonts'] = array('logo' => 'league_gothic.font.js|League Gothic', 'tagline' => '', 'menu' => $font, 'post_title' => $font, 'widget_title' => '', 'headlines' => $font, 'shortcode' => $font, 'other' => $font, 'custom' => '');
        }
        if (isset($options['cufon']['selector'])) {
            $options['typography']['custom_selector'] = $options['cufon']['selector'];
        }
    }
    if ($options['_build'] < 4) {
        if (isset($options['fancybox'])) {
            $options['fancybox'] = array('enabled' => $options['fancybox']);
        }
    }
    if ($options['_build'] < 6) {
        if (isset($options['header']['logo']) && is_string($options['header']['logo'])) {
            $options['header']['logo'] = array('logo' => $options['header']['logo']);
        }
    }
    return $options;
}
Пример #2
0
		<!-- Page options -->
		<?php 
tb_options_open_section(__('Page', 'fastblog'));
tb_options_field(__('Settings', 'fastblog'), '', 'checkbox', "fastblog[page][hide_title]", fastblog_get_option('page/hide_title'), __("Don't display page titles on pages", 'fastblog'));
tb_options_field(__('Page meta', 'fastblog'), '', 'checkbox_group', "fastblog[page][meta]", fastblog_get_option('page/meta'), array('date' => __('Modification date', 'fastblog'), 'comments' => __('Comments number', 'fastblog'), 'admin_edit' => __('Admin edit link', 'fastblog')));
tb_options_close_section();
?>
		<!-- // Page options -->

		<!-- Typography options -->
		<?php 
tb_options_open_section(__('Typography', 'fastblog'));
$fonts = array('' => '(' . __('None', 'fastblog') . ')');
foreach (tb_get_directory(TEMPLATEPATH . '/js/fonts') as $filename) {
    if ($fontfamily = tb_cufon_font_get_name(TEMPLATEPATH . '/js/fonts/' . $filename)) {
        $fonts[$filename . '|' . $fontfamily] = $fontfamily;
    }
}
tb_options_open_field(__('Fonts', 'fastblog'));
$typografy_fonts_captions = array('logo' => __('Logo', 'fastblog'), 'tagline' => __('Tagline', 'fastblog'), 'menu' => __('Menu', 'fastblog'), 'post_title' => __('Post/page title', 'fastblog'), 'widget_title' => __('Widget title', 'fastblog'), 'headlines' => __('Headlines', 'fastblog'), 'shortcode' => __('Cufon shortcode', 'fastblog'), 'other' => __('Other elements', 'fastblog'), 'custom' => __('Custom elements', 'fastblog'));
echo '<table class="clear">';
foreach (fastblog_get_option('typography/fonts') as $element => $font) {
    echo '<tr><td>' . $typografy_fonts_captions[$element] . '</td><td>';
    tb_options_select("fastblog[typography][fonts][{$element}]", $font, $fonts);
    echo '</td></tr>';
}
echo '</table>';
tb_options_description(__('If you use more than one version of the Myriad font, select the biggest version you need for all of them.', 'fastblog'));
tb_options_close_field();
tb_options_field(__('Custom elements CSS selector(s)', 'fastblog'), '', 'input_code', 'fastblog[typography][custom_selector]', fastblog_get_option('typography/custom_selector'));