本文整理汇总了PHP中TitanFramework::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP TitanFramework::getInstance方法的具体用法?PHP TitanFramework::getInstance怎么用?PHP TitanFramework::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TitanFramework
的用法示例。
在下文中一共展示了TitanFramework::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootswatch_hook_callback
/**
* [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.
}
示例2: nswp_create_options
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: initalize_theme_and_create_admin_panel
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: create_customizer_options
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: bodhi_yoga_create_options
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">·</span>HEAL<span class="dot">·</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'));
}
示例6: una_create_options
/**
* 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'));
}
示例7: cfc_options__custom_css
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()
}
示例8: load_titan_framework
/**
* 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: aa_metabox_options
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')));
}
示例10: cfc_options__txt_bg
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';
}
}
示例11: jg_custom_css
function jg_custom_css()
{
$titan = TitanFramework::getInstance('jg-one-page');
?>
<style type="text/css">
<?php
echo $titan->getOption('jg_custom_css');
?>
</style>
<?php
}
示例12: create_theme_option
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: regala_default_image_options
/**
* 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'));
}
示例14: checkValues
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: osp_blb_create_options
/**
* 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))));
}