示例#1
0
文件: options.php 项目: joasssko/schk
/**
 * Main page options tab.
 */
function thb_portfolio_options()
{
    if (thb_portfolio_framework_check() && thb_portfolio_config('options')) {
        $thb_page = thb_theme()->getAdmin()->getMainPage();
        $thb_tab = new THB_Tab(__('Portfolio', 'thb-portfolio'), 'portfolio');
        $thb_container = $thb_tab->createContainer('', 'single_work_options');
        $thb_field = new THB_TextField('works_url_slug');
        $thb_field->setLabel(__('URL slug', 'thb-portfolio'));
        $thb_field->setHelp(sprintf(__('URL slug for Portfolio items. Defaults to "works". Remember to <a href="%s">re-save the site\'s permalinks</a>.', 'thb-portfolio'), admin_url('options-permalink.php')));
        $thb_container->addField($thb_field);
        if (thb_portfolio_config('works_navigation')) {
            $thb_field = new THB_YesNoField('works_navigation');
            $thb_field->setLabel(__('Enable navigation between Portfolio items', 'thb-portfolio'));
            $thb_container->addField($thb_field);
        }
        if (thb_portfolio_config('portfolio_index')) {
            $thb_field = new THB_SelectField('portfolio_index');
            $thb_field->setLabel(__('Select the Portfolio index', 'thb-portfolio'));
            $thb_field->setHelp(__('Choose the index page for your portfolio items "back to portfolio" link.', 'thb-portfolio'));
            $thb_field->setOptions(thb_get_pages_for_select('template-portfolio.php'));
            $thb_container->addField($thb_field);
        }
        $thb_page->addTab($thb_tab);
    }
}
 function thb_woocommerce_extra_options()
 {
     $thb_theme = thb_theme();
     $thb_page = $thb_theme->getAdmin()->getMainPage();
     $thb_tab = $thb_page->getTab('woocommerce');
     $thb_container = $thb_tab->createContainer(__('Shop general options', 'thb_text_domain'), 'woocommerce_general_options');
     $thb_field = new THB_YesNoField('enable_shop_cart_allpages');
     $thb_field->setLabel(__('Enable shop cart on all pages', 'thb_text_domain'));
     $thb_field->setHelp(__('Choose if you want to enable the shop cart on header on all pages or only for "Shop" related pages.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_container = $thb_tab->getContainer('woocommerce_shop_options');
     $thb_field = new THB_SelectField('woocommerce_shop_pageheader_layout');
     $thb_field->setLabel(__('Page header layout', 'thb_text_domain'));
     $thb_field->setOptions(array('left' => __('Left', 'thb_text_domain'), 'center' => __('Center', 'thb_text_domain'), 'right' => __('Right', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     $thb_field = new THB_SelectField('woocommerce_shop_pageheader_height');
     $thb_field->setLabel(__('Page header height', 'thb_text_domain'));
     $thb_field->setOptions(array('pageheader-big' => __('Large', 'thb_text_domain'), 'pageheader-compact' => __('Compact', 'thb_text_domain')));
     $thb_field->setHelp(__('This setting will affect also the shop\'s archive and taxonomy pages.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_UploadField('woocommerce_shop_pageheader_background_image');
     $thb_field->setLabel(__('Page header background image', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('woocommerce_shop_pageheader_background_opacity');
     $thb_field->setMin(0);
     $thb_field->setMax(1);
     $thb_field->setStep(0.05);
     $thb_field->setLabel(__('Page header background opacity', 'thb_text_domain'));
     $thb_container->addField($thb_field);
 }
示例#3
0
/**
 * Theme customizations
 * -----------------------------------------------------------------------------
 */
$thb_page = $thb_theme->getAdmin()->getMainPage();
$thb_tab = $thb_page->getTab('layout');
$thb_container = $thb_tab->getContainer('layout_options_footer');
$sep = '&nbsp;&nbsp;&nbsp;';
$thb_field = new THB_SelectField('footer_layout');
$thb_field->setLabel(__('Layout', 'thb_text_domain'));
$thb_field->addOptionsGroup(__('None', 'thb_text_domain'), array('0' => "-"));
$thb_field->addOptionsGroup(__('One column', 'thb_text_domain'), array('full-width' => __('Full width', 'thb_text_domain')));
$thb_field->addOptionsGroup(__('Two columns', 'thb_text_domain'), array('one-half,one-half' => "1/2 {$sep} 1/2", 'one-third,two-thirds' => "1/3 {$sep} 2/3", 'two-thirds,one-third' => "2/3 {$sep} 1/3", 'one-fourth,three-fourths' => "1/4 {$sep} 3/4", 'three-fourths,one-fourth' => "3/4 {$sep} 1/4"));
$thb_field->addOptionsGroup(__('Three columns', 'thb_text_domain'), array('one-third,one-third,one-third' => "1/3 {$sep} 1/3 {$sep} 1/3", 'one-fourth,one-half,one-fourth' => "1/4 {$sep} 1/2 {$sep} 1/4", 'one-half,one-fourth,one-fourth' => "1/2 {$sep} 1/4 {$sep} 1/4", 'one-fourth,one-fourth,one-half' => "1/4 {$sep} 1/4 {$sep} 1/2"));
$thb_field->addOptionsGroup(__('Four columns', 'thb_text_domain'), array('one-fourth,one-fourth,one-fourth,one-fourth' => "1/4 {$sep} 1/4 {$sep} 1/4 {$sep} 1/4"));
$thb_field->setHelp(__('Select the columns layout for the footer area. Selecting none will disable the footer area entirely.', 'thb_text_domain'));
$thb_container->addField($thb_field);
// Add page layout options
// -----------------------------------------------------------------------------
$page_templates = array('default', 'template-archives.php', 'template-contact.php', 'template-blog-stream.php', 'template-blog-classic.php', 'template-photogallery.php', 'template-portfolio.php');
$single_post = array('single.php');
$page_layout_templates = array_merge($page_templates, $single_post);
$thb_pages = $thb_theme->getPostType('page');
// Pages options ---------------------------------------------------------------
if (!function_exists('thb_theme_layout_options')) {
    function thb_theme_layout_options()
    {
        global $page_templates, $single_post, $portfolio, $masonry, $page_layout_templates;
        $thb_container = new THB_MetaboxFieldsContainer('', 'extra_container');
        $thb_field = new THB_SelectField('pageheader_layout');
        $thb_field->setLabel(__('Page header alignment', 'thb_text_domain'));