function thb_backup_page() { $thb_theme = thb_theme(); $thb_page = new THB_BackupPage(__('Framework settings', 'thb_text_domain'), 'thb-framework_settings'); // General --------------------------------------------------------- $thb_tab = new THB_StaticTab(__('General', 'thb_text_domain'), 'general'); $thb_tab->setAction('thb_save_super_users'); $thb_tab->setSubmitLabel(__('Save changes', 'thb_text_domain')); $thb_container = $thb_tab->createContainer('', 'framework_settings_container'); $thb_field = new THB_TextField('thb_super_users'); $thb_field->setStaticOption('thb_super_users'); $thb_field->setLabel(__('Super users', 'thb_text_domain')); $thb_field->setHelp(sprintf(__('Enter a list of comma separated usernames to hide this page from other users. Can be reset from the <a href="%s">WP options page</a> under <code>thb_super_users</code>.', 'thb_text_domain'), admin_url('options.php'))); $thb_container->addField($thb_field); $thb_page->addTab($thb_tab); // Admin customizations -------------------------------------------- $thb_tab = new THB_Tab(__('Admin customizations', 'thb_text_domain'), 'thb_admin_customizations'); $thb_container = $thb_tab->createContainer('', 'admin_customizations'); $thb_field = new THB_UploadField('login_logo'); $thb_field->setLabel(__('Login logo', 'thb_text_domain')); $thb_field->setValue(thb_get_option('login_logo')); $thb_field->setHelp(__('Upload an image to be used as a logo in the login screen of your site. Please remember to load a properly dimensioned logo.', 'thb_text_domain')); $thb_container->addField($thb_field); $thb_field = new THB_TextareaField('admin_css'); $thb_field->setAllowCode(); $thb_field->setValue(thb_get_option('admin_css')); $thb_field->setLabel(__('Custom admin CSS', 'thb_text_domain')); $thb_container->addField($thb_field); $thb_page->addTab($thb_tab); // Export options -------------------------------------------------- $thb_tab = new THB_StaticTab(__('Export', 'thb_text_domain'), 'export'); $thb_tab->setAction('thb_export'); $thb_tab->setSubmitLabel(__('Export', 'thb_text_domain')); $thb_container = $thb_tab->createContainer('', 'export_container'); $thb_container->setIntroText(__('Backup your duplicable content (slides, meta fields, etc.), options and customizations to the theme\'s appearance. Upon clicking on the Export button, the browser will prompt you to save a file with a <code>.thb-backup</code> extension which will contain your settings, encrypted.', 'thb_text_domain')); $thb_export_duplicable = new THB_CheckboxField('export_duplicable'); $thb_export_duplicable->setLabel(__('Export duplicable content', 'thb_text_domain')); $thb_export_duplicable->setValue('1'); $thb_container->addField($thb_export_duplicable); $thb_export_options = new THB_CheckboxField('export_options'); $thb_export_options->setLabel(__('Export options', 'thb_text_domain')); $thb_export_options->setValue('1'); $thb_container->addField($thb_export_options); $thb_export_skin = new THB_CheckboxField('export_mods'); $thb_export_skin->setLabel(__('Export skin', 'thb_text_domain')); $thb_export_skin->setValue('1'); $thb_container->addField($thb_export_skin); $thb_page->addTab($thb_tab); // Import options -------------------------------------------------- $thb_tab = new THB_StaticTab(__('Import', 'thb_text_domain'), 'import'); $thb_tab->setAction('thb_import'); $thb_tab->setSubmitLabel(__('Import', 'thb_text_domain')); $thb_container = $thb_tab->createContainer('', 'import_container'); $thb_container->setIntroText(__('Import a previously saved <code>.thb-backup</code> file. Please note that this will completely overwrite your options or skin settings.', 'thb_text_domain')); $thb_upload = new THB_ClassicUploadField('import_data'); $thb_upload->setLabel(__('Upload backup file', 'thb_text_domain')); $thb_container->addField($thb_upload); $thb_page->addTab($thb_tab); $thb_theme->getAdmin()->addPage($thb_page); }
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); }
$thb_container->addField($thb_field); $thb_field = new THB_TextareaField('analytics'); $thb_field->setLabel(__('Google Analytics tracking code', 'thb_text_domain')); $thb_field->setHelp(sprintf(__('Paste your Google Analytics code here to enable statistics tracking for this site. For more info <a href="%s">read this article</a>.', 'thb_text_domain'), 'http://support.google.com/analytics/bin/answer.py?hl=en&topic=1006226&answer=1008080')); $thb_container->addField($thb_field); /** * Images */ $thb_tab = $thb_page->getTab('general_images'); $thb_container = $thb_tab->createContainer('', 'general_images_options'); $thb_field = new THB_UploadField('main_logo'); $thb_field->setLabel(__('Logo', 'thb_text_domain')); $thb_field->setHelp(__('Upload an image to be used as a logo for your site. If this field is left empty, a simple text logo will be used. Please remember to load a properly dimensioned logo.', 'thb_text_domain')); $thb_container->addField($thb_field); $thb_field = new THB_UploadField('main_logo_retina'); $thb_field->setLabel(__('Retina Logo', 'thb_text_domain')); $thb_field->setHelp(__('Upload an image to be used as a retina logo for your site. For retina upload a double size image.', 'thb_text_domain')); $thb_container->addField($thb_field); $thb_field = new THB_TextField('favicon'); $thb_field->setLabel(__('Favicon', 'thb_text_domain')); $thb_field->setHelp(__('Paste here the URL of your custom favicon.', 'thb_text_domain')); $thb_container->addField($thb_field); $thb_field = new THB_TextField('touch_icon_57'); $thb_field->setLabel(__('Apple Touch Icon 57×57', 'thb_text_domain')); $thb_field->setHelp(__('Paste here the URL of your custom 57×57px Apple Touch Icon. <a href="http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html">What\'s an Apple Touch Icon</a>?', 'thb_text_domain')); $thb_container->addField($thb_field); $thb_field = new THB_TextField('touch_icon_72'); $thb_field->setLabel(__('Apple Touch Icon 72×72', 'thb_text_domain')); $thb_field->setHelp(__('Paste here the URL of your custom 72×72px Apple Touch Icon.', 'thb_text_domain')); $thb_container->addField($thb_field); $thb_field = new THB_TextField('touch_icon_114');