Exemplo n.º 1
0
 /**
  * Adds options to print at the frontend.
  * 
  * @since 1.0.0
  */
 function opanda_signin_locker_options($options, $id)
 {
     $options['terms'] = opanda_terms_url();
     $options['privacyPolicy'] = opanda_privacy_policy_url();
     if (!get_option('opanda_terms_use_pages', false)) {
         $options['termsPopup'] = array('width' => 570, 'height' => 400);
     }
     $options['theme'] = 'great-attractor';
     $actions = explode(',', opanda_get_item_option($id, 'connect_buttons'));
     $hasEmailForm = in_array('email', $actions);
     if ($hasEmailForm) {
         $emailFormIndex = array_search('email', $actions);
         unset($actions[$emailFormIndex]);
     }
     $options['groups'] = $hasEmailForm ? array('connect-buttons', 'subscription') : array('connect-buttons');
     // connect buttons
     $options['connectButtons'] = array();
     $options['connectButtons']['order'] = $actions;
     if (in_array('facebook', $actions)) {
         $options['connectButtons']['facebook'] = array('actions' => opanda_signin_locker_get_actions($id, 'facebook_actions'), 'appId' => opanda_get_option('facebook_appid'));
     }
     if (in_array('twitter', $actions)) {
         $options['connectButtons']['twitter'] = array('actions' => opanda_signin_locker_get_actions($id, 'twitter_actions'), 'follow' => array('user' => opanda_get_item_option($id, 'twitter_follow_user'), 'notifications' => opanda_get_item_option($id, 'twitter_follow_notifications')), 'tweet' => array('message' => opanda_get_item_option($id, 'twitter_tweet_message')));
     }
     if (in_array('google', $actions)) {
         $options['connectButtons']['google'] = array('actions' => opanda_signin_locker_get_actions($id, 'google_actions'), 'clientId' => opanda_get_option('google_client_id'), 'youtubeSubscribe' => array('channelId' => opanda_get_item_option($id, 'google_youtube_channel_id')));
     }
     if (in_array('linkedin', $actions)) {
         $linkedInActions = opanda_signin_locker_get_actions($id, 'linkedin_actions');
         if (($key = array_search('follow', $linkedInActions)) !== false) {
             unset($linkedInActions[$key]);
         }
         $options['connectButtons']['linkedin'] = array('actions' => $linkedInActions, 'apiKey' => opanda_get_option('linkedin_api_key'));
     }
     // subscription options
     if ($hasEmailForm) {
         $options['subscription'] = array();
         $options['subscription']['text'] = opanda_get_item_option($id, 'subscribe_before_form', false);
         $options['subscription']['form'] = array('actions' => opanda_signin_locker_get_actions($id, 'email_actions'), 'buttonText' => opanda_get_item_option($id, 'subscribe_button_text', false), 'noSpamText' => opanda_get_item_option($id, 'subscribe_after_button', false), 'type' => opanda_get_item_option($id, 'subscribe_name') ? 'name-email-form' : 'email-form');
     }
     $optinMode = opanda_get_item_option($id, 'subscribe_mode');
     $service = opanda_get_option('subscription_service', 'database');
     $listId = 'database' === $service ? 'default' : opanda_get_item_option($id, 'subscribe_list', false);
     $options['subscribeActionOptions'] = array('listId' => $listId, 'service' => $service, 'doubleOptin' => in_array($optinMode, array('quick-double-optin', 'double-optin')), 'confirm' => in_array($optinMode, array('double-optin')));
     return $options;
 }
Exemplo n.º 2
0
?>
</p>
                </td>
            </tr>
            <tr>
                <td class="onp-title"><?php 
_e('Terms of Service URL', 'bizpanda');
?>
</td>
                <td>
                    <p><?php 
_e('Recommended to set it in order to make the work of the plugin transparent for the users. While the plugin activation, we created one for you:', 'bizpanda');
?>
</p>
                    <p><i><?php 
echo opanda_terms_url();
?>
</i></p>
                    <p><?php 
_e('You can change it or create your own one.', 'bizpanda');
?>
</p>
                </td>
            </tr>
        </tbody>
    </table>
</div>

<div class="onp-help-section">
    <p><?php 
_e('6. In the sidebar on the left, select "APIs" and enable the following APIs:', 'bizpanda');
Exemplo n.º 3
0
    /**
     * 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 
    }