/** * Renders content of the metabox. * * @see FactoryMetaboxes321_Metabox * @since 1.0.0 * * @return void */ public function html() { global $bizpanda; $query_string = '?action=onp_sl_preview'; $query_string = apply_filters('opanda_preview_url', $query_string); $extra_data = array('data-lang' => get_option('opanda_lang'), 'data-short-lang' => get_option('opanda_short_lang'), 'data-facebook-appid' => get_option('opanda_facebook_appid'), 'data-facebook-version' => get_option('opanda_facebook_version', 'v1.0')); $extra_data['data-vk-appid'] = get_option('opanda_vk_appid'); $extra_data['data-url'] = admin_url('admin-ajax.php') . $query_string; $extra_data = apply_filters('onp_sl_preview_data_wrap', $extra_data); $dataPrint = sizeof($extra_data) ? ' ' : ''; foreach ($extra_data as $key => $val) { $dataPrint .= $key . '="' . $val . '" '; } $dataPrint = rtrim($dataPrint, ' '); $showStyleRollerOffer = BizPanda::isSinglePlugin() && BizPanda::hasPlugin('sociallocker'); ?> <script> function onp_sl_update_preview_height(height) { jQuery("#lock-preview-wrap iframe").height(height); } var pluginName = '<?php echo $bizpanda->pluginName; ?> '; window.opanda_proxy_url = '<?php echo opanda_proxy_url(); ?> ' window.opanda_facebook_app_id = '<?php echo get_option('opanda_facebook_appid'); ?> '; window.opanda_google_client_id = '<?php echo get_option('opanda_google_client_id'); ?> '; window.opanda_linkedin_api_key = '<?php echo get_option('opanda_linkedin_api_key'); ?> '; window.opanda_terms = '<?php echo opanda_terms_url(); ?> '; window.opanda_privacy_policy = '<?php echo opanda_privacy_policy_url(); ?> '; window.opanda_subscription_service_name = '<?php echo get_option('opanda_subscription_service', 'none'); ?> '; <?php if (defined('ONP_OP_STYLER_PLUGIN_ACTIVE')) { ?> window.onp_sl_styleroller = true; <?php } else { ?> window.onp_sl_styleroller = false; window.onp_sl_styleroller_offer_text = '<?php _e('Want more themes?', 'bizpanda'); ?> '; window.onp_sl_styleroller_offer_url = '<?php echo $bizpanda->options['styleroller']; ?> '; <?php } ?> <?php if ($showStyleRollerOffer) { ?> window.onp_sl_show_styleroller_offer = true; <?php } else { ?> window.onp_sl_show_styleroller_offer = false; <?php } ?> </script> <p class="note"><strong><?php _e('Note', 'bizpanda'); ?> :</strong> <?php _e('In the preview mode, some features of the locker may not work properly.', 'bizpanda'); ?> </p> <div id="lock-preview-wrap"<?php echo $dataPrint; ?> > <iframe allowtransparency="1" frameborder="0" hspace="0" marginheight="0" marginwidth="0" name="preview" vspace="0" width="100%"> <?php _e('Your browser doen\'t support the iframe tag.', 'bizpanda'); ?> </iframe> </div> <?php }
/** * Returns base options for all Panda Items. * * @since 1.0.0 */ public static function getBaseOptions($id) { $hasScope = get_option('opanda_interrelation', false); $params = array('demo' => self::getLockerOption($id, 'always', false, false), 'actualUrls' => get_option('opanda_actual_urls', false), 'text' => array('header' => self::getLockerOption($id, 'header'), 'message' => self::getLockerOption($id, 'message')), 'theme' => self::getLockerOption($id, 'style'), 'lang' => get_option('opanda_lang', 'en_US'), 'overlap' => array('mode' => self::getLockerOption($id, 'overlap', false, 'full'), 'position' => self::getLockerOption($id, 'overlap_position', false, 'middle'), 'altMode' => get_option('opanda_alt_overlap_mode', 'transparence')), 'highlight' => self::getLockerOption($id, 'highlight'), 'googleAnalytics' => get_option('opanda_google_analytics', 1), 'locker' => array('scope' => $hasScope ? 'global' : '', 'counter' => self::getLockerOption($id, 'show_counters', false, 1), 'loadingTimeout' => get_option('opanda_timeout', 20000), 'tumbler' => get_option('opanda_tumbler', false), 'naMode' => get_option('opanda_na_mode', 'show-error'))); if ('blurring' === $params['overlap']['mode']) { $options['overlap']['mode'] = 'transparence'; } $params['proxy'] = opanda_proxy_url(); // - Replaces shortcodes in the locker message global $post; $postTitle = $post != null ? $post->post_title : ''; $postUrl = $post != null ? get_permalink($post->ID) : ''; if (!empty($params['text']['message'])) { $params['text']['message'] = str_replace('[post_title]', $postTitle, $params['text']['message']); $params['text']['message'] = str_replace('[post_url]', $postUrl, $params['text']['message']); } return $params; }
/** * Returns the connect handler options. * * @since 1.0.0 */ function opanda_get_handler_options($handlerName) { switch ($handlerName) { case 'twitter': $consumerKey = 'Fr5DrCse2hsNp5odQdJOexOOA'; $consumerSecret = 'jzNmDGYPZOGV10x2HmN8tYMDqnMTowycXFu4xTTLbw3VBVeFKm'; $optDefaultKeys = get_option('opanda_twitter_use_dev_keys', 'default'); if ('default' !== $optDefaultKeys) { $consumerKey = get_option('opanda_twitter_consumer_key'); $consumerSecret = get_option('opanda_twitter_consumer_secret'); } return array('consumer_key' => $consumerKey, 'consumer_secret' => $consumerSecret, 'proxy' => opanda_proxy_url()); case 'subscription': return array('service' => get_option('opanda_subscription_service', 'database')); case 'signup': return array('mode' => get_option('opanda_signup_mode', 'hidden')); } }