Beispiel #1
0
        function app_meta()
        {
            global $post;
            $zb_site = get_option('zappbar_site');
            $zb_social = get_option('zappbar_social');
            $bar_colors = get_option('zappbar_colors');
            $panels = get_option('zappbar_panels');
            $plugin_dir_url = zappbar_pluginfo('plugin_url');
            echo '<meta name="apple-mobile-web-app-capable" content="yes" id="app_meta">';
            /* 	If you want a zoomable interface in app mode (not recommended) uncomment the line below 
            				but understand it WILL break scrolling and fixed positioning on Android 2.x devices, it
            				will also likely confuse users who accidentally zoom in on other devices.
            			*/
            //			echo '<meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=5,user-scalable=yes" id="view_meta">';
            echo '<meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" id="view_meta">';
            echo '<meta name="apple-mobile-web-app-status-bar-style" content="black" />';
            echo '<meta name="apple-mobile-web-app-title" content="' . get_bloginfo('name') . '">';
            $blank_splash = '<!-- iPad, retina, portrait -->
<link href="' . $plugin_dir_url . 'includes/images/splash/1536x2008.png"
	  media="(device-width: 768px) and (device-height: 1024px)
		 and (orientation: portrait)
		 and (-webkit-device-pixel-ratio: 2)"
	  rel="apple-touch-startup-image">
<!-- iPad, retina, landscape -->
<link href="' . $plugin_dir_url . 'includes/images/splash/1496x2048.png"
	  media="(device-width: 768px) and (device-height: 1024px)
		 and (orientation: landscape)
		 and (-webkit-device-pixel-ratio: 2)"
	  rel="apple-touch-startup-image">
<!-- iPad, portrait -->
<link href="' . $plugin_dir_url . 'includes/images/splash/768x1004.png"
	  media="(device-width: 768px) and (device-height: 1024px)
		 and (orientation: portrait)
		 and (-webkit-device-pixel-ratio: 1)"
	  rel="apple-touch-startup-image">
<!-- iPad, landscape -->
<link href="' . $plugin_dir_url . 'includes/images/splash/748x1024.png"
	  media="(device-width: 768px) and (device-height: 1024px)
		 and (orientation: landscape)
		 and (-webkit-device-pixel-ratio: 1)"
	  rel="apple-touch-startup-image">
<!-- iPhone 6 plus -->
<link href="' . $plugin_dir_url . 'includes/images/splash/828x1418.png"
	  media="(device-width: 414px) and (device-height: 736px)
		 and (-webkit-device-pixel-ratio: 2)"
	  rel="apple-touch-startup-image">
<!-- iPhone 6 -->
<link href="' . $plugin_dir_url . 'includes/images/splash/750x1284.png"
	  media="(device-width: 375px) and (device-height: 667px)
		 and (-webkit-device-pixel-ratio: 2)"
	  rel="apple-touch-startup-image">
<!-- iPhone 5 -->
<link href="' . $plugin_dir_url . 'includes/images/splash/640x1096.png"
	  media="(device-width: 320px) and (device-height: 568px)
		 and (-webkit-device-pixel-ratio: 2)"
	  rel="apple-touch-startup-image">
<!-- iPhone, retina -->
<link href="' . $plugin_dir_url . 'includes/images/splash/640x920.png"
	  media="(device-width: 320px) and (device-height: 480px)
		 and (-webkit-device-pixel-ratio: 2)"
	  rel="apple-touch-startup-image">
<!-- iPhone -->
<link href="' . $plugin_dir_url . 'includes/images/splash/320x460.png"
	  media="(device-width: 320px) and (device-height: 480px)
		 and (-webkit-device-pixel-ratio: 1)"
	  rel="apple-touch-startup-image">
';
            echo $blank_splash;
            if ($zb_site['app_icon'] != '') {
                $icon = $zb_site['app_icon'];
                $favicon = aq_resize($icon, 16, 16, true);
                $tablet = aq_resize($icon, 72, 72, true);
                $hi_res = aq_resize($icon, 114, 114, true);
                $phones = aq_resize($icon, 57, 57, true);
            } else {
                $favicon = $plugin_dir_url . 'includes/images/app_icons/wordpress-logo_16x16.png';
                $tablet = $plugin_dir_url . 'includes/images/app_icons/wordpress-logo_72x72.png';
                $hi_res = $plugin_dir_url . 'includes/images/app_icons/wordpress-logo_114x114.png';
                $phones = $plugin_dir_url . 'includes/images/app_icons/wordpress-logo_57x57.png';
            }
            echo '<link rel="icon" type="image/png" href="' . $favicon . '" />';
            echo '<link rel="apple-touch-icon-precomposed" sizes="114x114" href="' . $hi_res . '" />';
            echo '<link rel="apple-touch-icon-precomposed" sizes="72x72" href="' . $tablet . '" />';
            echo '<link rel="apple-touch-icon-precomposed" href="' . $phones . '" />';
            // Facebook Open Graph stuff //
            if ($zb_social['fb_default_img'] != '') {
                echo '<!--// Facebook OpenGraph Data by ZappBar //-->';
                echo '<meta property="og:locale" content="' . get_bloginfo('language') . '" />';
                echo '<meta property="og:type" content="website" />';
                echo '<meta property="og:title" content="' . get_bloginfo('name') . ' -" />';
                echo '<meta property="og:url" content="' . get_bloginfo('url') . '" />';
                echo '<meta property="og:site_name" content="' . get_bloginfo('name') . '" />';
                if (!is_singular()) {
                    //if it is not a post or a page
                    // we cannot get a thumbnail
                } else {
                    if (!has_post_thumbnail($post->ID)) {
                        //the post does not have featured image, use a default image
                        $default_image = "http://example.com/image.jpg";
                        //replace this with a default image on your server or an image in your media library
                        echo '<meta property="og:image" content="' . $zb_social['fb_default_img'] . '"/>';
                    } else {
                        $thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium');
                        echo '<meta property="og:image" content="' . esc_attr($thumbnail_src[0]) . '"/>';
                    }
                }
                echo "\n\t\t\t\t";
            }
            // Twitter stuff //
            if ($zb_social['twitter_id'] != '') {
                echo '<!--// Twitter Meta //-->';
                echo '<meta name="twitter:card" content="summary"/>';
                echo '<meta name="twitter:site" content="' . $zb_social['twitter_id'] . '"/>';
                echo '<meta name="twitter:domain" content="' . get_bloginfo('name') . '"/>';
                echo '<meta name="twitter:creator" content="' . $zb_social['twitter_id'] . '"/>';
            }
            require_once zappbar_pluginfo('plugin_path') . 'includes/dynamic-css.php';
            // fallback values
            $zb_site_alter = array('header' => '', 'sitenav' => '', 'commentform' => '', 'push' => '');
            if (isset($zb_site['altertheme'])) {
                // one or more is set
                foreach ($zb_site_alter as $key => $value) {
                    if (isset($zb_site['altertheme'][$key])) {
                        // this one is set
                        $zb_site_alter[$key] = $zb_site['altertheme'][$key];
                    }
                }
            }
            // now move vars into js config:
            ?>
		<script type="text/javascript">
			var zb_base = "<?php 
            echo $plugin_dir_url;
            ?>
";
			var showon = "<?php 
            echo $zb_site['showon'];
            ?>
";
			var applyto = "<?php 
            echo $zb_site['applyto'];
            ?>
";
			var wrapper = ['page','page-wide','wrapper'<?php 
            if ($zb_site['page_custom'] != '') {
                echo ',\'' . $zb_site['page_custom'] . '\'';
            }
            ?>
];
			var is_responsive = "<?php 
            echo $zb_site['responsive'];
            ?>
";
			var auto_width  = "<?php 
            echo get_theme_mod('comicpress-customize-range-site-width') ? 'off' : $zb_site['auto_width'];
            ?>
";
			var theme_width = "<?php 
            echo get_theme_mod('comicpress-customize-range-site-width') ? intval(get_theme_mod('comicpress-customize-range-site-width')) : $zb_site['theme_width'];
            ?>
";
			var telnum = escape("<?php 
            if ($zb_social['phone_number'] != '') {
                echo $zb_social['phone_number'];
            }
            ?>
");
			var splash = "<?php 
            if ($zb_site['splash_screen'] != '') {
                echo $zb_site['splash_screen'];
            }
            ?>
";
			var splash_timer = <?php 
            echo $zb_site['splash_timer'];
            ?>
;
			var splash_link = "<?php 
            echo $zb_site['splash_link'];
            ?>
";
			var comments_open = "<?php 
            if (is_singular()) {
                echo comments_open();
            }
            ?>
";
			var is_home = "<?php 
            echo is_home();
            ?>
";
			var is_archive = "<?php 
            echo is_archive();
            ?>
";
			var header_custom = "<?php 
            echo $zb_site['header_custom'];
            ?>
";
			var nav_custom 	  = "<?php 
            echo $zb_site['nav_custom'];
            ?>
";
			var altertheme_sidebars = "<?php 
            echo $zb_site['sidebars'];
            ?>
";
			var altertheme_header 	= "<?php 
            echo $zb_site_alter['header'];
            ?>
";
			var altertheme_sitenav	= "<?php 
            echo $zb_site_alter['sitenav'];
            ?>
";
			var altertheme_commentform = "<?php 
            echo $zb_site_alter['commentform'];
            ?>
";
			var altertheme_push = "<?php 
            echo $zb_site_alter['push'];
            ?>
";
			var page_custom = "<?php 
            echo $zb_site['page_custom'];
            ?>
";
			var sidebars_custom = "<?php 
            echo $zb_site['sidebars_custom'];
            ?>
";
			var comment_custom = "<?php 
            if ($zb_site['comment_custom'] != '') {
                echo $zb_site['comment_custom'];
            } else {
                echo 'respond';
            }
            ?>
";
		<?php 
            if (class_exists('woocommerce')) {
                $zb_site_alterwoo = $zb_site['alter_woo_theme'];
                ?>
			var woocommerce = true;
			var is_product = "<?php 
                echo is_product();
                ?>
";
			var alter_woo_theme_woo_reviews = "<?php 
                echo $zb_site_alterwoo['woo_reviews'];
                ?>
";
			var alter_woo_theme_woo_desc = "<?php 
                echo $zb_site_alterwoo['woo_desc'];
                ?>
";
			var alter_woo_theme_woo_addl = "<?php 
                echo $zb_site_alterwoo['woo_addl'];
                ?>
";
		<?php 
            } else {
                ?>
			var woocommerce = false;
			var is_product = "";
			var alter_woo_theme_woo_reviews = "";
			var alter_woo_theme_woo_desc = "";
			var alter_woo_theme_woo_addl = "";
		<?php 
            }
            ?>
		</script>
<?php 
        }
        /**
         * Returns all the settings fields
         *
         * @return array settings fields
         */
        function get_settings_fields()
        {
            $plugin_dir_url = zappbar_pluginfo('plugin_url');
            $cp_msg = get_theme_mod('comicpress-customize-range-site-width') ? array('name' => 'cp_auto_width', 'label' => 'Note:', 'type' => 'paragraph', 'desc' => __('Retrofit width of ComicPress 4.3 theme is automatically synchronized with <em>Appearance --&gt; Customize</em> setting.  Please change it there instead.', 'zbotps')) : array('name' => 'cp_auto_width', 'label' => '', 'type' => 'paragraph');
            $settings_fields = array('zappbar_site' => array(array('name' => 'responsive', 'label' => __('Theme Layout', 'zbopts'), 'type' => 'radio', 'default' => '0', 'options' => array('0' => 'Theme is already responsive', '1' => 'Tweak theme to be responsive when ZappBars are displayed', '2' => 'Retrofit to responsive theme even when ZappBars are not displayed')), array('name' => 'auto_width', 'label' => __('Auto-detect Theme Width', 'zbopts'), 'desc' => __('ZappBar can try to auto detect theme width before applying Retrofit (ignored if not retrofitting)', 'zbopts'), 'default' => 'on', 'type' => 'checkbox'), array('name' => 'theme_width', 'label' => __('Manual Theme Width', 'zbopts'), 'type' => 'number', 'default' => '940', 'size' => '5', 'desc' => __('If retrofitting and auto-detect is off, what is the theme width in pixels?', 'zbopts')), $cp_msg, array('name' => 'sidebars', 'label' => __('Theme Sidebars', 'zbopts'), 'type' => 'radio', 'default' => '1', 'options' => array('0' => 'Try to MOVE sidebar(s) below main content on mobile', '1' => 'Try to HIDE sidebar(s) but only from narrow mobile screens', '2' => 'Try to HIDE sidebar(s) whenever ZappBars are displayed'), 'desc' => __('Ignored if setting above indicates theme is already responsive', 'zbopts')), array('name' => 'fix_admin', 'label' => __('Admin Mobile Layout', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Tweak Admin Layout', 'no' => 'Use Admin Default'), 'desc' => __('Attempts to improve the responsive layout of the Admin back-end (WordPress 3.8.1+ only)', 'zbopts')), array('name' => 'adminbar', 'label' => __('WP Admin Bar', 'zbopts'), 'desc' => __('Disable Admin Toolbar on Front-End', 'zbopts'), 'default' => 'off', 'type' => 'checkbox'), array('name' => 'showon', 'label' => __('ZappBars On Screen Size', 'zbopts'), 'desc' => __('Determined by rendered width in browser not device or device screen size.', 'zbopts'), 'type' => 'radio', 'default' => 'none', 'options' => array('none' => 'None (to disable during set-up)', 'phones' => '< &nbsp;&nbsp;736px wide (Phones)', 'idevices' => '< 1024px wide (Tablets & Phones)', 'tablets' => '< 1280px wide (Tablets & Phones)', 'tablets_hd' => '< 1440px wide (HD Tablets & Phones)', 'desktops' => '< 1920px wide (Phones, Tablets, 720p HD Desktops)', 'desktops_hd' => 'All Screen Sizes')), array('name' => 'applyto', 'label' => __('Apply ZappBars On', 'zbopts'), 'desc' => __('"Mobile Only" uses device detection, which can be spoofed. "Force" ignores screen size.', 'zbopts'), 'type' => 'radio', 'default' => 'all', 'options' => array('all' => 'ALL Devices by Screen Size', 'only_mobile' => 'ONLY Mobile Devices by Screen Size', 'only_mobile_forced' => 'ONLY Mobile Devices & FORCE ZappBars', 'force_mobile' => 'Desktops by Screen Size & FORCE Mobile Devices to use ZappBars')), array('name' => 'altertheme', 'label' => __('When ZappBars are Included', 'zbopts'), 'desc' => __('If header section is hidden and site navigation is inside it, site navigation will be automatically hidden as well.', 'zbopts'), 'type' => 'multicheck', 'default' => array('header' => '', 'sitenav' => '', 'commentform' => '', 'push' => ''), 'options' => array('header' => 'Hide Entire &lt;header&gt; Section', 'sitenav' => 'Hide regular site navigation', 'commentform' => 'Convert Comment Form to App Panel', 'push' => 'Push #page element over when App Panel is open')), array('name' => 'app_icon', 'label' => __('App Icon Image', 'zbopts'), 'desc' => __('Select an image to be used as an "App Icon" when your site is bookmarked to the home screen of a phone or tablet. 
                    The image will be automatically cropped/resized for each of the required app icon sizes.  If you leave this blank a generic WordPress icon 
                    will be used instead.', 'zbopts'), 'type' => 'media', 'button' => __('Choose Image'), 'default' => ''), array('name' => 'splash_screen', 'label' => __('Splash Image', 'zbopts'), 'desc' => __('Select an image to use on the App Splash Screen.  This will show only at the start of a 
                    new user session, centered and scaled, against whatever color you have set for panel backgrounds.  
                    If you leave this blank the Splash Screen is disabled.', 'zbopts'), 'type' => 'media', 'button' => __('Choose Image'), 'default' => ''), array('name' => 'splash_size', 'label' => __('Splash Image Fit', 'zbopts'), 'type' => 'radio', 'default' => 'auto', 'options' => array('auto' => 'Do NOT Scale Splash Image, use original size', 'contain' => 'Scale Splash Image to FIT if image is larger than screen space', 'cover' => 'Scale Splash Image to FILL all available screen space'), 'desc' => __('No scaling may not fit on screen.  "Fit" may show some of the background color around it; "Fill" may crop off parts of the image 
                    (this setting is ignored if no Splash Image is set above)', 'zbopts')), array('name' => 'splash_timer', 'label' => __('Splash Timer', 'zbopts'), 'desc' => __('Number of seconds to show Splash Screen before clearing it automatically<br/>
                    (Users can always clear it sooner by clicking on it)', 'zbopts'), 'type' => 'select', 'default' => '5000', 'options' => array('3000' => '3 seconds', '5000' => '5 seconds', '10000' => '10 seconds', '15000' => '15 seconds')), array('name' => 'splash_link', 'label' => __('Splash Link', 'zbopts'), 'desc' => __('(optional)<br/>If using Splash Screen to show advertising, provide target link here.<br/>URL should include http:// and domain name.', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'custom_explain', 'label' => 'About Custom Settings', 'type' => 'paragraph', 'desc' => __('
                		The settings above expect the theme to be using the most common element identifiers. 
                		However a theme designer might assign any ID or class name to a given element, in 
                		which case - if a selected layout option above is not working - you will need to look 
                		at the source code for the theme you are using and in the boxes below provide the correct IDs/class names 
                		so ZappBar can target them.<hr/>', 'zbotps')), array('name' => 'header_custom', 'label' => __('Header target', 'zbopts'), 'desc' => __('<br/>(optional) ID or class name of theme header element to hide (if set to hide).', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'nav_custom', 'label' => __('Navigation target', 'zbopts'), 'desc' => __('<br/>(optional) ID or class name of theme nav element to hide (if set to hide).', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'comment_custom', 'label' => __('Comment target', 'zbopts'), 'desc' => __('<br/>(optional) ID or class name of comment form element if you set it to convert to a panel and it is not doing so.', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'page_custom', 'label' => __('Page target', 'zbopts'), 'desc' => __('<br/>(optional) ID of main page container (but NOT &gt;body&lt; tag) to push over - if set to push over on App Panel open.', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'sidebars_custom', 'label' => __('Sidebar targets', 'zbopts'), 'desc' => __('<br/>(optional) Comma-separated list of element IDs/Classes to treat as sidebars (include "." if class or "#" if ID).', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'other_elements', 'label' => __('Always Hide', 'zbopts'), 'desc' => __('<br/>(optional) Comma-separated list of element IDs/Classes to hide when ZappBars are displayed, <em>even if the theme is already responsive</em> (include "." if class or "#" if ID)', 'zbopts'), 'type' => 'text', 'default' => '')), 'zappbar_social' => array(array('name' => 'social_explain', 'label' => 'About Meta Tags', 'type' => 'paragraph', 'desc' => __('
                		The following two items can inject &lt;meta&gt; tags for both Facebook and Twitter 
                		into the &lt;head&gt; of your site pages.  ZappBar injects content late so these 
                		may not work if your theme already has, or another plugin (such as Yoast SEO) injects 
                		&lt;meta&gt; for these earlier.', 'zbotps')), array('name' => 'fb_default_img', 'label' => __('Default Facebook Image', 'zbopts'), 'desc' => __('If the post has no "Featured Image" this image will be displayed as the thumbnail when somebody shares on Facebook.<br/>(If left blank ZappBar will not inject any Facebook &lt;meta&gt; tags).', 'zbopts'), 'type' => 'media', 'button' => __('Choose Image'), 'default' => ''), array('name' => 'twitter_id', 'label' => __('Twitter ID', 'zbopts'), 'desc' => __('<br/>Enter the @ Twitter ID associated with your blog (if you leave this blank no Twitter &lt;meta&gt; tags will be injected).', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'phone_number', 'label' => __('Phone Number', 'zbopts'), 'desc' => __('<br/>(optional) If you intend to link a ZappBar button to the "Phone" action this is the number that will be inserted into the on-screen notice box.', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'email_address', 'label' => __('E-Mail Address', 'zbopts'), 'desc' => __('<br/>(optional) If you wire a ZappBar button to "E-Mail Contact" this is the e-mail address to which the message will be sent<br/>
                	If you want people to email the site administrator set your button action to "E-Mail Admin" and it will use the address 
                	on the <em>Settings > General</em> page.', 'zbopts'), 'type' => 'text', 'default' => ''), array('name' => 'social_panel', 'label' => __('Social Media Panel', 'zbopts'), 'desc' => __('If you have linked a button to the social sharing panel this is where you can set which options appear in the panel.  You cannot
                    deselect all of them, however if you are usin site-specific social media buttons on your ZappBars this list is ignored.  It is also ignored by the shortcode since 
                    each instance can display a different list of sites.', 'zbopts'), 'type' => 'multicheck', 'default' => array('facebook' => 'facebook', 'twitter' => 'twitter', 'google' => 'google', 'reddit' => 'reddit', 'stumble' => 'stumble', 'digg' => 'digg', 'linkedin' => 'linkedin', 'pinterest' => 'pinterest', 'delicious' => 'delicious', 'rss' => 'rss', 'email' => 'email'), 'options' => array('facebook' => 'Facebook (facebook)', 'twitter' => 'Twitter (twitter)', 'google' => 'Google+ (googleplus)', 'reddit' => 'Reddit (reddit)', 'stumble' => 'StumbleUpon (stumbleupon)', 'digg' => 'Digg (digg)', 'linkedin' => 'LinkedIn (linkedin)', 'pinterest' => 'Pinterest (pinterest)', 'delicious' => 'Del.icio.us (delicious)', 'rss' => 'RSS Feed (rss)', 'email' => 'Share via E-Mail (email)')), array('name' => 'social_shortcode', 'label' => 'Social Shortcode', 'type' => 'paragraph', 'desc' => __('
                		There is also a <em><strong>[zb-share]</strong></em> shortcode available for dropping in social media links whereever you 
                		might need them.  This is really lightweight, does not cue any scripts or load remote IFRAME 
                		content.  The shortcode accepts the following (optional) parameters:<br/>
                		<ul style="padding: 0 40px;list-style: disc;">
                			<li><strong>type="text"</strong> (simple text-only links)</li>
                			<li><strong>type="label"</strong> (buttons with both a small icon and a text label.  This is the default if type is omitted)</li>
                			<li><strong>type="small"</strong>	(16x16 icons as buttons, spaced far enough apart to be clickable on mobile devices)</li>
                			<li><strong>type="medium"</strong> (24x24 icons as buttons)</li>
                			<li><strong>type="large"</strong>	(32x32 icons as buttons)</li>
                			<li><strong>include="twitter,linkedin..."</strong> a comma-separated list limiting which social media sites are included</li>
                			<li><strong>exclude="facebook,pinterest..."</strong> a comma-separated list of which social media sites to exclude</li>
                		</ul>
						The social shortcode will work even if the ZappBars are set to "Display on: None" under the Site settings.  The names to enter 
						in include/exclude lists are in parenthesis above in the Social Media Panel section.
                		', 'zbotps'))), 'zappbar_colors' => array(array('name' => 'color_src', 'label' => __('Styling Source', 'zbopts'), 'type' => 'radio', 'default' => 'basic', 'options' => array('basic' => 'Use ZappBar settings on this page', 'custom' => 'Use a CUSTOM stylesheet'), 'desc' => __('If you set this to "custom" enter the full path to your stylesheet below', 'zbopts')), array('name' => 'custom_styles', 'label' => __('Custom Stylesheet', 'zbopts'), 'desc' => __('<br/>URL should include http:// and domain name.', 'zbopts'), 'type' => 'text', 'defalt' => ''), array('name' => 'bar_bg', 'label' => __('Bar Background', 'zbopts'), 'type' => 'color', 'default' => '#ffffff'), array('name' => 'bar_bg_opacity', 'label' => __('Bar BG Opacity', 'zbopts'), 'desc' => __('(optional)', 'zbopts'), 'type' => 'number', 'default' => '1.0', 'class' => 'none', 'size' => '3', 'options' => array('min' => '0', 'max' => '1', 'step' => '0.1'), 'sanitize_callback' => 'floatval'), array('name' => 'button_bg', 'label' => __('Button Color', 'zbopts'), 'desc' => __('Background color of buttons', 'zbopts'), 'type' => 'color', 'default' => '#ffffff'), array('name' => 'button_bg_opacity', 'label' => __('Button BG Opacity', 'zbopts'), 'desc' => __('(optional)', 'zbopts'), 'type' => 'number', 'default' => '1.0', 'class' => 'none', 'size' => '3', 'options' => array('min' => '0', 'max' => '1', 'step' => '0.1'), 'sanitize_callback' => 'floatval'), array('name' => 'button_hover_bg', 'label' => __('Button Hover Color', 'zbopts'), 'desc' => __('When pointer hovers or touch device focuses on button.', 'zbopts'), 'type' => 'color', 'default' => '#cccccc'), array('name' => 'button_bg_hover_opacity', 'label' => __('Button Hover Opacity', 'zbopts'), 'desc' => __('(optional)', 'zbopts'), 'type' => 'number', 'default' => '1.0', 'class' => 'none', 'size' => '3', 'options' => array('min' => '0', 'max' => '1', 'step' => '0.1'), 'sanitize_callback' => 'floatval'), array('name' => 'font_color', 'label' => __('Font Color', 'zbopts'), 'desc' => __('', 'zbopts'), 'type' => 'color', 'default' => '#333333'), array('name' => 'font_hover_color', 'label' => __('Font Hover color', 'zbopts'), 'desc' => __('When pointer hovers or touch device focuses on button.', 'zbopts'), 'type' => 'color', 'default' => '#000000'), array('name' => 'bar_border_color', 'label' => __('Bar Border color', 'zbopts'), 'desc' => __('Color of the (optional) border under/over the top/bottom ZappBars.', 'zbopts'), 'type' => 'color', 'default' => '#000000'), array('name' => 'bar_border_style', 'label' => __('Bar Border Style', 'zbopts'), 'desc' => __('This border appears along the bottom of the top bar and top of the bottom bar.', 'zbopts'), 'type' => 'dropview', 'options' => array('none' => 'None', 'solid' => 'Solid', 'double' => 'Double', 'dashed' => 'Dashed', 'dotted' => 'Dotted', 'groove' => 'Grooved', 'ridge' => 'Ridged', 'inset' => 'Inset', 'outset' => 'Outset')), array('name' => 'bar_border_width', 'label' => __('Bar Border Width', 'zbopts'), 'desc' => __('This border appears along the bottom of the top bar and top of the bottom bar.', 'zbopts'), 'type' => 'dropview', 'options' => array('1px' => '1px', '2px' => '2px', '3px' => '3px', '4px' => '4px', '5px' => '5px', '6px' => '6px', '7px' => '7px', '8px' => '8px', '9px' => '9px', '10px' => '10px'))), 'zappbar_panels' => array(array('name' => 'panels_explain', 'label' => 'About Panel Settings', 'type' => 'paragraph', 'desc' => __('
                		If you have set a custom stylesheet on the "ZappBar Colors" tab everything on this tab will 
                		be ignored in favor of your custom stylesheet.  If you tick the "Use Bar Styles for Panels" 
                		checkbox below all the color and styles settings after it will be ignored in favor of the 
                		settings on the "ZappBar Colors" tab.', 'zbotps')), array('name' => 'panel_menu', 'label' => __('Menu Panel'), 'desc' => __('Layout of menu items in the Menu Panel.'), 'type' => 'radio', 'default' => '0', 'options' => array('0' => 'Indent sub-items', '-1' => 'Flatten List (no indents)', '1' => 'Show top-level (parent) items only')), array('name' => 'panel_tabs', 'label' => __('Sidebar Panels', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Overlay TABS to trigger left/right App Panel sidebars', 'no' => 'Do NOT overlay sidebar panel tabs'), 'desc' => __('If enabled two tabs will overlay your site, left and right, which can be used to show the left/right sidebar App Panels.', 'zbopts')), array('name' => 'panel_styles', 'label' => __('Use Bar styles for Panels'), 'desc' => __('Automatically applies the Bar styles to Panels <strong>(Ignores the settings below!)</strong>'), 'type' => 'checkbox', 'default' => 'on'), array('name' => 'panel_bg', 'label' => __('Panel Background', 'zbopts'), 'type' => 'color', 'default' => '#ffffff'), array('name' => 'panel_bg_opacity', 'label' => __('Panel BG Opacity', 'zbopts'), 'desc' => __('(optional)', 'zbopts'), 'type' => 'number', 'default' => '1.0', 'class' => 'none', 'size' => '3', 'options' => array('min' => '0', 'max' => '1', 'step' => '0.1'), 'sanitize_callback' => 'floatval'), array('name' => 'panel_button_bg', 'label' => __('Panel Button Color', 'zbopts'), 'desc' => __('Background color of panel buttons', 'zbopts'), 'type' => 'color', 'default' => '#ffffff'), array('name' => 'panel_button_bg_opacity', 'label' => __('Panel Button BG Opacity', 'zbopts'), 'desc' => __('(optional)', 'zbopts'), 'type' => 'number', 'default' => '1.0', 'class' => 'none', 'size' => '3', 'options' => array('min' => '0', 'max' => '1', 'step' => '0.1'), 'sanitize_callback' => 'floatval'), array('name' => 'panel_button_hover_bg', 'label' => __('Panel Button Hover Color', 'zbopts'), 'desc' => __('When pointer hovers or touch device focuses on button.', 'zbopts'), 'type' => 'color', 'default' => '#cccccc'), array('name' => 'panel_button_bg_hover_opacity', 'label' => __('Panel Button Hover Opacity', 'zbopts'), 'desc' => __('(optional)', 'zbopts'), 'type' => 'number', 'default' => '1.0', 'class' => 'none', 'size' => '3', 'options' => array('min' => '0', 'max' => '1', 'step' => '0.1'), 'sanitize_callback' => 'floatval'), array('name' => 'panel_font_color', 'label' => __('Panel Font Color', 'zbopts'), 'desc' => __('', 'zbopts'), 'type' => 'color', 'default' => '#333333'), array('name' => 'panel_font_hover_color', 'label' => __('Panel Font Hover color', 'zbopts'), 'desc' => __('When pointer hovers or touch device focuses on button.', 'zbopts'), 'type' => 'color', 'default' => '#000000'), array('name' => 'panel_border_color', 'label' => __('Panel Bar Border color', 'zbopts'), 'desc' => __('Color of the (optional) border under/over the top/bottom ZappBars.', 'zbopts'), 'type' => 'color', 'default' => '#000000'), array('name' => 'panel_border_style', 'label' => __('Panel Bar Border Style', 'zbopts'), 'desc' => __('This border appears along right side of panels on tablets and desktops', 'zbopts'), 'type' => 'dropview', 'options' => array('none' => 'None', 'solid' => 'Solid', 'double' => 'Double', 'dashed' => 'Dashed', 'dotted' => 'Dotted', 'groove' => 'Grooved', 'ridge' => 'Ridged', 'inset' => 'Inset', 'outset' => 'Outset')), array('name' => 'panel_border_width', 'label' => __('Panel Bar Border Width', 'zbopts'), 'desc' => __('This border appears along right side of panels on tablets and desktops.', 'zbopts'), 'type' => 'dropview', 'options' => array('1px' => '1px', '2px' => '2px', '3px' => '3px', '4px' => '4px', '5px' => '5px', '6px' => '6px', '7px' => '7px', '8px' => '8px', '9px' => '9px', '10px' => '10px'))), 'zappbar_layout' => array(array('name' => 'bar_explain', 'label' => 'Introduction', 'type' => 'paragraph', 'desc' => __('
                		The bars below are editable.<br/>Click on the top part of a button to set the icon, 
                		and on the bottom to edit the button label text.  Then set the action for each 
                		button below the bar.', 'zbotps')), array('name' => 'button_layout', 'label' => __('Button Layout', 'zbopts'), 'desc' => __('Determines how the buttons are positioned on the ZappBars', 'zbopts'), 'type' => 'radio', 'default' => 'spread', 'options' => array('spread' => '<img src="' . $plugin_dir_url . 'options/images/button_layouts-01.png" width="150" height="30" alt="Spread Out"/><br/>', 'pushout' => '<img src="' . $plugin_dir_url . 'options/images/button_layouts-02.png"  width="150" height="30" alt="Push Out"/><br/>', 'clusterleft1r' => '<img src="' . $plugin_dir_url . 'options/images/button_layouts-03.png"  width="150" height="30" alt="Cluster Left, One Right"/><br/>', 'clusterleft' => '<img src="' . $plugin_dir_url . 'options/images/button_layouts-04.png"  width="150" height="30" alt="Cluster Left"/><br/>', 'clusterright1l' => '<img src="' . $plugin_dir_url . 'options/images/button_layouts-05.png"  width="150" height="30" alt="Cluster Right, One Left"/><br/>', 'clusterright' => '<img src="' . $plugin_dir_url . 'options/images/button_layouts-06.png"  width="150" height="30" alt="Cluster Right"/>')), array('name' => 'search_button', 'label' => __('ZappBar Search Box', 'zbopts'), 'desc' => __('Hide "Search" button (form submits on Enter/Return)', 'zbopts'), 'default' => 'on', 'type' => 'checkbox'), array('name' => 'logo', 'label' => __('Logo Icon', 'zbopts'), 'desc' => __('(optional) Select an image to be your logo icon, then set one of the buttons below to "logo" to display it.', 'zbopts'), 'type' => 'media', 'button' => __('Choose Logo'), 'default' => ''), array('name' => 'default_top', 'label' => __('Default Top ZappBar', 'zbopts'), 'type' => 'appbar', 'default' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-search', 'Search', 'search_right'))), array('name' => 'default_bottom', 'label' => __('Default Bottom ZappBar', 'zbopts'), 'type' => 'appbar', 'class' => 'bottom', 'default' => array(array('dashicons|dashicons-wordpress', 'Blog', 'blogposts'), array('dashicons|dashicons-info', 'About', ''), array('dashicons|dashicons-admin-comments', 'Comment', 'commentform'), array('dashicons|dashicons-edit', 'Contact', 'mailto:' . get_bloginfo('admin_email')), array('dashicons|dashicons-share', 'Share', 'share_this'))), array('name' => 'use_archive_top_bar', 'label' => __('Top Archive ZappBar', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Use Archive top bar on archive pages', 'no' => 'Use Default top bar on archive pages')), array('name' => 'archive_top_bar', 'label' => __('Archive Top ZappBar', 'zbopts'), 'desc' => __('Used on archive pages of any kind.', 'zbopts'), 'type' => 'appbar', 'class' => 'top', 'default' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-search', 'Search', 'search_right'))), array('name' => 'use_archive_bottom_bar', 'label' => __('Bottom Archive ZappBar', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Use Archive bottom bar on archive pages', 'no' => 'Use Default bottom bar on archive pages')), array('name' => 'archive_bottom_bar', 'label' => __('Archive Bottom ZappBar', 'zbopts'), 'desc' => __('Used on archive pages of any kind.', 'zbopts'), 'type' => 'appbar', 'class' => 'bottom', 'default' => array(array('dashicons|dashicons-arrow-left-alt', 'First', 'first_page'), array('dashicons|dashicons-arrow-left-alt2', 'Previous', 'prev_page'), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-arrow-right-alt2', 'Next', 'next_page'), array('dashicons|dashicons-arrow-right-alt', 'Last', 'last_page')))));
            if (function_exists('ceo_pluginfo') || function_exists('comicpress_themeinfo') || class_exists('Webcomic')) {
                // Detect if any web comics plugins/themes are in use, if so add this bar option
                $settings_fields['zappbar_site'][] = array('name' => 'comic_nav', 'label' => __('Comic Navigation', 'zbopts'), 'desc' => __('Hide Comic Naviation Footer when ZappBars are displayed.', 'zbopts'), 'type' => 'checkbox', 'default' => 'on');
                $settings_fields['zappbar_layout'][] = array('name' => 'comic_explain', 'label' => 'Web comics', 'type' => 'paragraph', 'desc' => __('
                		If you are using the ComicPress theme, Comic Easel plugin, or Webcomic plugin the bars 
                		below can be shown on pages displaying single comic posts.', 'zbotps'));
                $settings_fields['zappbar_layout'][] = array('name' => 'use_comic_top_bar', 'label' => __('Top Comic ZappBar', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Use Comic top bar on comics pages', 'no' => 'Use Default top bar on comics pages'));
                $settings_fields['zappbar_layout'][] = array('name' => 'comic_top_bar', 'label' => __('Comic Top ZappBar', 'zbopts'), 'desc' => __('Used on single pages with comics posts.', 'zbopts'), 'type' => 'appbar', 'class' => 'top', 'default' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('fa|fa-angle-double-left', 'Prev Chap', 'prev_comic'), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('fa|fa-angle-double-right', 'Next chap', 'next_comic'), array('dashicons|dashicons-images-alt2', 'Archive', 'comic_archive')));
                $settings_fields['zappbar_layout'][] = array('name' => 'use_comic_bottom_bar', 'label' => __('Bottom Comic ZappBar', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Use Comic bottom bar on comics pages', 'no' => 'Use Default bottom bar on comics pages'));
                $settings_fields['zappbar_layout'][] = array('name' => 'comic_bottom_bar', 'label' => __('Comic Bottom ZappBar', 'zbopts'), 'desc' => __('Used on single pages with comics posts.', 'zbopts'), 'type' => 'appbar', 'class' => 'bottom', 'default' => array(array('dashicons|dashicons-arrow-left-alt', 'First', 'first_comic'), array('dashicons|dashicons-arrow-left-alt2', 'Previous', 'prev_comic'), array('dashicons|dashicons-admin-comments', 'Comment', 'commentform'), array('dashicons|dashicons-arrow-right-alt2', 'Next', 'next_comic'), array('dashicons|dashicons-arrow-right-alt', 'Last', 'last_comic')));
            }
            if (class_exists('woocommerce')) {
                // Detect if Woocommerce is activated and add custom bar options
                $settings_fields['zappbar_layout'][] = array('name' => 'woo_explain', 'label' => 'WooCommerce', 'type' => 'paragraph', 'desc' => __('
                		If you are using the WooCommerce plugin the bars below can be customized 
                		for use on e-commerce related pages of your site.', 'zbotps'));
                $settings_fields['zappbar_layout'][] = array('name' => 'use_woo_top_bar', 'label' => __('Top Woocommerce ZappBar', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Use WooCommerce top bar on store pages', 'no' => 'Use Default top bar on store pages'));
                $settings_fields['zappbar_layout'][] = array('name' => 'woo_top_bar', 'label' => __('WooCommerce Top ZappBar', 'zbopts'), 'desc' => __('Used on WooCommerce single product pages.', 'zbopts'), 'type' => 'appbar', 'class' => 'top', 'default' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('dashicons|dashicons-cart', 'Cart', 'woo_cart'), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('dashicons|dashicons-admin-users', 'Account', 'woo_account'), array('dashicons|dashicons-search', 'Search', 'woo_search_right')));
                $settings_fields['zappbar_layout'][] = array('name' => 'use_woo_bottom_bar', 'label' => __('Bottom WooCommerce ZappBar', 'zbopts'), 'type' => 'radio', 'default' => 'yes', 'options' => array('yes' => 'Use WooCommerce bottom bar on store pages', 'no' => 'Use Default bottom bar on store pages'));
                $settings_fields['zappbar_layout'][] = array('name' => 'woo_bottom_bar', 'label' => __('WooCommerce Bottom ZappBar', 'zbopts'), 'desc' => __('Used on WooCommerce single product pages.', 'zbopts'), 'type' => 'appbar', 'class' => 'bottom', 'default' => array(array('dashicons|dashicons-products', 'Store', 'woo_store'), array('dashicons|dashicons-tag', 'Info', 'woo_desc'), array('dashicons|dashicons-star-filled', 'Reviews', 'woo_review'), array('fa|fa-tags', 'More Info', 'woo_addl'), array('dashicons|dashicons-share', 'Share', 'share_this')));
                $settings_fields['zappbar_site'][] = array('name' => 'alter_woo_theme', 'label' => __('WooCommerce Site', 'zbopts'), 'desc' => __('Select which WooCommerce features to alter.', 'zbopts'), 'type' => 'multicheck', 'default' => array('woo_reviews' => 'woo_reviews', 'woo_desc' => 'woo_desc', 'woo_addl' => 'woo_addl'), 'options' => array('woo_reviews' => 'Convert Woo Reviews to App Panel', 'woo_desc' => 'Convert Woo Product Description to App Panel', 'woo_addl' => 'Convert Woo Additional Product Info to App Panel'));
            }
            return $settings_fields;
        }