Esempio n. 1
0
 function thb_seo_options_tab()
 {
     if (thb_is_super_user()) {
         $thb_page = thb_theme()->getAdmin()->getMainPage();
         $thb_tab = new THB_Tab(__('SEO', 'thb_text_domain'), 'seo');
         $thb_container = $thb_tab->createContainer('', 'seo_options');
         $thb_field = new THB_CheckboxField('seo_enable');
         $thb_field->setLabel(__('Enable SEO', 'thb_text_domain'));
         $thb_field->setHelp(__('This option will enable the search engines optimization component. If you mind to use an external plugin, you might want to disable it.', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('seo_author');
         $thb_field->setLabel(__('Site author', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextareaField('seo_description');
         $thb_field->setLabel(__('Site description', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextareaField('seo_keywords');
         $thb_field->setLabel(__('Keywords', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('seo_robots');
         $thb_field->setLabel(__('Robots', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('google_site_verification');
         $thb_field->setLabel(__('Google site verification', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_page->addTab($thb_tab);
     }
 }
Esempio n. 2
0
 /**
  * Build the block modals.
  */
 private function buildModals()
 {
     $thb_modal = new THB_Modal($this->getTitle(), $this->getSlug());
     $thb_modal_container = $thb_modal->createContainer('', $this->getSlug() . '_container');
     $thb_field = new THB_TextField('title');
     $thb_field->setLabel(__('Title', 'thb-portfolio'));
     $thb_modal_container->addField($thb_field);
     $thb_field = new THB_GraphicRadioField('layout');
     $thb_field->setLabel(__('Layout', 'thb_text_domain'));
     $thb_field->setOptions(thb_portfolio_config('builder_portfolio_layouts'));
     $thb_modal_container->addField($thb_field);
     thb_grid_layout_add_fields($thb_modal_container, thb_portfolio_config('grid_builder_columns'));
     $thb_field = new THB_QueryFilterField('query_filter');
     $thb_field->addClass('full');
     $thb_field->setTaxonomies(thb_get_post_type_taxonomies('works'));
     $thb_modal_container->addField($thb_field);
     $thb_field = new THB_CheckboxField('disable_filter');
     $thb_field->setLabel(__('Disable filter', 'thb-portfolio'));
     $thb_modal_container->addField($thb_field);
     $thb_field = new THB_YesNoField('works_ajax_pagination');
     $thb_field->setLabel(__('Use AJAX pagination', 'thb-portfolio'));
     $thb_field->setHelp(__('If the page template supports this feature (e.g. its items are filterable), enabling AJAX pagination won\'t refresh your page while filtering through Portfolio items.', 'thb-portfolio'));
     $thb_modal_container->addField($thb_field);
     $thb_modal_container = $thb_modal->createContainer(__('Carousel', 'thb_text_domain'), $this->getSlug() . '_carousel_container');
     thb_carousel_options($thb_modal_container);
     $this->addModal($thb_modal);
 }
 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);
 }
Esempio n. 4
0
 function thb_add_post_metabox()
 {
     $thb_posts = thb_theme()->getPostType('post');
     $thb_metabox = $thb_posts->getMetabox('layout');
     if (!$thb_metabox) {
         return;
     }
     if (thb_config('core/blog', 'enable_author_block') || thb_config('core/blog', 'disable_navigation_block')) {
         $thb_container = $thb_metabox->createContainer(__('Post details', 'thb_text_domain'), 'single_display_settings');
         if (thb_config('core/blog', 'enable_author_block')) {
             $thb_field = new THB_CheckboxField('enable_author_block');
             $thb_field->setLabel(__('Author section', 'thb_text_domain'));
             $thb_field->setHelp(__('Show a secondary section displaying the author\'s name, avatar and short bio.', 'thb_text_domain'));
             $thb_container->addField($thb_field);
         }
         if (thb_config('core/blog', 'disable_navigation_block')) {
             $thb_field = new THB_CheckboxField('disable_navigation_block');
             $thb_field->setLabel(__('Hide navigation', 'thb_text_domain'));
             $thb_field->setHelp(__('Hide the navigation between posts secondary section.', 'thb_text_domain'));
             $thb_container->addField($thb_field);
         }
     }
     $thb_container = $thb_metabox->createContainer(__('Related posts', 'thb_text_domain'), 'related');
     $thb_field = new THB_CheckboxField('post_related');
     $thb_field->setLabel(__('Enable a related posts section', 'thb_text_domain'));
     $thb_field->setHelp(__('Checking this control automatically creates a "related posts" section at the bottom of the post page.', 'thb_text_domain'));
     $thb_field->setDynamicDefault('thb_default_post_related');
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('post_related_number');
     $thb_field->setLabel(__('Related posts to show', 'thb_text_domain'));
     $thb_field->setHelp(__('Choose how many related posts you want to display. Defaults to 3.', 'thb_text_domain'));
     $thb_field->setDynamicDefault('thb_default_post_related_number');
     $thb_container->addField($thb_field);
     $thb_field = new THB_CheckboxField('post_related_thumb');
     $thb_field->setLabel(__('Show thumbnails in related posts', 'thb_text_domain'));
     $thb_field->setHelp(__('Checking this control enables the display of thumbnails for related posts.', 'thb_text_domain'));
     $thb_field->setDynamicDefault('thb_default_post_related_thumb');
     $thb_container->addField($thb_field);
     $thb_metabox->getContainers();
     // thb_theme()->getPostType('post')->addMetabox( $thb_metabox );
 }
Esempio n. 5
0
if ($lightbox_enable) {
    $thb_lightbox = thb_get_module_url('core/lightbox/submodules/magnific-popup');
    if (thb_config('core/lightbox/submodules/magnific-popup', 'skin') == false) {
        $thb_theme->getFrontend()->addStyle($thb_lightbox . '/css/magnific-popup.css');
    }
    $thb_theme->getFrontend()->addScript($thb_lightbox . '/js/jquery.magnific-popup.min.js');
    if (thb_get_option('enable_lightbox_images') == 1) {
        $thb_theme->getFrontend()->addScript($thb_lightbox . '/js/thb.lightbox.config_images.js');
    }
    if (thb_get_option('enable_lightbox_videos') == 1) {
        $thb_theme->getFrontend()->addScript($thb_lightbox . '/js/thb.lightbox.config_videos.js');
    }
    $thb_theme->getFrontend()->addScript($thb_lightbox . '/js/thb.lightbox.js');
}
/**
 * Theme options tab
 * -----------------------------------------------------------------------------
 */
if (thb_config('core/lightbox/submodules/magnific-popup', 'options')) {
    $thb_page = $thb_theme->getAdmin()->getMainPage();
    $thb_tab = new THB_Tab(__('Lightbox', 'thb_text_domain'), 'lightbox');
    $thb_container = $thb_tab->createContainer('', 'lightbox_options');
    $thb_container->setIntroText(__('Powered by Magnific Popup. If you mind to use another plugin, you might want to disable this feature.', 'thb_text_domain'));
    $thb_field = new THB_CheckboxField('enable_lightbox_images');
    $thb_field->setLabel(__('Enable lightbox for images', 'thb_text_domain'));
    $thb_container->addField($thb_field);
    $thb_field = new THB_CheckboxField('enable_lightbox_videos');
    $thb_field->setLabel(__('Enable lightbox for links to video pages and files', 'thb_text_domain'));
    $thb_container->addField($thb_field);
    $thb_page->addTab($thb_tab);
}
Esempio n. 6
0
 function thb_home_add_config_metabox()
 {
     $thb_container = thb_theme()->getPostType('page')->getMetabox('layout')->createContainer(__('Twitter', 'thb_text_domain'), 'home-config-twitter');
     $thb_field = new THB_CheckboxField('enable_twitter_home');
     $thb_field->setLabel(__('Enable', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('twitter_home_username');
     $thb_field->setLabel(__('Screen name', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('twitter_home_count');
     $thb_field->setLabel(__('How many tweets', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_container = thb_theme()->getPostType('page')->getMetabox('layout')->createContainer(__('Social links', 'thb_text_domain'), 'home-config-social');
     $thb_field = new THB_CheckboxField('enable_social_home');
     $thb_field->setLabel(__('Enable social', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('social_home_services');
     $thb_field->setLabel(__('Services list', 'thb_text_domain'));
     $thb_field->setHelp(__('Comma separated, order matters. Possible values: twitter, facebook, googleplus, flickr, youtube,	vimeo, pinterest, dribbble,	forrst.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
 }
Esempio n. 7
0
/**
 * Portfolio single entries options
 */
function thb_portfolio_single_options()
{
    if (thb_portfolio_framework_check()) {
        $thb_works = thb_theme()->getPostType('works');
        $slide_field = new THB_SlideField(thb_portfolio_config('work_slides_key'));
        $slide_field->setLabel(__('Slide', 'thb-portfolio'));
        $slide_field = apply_filters('thb_work_slide', $slide_field);
        if (thb_is_admin_template('single-works.php') && thb_portfolio_config('single')) {
            $thb_metabox = thb_theme()->getPostType('works')->getMetabox('layout');
            $thb_container = $thb_metabox->createContainer(__('Related works', 'thb-portfolio'), 'related_works');
            $thb_field = new THB_CheckboxField('works_related');
            $thb_field->setLabel(__('Enable a related works section', 'thb-portfolio'));
            $thb_field->setHelp(__('Selecting "Yes" automatically creates a "related works" section at the bottom of a Portfolio item page.', 'thb-portfolio'));
            $thb_field->setDynamicDefault('thb_default_works_related');
            $thb_container->addField($thb_field);
            $thb_field = new THB_NumberField('works_related_number');
            $thb_field->setLabel(__('Related works to show', 'thb-portfolio'));
            $thb_field->setHelp(__('Choose how many related works you want to display. Defaults to 3.', 'thb-portfolio'));
            $thb_field->setDynamicDefault('thb_default_works_related_number');
            $thb_container->addField($thb_field);
            $thb_field = new THB_CheckboxField('works_related_thumb');
            $thb_field->setLabel(__('Show thumbnails in related works', 'thb-portfolio'));
            $thb_field->setHelp(__('Choose to enable the display of thumbnails for related works.', 'thb-portfolio'));
            $thb_field->setDynamicDefault('thb_default_works_related_thumb');
            $thb_container->addField($thb_field);
        }
        $thb_metabox = $thb_works->getMetabox('layout');
        $thb_tab = $thb_metabox->createTab(__('Project data', 'thb-portfolio'), 'extra');
        $thb_tab->setIcon('clipboard');
        // $thb_metabox = new THB_Metabox( __('Project data', 'thb-portfolio'), 'extra' );
        // $thb_metabox->setPriority('high');
        if (thb_portfolio_config('work_external_url')) {
            $thb_container = $thb_tab->createContainer('', 'data_details');
            $field = new THB_TextField('external_url');
            $field->setLabel(__('External URL', 'thb-portfolio'));
            $field->setHelp(__('Insert here an external URL to link to in Portfolio pages directly.', 'thb-portfolio'));
            $thb_container->addField($field);
        }
        if ($work_details = thb_portfolio_config('work_details')) {
            if ($work_details == 'text') {
                $thb_container = $thb_tab->createContainer(__('Details', 'thb-portfolio'), 'details');
                $field = new THB_TextareaField('prj_info');
                $field->setHelp(__('Insert here your project details (Note: accepts basic HTML).', 'thb-portfolio'));
                $thb_container->addField($field);
            } elseif ($work_details == 'keyvalue') {
                $thb_container = $thb_tab->createDuplicableContainer(__('Details', 'thb-portfolio'), 'details');
                $thb_container->setIntroText(__('Click on the "Add" button to start inserting a series of key/value pairs details.', 'thb-portfolio'));
                $thb_container->addControl(__('Add', 'thb-portfolio'), '');
                $thb_container->setSortable();
                $thb_upload = new THB_KeyValueField('prj_info');
                $thb_upload->setLabel(__('Detail', 'thb-portfolio'));
                $thb_container->setField($thb_upload);
            }
        }
        if (thb_portfolio_config('work_slides')) {
            if ($work_slides_config = thb_portfolio_config('work_slides_config')) {
                if (is_callable($work_slides_config)) {
                    $thb_tab->addContainer(call_user_func($work_slides_config));
                }
            }
            $thb_container = new THB_MetaboxDuplicableFieldsContainer(__('Project images and videos', 'thb-portfolio'), 'slides_container');
            $thb_container->setSortable();
            $thb_container->addControl(__('Add images', 'thb-portfolio'), 'add_image', '', array('action' => 'thb_add_multiple_slides', 'title' => __('Add images', 'thb-portfolio')));
            $thb_container->addControl(__('Add video', 'thb-portfolio'), 'add_video', '', array('action' => 'thb_add_video_slide', 'title' => __('Add video', 'thb-portfolio')));
            $thb_container->setField($slide_field);
            $thb_tab->addContainer($thb_container);
            // $thb_works->addMetabox($thb_metabox);
        }
    }
}
Esempio n. 8
0
 function thb_portfolio_single_options()
 {
     $thb_metabox = thb_theme()->getPostType('works')->getMetabox('layout');
     // $thb_container = $thb_metabox->getContainer( 'layout_container' );
     $thb_container = $thb_metabox->createContainer(__('Related works', 'thb_text_domain'), 'related_works');
     $thb_field = new THB_CheckboxField('works_related');
     $thb_field->setLabel(__('Enable a related works section', 'thb_text_domain'));
     $thb_field->setHelp(__('Selecting "Yes" automatically creates a "related works" section at the bottom of a Portfolio item page.', 'thb_text_domain'));
     $thb_field->setDynamicDefault('thb_default_works_related');
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('works_related_number');
     $thb_field->setLabel(__('Related works to show', 'thb_text_domain'));
     $thb_field->setHelp(__('Choose how many related works you want to display. Defaults to 3.', 'thb_text_domain'));
     $thb_field->setDynamicDefault('thb_default_works_related_number');
     $thb_container->addField($thb_field);
     $thb_field = new THB_CheckboxField('works_related_thumb');
     $thb_field->setLabel(__('Show thumbnails in related works', 'thb_text_domain'));
     $thb_field->setHelp(__('Choose to enable the display of thumbnails for related works.', 'thb_text_domain'));
     $thb_field->setDynamicDefault('thb_default_works_related_thumb');
     $thb_container->addField($thb_field);
 }