Beispiel #1
0
 function tb_options_select($name, $value = '', $options = array(), $description = '')
 {
     if (is_array($name)) {
         extract($name);
     }
     echo '<select id="' . tb_options_name_to_id($name) . '" name="' . $name . '">';
     foreach ($options as $option_value => $option_label) {
         $selected = $option_value == $value ? ' selected="selected"' : '';
         echo '<option value="' . $option_value . '"' . $selected . '>' . $option_label . '</option>';
     }
     echo '</select>';
     tb_options_description($description);
 }
Beispiel #2
0
$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'));
tb_options_close_section();
?>
		<!-- // Typography options -->

		<!-- Contact form options -->
		<?php 
tb_options_open_section(__('Contact form', 'fastblog'));
tb_options_field(__('Recipient e-mail address', 'fastblog'), '', 'input_code', 'fastblog[contact_form][email]', fastblog_get_option('contact_form/email'));
tb_options_open_field(__('E-mail subject', 'fastblog'));
tb_options_input('fastblog[contact_form][subject]', fastblog_get_option('contact_form/subject'));
echo '<table class="clear">';
foreach (array('blogname' => __('Blog name', 'fastblog'), 'blogurl' => __('Blog URL', 'fastblog'), 'name' => __('Name field', 'fastblog'), 'email' => __('E-mail field', 'fastblog'), 'subject' => __('Subject field', 'fastblog')) as $variable => $label) {
    ?>