getInstance() public static method

Gets an instance of the framework for the namespace
Since: 1.0
public static getInstance ( string $optionNamespace ) : TitanFramework
$optionNamespace string The namespace to get options from.
return TitanFramework
示例#1
0
/**
 * [bootswatch_hook_callback description]
 */
function bootswatch_hook_callback()
{
    $hook = preg_replace('/^bootswatch_/', '', current_filter());
    $content = TitanFramework::getInstance('bootswatch')->getOption($hook);
    printf('<div class="%s">%s</div>', 'bootswatch_' . $hook, do_shortcode($content));
    // WPCS: XSS OK.
}
function nswp_create_options()
{
    $nswp_option_page = TitanFramework::getInstance('nswp');
    $nswp_options = $nswp_option_page->createAdminPanel(array('name' => __('Nicescrollbar WP Options', 'nswp')));
    $nswp_options->createOption(array('id' => 'nswp-cursor-color', 'name' => __('Scrollbar Color', 'nswp'), 'desc' => __('Background color of the scrollbar.'), 'type' => 'color', 'default' => '#e74c3c'));
    $nswp_options->createOption(array('id' => 'nswp-cursor-opacity-min', 'name' => __('Minimum Scrollbar Opacity', 'nswp'), 'desc' => __('Opacity of scrollbar when inactive.'), 'type' => 'number', 'min' => '0', 'max' => '1', 'step' => '0.1', 'default' => '0'));
    $nswp_options->createOption(array('id' => 'nswp-cursor-opacity-max', 'name' => __('Maximum Scrollbar Opacity', 'nswp'), 'desc' => __('Opacity of scrollbar when active.'), 'type' => 'number', 'min' => '0', 'max' => '1', 'step' => '0.1', 'default' => '1'));
    $nswp_options->createOption(array('id' => 'nswp-hide-cursor-delay', 'name' => __('Scrollbar Hiding Delay', 'nswp'), 'desc' => __('Set the delay in microseconds to fading out scrollbar', 'nswp'), 'type' => 'number', 'min' => '200', 'max' => '5000', 'step' => '50', 'default' => '400'));
    $nswp_options->createOption(array('id' => 'nswp-cursor-width', 'name' => __('Scrollbar Width', 'nswp'), 'type' => 'number', 'min' => '0', 'max' => '100', 'step' => '1', 'unit' => 'px', 'default' => '5'));
    $nswp_options->createOption(array('id' => 'nswp-border-color', 'name' => __('Scrollbar Border Color', 'nswp'), 'desc' => __('Border color of scrollbar'), 'type' => 'color', 'default' => '#fff'));
    $nswp_options->createOption(array('id' => 'nswp-border-width', 'name' => __('Scrollbar Border Width', 'nswp'), 'type' => 'number', 'min' => '0', 'max' => '100', 'step' => '1', 'unit' => 'px', 'default' => '0'));
    $nswp_options->createOption(array('id' => 'nswp-border-radious', 'name' => __('Scrollbar Border Radious', 'nswp'), 'type' => 'number', 'min' => '0', 'max' => '100', 'step' => '1', 'unit' => 'px', 'default' => '0'));
    $nswp_options->createOption(array('id' => 'nswp-scroll-speed', 'name' => __('Scrolling Speed', 'nswp'), 'type' => 'number', 'min' => '0', 'max' => '1000', 'step' => '1', 'default' => '60'));
    $nswp_options->createOption(array('id' => 'nswp-mouse-scroll-step', 'name' => __('Scrolling Speed with Mouse Wheel', 'nswp'), 'type' => 'number', 'min' => '0', 'max' => '1000', 'step' => '1', 'unit' => 'px', 'default' => '40'));
    $nswp_options->createOption(array('id' => 'nswp-touchbehavior', 'name' => __('Enable cursor-drag', 'nswp'), 'desc' => __('Enable cursor-drag scrolling like touch devices in desktop computer', 'nswp'), 'type' => 'checkbox', 'default' => false));
    $nswp_options->createOption(array('id' => 'nswp-hwacceleration', 'name' => __('Use Hardware Acceleration', 'nswp'), 'desc' => __('Use hardware accelerated scroll when supported', 'nswp'), 'type' => 'checkbox', 'default' => true));
    $nswp_options->createOption(array('id' => 'nswp-boxzoom', 'name' => __('Enable Boxzoom', 'nswp'), 'desc' => __('Enable zoom for box content', 'nswp'), 'type' => 'checkbox', 'default' => false));
    $nswp_options->createOption(array('id' => 'nswp-grab-cursor-enabled', 'name' => __('Display "grab" icon', 'nswp'), 'desc' => __('Display "grab" icon for div', 'nswp'), 'type' => 'checkbox', 'default' => true));
    $nswp_options->createOption(array('id' => 'nswp-auto-hide-mode', 'name' => __('Auto Hide Scrollbar', 'nswp'), 'desc' => __('Scrollbar auto hide', 'nswp'), 'type' => 'checkbox', 'default' => true));
    $nswp_options->createOption(array('id' => 'nswp-bounce-scroll', 'name' => __('Enable Bouncescroll', 'nswp'), 'desc' => __('Enable Bouncescroll', 'nswp'), 'type' => 'checkbox', 'default' => false));
    $nswp_options->createOption(array('id' => 'nswp-horizrail-enabled', 'name' => __('Enable Horizontal Scrollbar', 'nswp'), 'desc' => __('Enable Horizontal Scrollbar', 'nswp'), 'type' => 'checkbox', 'default' => false));
    $nswp_options->createOption(array('id' => 'nswp-railalign', 'name' => __('Vertical Scrollbar Alignment', 'nswp'), 'type' => 'select', 'options' => array('right' => __('Right', 'nswp'), 'left' => __('Left', 'nswp')), 'default' => 'right'));
    $nswp_options->createOption(array('id' => 'nswp-railvalign', 'name' => __('Horizontal Scrollbar Alignment', 'nswp'), 'type' => 'select', 'options' => array('bottom' => __('Bottom', 'nswp'), 'top' => __('Top', 'nswp')), 'default' => 'bottom'));
    $nswp_options->createOption(array('id' => 'nswp-enable-mousewheel', 'name' => __('Enable Scroll With Mouse Wheel', 'nswp'), 'desc' => __('Enable Scroll With Mouse Wheel', 'nswp'), 'type' => 'checkbox', 'default' => true));
    $nswp_options->createOption(array('id' => 'nswp-smooth-scroll', 'name' => __('Enable Smooth Scroll', 'nswp'), 'desc' => __('Enable Smooth Scroll', 'nswp'), 'type' => 'checkbox', 'default' => true));
    $nswp_options->createOption(array('type' => 'save'));
}
示例#3
0
function initalize_theme_and_create_admin_panel()
{
    // We create all our options here
    $titan = TitanFramework::getInstance('bas-intranet');
    // Load in the the Theme Menu
    require locate_template('framework/theme-menu.php');
}
示例#4
0
 function create_customizer_options()
 {
     $titan = TitanFramework::getInstance('thim');
     TitanFrameworkOptionFontColor::$webSafeFonts = array('aileron' => 'Aileron', 'Arial, Helvetica, sans-serif' => 'Arial', '"Arial Black", Gadget, sans-serif' => 'Arial Black', '"Comic Sans MS", cursive, sans-serif' => 'Comic Sans', '"Courier New", Courier, monospace' => 'Courier New', 'Georgia, serif' => 'Geogia', 'Impact, Charcoal, sans-serif' => 'Impact', '"Lucida Console", Monaco, monospace' => 'Lucida Console', '"Lucida Sans Unicode", "Lucida Grande", sans-serif' => 'Lucida Sans', '"Palatino Linotype", "Book Antiqua", Palatino, serif' => 'Palatino', 'Tahoma, Geneva, sans-serif' => 'Tahoma', '"Times New Roman", Times, serif' => 'Times New Roman', '"Trebuchet MS", Helvetica, sans-serif' => 'Trebuchet', 'Verdana, Geneva, sans-serif' => 'Verdana');
     /* Register Customizer Sections */
     //include heading
     include TP_THEME_DIR . "/inc/admin/customizer-sections/logo.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/header.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/header-mainmenu.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/header-mobile.php";
     // include TP_THEME_DIR . "/inc/admin/customizer-sections/header-offcanvas.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/header-submenu.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/header-stickymenu.php";
     // include TP_THEME_DIR . "/inc/admin/customizer-sections/header-topdrawer.php";
     //include styling
     include TP_THEME_DIR . "/inc/admin/customizer-sections/styling.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/styling-color.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/styling-layout.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/styling-pattern.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/styling-rtl.php";
     //include display setting
     include TP_THEME_DIR . "/inc/admin/customizer-sections/display.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/display-archive.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/display-frontpage.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/display-postpage.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/display-404.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/display-sharing.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/display-loading.php";
     //include woocommerce
     if (class_exists('WooCommerce')) {
         include TP_THEME_DIR . "/inc/admin/customizer-sections/woocommerce.php";
         include TP_THEME_DIR . "/inc/admin/customizer-sections/woocommerce-archive.php";
         include TP_THEME_DIR . "/inc/admin/customizer-sections/woocommerce-setting.php";
         include TP_THEME_DIR . "/inc/admin/customizer-sections/woocommerce-sharing.php";
         include TP_THEME_DIR . "/inc/admin/customizer-sections/woocommerce-single.php";
         include TP_THEME_DIR . "/inc/admin/customizer-sections/woocommerce-badges.php";
     }
     //include typography
     include TP_THEME_DIR . "/inc/admin/customizer-sections/typography.php";
     //include footer
     include TP_THEME_DIR . "/inc/admin/customizer-sections/footer.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/footer-copyright.php";
     include TP_THEME_DIR . "/inc/admin/customizer-sections/footer-options.php";
     //include Custom Css
     include TP_THEME_DIR . "/inc/admin/customizer-sections/custom-css.php";
     //include Import/Export
     include TP_THEME_DIR . "/inc/admin/customizer-sections/import-export.php";
     //Page Event
     include TP_THEME_DIR . "/inc/admin/metabox-sections/event.php";
     // One Page
     include TP_THEME_DIR . "/inc/admin/metabox-sections/onepage.php";
     //include Document
     if (class_exists('wpdoc')) {
         include TP_THEME_DIR . "/inc/admin/customizer-sections/display-document.php";
     }
     // Job
     if (class_exists('WP_Job_Manager')) {
         include TP_THEME_DIR . "/inc/admin/customizer-sections/display-job.php";
     }
 }
示例#5
0
function bodhi_yoga_create_options()
{
    // Get Framework Instance
    $bodhi_yoga = TitanFramework::getInstance('bodhi-yoga');
    //====================================== //
    //======== Theme Options Panel ========= //
    //====================================== //
    $bodhi_options = $bodhi_yoga->createAdminPanel(array('name' => 'Bodhi Options'));
    //====================================== //
    //======== Options General tab ========= //
    //====================================== //
    $gen_tab = $bodhi_options->createTab(array('name' => 'Home'));
    $social_tab = $bodhi_options->createTab(array('name' => 'Social'));
    //======================================== //
    //============ Options Start ============= //
    //======================================== //
    // Main heading
    $gen_tab->createOption(array('name' => 'Main Heading', 'id' => 'bodhi_main_heading', 'type' => 'text', 'desc' => 'Home page main heading. Header image heading.', 'default' => 'AWAKEN<span class="dot">&middot;</span>HEAL<span class="dot">&middot;</span>INSPIRE'));
    // sub heading
    $gen_tab->createOption(array('name' => 'sub Heading', 'id' => 'bodhi_sub_heading', 'type' => 'text', 'desc' => 'Home page sub heading. Header image heading.', 'default' => 'Come and Join the Yoga Teacher Training'));
    // facebook
    $social_tab->createOption(array('name' => 'facebook', 'id' => 'bodhi_social_facebook', 'type' => 'text'));
    // instagram
    $social_tab->createOption(array('name' => 'instagram', 'id' => 'bodhi_social_instagram', 'type' => 'text'));
    // tumblr
    $social_tab->createOption(array('name' => 'tumblr', 'id' => 'bodhi_social_tumblr', 'type' => 'text'));
    // twitter
    $social_tab->createOption(array('name' => 'twitter', 'id' => 'bodhi_social_twitter', 'type' => 'text'));
    //====================================== //
    //============ Save Values ============= //
    //====================================== //
    $bodhi_options->createOption(array('type' => 'save'));
}
/**
 * Initialize Titan & options here
 */
function una_create_options()
{
    $titan = TitanFramework::getInstance('una');
    $backgroundSection = $titan->createThemeCustomizerSection(array('name' => __('Backgrounds', 'una')));
    $backgroundSection->createOption(array('name' => __('Sidebar Background Color', 'una'), 'id' => 'sidebar_bg_color', 'type' => 'color', 'desc' => __('This color changes the background of your theme', 'una'), 'default' => '#FFFFFF', 'css' => 'body:before { background-color: value }'));
    $backgroundSection->createOption(array('name' => __('Body Background Color', 'una'), 'id' => 'body_bg_color', 'type' => 'color', 'desc' => __('This color changes the background of your theme', 'una'), 'default' => '#FAFAFA', 'css' => 'body { background-color: value }'));
    $backgroundSection->createOption(array('name' => __('Panels Background Color', 'una'), 'id' => 'panels_bg_color', 'type' => 'color', 'desc' => __('This color changes the panel background of your theme', 'una'), 'default' => '#FFFFFF', 'css' => '.hentry,.footer,.comments-area { background-color: value }'));
    $brandSection = $titan->createThemeCustomizerSection(array('name' => 'title_tagline'));
    $brandSection->createOption(array('name' => 'Logo', 'id' => 'brand_logo', 'type' => 'upload', 'desc' => 'Upload your logo'));
    /**
     * Create a Theme Customizer panel where we can edit some options.
     * You should put options here that change the look of your theme.
     */
    $section = $titan->createThemeCustomizerSection(array('name' => __('Theme Typography', 'una')));
    $section->createOption(array('name' => __('Headings Font', 'una'), 'id' => 'headings_font', 'type' => 'font', 'desc' => __('Select the font for all headings in the site', 'una'), 'show_color' => false, 'show_font_size' => false, 'show_font_weight' => false, 'show_font_style' => false, 'show_line_height' => false, 'show_letter_spacing' => false, 'show_text_transform' => false, 'show_font_variant' => false, 'show_text_shadow' => false, 'default' => array('font-family' => 'Lato'), 'css' => 'h1, h2, h3, h4, h5, h6,th,.page-title, .comments-title, .comment-reply-title, .post-navigation .post-title,.entry-title,.entry-title a { value }'));
    $section->createOption(array('name' => __('Headings Text Color', 'una'), 'id' => 'headings_text_color', 'type' => 'color', 'desc' => __('This color changes the background of your theme', 'una'), 'default' => '#2C2C2C', 'css' => 'h1, h2, h3, h4, h5, h6,th { color: value }'));
    $section->createOption(array('name' => __('Text Font', 'una'), 'id' => 'body_text_font', 'type' => 'font', 'desc' => __('Select the font for text (excluding titles) in the site', 'una'), 'show_color' => false, 'show_font_size' => false, 'show_font_weight' => false, 'show_font_style' => false, 'show_line_height' => false, 'show_letter_spacing' => false, 'show_text_transform' => false, 'show_font_variant' => false, 'show_text_shadow' => false, 'default' => array('font-family' => 'Roboto'), 'css' => 'body,a,blockquote,td,p{ value }'));
    $section->createOption(array('name' => __('Text Color', 'una'), 'id' => 'body_text_color', 'type' => 'color', 'desc' => __('This color changes the background of your theme', 'una'), 'default' => '#2C2C2C', 'css' => 'body,a,blockquote,td,p { color: value }'));
    /**
     * Create an admin panel & tabs
     * You should put options here that do not change the look of your theme
     */
    $adminPanel = $titan->createAdminPanel(array('name' => __('Theme Settings', 'una')));
    $generalTab = $adminPanel->createTab(array('name' => __('General', 'una')));
    $generalTab->createOption(array('name' => __('Custom Javascript Code', 'una'), 'id' => 'custom_js', 'type' => 'code', 'desc' => __('If you want to add some additional Javascript code into your site, add them here and it will be included in the frontend header. No need to add <code>script</code> tags', 'una'), 'lang' => 'javascript'));
    $generalTab->createOption(array('name' => __('Display Search', 'una'), 'id' => 'display_search', 'type' => 'enable', 'default' => true));
    $generalTab->createOption(array('type' => 'save'));
    $footerTab = $adminPanel->createTab(array('name' => __('Footer', 'una')));
    $footerTab->createOption(array('name' => __('Copyright Text', 'una'), 'id' => 'copyright', 'type' => 'text', 'desc' => __('Enter your copyright text here (sample only)', 'una')));
    $footerTab->createOption(array('type' => 'save'));
}
function cfc_options__custom_css()
{
    // Initialize Titan.
    $titan = TitanFramework::getInstance('cfc');
    /**
     * First Section & Panel Creation.
     *
     * Section: $cfc_sec_ccss
     * Panel  : CF7 Customizer
     *
     */
    $cfc_sec_ccss = $titan->createThemeCustomizerSection(array('name' => 'Custom CSS', 'panel' => 'CF7 Customizer'));
    /**
     * Note
     *
     */
    $cfc_sec_ccss->createOption(array('type' => 'note', 'desc' => 'Use this area to add custom CSS if you know what you are doing.'));
    /**
     * Option: Code Custom CSS.
     *
     * @since 1.0.1
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_code_custom_css.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_code_custom_css.php';
    }
    // End of cfc_options__custom_css()
}
 /**
  * Load Titan Framework.
  *
  * @link   http://www.titanframework.net/embedding-titan-framework-in-your-project/
  * @since  3.0.0
  */
 public function load_titan_framework()
 {
     /*
      * When using the embedded framework, use it only if the framework
      * plugin isn't activated.
      */
     // Don't do anything when we're activating a plugin to prevent errors
     // on redeclaring Titan classes
     if (!empty($_GET['action']) && !empty($_GET['plugin'])) {
         if ($_GET['action'] == 'activate') {
             return;
         }
     }
     // Check if the framework plugin is activated
     $useEmbeddedFramework = true;
     $activePlugins = get_option('active_plugins');
     if (is_array($activePlugins)) {
         foreach ($activePlugins as $plugin) {
             if (is_string($plugin)) {
                 if (stripos($plugin, '/titan-framework.php') !== false) {
                     $useEmbeddedFramework = false;
                     break;
                 }
             }
         }
     }
     // Use the embedded Titan Framework
     if ($useEmbeddedFramework && !class_exists('TitanFramework')) {
         require_once WPAS_PATH . 'vendor/gambitph/titan-framework/titan-framework.php';
     }
     /*
      * Start your Titan code below
      */
     $titan = TitanFramework::getInstance('wpas');
     $settings = $titan->createContainer(array('type' => 'admin-page', 'name' => __('Settings', 'awesome-support'), 'title' => __('Awesome Support Settings', 'awesome-support'), 'id' => 'wpas-settings', 'parent' => 'edit.php?post_type=ticket', 'capability' => 'settings_tickets'));
     /**
      * Get plugin core options
      * 
      * @var (array)
      * @see  admin/includes/settings.php
      */
     $options = wpas_get_settings();
     /* Parse options */
     foreach ($options as $tab => $content) {
         /* Add a new tab */
         $tab = $settings->createTab(array('name' => $content['name'], 'title' => isset($content['title']) ? $content['title'] : $content['name'], 'id' => $tab));
         /* Add all options to current tab */
         foreach ($content['options'] as $option) {
             $tab->createOption($option);
             if (isset($option['type']) && 'heading' === $option['type'] && isset($option['options']) && is_array($option['options'])) {
                 foreach ($option['options'] as $opt) {
                     $tab->createOption($opt);
                 }
             }
         }
         $tab->createOption(array('type' => 'save'));
     }
 }
示例#9
0
function aa_metabox_options()
{
    // Initialize Titan with your theme name.
    $titan = TitanFramework::getInstance('neat');
    /**
     * First metabox.
     */
    $aa_metbox = $titan->createMetaBox(array('name' => 'Metabox Options', 'post_type' => array('page', 'post', 'my_custom_post_type')));
}
function cfc_options__txt_bg()
{
    // Initialize Titan
    $titan = TitanFramework::getInstance('cfc');
    /**
     * First Section & Panel Creation
     *
     * Section: $cfc_sec_form_style
     * Panel  : CF7 Customizer
     *
     */
    $cfc_sec_form_txt_bg = $titan->createThemeCustomizerSection(array('name' => 'Form Text & BG Colors', 'panel' => 'CF7 Customizer'));
    /**
     * Note
     *
     */
    $cfc_sec_form_txt_bg->createOption(array('type' => 'note', 'desc' => 'Customize form\'s text color, background color, add a background image or change the font-size.'));
    /**
     * Option: Text Color
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_txt_clr.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_txt_clr.php';
    }
    /**
     * Option: Background Color
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_bg_clr.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_bg_clr.php';
    }
    /**
     * Option: Background Image
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_bg_img.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_bg_img.php';
    }
    /**
     * Option: Font Size
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_font_size.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_font_size.php';
    }
}
function jg_custom_css()
{
    $titan = TitanFramework::getInstance('jg-one-page');
    ?>
	<style type="text/css">
		<?php 
    echo $titan->getOption('jg_custom_css');
    ?>
	</style>
	<?php 
}
 function create_theme_option()
 {
     $titan = TitanFramework::getInstance('thim');
     $panel = $titan->createAdminPanel(array('name' => 'Import Demo'));
     //data demo tab
     $data_demo_tab = $panel->createTab(array('name' => 'Demo Data'));
     $data_demo_tab->createOption(array('type' => 'Import', 'import' => 'Import Demo'));
     // Post Format
     include 'meta-box/post-format.php';
     // Display Setting
     include 'meta-box/setting.php';
 }
示例#13
0
/**
 * Initialize Titan & options here
 */
function regala_default_image_options()
{
    $titan = TitanFramework::getInstance('regala');
    /**
     *   Default featured images
     */
    $image = $titan->createThemeCustomizerSection(array('name' => __('Default Featured Images', 'regala'), 'desc' => __('Upload a photo that you want to use as Featured Image in your Posts/Pages', 'regala')));
    $image->createOption(array('name' => __('Image 1', 'regala'), 'id' => 'featured_image', 'type' => 'upload'));
    $image->createOption(array('name' => __('Image 2', 'regala'), 'id' => 'featured_image2', 'type' => 'upload'));
    $image->createOption(array('name' => __('Image 3', 'regala'), 'id' => 'featured_image3', 'type' => 'upload'));
    $image->createOption(array('name' => __('Image 4', 'regala'), 'id' => 'featured_image4', 'type' => 'upload'));
    $image->createOption(array('name' => __('Image 5', 'regala'), 'id' => 'featured_image5', 'type' => 'upload'));
}
 protected function checkValues($option)
 {
     $titan = TitanFramework::getInstance('testing');
     $id = $option->settings['id'];
     $this->assertEquals('#123456', $titan->getOption($id));
     $option->setValue('rgba(0,0,0,.5)');
     $titan->saveInternalAdminPageOptions();
     // Does nothing for non-admin options
     $this->assertEquals('rgba(0,0,0,.5)', $titan->getOption($id));
     $option->setValue('');
     $titan->saveInternalAdminPageOptions();
     // Does nothing for non-admin options
     $this->assertEquals('', $titan->getOption($id));
 }
示例#15
0
/**
 * Inicializa y crear todas las opciones del plugin
 *
 * @return	void
 * @since	1.0
 */
function osp_blb_create_options()
{
    $titan = TitanFramework::getInstance(OSP_BLB_NAME);
    $titan->set('css', false);
    //ENCABEZADO DE LA PAGINA
    $panel = $titan->createAdminPanel(array('name' => __(OSP_BLB_NAME, OSP_BLB_HANDLER), 'parent' => 'options-general.php', 'desc' => __('Make all the settings to the appearance and functionality that you would like your personalize it to your taste ', OSP_BLB_HANDLER) . '"' . OSP_BLB_NAME . "'"));
    //**************************************************************************
    //**SECCIÓN: OPCIONES GENERALES*********************************************
    //**************************************************************************
    //ENCABEZADO DE SECCIÓN "Opciones Generales"
    $panel->createOption(array('name' => __('General Settings', OSP_BLB_HANDLER), 'type' => 'heading'));
    //ACTIVAR/DESACTICAR EL PLUGIN
    $panel->createOption(array('name' => __('Enable - ', OSP_BLB_HANDLER) . OSP_BLB_NAME, 'id' => 'enable', 'type' => 'enable', 'desc' => __('It permits you to activate or deactivate the appearance of the progress bar on the front-end of your website.', OSP_BLB_HANDLER), 'default' => false, "enabled" => __("Enabled", OSP_BLB_HANDLER), "disabled" => __("Disabled", OSP_BLB_HANDLER)));
    //MODO DE PRUEBA
    $panel->createOption(array('name' => '<div class="dashicons dashicons-admin-tools"></div>' . __('Test Mode', OSP_BLB_HANDLER), 'id' => 'testMode', 'type' => 'enable', 'desc' => __('It allows the test mode so that only the administrator can see the loading bar. This helps to observe the adjustments that the administrator is currently making with the plugin.', OSP_BLB_HANDLER), 'default' => false, "enabled" => __("Enabled", OSP_BLB_HANDLER), "disabled" => __("Disabled", OSP_BLB_HANDLER)));
    //NO OCULTAR LA BARRA DE PROGRESO
    $panel->createOption(array('name' => '<div class="dashicons dashicons-admin-tools"></div>' . __('Don’t Hide Bar Loading', OSP_BLB_HANDLER), 'id' => 'testMode_showBar', 'type' => 'enable', 'desc' => __('Keep the loading bar hidden until the page is 100% loaded. It is very useful in carrying out the necessary adjustments.', OSP_BLB_HANDLER), 'default' => false, "enabled" => __("Enabled", OSP_BLB_HANDLER), "disabled" => __("Disabled", OSP_BLB_HANDLER), "depends" => array("testMode" => true)));
    //GUARDAR DATOS
    osp_blb_options_save($panel);
    //**************************************************************************
    //**SECCIÓN: PROPIEDADES DE LA BARRA DE PROGRESO****************************
    //**************************************************************************
    //
    //ENCABEZADO DE SECCIÓN "PROPIEDADES DE LA BARRA DE PROGRESO"
    $panel->createOption(array('name' => __('Properties of the Loading Bar', OSP_BLB_HANDLER), 'type' => 'heading'));
    //***PROPIEDADES BARRA DE PROGRESO - BORDE DE PANTALLA*********************
    $properties_generals = array("animation" => array(__('Animation', OSP_BLB_HANDLER), __('Indicate the type of animation using the loading bar that appears on the screen.', OSP_BLB_HANDLER)), "position" => array(__('Position', OSP_BLB_HANDLER), __('Select the location where the border for the loading bar will appear. (Default: Top', OSP_BLB_HANDLER)), "color" => array(__('Color', OSP_BLB_HANDLER), __('Select the color of the loading bar. (Default: #FF0000)', OSP_BLB_HANDLER)), "wide" => array(__('Wide', OSP_BLB_HANDLER), __('Indicate the thickness of the loading bar. (Default: 20px)', OSP_BLB_HANDLER)), "direction" => array(__('Direction', OSP_BLB_HANDLER), __('Indicate the filling direction of the loading bar. That is to say, from where to where should the bar move. (Default: Normal)', OSP_BLB_HANDLER)), "opacity" => array(__('Opacity', OSP_BLB_HANDLER), __('Indicate the level of transparency of the loading bar. (Default: 100)', OSP_BLB_HANDLER)));
    //Muestra las propieades del indicador
    osp_blb_options_generals($panel, $properties_generals);
    //PROPIEDADES (BORDE)
    osp_blb_options_border($panel);
    //PROPIEDADES (SOMBRA)
    osp_blb_options_shadow($panel);
    //FONDO DE LA BARRA DE PROGRESO
    osp_blb_options_background($panel);
    //PROPIEDADES (FUENTE)
    osp_blb_options_font($panel);
    //**************************************************************************
    //**SECCIÓN: UBICACIONES****************************************************
    //**************************************************************************
    //
    osp_blb_options_locations($panel);
    //ENCABEZADO DE SECCIÓN "CSS PERSONALIZADO"
    $panel->createOption(array('name' => __('Custom CSS', OSP_BLB_HANDLER), 'type' => 'heading'));
    osp_blb_options_generals($panel, array("customCSS" => array(__('CSS Personalizado', OSP_BLB_HANDLER), __('If you want to custom "' . OSP_BLB_NAME . '" even more, you can write your own rules in the CSS. "' . OSP_BLB_NAME . '" the options under three main elements and they are the following:<br><ul>' . '<li><code>#' . OSP_BLB_PREFIX . 'loading-bar</code> - This is the progress bar.</li>' . '<li><code>#' . OSP_BLB_PREFIX . 'loading-bar-container</code> - This is the container that holds the progress bar.</li>' . '<li><code>#' . OSP_BLB_PREFIX . 'text</code> - This is the container where the contents of the text described by the administrator writes.</li>' . '</ul>', OSP_BLB_HANDLER))));
}
示例#16
0
 /**
  * Loads Titan Framework.
  *
  * Titan Framework is used to handle all plugin options.
  *
  * @since 1.0.0
  */
 public function load_titan_framework()
 {
     // Don't do anything when we're activating a plugin to prevent errors
     // on redeclaring Titan classes
     if (!empty($_GET['action']) && !empty($_GET['plugin'])) {
         if ($_GET['action'] == 'activate') {
             return;
         }
     }
     // Check if the framework plugin is activated
     $useEmbeddedFramework = true;
     $activePlugins = get_option('active_plugins');
     if (is_array($activePlugins)) {
         foreach ($activePlugins as $plugin) {
             if (is_string($plugin)) {
                 if (stripos($plugin, '/titan-framework.php') !== false) {
                     $useEmbeddedFramework = false;
                     break;
                 }
             }
         }
     }
     // Use the embedded Titan Framework
     if ($useEmbeddedFramework && !class_exists('TitanFramework')) {
         require_once WPBO_PATH . 'vendor/gambitph/titan-framework/titan-framework.php';
     }
     /**
      * wpbo_before_load_titan hook
      */
     do_action('wpbo_before_load_titan');
     $this->titan = TitanFramework::getInstance('wpbo');
     $this->settings = $this->titan->createAdminPanel(array('name' => __('Settings', 'wpbo'), 'parent' => 'edit.php?post_type=wpbo-popup', 'position' => 999));
     /* Get all options */
     $options = $this->get_options();
     /* Iterate */
     foreach ($options as $tab => $content) {
         /* Add a new tab */
         $tab = $this->settings->createTab(array('name' => $content['name'], 'title' => isset($content['title']) ? $content['title'] : $content['name'], 'id' => $tab));
         /* Add all options to current tab */
         foreach ($content['options'] as $option) {
             $tab->createOption($option);
         }
         $tab->createOption(array('type' => 'save'));
     }
 }
 protected function checkValues($option)
 {
     $titan = TitanFramework::getInstance('testing');
     $id = $option->settings['id'];
     $this->assertEquals('default', $titan->getOption($id));
     $option->setValue('modified');
     $titan->saveInternalAdminPageOptions();
     // Does nothing for non-admin options
     $this->assertEquals('modified', $titan->getOption($id));
     $option->setValue('');
     $titan->saveInternalAdminPageOptions();
     // Does nothing for non-admin options
     $this->assertEquals('', $titan->getOption($id));
     $option->setValue('0');
     $titan->saveInternalAdminPageOptions();
     // Does nothing for non-admin options
     $this->assertEquals('0', $titan->getOption($id));
 }
示例#18
0
function bodhi_yoga_create_metabox()
{
    // Get Framework Instance
    $bodhi_yoga = TitanFramework::getInstance('bodhi-yoga');
    //================================= //
    //======== Theme Meta Box ========= //
    //================================= //
    $page_meta = $bodhi_yoga->createMetaBox(array('name' => 'Page Metabox'));
    $teacher_meta = $bodhi_yoga->createMetaBox(array('name' => 'Become Teacher Metabox', 'post_type' => 'training'));
    $testimonial_meta = $bodhi_yoga->createMetaBox(array('name' => 'Testimonial Metabox', 'post_type' => 'testimonial'));
    $teachers_meta = $bodhi_yoga->createMetaBox(array('name' => 'Teacher Metabox', 'post_type' => 'teacher'));
    //========================================= //
    //========== Page Metabox Start =========== //
    //========================================= //
    // hide page title
    $page_meta->createOption(array('name' => 'Hide Page Title', 'id' => 'bodhi_toggle_page_title', 'type' => 'checkbox', 'default' => false));
    $page_meta->createOption(array('name' => 'Bodhi Yoga Owner', 'id' => 'bodhi_owner_meta', 'type' => 'text', 'default' => 'Marcus Julian Felicetti'));
    $page_meta->createOption(array('name' => 'Bodhi Yoga Founder', 'id' => 'bodhi_founder_meta', 'type' => 'text', 'default' => 'Founder, Director, Primary Teacher'));
    $page_meta->createOption(array('name' => 'Page Sub Heading', 'id' => 'bodhi_page_subheading', 'type' => 'text', 'default' => ''));
    $page_meta->createOption(array('name' => 'Register Button URL', 'id' => 'bodhi_register_button_url', 'type' => 'text', 'default' => ''));
    //============================================= //
    //========== Training Metabox Start =========== //
    //============================================= //
    // teacher trainig heading
    $teacher_meta->createOption(array('name' => 'Teacher Training Heading', 'id' => 'bodhi_teacher_training_heading', 'type' => 'text'));
    // teacher trainig sub heading
    $teacher_meta->createOption(array('name' => 'Teacher Training Sub Heading', 'id' => 'bodhi_teacher_training_subheading', 'type' => 'text'));
    // teacher trainig Location
    $teacher_meta->createOption(array('name' => 'Teacher Training Location', 'id' => 'bodhi_teacher_training_location', 'type' => 'text'));
    // teacher training start date
    $teacher_meta->createOption(array('name' => 'Training Start Date', 'id' => 'bodhi_teacher_training_sdate', 'type' => 'date', 'desc' => 'Choose a starte date', 'default' => '2015-10-10'));
    // teacher training end date
    $teacher_meta->createOption(array('name' => 'Training Start Date', 'id' => 'bodhi_teacher_training_edate', 'type' => 'date', 'desc' => 'Choose a End date', 'default' => ''));
    //================================================ //
    //========== Testimonial Metabox Start =========== //
    //================================================ //
    // testimonial author
    $testimonial_meta->createOption(array('name' => 'Testimonial Author Meta', 'id' => 'bodhi_testimonial_author_meta', 'type' => 'text'));
    //================================================ //
    //========== Teacher Metabox Start =========== //
    //================================================ //
    // teacher trainig heading
    $teachers_meta->createOption(array('name' => 'Teacher Meta', 'id' => 'bodhi_teacher_meta', 'type' => 'text'));
}
function polimed_options_creating_function()
{
    // Initialize Titan with your theme name.
    $titan = TitanFramework::getInstance('polimed');
    /**
     * First Admin panel.
     */
    /**
     * Create admin panel options page called `$aa_panel`.
     *
     * This is a first admin panel and is called by its name i.e. `$aa_panel`.
     */
    $polimed_panel = $titan->createAdminPanel(array('name' => 'Polimed'));
    $polimed_panel_tab1 = $polimed_panel->createTab(array('name' => 'Tab 1'));
    /**
     * Create the options.
     *
     * Now we will create options for our panel that we just created called `$aa_panel`.
     */
    $polimed_panel_tab1->createOption(array('id' => 'aa_txt', 'type' => 'text', 'name' => 'My Text Option', 'desc' => 'This is our option'));
    /**
     * Save button for options.
     *
     * When creating admin panel options, use this code to add an option "Save" button
     * since there is no other way for user to save the options.Your users can now save
     * (and reset) the options we just created.
     */
    $polimed_panel_tab1->createOption(array('type' => 'save'));
    /**
     * 
     * Create second tab.
     * 
     */
    $polimed_panel_tab2 = $polimed_panel->createTab(array('name' => 'Tab 2'));
    // Create options inside tab2.
    $polimed_panel_tab2->createOption(array('id' => 'aa_txtarea_in_tab2_panel2', 'type' => 'textarea', 'name' => 'My Text Area', 'desc' => 'This is our option'));
    /**
     * Save button for options.
     */
    $polimed_panel_tab2->createOption(array('type' => 'save'));
}
示例#20
0
/**
 * Retorna un Script con el constructor de un objeto Jquery con los parametros establecidos por el usuarios para crear la barra de progreso en pantalla
 *
 * @return	String
 * @since	1.0
 */
function osp_blb_getScript()
{
    $titan = TitanFramework::getInstance(OSP_BLB_NAME);
    //Obtiene las propiedades
    $position = $titan->getOption(OSP_BLB_ID . "_position");
    $direction = osp_blb_converterBoolean($titan->getOption(OSP_BLB_ID . "_direction"));
    $color = osp_blb_hex2rgb($titan->getOption(OSP_BLB_ID . "_color"));
    $wide = $titan->getOption(OSP_BLB_ID . "_wide");
    $opacity = intval($titan->getOption(OSP_BLB_ID . "_opacity")) / 100;
    $shadow = osp_blb_converterBoolean($titan->getOption(OSP_BLB_ID . "_shadow"));
    $shadowScope = osp_blb_converterBoolean($titan->getOption(OSP_BLB_ID . "_shadowScope"));
    $shadowColor = osp_blb_hex2rgb($titan->getOption(OSP_BLB_ID . "_shadowColor"));
    $shadowPosX = $titan->getOption(OSP_BLB_ID . "_shadowPosX");
    $shadowPosY = $titan->getOption(OSP_BLB_ID . "_shadowPosY");
    $shadowDith = $titan->getOption(OSP_BLB_ID . "_shadowDith");
    $shadowSpread = $titan->getOption(OSP_BLB_ID . "_shadowSpread");
    $shadowOpacity = $titan->getOption(OSP_BLB_ID . "_shadowOpacity") / 100;
    $border = osp_blb_converterBoolean($titan->getOption(OSP_BLB_ID . "_border"));
    $borderColor = osp_blb_hex2rgb($titan->getOption(OSP_BLB_ID . "_borderColor"));
    $borderWidth = $titan->getOption(OSP_BLB_ID . "_borderWidth");
    $borderVisibility = $titan->getOption(OSP_BLB_ID . "_borderVisibility");
    $borderRadius = $titan->getOption(OSP_BLB_ID . "_borderRadius");
    $borderStyle = $titan->getOption(OSP_BLB_ID . "_borderStyle");
    $borderOpacity = $titan->getOption(OSP_BLB_ID . "_borderOpacity") / 100;
    $font = osp_blb_converterBoolean($titan->getOption(OSP_BLB_ID . "_font"));
    $fontStyle = $titan->getOption(OSP_BLB_ID . "_fontStyle");
    $fontAlignH = $titan->getOption(OSP_BLB_ID . "_fontAlignH");
    $fontAlignV = $titan->getOption(OSP_BLB_ID . "_fontAlignV");
    $fontOrient = $titan->getOption(OSP_BLB_ID . "_fontOrient");
    $fontText = osp_blb_formatText($titan->getOption(OSP_BLB_ID . "_fontText"));
    $animation = $titan->getOption(OSP_BLB_ID . "_animation");
    $background = osp_blb_converterBoolean($titan->getOption(OSP_BLB_ID . "_background"));
    $backgroundColor = $titan->getOption(OSP_BLB_ID . "_backgroundColor");
    //MODO DE PRUEBAS
    $testMode = osp_blb_converterBoolean($titan->getOption("testMode"));
    $testModeShowBar = osp_blb_converterBoolean($titan->getOption("testMode_showBar"));
    return "jQuery().borderLoadingBar({" . "position:\"{$position}\"," . "direction:{$direction}," . "color:\"rgba(" . $color[0] . "," . $color[1] . "," . $color[2] . "," . $opacity . ")\"," . "wide:{$wide}," . "opacity:{$opacity}," . "shadow:{$shadow}," . "shadowColor:\"rgba(" . $shadowColor[0] . "," . $shadowColor[1] . "," . $shadowColor[2] . "," . $shadowOpacity . ")\"," . "shadowScope:" . $shadowScope . "," . "shadowPosX:{$shadowPosX}," . "shadowPosY:{$shadowPosY}," . "shadowDith:{$shadowDith}," . "shadowSpread:{$shadowSpread}," . "border: {$border}," . "borderColor:\"rgba(" . $borderColor[0] . "," . $borderColor[1] . "," . $borderColor[2] . "," . $borderOpacity . ")\"," . "borderWidth: {$borderWidth}," . "borderVisibility: [\"" . implode("\",\"", $borderVisibility) . "\"]," . "borderRadius: {$borderRadius}," . "borderStyle: \"{$borderStyle}\"," . "borderOpacity: {$borderOpacity}," . "font: {$font}," . "fontStyle: [\"" . implode("\",\"", $fontStyle) . "\"]," . "fontAlignH: \"{$fontAlignH}\"," . "fontAlignV: \"{$fontAlignV}\"," . "fontOrient:{$fontOrient}," . "fontText:\"" . $fontText . "\"," . "animation:" . $animation . "," . "background:" . $background . "," . "backgroundColor:\"" . $backgroundColor . "\"" . "}," . "{mode:{$testMode}," . "showBar:{$testModeShowBar}" . "});";
}
示例#21
0
function ll_customizer_options_logo()
{
    // Initialize Titan
    $aa_tf = TitanFramework::getInstance('ll');
    /**
     * Logo Section & Panel Creation
     *
     * Section: $ll_section_logo
     * Panel  :  LoadingLogo Customizer
     *
     */
    $ll_section_logo = $aa_tf->createThemeCustomizerSection(array('name' => 'Logo', 'panel' => 'LoadingLogo'));
    /**
     * Note
     *
     */
    $ll_section_logo->createOption(array('type' => 'note', 'desc' => 'Customize the logo, width, animation overlay or filter.'));
    /**
     * Option: Logo Image
     *
     * @since 0.0.1
     *
     */
    if (file_exists(LL_DIR . '/assets/admin/inc/options/titan-framework-options/ll_option_logo.php')) {
        require_once LL_DIR . '/assets/admin/inc/options/titan-framework-options/ll_option_logo.php';
    }
    /**
     * Option: Logo Width
     *
     * @since 0.0.1
     *
     */
    if (file_exists(LL_DIR . '/assets/admin/inc/options/titan-framework-options/ll_option_logo_width.php')) {
        require_once LL_DIR . '/assets/admin/inc/options/titan-framework-options/ll_option_logo_width.php';
    }
}
示例#22
0
function ll_scripts_stlyes()
{
    // Titan Framework is initialized here
    $aa_tf = TitanFramework::getInstance('ll');
    // jQuery
    wp_enqueue_script('jquery');
    // Enqueue it!
    /**
     * Scripts
     *
     *     @vendor   loadgo.min.js
     *     @custom   custom.js, etc. TODO: list all custom js here.
     *
     * @since 0.0.1
     *
     */
    /**
     *
     * Vendor Scripts
     *
     */
    // loadgo.js
    wp_enqueue_script('ll_vendorsJS', LL_URL . '/assets/js/vendors/loadgo.min.js', array('jquery'));
    // Loadgo script
    /**
     *
     * Custom Scripts
     *
     *
     * @since 0.0.1
     *
     */
    // Get the logo image ID
    $ll_logo_attachmentID = $aa_tf->getOption('ll_option_logo');
    // Get the logo image source via the ID
    $ll_logo_src = wp_get_attachment_image_src($ll_logo_attachmentID, 'large');
    // Placeholder logo imaage
    $ll_logo_src_fallback = LL_URL . '/assets/img/loadinglogo.png';
    // If empty then add Placeholder image else add the image source
    $ll_logo_src_final = empty($ll_logo_src) ? $ll_logo_src_fallback : $ll_logo_src[0];
    // Custom.js: This file performs the animation effects during page loading
    wp_register_script('ll_customJS', LL_URL . '/assets/js/custom/custom.js', array('jquery', 'll_vendorsJS'));
    // costom.js
    // For ll_customJS create a JS object called ll_logo and give it an
    // attribute called imgSrc accessable via ll_logo.imgSrc in the JS file
    wp_localize_script('ll_customJS', 'll_logo', array('imgSrc' => $ll_logo_src_final));
    wp_enqueue_script('ll_customJS');
    /**
     *
     * Overlay and filters
     *
     * @since 0.0.2
     *
     */
    // Choose between Overlay or Filter Option
    $ll_animate_overlayORfilter = $aa_tf->getOption('ll_option_animation');
    // Overlay Animation Direction
    $ll_animate_direction = $aa_tf->getOption('ll_option_direction');
    // Image Filter Type
    $ll_animate_filter = $aa_tf->getOption('ll_option_filter');
    // TODO: use wp_localize_script
    // Check for whether user has selected overlay or filter
    if ($ll_animate_overlayORfilter == 'overlay') {
        // Custom.js: This file performs the animation effects during page loading
        wp_register_script('ll_overlayJS', LL_URL . '/assets/js/custom/overlay.js', array('jquery', 'll_vendorsJS', 'll_customJS'));
        // overlay.js
        // For ll_overlayJS create a JS object called ll_overlay and give it an
        // attribute called dir accessable via ll_overlay.dir in the JS file
        wp_localize_script('ll_overlayJS', 'll_overlay', array('dir' => $ll_animate_direction));
        wp_enqueue_script('ll_overlayJS');
    } elseif ($ll_animate_overlayORfilter == 'filter') {
        // Custom.js: This file performs the animation effects during page loading
        wp_register_script('ll_filterJS', LL_URL . '/assets/js/custom/filter.js', array('jquery', 'll_vendorsJS', 'll_customJS'));
        // overlay.js
        // For ll_filterJS create a JS object called ll_filter and give it an
        // attribute called type accessable via ll_filter.type in the JS file
        wp_localize_script('ll_filterJS', 'll_filter', array('type' => $ll_animate_filter));
        wp_enqueue_script('ll_filterJS');
    }
    /**
     * Style
     *
     * style.min.css contains all the minified CSS from vendors and partials
     *
     * @since 0.0.1
     */
    // CSS
    wp_enqueue_style('ll_style', LL_URL . '/assets/css/style.css', array(), '1.0', 'all');
}
示例#23
0
文件: opt.php 项目: hsleonis/dgroup
<?php

if (class_exists('TitanFramework')) {
    $titan = TitanFramework::getInstance('wp_dg');
    /**
     * Home page settings
     */
    $adminPanel = $titan->createAdminPanel(array('name' => __('Doreen Options', 'dcastalia'), 'id' => 'doreen-options'));
    /* General settings */
    $generalTab = $adminPanel->createTab(array('name' => __('General', 'dcastalia')));
    $generalTab->createOption(array('type' => 'save'));
    $generalTab->createOption(array('name' => __('Header', 'dcastalia'), 'type' => 'heading'));
    $generalTab->createOption(array('name' => __('Career Link', 'dcastalia'), 'id' => 'career_link', 'type' => 'text', 'desc' => __('Enter career button link with http://', 'dcastalia')));
    $generalTab->createOption(array('name' => __('Download Link', 'dcastalia'), 'id' => 'download_link', 'type' => 'text', 'desc' => __('Enter download button link with http://', 'dcastalia')));
    $generalTab->createOption(array('name' => __('Footer', 'dcastalia'), 'type' => 'heading'));
    $generalTab->createOption(array('name' => __('Copyright Info', 'dcastalia'), 'id' => 'copy_info', 'type' => 'editor', 'desc' => __('Enter copyright information', 'dcastalia')));
    $generalTab->createOption(array('type' => 'save'));
    $homeTab = $adminPanel->createTab(array('name' => __('Featured', 'dcastalia')));
    $homeTab->createOption(array('type' => 'save'));
    // Featured
    for ($i = 1; $i <= 10; $i++) {
        $homeTab->createOption(array('name' => __('Featured Item ' . $i, 'dcastalia'), 'type' => 'heading'));
        $homeTab->createOption(array('name' => __('Overlay Color', 'dcastalia'), 'id' => 'feat' . $i . '_color', 'type' => 'color', 'desc' => __('Item overlay color', 'dcastalia'), 'default' => '#26292C'));
        $homeTab->createOption(array('name' => __('Background Image', 'dcastalia'), 'id' => 'feat' . $i . '_img', 'type' => 'upload', 'desc' => __('Upload image', 'dcastalia'), 'size' => 'full'));
        $homeTab->createOption(array('name' => __('Header Text (Bold)', 'dcastalia'), 'id' => 'feat' . $i . '_title1_text', 'type' => 'text', 'desc' => __('Enter heading text', 'dcastalia')));
        $homeTab->createOption(array('name' => __('Header Text (Light)', 'dcastalia'), 'id' => 'feat' . $i . '_title2_text', 'type' => 'text', 'desc' => __('Enter heading text', 'dcastalia')));
        $homeTab->createOption(array('name' => __('Subheader Text', 'dcastalia'), 'id' => 'feat' . $i . '_sub_text', 'type' => 'text', 'desc' => __('Enter subheading text', 'dcastalia')));
        $homeTab->createOption(array('name' => __('Item Link', 'dcastalia'), 'id' => 'feat' . $i . '_link', 'type' => 'text', 'desc' => __('Item hyperlink with http://', 'dcastalia')));
    }
    $homeTab->createOption(array('type' => 'save'));
    /* Parallax */
/**
 * Initialize Titan & options here
 */
function dinamarca_create_options()
{
    $titan = TitanFramework::getInstance('dinamarca');
    /**
     * Create a Theme Customizer panel where we can edit some options.
     * You should put options here that change the look of your theme.
     */
    $callTo = $titan->createThemeCustomizerSection(array('name' => __('Call To Action Colors', 'dinamarca')));
    $callTo->createOption(array('name' => __('Background Color', 'dinamarca'), 'id' => 'call_to_action_BG', 'type' => 'color', 'desc' => __('This color changes the background of your call to action', 'dinamarca'), 'default' => '#91c842', 'livepreview' => '', 'css' => '#call-to-action { background-color: value !important}'));
    $callTo->createOption(array('name' => __('Text Color', 'dinamarca'), 'id' => 'call_to_action_TC', 'type' => 'color', 'desc' => __('This color changes the text color of your call to action', 'dinamarca'), 'default' => '#FFFFFF', 'livepreview' => '', 'css' => '#call-to-action p { color: value !important}'));
    /**
     * Create a Theme Customizer panel where we can edit some options.
     * You should put options here that change the look of your theme.
     */
    $section = $titan->createThemeCustomizerSection(array('name' => __('Header Options', 'dinamarca')));
    $section->createOption(array('name' => __('Background Color', 'dinamarca'), 'id' => 'sample_color1', 'type' => 'color', 'desc' => __('This color changes the background of your header', 'dinamarca'), 'default' => '#363f48', 'livepreview' => '', 'css' => 'header .site-branding {
	  	                        background-color: value!important;
						    }
							  h1.widget-title {
									color:value!important;
						    }
								.main-navigation ul.menu li.current_page_item {
									background-color:value!important;
								}'));
    $section->createOption(array('name' => __('Navigation Background Color', 'dinamarca'), 'id' => 'nav_color', 'type' => 'color', 'desc' => __('This color changes the background of your navigation', 'dinamarca'), 'default' => '#242A30', 'livepreview' => '', 'css' => 'header.site-header  .main-navigation{
	  	                        background-color: value!important;
						    }'));
    $section->createOption(array('name' => __('Hover and Dropdown Color for Navigation', 'dinamarca'), 'id' => 'hover_bg', 'type' => 'color', 'desc' => __('This color changes the background of your Hover and Dropdown', 'dinamarca'), 'default' => '#242A30', 'livepreview' => '', 'css' => '.main-navigation ul.menu li:hover,
								.main-navigation div.menu li:hover,
								.main-navigation ul.menu li > ul,
								.main-navigation div.menu li > ul {
										background: value!important;
								}

								'));
    $section->createOption(array('name' => 'Upload your Logo', 'id' => 'logo_imagen', 'type' => 'upload', 'desc' => 'Upload your Logo', 'default' => '', 'livepreview' => ''));
    $section->createOption(array('name' => 'Header Image', 'id' => 'header_image', 'type' => 'upload', 'desc' => 'Upload an Image', 'default' => '', 'livepreview' => '', 'css' => 'header.site-header {
									background-image: value!important
							}'));
    /**
     * Create a Theme Customizer panel where we can edit some options.
     * You should put options here that change the look of your theme.
     */
    $section = $titan->createThemeCustomizerSection(array('name' => __('Background Options', 'dinamarca')));
    $section->createOption(array('name' => 'Background Pattern Image', 'id' => 'bg_pattern', 'type' => 'upload', 'desc' => 'Upload an Image', 'default' => '', 'livepreview' => '', 'css' => '.site-content  {
									background-image: value!important
							}'));
    $section->createOption(array('name' => 'Background Color', 'id' => 'bg_color', 'type' => 'color', 'desc' => 'Pick a Color', 'default' => '', 'livepreview' => '', 'css' => '.site-content  {
									background: value!important
							}'));
    /**
     * Create an admin panel & tabs
     * You should put options here that do not change the look of your theme
     */
    $footer = $titan->createThemeCustomizerSection(array('name' => __('Footer and Testimonial (Front) Colors', 'dinamarca')));
    $footer->createOption(array('name' => __('Background Color', 'dinamarca'), 'id' => 'footer_bg', 'type' => 'color', 'desc' => __('This color changes the background of your footer', 'dinamarca'), 'default' => '#363f48', 'css' => 'footer.site-footer, .testimonials-section {
								    background-color:value!important;
						     }'));
    $footer->createOption(array('name' => __('Text Color', 'dinamarca'), 'id' => 'footer_p', 'type' => 'color', 'desc' => __('This color changes the text color of your call to action', 'dinamarca'), 'default' => '#FFFFFF', 'livepreview' => '', 'css' => '.testimonials-section h2.title,
								.testimonials-section p,
								.testimonials-section h3,
								footer.site-footer .textwidget,
								footer.site-footer a {
				  					color:value!important;
								}'));
    $adminPanel = $titan->createAdminPanel(array('name' => __('Dinamarca Settings', 'dinamarca')));
    /** CALL TO ACTION **/
    $callToActionOptions = $adminPanel->createTab(array('name' => __('Call To Action Options', 'dinamarca')));
    $callToActionOptions->createOption(array('name' => 'Phone Number', 'id' => 'phone_number', 'type' => 'text', 'desc' => 'Add your Phone number to header.'));
    $callToActionOptions->createOption(array('name' => 'Contact Button Text', 'id' => 'button_text', 'type' => 'text', 'desc' => 'Contact Text.'));
    $callToActionOptions->createOption(array('name' => 'Contact Button Link', 'id' => 'button_link', 'type' => 'text', 'desc' => 'Contact Link.'));
    $callToActionOptions->createOption(array('type' => 'save'));
    /** Front Page **/
    $frontPage = $adminPanel->createTab(array('name' => __('Front Page', 'dinamarca')));
    $frontPage->createOption(array('name' => __('Show Slider', 'dinamarca'), 'id' => 'show_slider', 'type' => 'checkbox', 'desc' => __('Check to True', 'dinamarca'), 'default' => false));
    $frontPage->createOption(array('name' => __('Show Services', 'dinamarca'), 'id' => 'show_services', 'type' => 'checkbox', 'desc' => __('Check to True', 'dinamarca'), 'default' => false));
    $frontPage->createOption(array('name' => __('Show Testimonials', 'dinamarca'), 'id' => 'show_testimonials', 'type' => 'checkbox', 'desc' => __('Check to True', 'dinamarca'), 'default' => false));
    $frontPage->createOption(array('name' => __('Show Blog', 'dinamarca'), 'id' => 'show_blog', 'type' => 'checkbox', 'desc' => __('Check to True', 'dinamarca'), 'default' => false));
    $frontPage->createOption(array('type' => 'save'));
    /** GENERAL **/
    $generalTab = $adminPanel->createTab(array('name' => __('General', 'dinamarca')));
    $generalTab->createOption(array('name' => __('Show Author Bio', 'dinamarca'), 'id' => 'author_bio', 'type' => 'checkbox', 'desc' => __('Check to True', 'dinamarca'), 'default' => false));
    $generalTab->createOption(array('type' => 'save'));
    /** FOOTER **/
    $footerTab = $adminPanel->createTab(array('name' => __('Footer', 'dinamarca')));
    $footerTab->createOption(array('name' => __('Copyright Text', 'dinamarca'), 'id' => 'copyright', 'type' => 'text', 'desc' => __('Enter your copyright text here', 'dinamarca')));
    $footerTab->createOption(array('type' => 'save'));
}
$titan = TitanFramework::getInstance('dinamarca');
if ($titan->getOption('show_services')) {
    ?>
    <?php 
    get_template_part('template-parts/index', 'services');
}
?>

<?php 
// Load Testimonials
$titan = TitanFramework::getInstance('dinamarca');
if ($titan->getOption('show_testimonials')) {
    ?>
    <?php 
    get_template_part('template-parts/index', 'testimonials');
}
?>

<?php 
// Load Blog
$titan = TitanFramework::getInstance('dinamarca');
if ($titan->getOption('show_blog')) {
    ?>
    <?php 
    get_template_part('template-parts/index', 'blog');
}
?>


<?php 
get_footer();
示例#26
0
	</header>
	<?php 
}
/**
 * Main menu
 */
?>
	<nav id="site-navigation" class="main-navigation" role="navigation">
		<button class="menu-toggle" aria-controls="menu" aria-expanded="false"><span class="genericon genericon-menu"></span></button>
		<div id="main-menu" class="menu">
			<div class="inner-menu">
				<div class="menu-container">
					<?php 
$title = __('Menu', 'regala');
if (class_exists('TitanFramework')) {
    $titan = TitanFramework::getInstance('regala');
    $title = $titan->getOption('menu_title');
}
?>
					<h4><?php 
echo esc_html($title);
?>
</h4>
				    <?php 
wp_nav_menu(array('theme_location' => 'primary'));
?>
				</div>
			    <?php 
get_sidebar('main-menu');
?>
			</div>
if (!empty($_GET['action']) && !empty($_GET['plugin'])) {
    if ($_GET['action'] == 'activate') {
        return;
    }
}
// Check if the framework plugin is activated
$useEmbeddedFramework = true;
$activePlugins = get_option('active_plugins');
if (is_array($activePlugins)) {
    foreach ($activePlugins as $plugin) {
        if (is_string($plugin)) {
            if (stripos($plugin, '/titan-framework.php') !== false) {
                $useEmbeddedFramework = false;
                break;
            }
        }
    }
}
// Use the embedded Titan Framework
if ($useEmbeddedFramework) {
    require_once plugin_dir_path(__FILE__) . 'titan-framework/titan-framework.php';
}
/*
 * Start your Titan code below
 */
$titan = TitanFramework::getInstance('embed-testing');
$panel = $titan->createAdminPanel(array('name' => 'Embed Test'));
$panel->createOption(array('name' => 'Upload', 'id' => 'uploaded_photo', 'type' => 'upload'));
$panel->createOption(array('name' => 'Select Color Palette', 'id' => 'color_palette', 'type' => 'radio-palette', 'options' => array(array("#333333", "#888888", "#aaaaaa"), array("#3498db", "#1abc9c", "#e74c3c"), array("#1cafe7", "#fec7a8", "#e57ca6"), array("#efa6ea", "#e9ac43", "#e3a2ea"), array("#a4c3ae", "#a9e718", "#1abc9c", "#e74c3c", "#100489")), 'default' => 3));
$panel->createOption(array('name' => 'Editor', 'id' => 'my_editor', 'type' => 'editor', 'desc' => 'Enter your content here'));
$panel->createOption(array('type' => 'save'));
function cfc_options__padding_margin()
{
    // Initialize Titan
    $titan = TitanFramework::getInstance('cfc');
    /**
     * First Section & Panel Creation
     *
     * Section: $cfc_sec_pm
     * Panel  :  CF7 Customizer
     *
     */
    $cfc_sec_pmb = $titan->createThemeCustomizerSection(array('name' => 'Form Padding, Margin & Border', 'panel' => 'CF7 Customizer'));
    /**
     * Note
     *
     */
    $cfc_sec_pmb->createOption(array('type' => 'note', 'desc' => 'Add padding, margin and border to your form and customize the border color.'));
    /**
     * Option: Padding
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_padding.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_padding.php';
    }
    /**
     * Option: Margin
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_margin.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_margin.php';
    }
    /**
     * Option: Border
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_border.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_border.php';
    }
    /**
     * Option: Border Radius.
     *
     * @since 1.0.1
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_border_radius.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_border_radius.php';
    }
    /**
     * Option: Border Color
     *
     * @since 0.0.1
     *
     */
    if (file_exists(CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_border_clr.php')) {
        require_once CFC_DIR . '/assets/admin/inc/options/titan-framework-options/cfc_border_clr.php';
    }
    // End of cfc_options__padding_margin()
}
 function bas_get_from_titan_framework($value)
 {
     $titan = TitanFramework::getInstance('bas-intranet');
     return $titan->getOption($value);
 }
示例#30
0
?>
    </div>


    <?php 
$args = array('post_type' => 'teacher', 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => -1, 'paged' => get_query_var('paged'));
$testimonial_query = new WP_Query($args);
?>
    <div class="testimonial-wrap">
    <?php 
if ($testimonial_query->have_posts()) {
    ?>
        <?php 
    while ($testimonial_query->have_posts()) {
        $testimonial_query->the_post();
        $bodhi_value = TitanFramework::getInstance('bodhi-yoga');
        $bodhi_testimonial_author = $bodhi_value->getOption('bodhi_teacher_meta');
        ?>

        <article id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class('row teacher-item testimonial--item');
        ?>
>
	        <div class="testimonial--thumbnail col-md-4">
				<?php 
        if (has_post_thumbnail()) {
            the_post_thumbnail('square-300', array('class' => 'img-responsive'));
        }