Esempio n. 1
0
 * ---
 *
 * The Happy Framework: WordPress Development Framework
 * Copyright 2012, Andrea Gandino & Simone Maranzana
 *
 * Licensed under The MIT License
 * Redistribuitions of files must retain the above copyright notice.
 *
 * @package Modules\Core\Customfonts
 * @author The Happy Bit <*****@*****.**>
 * @copyright Copyright 2012, Andrea Gandino & Simone Maranzana
 * @link http://
 * @since The Happy Framework v 1.0
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
$thb_theme = thb_theme();
$thb_page = $thb_theme->getAdmin()->getMainPage();
/**
 * Custom fonts
 */
$thb_tab = new THB_StaticTab(__('Custom fonts', 'thb_text_domain'), 'custom_fonts');
$thb_tab->setAction('thb_upload_custom_fonts');
$thb_tab->setSubmitLabel(__('Save changes', 'thb_text_domain'));
$thb_container = $thb_tab->createDuplicableContainer('', 'custom_fonts_container');
$fontsquirrel_url = 'http://www.fontsquirrel.com';
$thb_container->setIntroText(sprintf(__('Upload a Font Face kit archive package from <a href="%s">Font Squirrel</a>. The archive will be unpacked automatically and the fonts will become available for you to select in the <a href="%s">Customize screen</a>.', 'thb_text_domain'), $fontsquirrel_url, admin_url('customize.php')));
$thb_container->addControl(__('Upload new font', 'thb_text_domain'), '');
$thb_upload = new THB_FontField('custom_font');
$thb_upload->setLabel(__('Upload', 'thb_text_domain'));
$thb_container->setField($thb_upload);
$thb_page->addTab($thb_tab);
 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);
 }