function bizpanda_compability_note()
 {
     $count = 0;
     if (method_exists('BizPanda', 'getInstalledPlugins')) {
         $plugins = BizPanda::getInstalledPlugins();
         $count = count($plugins);
         $titles = array();
         foreach ($plugins as $plugin) {
             $titles[] = $plugin['plugin']->options['title'];
         }
         $titles = implode(',', $titles);
     } else {
         $count = 1;
         if (BizPanda::hasPlugin('optinpanda')) {
             $titles = 'Opt-In Panda';
         } else {
             $titles = 'Social Locker';
         }
     }
     global $bizpanda_issue_plugin;
     echo '<div id="message" class="error" style="padding: 10px;">';
     if ($count > 1) {
         printf(__('Unable to activate <strong>%s</strong>. Please make sure that the following plugins are updated to the latest versions: <strong>%s</strong>. Deactivate %s and try to update the specified plugins.'), $bizpanda_issue_plugin, $titles, $bizpanda_issue_plugin);
     } else {
         printf(__('Unable to activate <strong>%s</strong>. Please make sure that the following plugin is updated to the latest version: <strong>%s</strong>. Deactivate %s and try to update the specified plugin.'), $bizpanda_issue_plugin, $titles, $bizpanda_issue_plugin);
     }
     echo '</div>';
 }
예제 #2
0
 public function getFields()
 {
     $fields = array();
     $fields['aggregate_date'] = array('title' => __('Date'));
     if (BizPanda::hasPlugin('optinpanda')) {
         $fields['got-twitter-follower'] = array('title' => __('Emails', 'signinlocker'), 'color' => '#FFCC66');
     }
     $fields['account-registered'] = array('title' => __('Accounts', 'signinlocker'), 'color' => '#336699');
     if (BizPanda::hasPlugin('sociallocker')) {
         $fields['got-twitter-follower'] = array('title' => __('Twitter Tweets', 'signinlocker'), 'color' => '#3bb4ea');
         $fields['tweet-posted'] = array('title' => __('Twitter Followers', 'signinlocker'), 'color' => '#1e92c9');
         $fields['got-youtube-subscriber'] = array('title' => __('Youtube Subscribers', 'signinlocker'), 'color' => '#ba5145');
         $fields['got-linkedin-follower'] = array('title' => __('LinkedIn Followers', 'signinlocker'), 'color' => '#006080');
     }
     return $fields;
 }
 /**
  * Returns options for the Basic Settings screen. 
  * 
  * @since 1.0.0
  * @return void
  */
 public function getOptions()
 {
     global $optinpanda;
     $options = array();
     $pages = get_pages();
     $result = array();
     $result[] = array('0', '- none -');
     foreach ($pages as $page) {
         $result[] = array($page->ID, $page->post_title . ' [ID=' . $page->ID . ']');
     }
     $confirmScreenOptions = array('type' => 'form-group', 'title' => 'The Screen "Please Confirm Your Email"', 'hint' => __('Appears when the locker asks the user to confirm one\'s email.', 'bizpanda'), 'items' => array(array('type' => 'textbox', 'name' => 'res_confirm_screen_title', 'title' => __('Header', 'bizpanda'), 'default' => __('Please Confirm Your Email', 'bizpanda')), array('type' => 'textarea', 'name' => 'res_confirm_screen_instructiont', 'title' => __('Instruction', 'bizpanda'), 'hint' => __('Explain here that the user has to do to confirm one\'s email. Use the tag {email} to display an email address of the user.', 'bizpanda'), 'default' => __('We have sent a confirmation email to {email}. Please click on the confirmation link in the email to reveal the content.', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_confirm_screen_note1', 'title' => __('Note #1', 'bizpanda'), 'hint' => __('Clarify when the content will be unlocked.', 'bizpanda'), 'default' => __('The content will be unlocked automatically within 10 seconds after confirmation.', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_confirm_screen_note2', 'title' => __('Note #2', 'bizpanda'), 'hint' => __('Clarify that delivering the confirmation email may take some time.', 'bizpanda'), 'default' => __('Note delivering the email may take several minutes.', 'bizpanda')), array('type' => 'separator'), array('type' => 'textbox', 'name' => 'res_confirm_screen_cancel', 'title' => __('Cancel Link', 'bizpanda'), 'default' => __('(cancel)', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_confirm_screen_open', 'title' => __('Open My Inbox Button', 'bizpanda'), 'default' => __('Open my inbox on {service}', 'bizpanda'), 'hint' => __('Use the tag {service} to display a name of a mailbox of the user.', 'bizpanda'), 'cssClass' => 'opanda-width-short')));
     $onestepScreenOptions = array('type' => 'form-group', 'title' => 'The Screen "One Step To Complete"', 'hint' => __('Appears when a social network does not return an email address and the locker asks the users to enter it manually.', 'bizpanda'), 'items' => array(array('type' => 'textbox', 'name' => 'res_onestep_screen_title', 'title' => __('Header', 'bizpanda'), 'default' => __('One Step To Complete', 'bizpanda')), array('type' => 'textarea', 'name' => 'res_onestep_screen_instructiont', 'title' => __('Instruction', 'bizpanda'), 'default' => __('Please enter your email below to continue.', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_onestep_screen_button', 'title' => __('Button', 'bizpanda'), 'default' => __('OK, complete', 'bizpanda'))));
     $signinOptions = array();
     if (BizPanda::hasFeature('signin-locker')) {
         $signinOptions = array('type' => 'form-group', 'title' => __('Sign-In Buttons', 'bizpanda'), 'hint' => __('The text which are located on the Sign-In Buttons.', 'bizpanda'), 'items' => array(array('type' => 'textbox', 'name' => 'res_signin_long', 'title' => __('Long Text', 'bizpanda'), 'hint' => __('Displayed on a wide Sign-In Button', 'bizpanda'), 'default' => __('Sign in via {name}', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_signin_short', 'title' => __('Short Text', 'bizpanda'), 'hint' => __('Displayed on a narrow Sign-In Button', 'bizpanda'), 'default' => __('via {name}', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'separator'), array('type' => 'textbox', 'name' => 'res_signin_facebook_name', 'title' => __('Facebook', 'bizpanda'), 'default' => __('Facebook', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_signin_twitter_name', 'title' => __('Twitter', 'bizpanda'), 'default' => __('Twitter', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_signin_google_name', 'title' => __('Google', 'bizpanda'), 'default' => __('Google', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_signin_linkedin_name', 'title' => __('LinkedIn', 'bizpanda'), 'default' => __('LinkedIn', 'bizpanda'), 'cssClass' => 'opanda-width-short')));
     }
     $miscOptions = array('type' => 'form-group', 'title' => 'Miscellaneous', 'hint' => __('Various text used usually with all lockers and screens.', 'bizpanda'), 'items' => array(array('type' => 'textbox', 'name' => 'res_misc_data_processing', 'title' => __('Processing Data', 'bizpanda'), 'default' => __('Processing data, please wait...', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_misc_or_enter_email', 'title' => __('Enter Your Email Manually', 'bizpanda'), 'default' => __('or enter your email manually to sign in', 'bizpanda')), array('type' => 'separator'), 'res_misc_enter_your_name' => array('type' => 'textbox', 'name' => 'res_misc_enter_your_name', 'title' => __('Enter Your Name', 'bizpanda'), 'default' => __('enter your name', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_misc_enter_your_email', 'title' => __('Enter Your Email Address', 'bizpanda'), 'default' => __('enter your email address', 'bizpanda')), array('type' => 'separator'), array('type' => 'textbox', 'name' => 'res_misc_your_agree_with', 'title' => __('You Agree With', 'bizpanda'), 'hint' => __('Use the tag {links} to display the links to the Terms Of Use and Privacy Policy.', 'bizpanda'), 'default' => __('By clicking on the button(s), you agree with {links}', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_misc_terms_of_use', 'title' => __('Terms Of Use', 'bizpanda'), 'default' => __('Terms of Use', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_misc_privacy_policy', 'title' => __('Privacy Policy', 'bizpanda'), 'default' => __('Privacy Policy', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'separator'), array('type' => 'textbox', 'name' => 'res_misc_or_wait', 'title' => __('Or Wait', 'bizpanda'), 'default' => __('or wait {timer}s', 'bizpanda'), 'hint' => __('Use the tag {timer} to display the number of seconds remaining to unlocking.'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_misc_close', 'title' => __('Close', 'bizpanda'), 'default' => __('close', 'bizpanda'), 'cssClass' => 'opanda-width-short'), array('type' => 'textbox', 'name' => 'res_misc_or', 'title' => __('Or', 'bizpanda'), 'default' => __('OR', 'bizpanda'), 'cssClass' => 'opanda-width-short')));
     if (!BizPanda::hasPlugin('optinpanda')) {
         unset($miscOptions['items']['res_misc_enter_your_name']);
     }
     $errosOptions = array('type' => 'form-group', 'title' => __('Errors & Notices', 'bizpanda'), 'hint' => __('The text which users see when something goes wrong.', 'bizpanda'), 'items' => array(array('type' => 'textbox', 'name' => 'res_errors_empty_email', 'title' => __('Empty Email', 'bizpanda'), 'default' => __('Please enter your email address.', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_errors_inorrect_email', 'title' => __('Incorrect Email', 'bizpanda'), 'default' => __('It seems you entered an incorrect email address. Please check it.', 'bizpanda')), array('type' => 'textbox', 'name' => 'res_errors_empty_name', 'title' => __('Empty Name', 'bizpanda'), 'default' => __('Please enter your name.', 'bizpanda')), array('type' => 'separator'), 'res_errors_subscription_canceled' => array('type' => 'textbox', 'name' => 'res_errors_subscription_canceled', 'title' => __('Subscription Canceled', 'bizpanda'), 'default' => __('You have canceled your subscription.', 'bizpanda')), 'res_errors_not_signed_in' => array('type' => 'textbox', 'name' => 'res_errors_not_signed_in', 'title' => __('Not Signed In', 'bizpanda'), 'default' => __('Sorry, but you have not signed in. Please try again.', 'bizpanda')), 'res_errors_not_granted' => array('type' => 'textbox', 'name' => 'res_errors_not_granted', 'title' => __('Not Granted Permissions', 'bizpanda'), 'hint' => __('Use the tag {permissions} to show required permissions.'), 'default' => __('Sorry, but you have not granted all the required permissions ({permissions}). Please try again.', 'bizpanda'))));
     if (!BizPanda::hasFeature('signin-locker')) {
         unset($errosOptions['items']['res_errors_not_signed_in']);
         unset($errosOptions['items']['res_errors_not_granted']);
     }
     if (!BizPanda::hasPlugin('optinpanda')) {
         unset($errosOptions['items']['res_errors_subscription_canceled']);
     }
     $options = array();
     if (BizPanda::hasPlugin('optinpanda')) {
         $options[] = $confirmScreenOptions;
         if (!empty($signinOptions)) {
             $options[] = $signinOptions;
         }
         $options[] = $miscOptions;
     } else {
         if (!empty($signinOptions)) {
             $options[] = $signinOptions;
         }
         $options[] = $miscOptions;
     }
     $options[] = $onestepScreenOptions;
     $options[] = $errosOptions;
     $options[] = array('type' => 'separator');
     return $options;
 }
예제 #4
0
 /**
  * A page to edit the Advanced Options.
  * 
  * @since v3.7.2
  * @return vod
  */
 public function getOptions()
 {
     global $optinpanda;
     $forms = array();
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'debug', 'title' => __('Debug', 'bizpanda'), 'hint' => __('If this option turned on, the plugin displays information about why the locker is not visible.', 'bizpanda'));
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'textbox', 'name' => 'passcode', 'title' => __('Pass Code', 'bizpanda'), 'hint' => sprintf(__('Optional. When the pass code is contained in your website URL, the locked content gets automatically unlocked.<br/><div class="opanda-example"><strong>Usage example:</strong> <a href="#" class="opanda-url" target="_blank">%s<span class="opanda-passcode"></span></a></div>', 'bizpanda'), site_url()), 'default' => false);
     $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'permanent_passcode', 'title' => __('Permanent Unlock<br /> For Pass Code', 'bizpanda'), 'hint' => __('Optional. If On, your lockers will be revealed forever if the user once opened the page URL with the Pass Code.<br />Otherwise your lockers will be unlocked only when the page URL contains the Pass Code.', 'bizpanda'), 'default' => false);
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'textbox', 'name' => 'session_duration', 'title' => __('Session Duration<br />(in secs)', 'bizpanda'), 'hint' => __('Optional. The session duration used in the advanced Visiblity Options. The default value 900 seconds (15 minutes).', 'bizpanda'), 'default' => 900);
     $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'session_freezing', 'title' => __('Session Freezing', 'bizpanda'), 'hint' => __('Optional. If On, the length of users\' sessions is fixed, by default the sessions are prolonged automatically every time when a user visits your website for a specified value of the session duration.', 'bizpanda'), 'default' => false);
     if (BizPanda::hasPlugin('sociallocker')) {
         $forms[] = array('type' => 'separator');
         $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'interrelation', 'title' => __('Interrelation', 'bizpanda'), 'hint' => __('Set On to make lockers interrelated. When one of the interrelated lockers are unlocked on your site, the others will be unlocked too.<br /> Recommended to turn on, if you use the Batch Locking feature.', 'bizpanda'), 'default' => false);
     }
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'rss', 'title' => __('Locked content<br /> is visible in RSS feeds', 'bizpanda'), 'hint' => __('Set On to make locked content visible in RSS feed.', 'bizpanda'), 'default' => false);
     if (BizPanda::hasPlugin('sociallocker')) {
         $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'actual_urls', 'title' => __('Actual URLs by default', 'bizpanda'), 'hint' => __('Optional. If you do not set explicitly URLs to like/share in the settings of social buttons, then by default the plugin will use an URL of the page where the locker is located. Turn on this option to extract URLs to like/share from an address bar of the user browser, saving all query arguments. By default (when this option disabled) permalinks are used.', 'bizpanda'), 'default' => false);
     }
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'html', 'html' => '<div class="col-md-offset-2" style="padding: 30px 0 10px 0;">' . '<strong style="font-size: 15px;">' . __('Advanced Options', 'bizpanda') . '</strong>' . '<p>' . __('Please don\'t change these options if everything works properly.', 'bizpanda') . '</p>' . '</div>');
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'normalize_markup', 'title' => __('Normalize Markup', 'bizpanda'), 'hint' => __('Optional. If you use the Batch Lock and the locker appears incorrectly, probably HTML markup of your page is broken. Try to turn on this option and the plugin will try to normalize html markup before output.', 'bizpanda'));
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'dynamic_theme', 'title' => __('I use a dynamic theme', 'bizpanda'), 'hint' => __('If your theme loads pages dynamically via ajax, set "On" to get the lockers working (if everything works properly, don\'t turn on this option).', 'bizpanda'));
     $forms[] = array('type' => 'textbox', 'way' => 'buttons', 'name' => 'managed_hook', 'title' => __('Creater Trigger', 'bizpanda'), 'hint' => __('Optional. Set any jQuery trigger bound to the root document to create lockers. By default lockers are created on loading a page.', 'bizpanda'));
     $forms[] = array('type' => 'separator');
     $forms[] = array('type' => 'dropdown', 'name' => 'alt_overlap_mode', 'data' => array(array('full', __('Classic (full)', 'bizpanda')), array('transparence', __('Transparency', 'bizpanda'))), 'default' => 'transparence', 'title' => __('Alt Overlap Mode', 'bizpanda'), 'hint' => __('This overlap mode will be applied for browsers which don\'t support the blurring effect.', 'bizpanda'));
     if (BizPanda::hasPlugin('sociallocker')) {
         $forms[] = array('type' => 'separator');
         $forms[] = array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'tumbler', 'title' => __('Anti-Cheating', 'bizpanda'), 'default' => false, 'hint' => __('Turn it on to protect your locked content against cheating from visitors. Some special browser extensions allow to view the locked content without actual sharing. This option checks whether the user has really liked/shared your page. In future versions of the plugin, we will make this option active by default.', 'bizpanda'));
         $forms[] = array('type' => 'textbox', 'name' => 'timeout', 'title' => __('Timeout of waiting<br />loading the locker (in ms)', 'bizpanda'), 'default' => '20000', 'hint' => __('The use can have browser extensions which block loading scripts from social networks. If the social buttons have not been loaded within the specified timeout, the locker shows the error (in the red container) alerting about that a browser blocks loading of the social buttons.<br />', 'bizpanda'));
     }
     $forms[] = array('type' => 'separator');
     return $forms;
 }
예제 #5
0
     $options['icon'] = 'opanda-bizpanda-vc-icon';
     $options['name'] = __('Email Locker', 'bizpanda');
     $options['base'] = 'emaillocker';
     $options['description'] = __('Adds one of existing Email Lockers.', 'bizpanda');
     $lockers = get_transient('opanda_vc_email_lockers');
     if (false === $lockers) {
         $lockers = opanda_get_lockers('email-locker', 'vc');
         set_transient('opanda_vc_email_lockers', $lockers, 60 * 60 * 24);
     }
     $options['params'][0]['value'] = $lockers;
     vc_map($options);
 }
 if (BizPanda::isSinglePlugin() && BizPanda::hasPlugin('sociallocker')) {
     $options['category'] = __('Social Locker', 'bizpanda');
     $options['icon'] = 'opanda-social-locker-vc-icon';
 } elseif (BizPanda::isSinglePlugin() && BizPanda::hasPlugin('optinpanda')) {
     $options['category'] = __('Opt-In Panda', 'bizpanda');
     $options['icon'] = 'opanda-bizpanda-vc-icon';
 } else {
     $options['category'] = __('BizPanda', 'bizpanda');
     $options['icon'] = 'opanda-bizpanda-vc-icon';
 }
 $options['name'] = __('Sign-In Locker', 'bizpanda');
 $options['base'] = 'signinlocker';
 $options['description'] = __('Adds one of existing Sign-In Lockers.', 'bizpanda');
 $lockers = get_transient('opanda_vc_signin_lockers');
 if (false === $lockers) {
     $lockers = opanda_get_lockers('signin-locker', 'vc');
     set_transient('opanda_vc_signin_lockers', $lockers, 60 * 60 * 24);
 }
 $options['params'][0]['value'] = $lockers;
예제 #6
0
    <h1><?php 
_e('Getting LinkedIn Client ID', 'bizpanda');
?>
</h1>

    <p>
        <?php 
_e('A LinkedIn Client ID is required for the following buttons:', 'bizpanda');
?>
        <ul>
            <li><?php 
_e('LinkedIn Sign-In of the Sign-In Locker.', 'bizpanda');
?>
</li>
            <?php 
if (BizPanda::hasPlugin('optinpanda')) {
    ?>
            <li><?php 
    _e('LinkedIn Subscribe of the Email Locker.', 'bizpanda');
    ?>
</li>     
            <?php 
}
?>
        </ul>
    </p>
    
    <p><?php 
_e('If you want to use these buttons, you need to get create a LinkedIn App for your website and generate a Client ID.', 'bizpanda');
?>
    <?php 
예제 #7
0
 /**
  * Adds a locker shortcodes on the flight if bulk locking are turned on.
  * 
  * @param type $content
  * @return type
  */
 public static function addSocialLockerShortcodes($content)
 {
     $bulkLockers = get_option('onp_sl_bulk_lockers', array());
     if (empty($bulkLockers)) {
         return $content;
     }
     global $bizpanda;
     $shortcodeEnds = array();
     $bulkIndex = 0;
     $ignoredShortcodes = array();
     foreach ($bulkLockers as $id => $options) {
         if (!in_array($options['way'], array('skip-lock', 'more-tag'))) {
             continue;
         }
         if (self::isPageExcluded($id, $options)) {
             continue;
         }
         $lockerStatus = get_post_status($id);
         if ('publish' !== $lockerStatus) {
             continue;
         }
         $itemType = get_post_meta($id, 'opanda_item', true);
         if ('social-locker' == $itemType && !BizPanda::hasPlugin('sociallocker')) {
             continue;
         }
         if ('email-locker' == $itemType && !BizPanda::hasPlugin('optinpanda')) {
             continue;
         }
         $bulkIndex++;
         switch ($itemType) {
             case 'email-locker':
                 $shortcodeName = 'emaillocker-bulk-' . $bulkIndex;
                 break;
             case 'signin-locker':
                 $shortcodeName = 'signinlocker-bulk-' . $bulkIndex;
                 break;
             default:
                 $shortcodeName = 'sociallocker-bulk-' . $bulkIndex;
                 break;
         }
         $shortcode = new OPanda_LockerShortcode($bizpanda);
         add_shortcode($shortcodeName, array($shortcode, 'render'));
         if ($options['way'] == 'skip-lock') {
             if ($options['skip_number'] == 0) {
                 $content = "[{$shortcodeName} id='{$id}']" . $content;
                 if (!isset($shortcodeEnds[0])) {
                     $shortcodeEnds[0] = array();
                 }
                 $shortcodeEnds[0][] = "[/{$shortcodeName}]";
             } else {
                 $counter = 0;
                 $offset = 0;
                 while (preg_match('/[^\\s]+((<\\/p>)|(\\n\\r){2,}|(\\r\\n){2,}|(\\n){2,}|(\\r){2,})/i', $content, $matches, PREG_OFFSET_CAPTURE, $offset)) {
                     $counter++;
                     $offset = $matches[0][1] + strlen($matches[0][0]);
                     if ($counter == $options['skip_number']) {
                         $beforeShortcode = substr($content, 0, $offset);
                         $insideShortcode = substr($content, $offset);
                         $content = self::normilizerMarkup($beforeShortcode, $insideShortcode, "[{$shortcodeName} id='{$id}']", "");
                         if (!isset($shortcodeEnds[$offset])) {
                             $shortcodeEnds[$offset] = array();
                         }
                         $shortcodeEnds[$offset][] = "[/{$shortcodeName}]";
                         break;
                     }
                 }
             }
         } elseif ($options['way'] == 'more-tag' && is_singular($options['post_types'])) {
             global $post;
             $label = '<span id="more-' . $post->ID . '"></span>';
             $pos = strpos($content, $label);
             if ($pos === false) {
                 return $content;
             }
             $offset = $pos + strlen($label);
             if (substr($content, $offset, 4) == '</p>') {
                 $offset += 4;
             }
             $content = substr($content, 0, $offset) . "[{$shortcodeName} id='{$id}']" . substr($content, $offset);
             if (!isset($shortcodeEnds[$offset])) {
                 $shortcodeEnds[$offset] = array();
             }
             $shortcodeEnds[$offset][] = "[/{$shortcodeName}]";
         }
     }
     if (!empty($shortcodeEnds)) {
         krsort($shortcodeEnds);
         foreach ($shortcodeEnds as $shortcodeEndItem) {
             foreach ($shortcodeEndItem as $shortcodeEnd) {
                 $content .= $shortcodeEnd;
             }
         }
     }
     return $content;
 }
예제 #8
0
    /**
     * Renders the page 
     * 
     * @sinve 1.0.0
     * @return void
     */
    public function indexAction()
    {
        global $bizpanda;
        $current = isset($_GET['opanda_screen']) ? $_GET['opanda_screen'] : null;
        $screens = array();
        $subscriptionOptions = array('title' => __('Subscription Options', 'bizpanda'), 'class' => 'OPanda_SubscriptionSettings', 'path' => OPANDA_BIZPANDA_DIR . '/admin/settings/class.subscription.php');
        $socialOptions = array();
        if (BizPanda::hasFeature('social') || BizPanda::hasPlugin('sociallocker')) {
            $socialOptions = array('title' => __('Social Options', 'bizpanda'), 'class' => 'OPanda_SocialSettings', 'path' => OPANDA_BIZPANDA_DIR . '/admin/settings/class.social.php');
        }
        // for the plugin Opt-In Panda, the subscription options should be the first
        if (BizPanda::isSinglePlugin() && BizPanda::hasPlugin('optinpanda')) {
            if (empty($current)) {
                $current = 'subscription';
            }
            $screens['subscription'] = $subscriptionOptions;
            if (!empty($socialOptions)) {
                $screens['social'] = $socialOptions;
            }
        } else {
            if (empty($current)) {
                $current = 'social';
            }
            if (!empty($socialOptions)) {
                $screens['social'] = $socialOptions;
            }
            if (BizPanda::hasFeature('subscription')) {
                $screens['subscription'] = $subscriptionOptions;
            }
        }
        if (BizPanda::hasFeature('lockers')) {
            $screens['lock'] = array('title' => __('Lock Options', 'bizpanda'), 'class' => 'OPanda_AdvancedSettings', 'path' => OPANDA_BIZPANDA_DIR . '/admin/settings/class.lock.php');
        }
        $screens['stats'] = array('title' => __('Stats Options', 'bizpanda'), 'class' => 'OPanda_StatsSettings', 'path' => OPANDA_BIZPANDA_DIR . '/admin/settings/class.stats.php');
        $screens['text'] = array('title' => __('Front-end Text', 'bizpanda'), 'class' => 'OPanda_TextSettings', 'path' => OPANDA_BIZPANDA_DIR . '/admin/settings/class.text.php');
        if (BizPanda::hasFeature('terms')) {
            $screens['terms'] = array('title' => __('Terms & Policies', 'bizpanda'), 'class' => 'OPanda_TermsSettings', 'path' => OPANDA_BIZPANDA_DIR . '/admin/settings/class.terms.php');
        }
        $screens = apply_filters('opanda_settings_screens', $screens);
        if (!isset($screens[$current])) {
            $current = 'social';
        }
        require_once OPANDA_BIZPANDA_DIR . '/admin/settings/class.settings.php';
        require_once $screens[$current]['path'];
        $screen = new $screens[$current]['class']($this);
        $action = isset($_GET['opanda_action']) ? $_GET['opanda_action'] : null;
        if (!empty($action)) {
            $methodName = $action . 'Action';
            $screen->{$methodName}();
            return;
        }
        // getting options
        $options = $screen->getOptions();
        $options = apply_filters("opanda_{$current}_settings", $options);
        // creating a form
        $form = new FactoryForms328_Form(array('scope' => 'opanda', 'name' => 'setting'), $bizpanda);
        $form->setProvider(new FactoryForms328_OptionsValueProvider(array('scope' => 'opanda')));
        $form->add($options);
        if (isset($_POST['save-action'])) {
            do_action("opanda_{$current}_settings_saving");
            $form->save();
            do_action("opanda_{$current}_settings_saved");
            $redirectArgs = apply_filters("opanda_{$current}_settings_redirect_args", array('opanda_saved' => 1, 'opanda_screen' => $current));
            return $this->redirectToAction('index', $redirectArgs);
        }
        $formAction = add_query_arg(array('post_type' => OPANDA_POST_TYPE, 'page' => 'settings-' . $bizpanda->pluginName, 'opanda_screen' => $current), admin_url('edit.php'));
        ?>
        <div class="wrap ">
            
            <h2 class="nav-tab-wrapper">
                <?php 
        foreach ($screens as $screenName => $screenData) {
            ?>
<a href="<?php 
            $this->actionUrl('index', array('opanda_screen' => $screenName));
            ?>
" class="nav-tab <?php 
            if ($screenName === $current) {
                echo 'nav-tab-active';
            }
            ?>
">
                    <?php 
            echo $screenData['title'];
            ?>
                </a><?php 
        }
        ?>
            </h2>
            
            <?php 
        $screen->header();
        ?>
            
            <div class="factory-bootstrap-329 opanda-screen-<?php 
        echo $current;
        ?>
">
            <form method="post" class="form-horizontal" action="<?php 
        echo $formAction;
        ?>
">

                <?php 
        if (isset($_GET['opanda_saved']) && empty($screen->error)) {
            ?>
                <div id="message" class="alert alert-success">
                    <p><?php 
            _e('The settings have been updated successfully!', 'bizpanda');
            ?>
</p>
                </div>
                <?php 
        }
        ?>
                
                <?php 
        if (!empty($screen->success)) {
            ?>
                <div id="message" class="alert alert-success">
                    <p><?php 
            echo $screen->success;
            ?>
</p>
                </div>
                <?php 
        }
        ?>
                
                <?php 
        if (!empty($screen->error)) {
            ?>
                <div id="message" class="alert alert-danger">
                    <p><?php 
            echo $screen->error;
            ?>
</p>
                </div>
                <?php 
        }
        ?>
                
                <?php 
        do_action('onp_sl_settings_options_notices');
        ?>

                <div style="padding-top: 10px;">
                <?php 
        $form->html();
        ?>
                </div>
                
                <div class="form-group form-horizontal">
                    <label class="col-sm-2 control-label"> </label>
                    <div class="control-group controls col-sm-10">
                        <input name="save-action" class="btn btn-primary" type="submit" value="<?php 
        _e('Save Changes', 'bizpanda');
        ?>
"/>
                    </div>
                </div>
            
            </form>
            </div>  
                
        </div>
        <?php 
    }
예제 #9
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 
    }
    /**
     * Shows a status of the lead.
     * 
     * @since 1.0.7
     * @return void
     */
    public function column_status($record)
    {
        if (BizPanda::hasPlugin('optinpanda')) {
            if ($record->lead_email_confirmed) {
                ?>
                <span class="opanda-status-help" title="<?php 
                _e('This email is real. It was received from social networks or the user confirmed it by clicking on the link inside the confirmation email.', 'bizpanda');
                ?>
">
                    <i class="fa fa-check-circle-o"></i><i><?php 
                _e('email', 'optinapnda');
                ?>
</i>
                </span>
            <?php 
            } else {
                ?>
                <span class="opanda-status-help" title="<?php 
                _e('This email was not confirmed. It means that actually this email address may be owned by another user.', 'bizpanda');
                ?>
">
                    <i class="fa fa-circle-o"></i><i><?php 
                _e('email', 'optinapnda');
                ?>
</i>
                </span>
            <?php 
            }
            echo '<br />';
            if ($record->lead_subscription_confirmed) {
                ?>
                <span class="opanda-status-help" title="<?php 
                _e('This user confirmed his subscription.', 'bizpanda');
                ?>
">
                    <i class="fa fa-check-circle-o"></i><i><?php 
                _e('subscription', 'optinapnda');
                ?>
</i>
                </span>
            <?php 
            } else {
                ?>
                <span class="opanda-status-help" title="<?php 
                _e('This user has not confirmed his subscription.', 'bizpanda');
                ?>
">
                    <i class="fa fa-circle-o"></i><i><?php 
                _e('subscription', 'optinapnda');
                ?>
</i>
                </span>
            <?php 
            }
        } else {
            if ($record->lead_email_confirmed) {
                ?>
                <span class="opanda-status-help" title="<?php 
                _e('This email is real. It was received from social networks.', 'bizpanda');
                ?>
">
                    <i class="fa fa-check-circle-o"></i><i><?php 
                _e('email', 'optinapnda');
                ?>
</i>
                </span>
            <?php 
            } else {
                ?>
                <span class="opanda-status-help" title="<?php 
                _e('This email was not confirmed. It means that actually this email address may be owned by another user.', 'bizpanda');
                ?>
">
                    <i class="fa fa-circle-o"></i><i><?php 
                _e('email', 'optinapnda');
                ?>
</i>
                </span>
            <?php 
            }
        }
    }
    /**
     * Shows the control to manage the connect buttons.
     * 
     * @since 1.0.0
     * @return string
     */
    public function showConnectButtonsControl()
    {
        $buttons = array('facebook' => array('title' => __('Facebook', 'signinlocker'), 'errors' => array($this, 'getFacebookErrors'), 'actions' => array('lead' => array('on' => true, 'title' => __('Save Email', 'signinlocker'), 'always' => true), 'subscribe' => array('title' => __('Subscribe', 'signinlocker')), 'signup' => array('on' => true, 'title' => __('Create Account', 'signinlocker')))), 'twitter' => array('title' => __('Twitter', 'signinlocker'), 'errors' => array($this, 'getTwitterErrors'), 'actions' => array('lead' => array('on' => true, 'title' => __('Save Email', 'signinlocker'), 'always' => true), 'subscribe' => array('title' => __('Subscribe', 'signinlocker')), 'signup' => array('on' => true, 'title' => __('Create Account', 'signinlocker')), 'follow' => array('title' => __('Follow', 'signinlocker'), 'type' => 'social'), 'tweet' => array('title' => __('Tweet', 'signinlocker'), 'type' => 'social'))), 'google' => array('title' => __('Google', 'signinlocker'), 'errors' => array($this, 'getGoogleErrors'), 'actions' => array('lead' => array('on' => true, 'title' => __('Save Email', 'signinlocker'), 'always' => true), 'subscribe' => array('title' => __('Subscribe', 'signinlocker')), 'signup' => array('on' => true, 'title' => __('Create Account', 'signinlocker')), 'youtube-subscribe' => array('title' => __('Subscribe (YT)', 'signinlocker'), 'type' => 'social'))), 'linkedin' => array('title' => __('LinkedIn', 'signinlocker'), 'errors' => array($this, 'getLinkedInErrors'), 'actions' => array('lead' => array('on' => true, 'title' => __('Save Email', 'signinlocker'), 'always' => true), 'subscribe' => array('title' => __('Subscribe', 'signinlocker')), 'signup' => array('on' => true, 'title' => __('Create Account', 'signinlocker')))), 'email' => array('title' => __('Email Form', 'signinlocker'), 'errors' => array($this, 'getEmailFormErrors'), 'actions' => array('lead' => array('on' => true, 'title' => __('Save Email', 'signinlocker'), 'always' => true), 'subscribe' => array('title' => __('Subscribe', 'signinlocker')), 'signup' => array('on' => true, 'title' => __('Create Account', 'signinlocker')))));
        if (BizPanda::hasPlugin('optinpanda')) {
            foreach ($buttons as $buttonName => $buttonData) {
                $buttons[$buttonName]['actions']['subscribe']['on'] = true;
            }
        } else {
            $url = OPanda_Plugins::getPremiumUrl('optinpanda', 'co-subscribe-action');
            foreach ($buttons as $buttonName => $buttonData) {
                $buttons[$buttonName]['actions']['subscribe']['error'] = sprintf(__('To enable this action, please install the plugin Opt-In Panda which provides subscription features. <a href="%s" target="_blank">Click here to learn more</a>.', 'signinlocker'), $url);
            }
        }
        if (BizPanda::hasPlugin('sociallocker')) {
            foreach ($buttons as $buttonName => $buttonData) {
                foreach ($buttons[$buttonName]['actions'] as $actionName => $actionData) {
                    if (isset($actionData['type']) && 'social' === $actionData['type']) {
                        $buttons[$buttonName]['actions'][$actionName]['on'] = true;
                    }
                }
            }
        } else {
            $url = OPanda_Plugins::getPremiumUrl('sociallocker', 'co-social-actions');
            foreach ($buttons as $buttonName => $buttonData) {
                foreach ($buttons[$buttonName]['actions'] as $actionName => $actionData) {
                    if (isset($actionData['type']) && 'social' === $actionData['type']) {
                        $buttons[$buttonName]['actions'][$actionName]['error'] = sprintf(__('To enable this action, please install the Social Locker plugin which provides social features. <a href="%s" target="_blank">Click here to learn more</a>.', 'signinlocker'), $url);
                    }
                }
            }
        }
        if (BizPanda::isSinglePlugin() && BizPanda::hasPlugin('optinpanda')) {
        } else {
            if (!BizPanda::hasFeature('sociallocker-premium')) {
                unset($buttons['twitter']['actions']['follow']['on']);
                $buttons['twitter']['actions']['follow']['error'] = opanda_get_premium_note(false, 'co-follow-action');
                unset($buttons['twitter']['actions']['tweet']['on']);
                $buttons['twitter']['actions']['tweet']['error'] = opanda_get_premium_note(false, 'co-follow-action');
                unset($buttons['google']['actions']['youtube-subscribe']['on']);
                $buttons['google']['actions']['youtube-subscribe']['error'] = opanda_get_premium_note(false, 'co-youtube-action');
            }
        }
        $buttons = apply_filters('opanda_connect_buttons_options', $buttons);
        $commonActions = array('subscribe', 'signup', 'lead');
        ?>
        <div class="opanda-connect-buttons factory-fontawesome-320">

            <?php 
        foreach ($buttons as $name => $button) {
            ?>
                <?php 
            $errors = isset($button['errors']) ? call_user_func($button['errors']) : null;
            $errorName = isset($errors['name']) ? $errors['name'] : 'noname';
            $errorIcon = isset($errors['icon']) ? $errors['icon'] : 'fa-exclamation-triangle';
            $errorText = isset($errors['text']) ? $errors['text'] : $errors;
            ?>
            
                <div class="opanda-button opanda-button-<?php 
            echo $name;
            ?>
 opanda-off <?php 
            if ($errors) {
                echo 'opanda-has-error';
            }
            ?>
" data-name="<?php 
            echo $name;
            ?>
">
                    <div class="opanda-inner-wrap">
                        <label class="opanda-button-title" for="opanda-button-<?php 
            echo $name;
            ?>
-activated">
                            
                            <?php 
            if ($errors) {
                ?>
                            <span class="opanda-error opanda-error-<?php 
                echo $errorName;
                ?>
">
                                <i class="fa <?php 
                echo $errorIcon;
                ?>
"></i>
                                <div class='opanda-error-text'><?php 
                echo $errorText;
                ?>
</div>
                            </span>
                            <?php 
            } else {
                ?>
                            <span class='opanda-checkbox'>
                                <input type="checkbox" value="<?php 
                echo $name;
                ?>
" id="opanda-button-<?php 
                echo $name;
                ?>
-activated" />
                            </span>
                            <?php 
            }
            ?>
  
                            <span><?php 
            echo $button['title'];
            ?>
</span>

                        </label>
                        <ul class='opanda-actions'>
                            <?php 
            foreach ($button['actions'] as $actionName => $actionData) {
                ?>
                            <?php 
                if (isset($button['actions'][$actionName]['on'])) {
                    ?>
                                <?php 
                    $actionTitle = $actionData['title'];
                    ?>
                                <?php 
                    $isCommon = in_array($actionName, $commonActions);
                    ?>
                            
                                <li class='opanda-action opanda-action-<?php 
                    echo $actionName;
                    ?>
'>
                                    <span>
                                        <input 
                                            type="checkbox" 
                                            value="1" 
                                            data-common="<?php 
                    echo $isCommon ? '1' : '0';
                    ?>
" 
                                            data-button="<?php 
                    echo $name;
                    ?>
" 
                                            data-action="<?php 
                    echo $actionName;
                    ?>
" 
                                            disabled="disabled" />
                                    </span>
                                    
                                    <a href="#" class="opanda-action-link" data-common="<?php 
                    echo $isCommon ? '1' : '0';
                    ?>
" data-button="<?php 
                    echo $name;
                    ?>
" data-action="<?php 
                    echo $actionName;
                    ?>
"><?php 
                    echo $actionTitle;
                    ?>
</a>
                                </li>
                            <?php 
                }
                ?>
                            <?php 
            }
            ?>
                        </ul>
                        <ul class='opanda-actions opanda-actions-disabled'>
                            <?php 
            foreach ($button['actions'] as $actionName => $actionData) {
                ?>
                            <?php 
                if (!isset($button['actions'][$actionName]['on'])) {
                    ?>
                            <?php 
                    $actionTitle = $actionData['title'];
                    ?>
                            <?php 
                    $isCommon = in_array($actionName, $commonActions);
                    ?>
                            <li class='opanda-action opanda-action-disabled opanda-action-<?php 
                    echo $actionName;
                    ?>
'>
                                <span class="opanda-error-wrap">
                                    <input type="checkbox" disabled="disabled" value="1" />
                                    <span class='opanda-error-text'><?php 
                    echo $actionData['error'];
                    ?>
</span>
                                    <a href="#" class="opanda-action-link" data-common="<?php 
                    echo $isCommon ? '1' : '0';
                    ?>
" data-button="<?php 
                    echo $name;
                    ?>
" data-action="<?php 
                    echo $actionName;
                    ?>
"><?php 
                    echo $actionTitle;
                    ?>
</a>  
                                </span>
                            </li>
                            <?php 
                }
                ?>
                            <?php 
            }
            ?>
                        </ul>
                    </div>
                </div>
            <?php 
        }
        ?>
        </div>  
        <?php 
    }
예제 #12
0
    public function leadDetailsAction()
    {
        $leadId = isset($_REQUEST['leadID']) ? intval($_REQUEST['leadID']) : 0;
        $lead = OPanda_Leads::get($leadId);
        $customFields = OPanda_Leads::getCustomFields($leadId);
        $email = $lead->lead_email;
        $name = $lead->lead_name;
        $family = $lead->lead_family;
        if (!empty($name) || !empty($family)) {
            $displayName = $name . ' ' . $family;
        } else {
            $displayName = !empty($lead->lead_display_name) ? $lead->lead_display_name : $lead->lead_email;
        }
        $emailConfirmed = empty($lead->lead_email_confirmed) ? 0 : 1;
        $subscriptionConfirmed = empty($lead->lead_subscription_confirmed) ? 0 : 1;
        if (isset($_POST['submit'])) {
            $data = array();
            $email = $_POST['email'];
            if (!filter_var($email, FILTER_VALIDATE_EMAIL) || !preg_match('/@.+\\./', $email)) {
                $error = __('Please enter a valid email.', 'bizpanda');
            } else {
                $name = $_POST['name'];
                $family = $_POST['family'];
                if (!empty($name) || !empty($family)) {
                    $displayName = $name . ' ' . $family;
                } else {
                    $displayName = !empty($lead->lead_display_name) ? $lead->lead_display_name : $lead->lead_email;
                }
                $data['email'] = $email;
                $data['displayName'] = $displayName;
                $data['name'] = $name;
                $data['family'] = $family;
                $emailConfirmed = empty($_POST['email_confirmed']) ? 0 : 1;
                $subscriptionConfirmed = empty($_POST['subscription_confirmed']) ? 0 : 1;
                $customValues = isset($_POST['opanda_values']) ? $_POST['opanda_values'] : array();
                $customNames = isset($_POST['opanda_names']) ? $_POST['opanda_names'] : array();
                $index = 0;
                foreach ($customNames as $customName) {
                    $data['{' . $customName . '}'] = $customValues[$index];
                    $customFields[$customName] = $customValues[$index];
                    $index++;
                }
                OPanda_Leads::save($lead, $data, array(), $emailConfirmed, $subscriptionConfirmed);
                $url = admin_url('/edit.php?post_type=opanda-item&page=leads-bizpanda&action=leadDetails&leadID=' . $lead->ID . '&opanda_success=1');
                wp_redirect($url);
                exit;
            }
        }
        $avatar = OPanda_Leads::getAvatar($leadId, $lead->lead_email, 150);
        $postUrl = admin_url('/edit.php?post_type=opanda-item&page=leads-bizpanda&action=leadDetails&leadID=' . $lead->ID);
        $cancelUrl = admin_url('/edit.php?post_type=opanda-item&page=leads-bizpanda');
        ?>

        <div class="wrap factory-fontawesome-320" id="opanda-lead-details-page">
            
        <h2>Edit <strong><?php 
        echo $displayName;
        ?>
</strong></h2>
        
        <?php 
        if (isset($_GET['opanda_success'])) {
            ?>
        <div class="factory-bootstrap-329">
            <div class="alert alert-success"><?php 
            _e('<strong>Well done!</strong> The lead data updated successfully.', 'bizpanda');
            ?>
</div>
        </div>
        <?php 
        }
        ?>
        
        <?php 
        if (!empty($error)) {
            ?>
        <div class="factory-bootstrap-329">
            <div class="alert alert-danger"><?php 
            echo $error;
            ?>
</div>
        </div>
        <?php 
        }
        ?>
        
        <form method="POST" action="<?php 
        echo $postUrl;
        ?>
">
            <input type="hidden" name="leadID" value="<?php 
        echo $leadId;
        ?>
" />
            <input type="hidden" name="submit" value="1" />
            
        <table class="form-table">
            <tr>
                <td scope="row" class="avatar-wrap">
                    <div class="opanda-avatar"><?php 
        echo $avatar;
        ?>
</div>
                </td>
                
                <td class="user-info">
                    
                    <h3 class="detail">
                        <ul class="click-to-edit">
                            <li><?php 
        echo $email;
        ?>
</li>
                            <li><input id="opanda_email" class="" type="text" name="email" value="<?php 
        echo $email;
        ?>
" placeholder="<?php 
        _e('Email', 'bizpanda');
        ?>
"></li>
                        </ul>
                    </h3>
                    
                    <div class="detail">
                        <label for="opanda_name"><?php 
        _e('Name:', 'bizpanda');
        ?>
</label>
                        <ul class="click-to-edit">
                            <li><?php 
        echo $name;
        ?>
 <?php 
        echo $family;
        ?>
</li>
                            <li>
                                <input id="opanda_name" type="text" name="name" value="<?php 
        echo $name;
        ?>
" placeholder="<?php 
        _e('First Name', 'bizpanda');
        ?>
">
                                <input id="opanda_family" class="" type="text" name="family" value="<?php 
        echo $family;
        ?>
" placeholder="<?php 
        _e('Last Name', 'bizpanda');
        ?>
">
                            </li>
                        </ul>
                    </div>
                    
                    <div class="detail">
                        <label for="opanda_email_confirmed"><?php 
        _e('Email Confirmed:', 'bizpanda');
        ?>
</label>
                        <ul class="click-to-edit">
                            <li><?php 
        if ($emailConfirmed) {
            _e('yes', 'bizpanda');
        } else {
            _e('no', 'bizpanda');
        }
        ?>
</li>
                            <li>
                                <input type="checkbox" id="opanda_email_confirmed" name="email_confirmed" value="1" <?php 
        if ($emailConfirmed) {
            echo 'checked="checked"';
        }
        ?>
 >            
                            </li>
                        </ul>
                    </div>
                    
                    <?php 
        if (BizPanda::hasPlugin('optinpanda')) {
            ?>
                    
                    <div class="detail">
                        <label for="opanda_subscription_confirmed"><?php 
            _e('Subscription Confirmed:', 'bizpanda');
            ?>
</label>
                        <ul class="click-to-edit">
                            <li><?php 
            if ($subscriptionConfirmed) {
                _e('yes', 'bizpanda');
            } else {
                _e('no', 'bizpanda');
            }
            ?>
</li>
                            <li>
                                <input type="checkbox" id="opanda_email_confirmed" name="subscription_confirmed" value="1" <?php 
            if ($subscriptionConfirmed) {
                echo 'checked="checked"';
            }
            ?>
 >                
                            </li>
                        </ul>
                    </div>
                    
                    <?php 
        }
        ?>
                    
                    <?php 
        if (!empty($customFields)) {
            ?>
                    
                    <div class="custom-field-wrap">
                        
                    <?php 
            $index = 0;
            foreach ($customFields as $fieldName => $fieldValue) {
                $index++;
                ?>
                    
                        <div class="detail">
                            <label for="opanda_<?php 
                echo $index;
                ?>
"><?php 
                echo $fieldName;
                ?>
:</label>

                            <ul class="click-to-edit">
                                <li><?php 
                echo $fieldValue;
                ?>
</li>
                                <li><input type="text" id="opanda_<?php 
                echo $index;
                ?>
" name="opanda_values[]" value="<?php 
                echo $fieldValue;
                ?>
" class="regular-text input"></li>
                                <input type="hidden" name="opanda_names[]" value="<?php 
                echo $fieldName;
                ?>
" />
                            </ul>
                        </div>
                    
                    <?php 
            }
            ?>
                        
                    </div>
                    
                    <?php 
        }
        ?>

                    <div class="controls-wrap">
                        <input type="submit" class="button button-primary" value="<?php 
        _e('Save Changes', 'bizpanda');
        ?>
" />
                        <a href="<?php 
        echo $cancelUrl;
        ?>
" class="button button-default"><?php 
        _e('Return', 'bizpanda');
        ?>
</a> 
                    </div>
                </td>

            </tr>
        </table>
            
        </form>
        
        </div>
        
        <?php 
    }
예제 #13
0
 /**
  * Adds the action 'lead' action of the user selected 
  * the action 'save email' but 'subscribe' and 'create account' are not selected.
  */
 function opanda_signin_locker_get_actions($id, $optionName)
 {
     $actions = explode(',', opanda_get_item_option($id, $optionName));
     if (empty($actions) || empty($actions[0])) {
         $actions = array();
     }
     if (!BizPanda::hasPlugin('optinpanda')) {
         $temp = $actions;
         $actions = array();
         foreach ($temp as $actionName) {
             if ('subscribe' === $actionName) {
                 continue;
             }
             $actions[] = $actionName;
         }
     }
     $catchLeads = opanda_get_item_option($id, 'catch_leads', false);
     if (!$catchLeads) {
         return $actions;
     }
     if (in_array('signup', $actions)) {
         return $actions;
     }
     if (in_array('subscribe', $actions)) {
         return $actions;
     }
     $actions[] = 'lead';
     return $actions;
 }
예제 #14
0
/**
 * Prepares the Sign-In Locker to use while activation.
 * 
 * @since 1.0.0
 */
function opanda_signin_locker_activation($plugin, $helper)
{
    // default email locker
    $helper->addPost('opanda_default_signin_locker_id', array('post_type' => OPANDA_POST_TYPE, 'post_title' => __('Sign-In Locker (default)', 'signinlocker'), 'post_name' => 'opanda_default_signin_locker'), array('opanda_item' => 'signin-locker', 'opanda_header' => __('Sign In To Unlock This Content', 'signinlocker'), 'opanda_message' => __('Please sign in. It\'s free. Just click one of the buttons below to get instant access.', 'signinlocker'), 'opanda_style' => 'great-attractor', 'opanda_catch_leads' => 1, 'opanda_connect_buttons' => 'facebook,twitter,google', 'opanda_facebook_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup', 'opanda_twitter_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup', 'opanda_google_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup', 'opanda_linkedin_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup', 'opanda_email_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup', 'opanda_mobile' => 1, 'opanda_highlight' => 1, 'opanda_is_system' => 1, 'opanda_is_default' => 1));
}