/**
  * Configures a form that will be inside the metabox.
  * 
  * @see FactoryMetaboxes321_FormMetabox
  * @since 1.0.0
  * 
  * @param FactoryForms328_Form $form A form object to configure.
  * @return void
  */
 public function form($form)
 {
     $itemType = OPanda_Items::getCurrentItem();
     $form->add(array('type' => 'hidden', 'name' => 'item', 'default' => isset($_GET['opanda_item']) ? $_GET['opanda_item'] : null));
     $defaultHeader = __('This content is locked!', 'bizpanda');
     $defaultMessage = __('Please support us, use one of the buttons below to unlock the content.', 'bizpanda');
     switch ($itemType['name']) {
         case 'email-locker':
             $defaultHeader = __('This Content Is Only For Subscribers', 'bizpanda');
             $defaultMessage = __('Please subscribe to unlock this content. Just enter your email below.', 'bizpanda');
             break;
         case 'connect-locker':
             $defaultHeader = __('Sing In To Unlock This Content', 'bizpanda');
             $defaultMessage = __('Please sign in. It\'s free. Just click one of the buttons below to get instant access.', 'bizpanda');
             break;
     }
     $textOptions = array(array('type' => 'textbox', 'name' => 'header', 'title' => __('Locker header', 'bizpanda'), 'hint' => __('Type a header which attracts attention or calls to action. You can leave this field empty.', 'bizpanda'), 'default' => $defaultHeader), array('type' => 'wp-editor', 'name' => 'message', 'title' => __('Locker message', 'bizpanda'), 'hint' => __('Type a message which will appear under the header.', 'bizpanda') . '<br /><br />' . __('Shortcodes: [post_title], [post_url].', 'bizpanda'), 'default' => $defaultMessage, 'tinymce' => array('setup' => 'function(ed){ window.bizpanda.lockerEditor.bindWpEditorChange( ed ); }', 'height' => 100), 'layout' => array('hint-position' => 'left')));
     $textOptions = apply_filters('opanda_text_options', $textOptions);
     $form->add($textOptions);
     if ('email-locker' === $itemType['name']) {
         $form->add(array('type' => 'columns', 'items' => array(array('type' => 'textbox', 'name' => 'button_text', 'title' => __('Buttton Text', 'bizpanda'), 'hint' => __('The text on the button. Call to action!'), 'default' => __('subscribe to unlock', 'bizpanda'), 'column' => 1), array('type' => 'textbox', 'name' => 'after_button', 'title' => __('After Buttton', 'bizpanda'), 'hint' => __('The text below the button. Guarantee something.'), 'default' => __('Your email address is 100% safe from spam!', 'bizpanda'), 'column' => 2))));
     }
     if (in_array($itemType['name'], array('email-locker', 'signin-locker'))) {
         $form->add(array('type' => 'html', 'html' => array($this, 'showOtherFrontendTextNote')));
         $form->add(array('type' => 'separator'));
     }
     require_once OPANDA_BIZPANDA_DIR . '/includes/themes.php';
     $form->add(array(array('type' => 'dropdown', 'hasHints' => true, 'name' => 'style', 'data' => OPanda_ThemeManager::getThemes(OPanda_Items::getCurrentItemName(), 'dropdown'), 'title' => __('Theme', 'bizpanda'), 'hint' => __('Select the most suitable theme.', 'bizpanda'), 'default' => 'secrets')));
     if (OPanda_Items::isCurrentPremium()) {
         $form->add(array(array('type' => 'dropdown', 'way' => 'buttons', 'name' => 'overlap', 'data' => array(array('full', '<i class="fa fa-lock"></i>' . __('Full (classic)', 'bizpanda')), array('transparence', '<i class="fa fa-adjust"></i>' . __('Transparency', 'bizpanda')), array('blurring', '<i class="fa fa-bullseye"></i>' . __('Blurring', 'bizpanda'), __('Works in all browsers except IE 10-11 (In IE 10-10, the transparency mode will be applied)', 'bizpanda'))), 'title' => __('Overlap Mode', 'bizpanda'), 'hint' => __('Choose the way how your locker should lock the content.', 'bizpanda'), 'default' => 'full')));
     } else {
         $form->add(array(array('type' => 'dropdown', 'way' => 'buttons', 'name' => 'overlap', 'data' => array(array('full', '<i class="fa fa-lock"></i>Full (classic)'), array('transparence', '<i class="fa fa-adjust"></i>Transparency'), array('blurring', '<i class="fa fa-bullseye"></i>Blurring', sprintf(__('This option is available only in the <a href="%s" target="_blank">premium version</a> of the plugin (the transparency mode will be used in the free version)', 'bizpanda'), opanda_get_premium_url(null, 'blurring')))), 'title' => __('Overlap Mode', 'bizpanda'), 'hint' => __('Choose the way how your locker should lock the content.', 'bizpanda'), 'default' => 'full')));
     }
     $form->add(array(array('type' => 'dropdown', 'name' => 'overlap_position', 'data' => array(array('top', __('Top Position', 'bizpanda')), array('middle', __('Middle Position', 'bizpanda')), array('scroll', __('Scrolling (N/A in Preview)', 'bizpanda'))), 'title' => '', 'hint' => '', 'default' => 'middle')));
 }
 /**
  * Creates a new instance of a form layout.
  * 
  * @since 1.0.0
  * @param mixed[] $options A holder options.
  * @param FactoryForms328_Form $form A parent form.
  */
 public function __construct($options, $form)
 {
     $options['name'] = $this->name;
     $options['items'] = $form->getItems();
     parent::__construct($options, $form);
     $this->addCssClass('factory-forms-328-' . $this->type);
     $this->addCssClass('factory-forms-328-' . $this->name);
 }
 /**
  * Configures a form that will be inside the metabox.
  * 
  * @see FactoryMetaboxes321_FormMetabox
  * @since 1.0.0
  * 
  * @param FactoryForms328_Form $form A form object to configure.
  * @return void
  */
 public function form($form)
 {
     $options = array(array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'hide_for_member', 'title' => __('Hide For Members', 'bizpanda'), 'hint' => __('If on, hides the locker for registered members.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/member-icon.png', 'default' => false), array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'lock_delay', 'title' => __('Lock Delay', 'bizpanda'), 'hint' => __('If on, shows the locker only in posts older than specified age.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/icon-delay-lock.png', 'default' => false), array('type' => 'html', 'html' => array($this, 'htmlLockDelayOptions')), array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'relock', 'title' => __('ReLock', 'bizpanda'), 'hint' => __('If on, being unlocked the locker will appear again after specified interval.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/icon-relock-3.png', 'default' => false), array('type' => 'html', 'html' => array($this, 'htmlReLockOptions')), array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'mobile', 'title' => __('Mobile', 'bizpanda'), 'hint' => __('If on, the locker will appear on mobile devices.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/mobile-icon.png', 'default' => true));
     if (OPanda_Items::isCurrentFree()) {
         $options[] = array('type' => 'html', 'html' => '<div style="display: none;" class="factory-fontawesome-320 opanda-overlay-note opanda-premium-note">' . __('<i class="fa fa-star-o"></i> Go Premium <i class="fa fa-star-o"></i><br />To Unlock These Features <a href="#" class="opnada-button">Learn More</a>', 'bizpanda') . '</div>');
     }
     $options = apply_filters('opanda_visability_options', $options, $this);
     $form->add($options);
 }
 /**
  * Configures a form that will be inside the metabox.
  * 
  * @see FactoryMetaboxes321_FormMetabox
  * @since 1.0.0
  * 
  * @param FactoryForms328_Form $form A form object to configure.
  * @return void
  */
 public function form($form)
 {
     $options = array(array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'close', 'title' => __('Close Icon', 'bizpanda'), 'hint' => __('Shows the Close Icon at the corner.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/close-icon.png', 'default' => false), array('type' => 'textbox', 'name' => 'timer', 'title' => __('Timer Interval', 'bizpanda'), 'hint' => __('Sets a countdown interval for the locker.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/timer-icon.png', 'default' => false), array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'ajax', 'title' => __('AJAX', 'bizpanda'), 'hint' => __('If On, locked content will be cut from a page source code.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/ajax-icon.png', 'default' => false), array('type' => 'html', 'html' => '<div id="opanda-ajax-disabled" class="alert alert-warning">The option AJAX is not applied when the "transparence" or "blurring" overlap modes selected.</div>'), array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'highlight', 'title' => __('Highlight', 'bizpanda'), 'hint' => __('Defines whether the locker must use the Highlight effect.', 'bizpanda'), 'icon' => OPANDA_BIZPANDA_URL . '/assets/admin/img/highlight-icon.png', 'default' => true));
     if (OPanda_Items::isCurrentFree()) {
         $options[] = array('type' => 'html', 'html' => '<div style="display: none;" class="factory-fontawesome-320 opanda-overlay-note opanda-premium-note">' . __('<i class="fa fa-star-o"></i> Go Premium <i class="fa fa-star-o"></i><br />To Unlock These Features <a href="#" class="opnada-button">Learn More</a>', 'bizpanda') . '</div>');
     }
     $options = apply_filters('opanda_advanced_options', $options);
     $form->add($options);
 }
 private function getForm($post_id = null)
 {
     // creating a value provider
     $this->provider = new FactoryForms328_MetaValueProvider(array('scope' => $this->scope));
     $this->provider->init($post_id);
     // creating a form
     $form = new FactoryForms328_Form(array('scope' => $this->scope, 'name' => $this->id), $this->plugin);
     $form->setProvider($this->provider);
     $this->form($form);
     return $form;
 }
Example #6
0
 /**
  * Renders a given control holder.
  * 
  * @since 1.0.0
  * @param type $type A holder type.
  * @param type $options Holder options.
  * @return void
  */
 public static function renderHolder($type, $options)
 {
     FactoryForms328_Form::connectAssetsForItem($options);
     $data = self::$_registeredHolders[$type];
     require_once $data['include'];
     $object = new $data['class']($options);
     $object->html();
 }
 /**
  * Configures a form that will be inside the metabox.
  * 
  * @see FactoryMetaboxes321_FormMetabox
  * @since 1.0.0
  * 
  * @param FactoryForms328_Form $form A form object to configure.
  * @return void
  */
 public function form($form)
 {
     require_once OPANDA_BIZPANDA_DIR . '/admin/includes/plugins.php';
     $sociallockerUrl = OPanda_Plugins::getPremiumUrl('sociallocker');
     $tabs = array('type' => 'tab', 'align' => 'vertical', 'class' => 'social-settings-tab', 'items' => array());
     $facebookIsActiveByDefault = true;
     $twitterActiveByDefault = true;
     $googleIsActiveByDefault = true;
     $vkIsActiveByDefault = false;
     // - Facebook Like Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'facebook-like', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'facebook-like_available', 'default' => $facebookIsActiveByDefault), array('type' => 'url', 'title' => __('URL to like', 'sociallocker'), 'hint' => __('Set an URL (a facebook page or website page) which the user has to like in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'facebook_like_url'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'facebook_like_title', 'default' => __('like', 'sociallocker')), array('type' => 'more-link', 'name' => 'like-button-options', 'title' => __('Show more options', 'sociallocker'), 'count' => 1, 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('I see the "confirm" link after a like', 'sociallocker'), 'hint' => __('<p style="margin-top: 8px;">Optional. Facebook has an automatic Like-spam protection that happens if the Like button gets clicked a lot (for example, while testing the plugin). Don\'t worry, it will go away automatically within some hours/days.</p><p>Just during the time, when Facebook asks to confirm likes on your website, turn on this option and the locker will wait the confirmation to unlock the content.</p>', 'sociallocker'), 'name' => 'facebook_like_confirm_issue', 'default' => false)))));
     // - Twitter Tweet Tab
     $tabs['items'][] = array('type' => 'tab-item', 'title' => '', 'name' => 'twitter-tweet', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'twitter-tweet_available', 'default' => $twitterActiveByDefault), array('type' => 'url', 'title' => __('URL to tweet', 'sociallocker'), 'hint' => __('Set an URL which the user has to tweet in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'twitter_tweet_url'), array('type' => 'textarea', 'title' => __('Tweet', 'sociallocker'), 'hint' => __('Type a message to tweet. Leave this field empty to use default tweet (page title + URL). Also you can use the shortcode [post_title] in order to insert automatically a post title into the tweet.', 'sociallocker'), 'name' => 'twitter_tweet_text'), array('type' => 'url', 'title' => __('Counter URL', 'sociallocker'), 'hint' => __('Optional. If you use a shorter tweet URL, paste here a full URL for the counter.', 'sociallocker'), 'name' => 'twitter_tweet_counturl'), array('type' => 'textbox', 'title' => __('Via', 'sociallocker'), 'hint' => __('Optional. Screen name of the user to attribute the Tweet to (without @).', 'sociallocker'), 'name' => 'twitter_tweet_via'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'twitter_tweet_title', 'default' => __('tweet', 'sociallocker'))));
     // - Google Plus Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'google-plus', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'google-plus_available', 'default' => $googleIsActiveByDefault), array('type' => 'url', 'title' => __('URL to +1', 'sociallocker'), 'hint' => __('Set an URL which the user has to +1 in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'google_plus_url'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'google_plus_title', 'default' => __('+1 us', 'sociallocker'))));
     // - Facebook Share Tab
     // if the user has not updated the facebook app id, show a notice
     $facebookAppId = get_option('opanda_facebook_appid', '117100935120196');
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'facebook-share', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'facebook-share_available', 'default' => false), array('type' => 'url', 'title' => __('URL to share', 'sociallocker'), 'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'facebook_fake_field_1'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'facebook_fake_field_2', 'default' => __('share', 'sociallocker'))));
     // - Twitter Follow Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'twitter-follow', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'twitter-follow_available', 'default' => false), array('type' => 'url', 'title' => __('User to follow', 'sociallocker'), 'hint' => __('Set an URL of your Twitter profile (for example, <a href="https://twitter.com/byonepress" target="_blank">https://twitter.com/byonepress</a>).', 'sociallocker'), 'name' => 'twiiter_fake_field_1'), array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Hide Username', 'sociallocker'), 'hint' => __('Set On to hide your username on the button (makes the button shorter).', 'sociallocker'), 'name' => 'twiiter_fake_field_2'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'twiiter_fake_field_3', 'default' => __('follow us', 'sociallocker'))));
     // - Google Share Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'google-share', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'google-share_available'), array('type' => 'url', 'title' => __('URL to share', 'sociallocker'), 'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'google_fake_field_1'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'google_fake_field_2', 'default' => __('share', 'sociallocker'))));
     // - Youtube Subscribe
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'youtube-subscribe', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'youtube-subscribe_available', 'default' => false), array('type' => 'textbox', 'title' => __('Channel ID', 'sociallocker'), 'hint' => __('Set a channel ID to subscribe (for example, <a href="http://www.youtube.com/channel/UCANLZYMidaCbLQFWXBC95Jg" target="_blank">UCANLZYMidaCbLQFWXBC95Jg</a>).', 'sociallocker'), 'name' => 'youtube_fake_field_2'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A visible title of the buttons that is used in some themes (by default only in the Secrets theme).', 'sociallocker'), 'name' => 'youtube_fake_field_3', 'default' => __('Youtube', 'sociallocker'))));
     // - LinkedIn Share Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'linkedin-share', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'linkedin-share_available', 'default' => false), array('type' => 'url', 'title' => __('URL to share', 'sociallocker'), 'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'linkedin_fake_field_1'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'linkedin_fake_field_2', 'default' => __('share', 'sociallocker'))));
     $allowed = array('facebook-like', 'twitter-tweet', 'google-plus');
     foreach ($tabs['items'] as $index => $tabItem) {
         if (in_array($tabItem['name'], $allowed)) {
             continue;
         }
         $tabs['items'][$index]['items'][0]['value'] = false;
         $tabs['items'][$index]['items'][1]['value'] = false;
         $tabs['items'][$index]['cssClass'] = 'opanda-not-available';
         $tabs['items'][$index]['items'][] = array('type' => 'html', 'html' => opanda_get_premium_note(true, 'social-buttons'));
     }
     $tabs = apply_filters('onp_sl_social_options', $tabs);
     $defaultOrder = array();
     if ($vkIsActiveByDefault) {
         $defaultOrder[] = 'vk-like';
     }
     if ($facebookIsActiveByDefault) {
         $defaultOrder[] = 'facebook-like';
     }
     if ($twitterActiveByDefault) {
         $defaultOrder[] = 'twitter-tweet';
     }
     if ($googleIsActiveByDefault) {
         $defaultOrder[] = 'google-plus';
     }
     $form->add(array(array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'show_counters', 'title' => __('Show counters', 'sociallocker'), 'default' => true), array('type' => 'html', 'html' => '<div class="onp-sl-metabox-hint">
                             <strong>' . __('Hint', 'sociallocker') . '</strong>: ' . __('Drag and drop the tabs to change the order of the buttons.', 'sociallocker') . '</div>'), array('type' => 'hidden', 'name' => 'buttons_order', 'default' => implode(',', $defaultOrder)), $tabs));
 }
 /**
  * Configures a form that will be inside the metabox.
  * 
  * @see FactoryMetaboxes321_FormMetabox
  * @since 1.0.0
  * 
  * @param FactoryForms328_Form $form A form object to configure.
  * @return void
  */
 public function form($form)
 {
     require_once OPANDA_BIZPANDA_DIR . '/admin/includes/plugins.php';
     $sociallockerUrl = OPanda_Plugins::getPremiumUrl('sociallocker');
     $tabs = array('type' => 'tab', 'align' => 'vertical', 'class' => 'social-settings-tab', 'items' => array());
     $facebookIsActiveByDefault = true;
     $twitterActiveByDefault = true;
     $googleIsActiveByDefault = true;
     $vkIsActiveByDefault = false;
     // - Facebook Like Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'facebook-like', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'facebook-like_available', 'default' => $facebookIsActiveByDefault), array('type' => 'url', 'title' => __('URL to like', 'sociallocker'), 'hint' => __('Set an URL (a facebook page or website page) which the user has to like in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'facebook_like_url'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'facebook_like_title', 'default' => __('like', 'sociallocker')), array('type' => 'more-link', 'name' => 'like-button-options', 'title' => __('Show more options', 'sociallocker'), 'count' => 1, 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('I see the "confirm" link after a like', 'sociallocker'), 'hint' => __('<p style="margin-top: 8px;">Optional. Facebook has an automatic Like-spam protection that happens if the Like button gets clicked a lot (for example, while testing the plugin). Don\'t worry, it will go away automatically within some hours/days.</p><p>Just during the time, when Facebook asks to confirm likes on your website, turn on this option and the locker will wait the confirmation to unlock the content.</p>', 'sociallocker'), 'name' => 'facebook_like_confirm_issue', 'default' => false)))));
     // - Twitter Tweet Tab
     $tabs['items'][] = array('type' => 'tab-item', 'title' => '', 'name' => 'twitter-tweet', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'twitter-tweet_available', 'default' => $twitterActiveByDefault), array('type' => 'url', 'title' => __('URL to tweet', 'sociallocker'), 'hint' => __('Set an URL which the user has to tweet in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'twitter_tweet_url'), array('type' => 'textarea', 'title' => __('Tweet', 'sociallocker'), 'hint' => __('Type a message to tweet. Leave this field empty to use default tweet (page title + URL). Also you can use the shortcode [post_title] in order to insert automatically a post title into the tweet.', 'sociallocker'), 'name' => 'twitter_tweet_text'), array('type' => 'url', 'title' => __('Counter URL', 'sociallocker'), 'hint' => __('Optional. If you use a shorter tweet URL, paste here a full URL for the counter.', 'sociallocker'), 'name' => 'twitter_tweet_counturl'), array('type' => 'textbox', 'title' => __('Via', 'sociallocker'), 'hint' => __('Optional. Screen name of the user to attribute the Tweet to (without @).', 'sociallocker'), 'name' => 'twitter_tweet_via'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'twitter_tweet_title', 'default' => __('tweet', 'sociallocker'))));
     // - Google Plus Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'google-plus', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'google-plus_available', 'default' => $googleIsActiveByDefault), array('type' => 'url', 'title' => __('URL to +1', 'sociallocker'), 'hint' => __('Set an URL which the user has to +1 in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'google_plus_url'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'google_plus_title', 'default' => __('+1 us', 'sociallocker'))));
     // - Facebook Share Tab
     // if the user has not updated the facebook app id, show a notice
     $facebookAppId = get_option('opanda_facebook_appid', '117100935120196');
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'facebook-share', 'items' => array(array('off' => !(empty($facebookAppId) || $facebookAppId == '117100935120196'), 'type' => 'html', 'html' => '<div class="alert alert-warning">' . sprintf(__('Please make sure that you <a href="%s">set a facebook app id</a> for your domain, otherwise the button will not work. The Facebook Share button requires an app id registered for a domain where it\'s used.', 'sociallocker'), opanda_get_settings_url('social')) . '</div>'), array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'facebook-share_available', 'default' => false), array('type' => 'url', 'title' => __('URL to share', 'sociallocker'), 'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'facebook_share_url'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'facebook_share_title', 'default' => __('share', 'sociallocker')), array('type' => 'more-link', 'name' => 'share-button-options', 'title' => __('Show more options', 'sociallocker'), 'count' => 5, 'items' => array(array('type' => 'form-group', 'id' => 'opanda-facebook-share-vs-feed', 'title' => __('Feed Dialog Or Share Dialog', 'sociallocker'), 'hint' => __('By default the plugin uses the Facebook <a href="https://developers.facebook.com/docs/sharing/reference/feed-dialog/" target="_blank">Feed Dialog</a>. But some users believe that posts published via the Facebook <a href="https://developers.facebook.com/docs/sharing/reference/share-dialog" target="_blank">Share Dialog</a> appear more often on the top of the news feeds and this way bring more traffic.  Both the dialogue perform the same action (sharing) and look approximately equally.', 'sociallocker'), 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Use Facebook Share Dialog', 'sociallocker'), 'hint' => __('Optional. Set On to use the Facebook Share Dialog instead of the Facebook Feed Dialog. Use the <A href="http://davidwalsh.name/facebook-meta-tags" target="_blank">Open Graph Meta Tags</a> to specify the message to share for the Share Dialog.', 'sociallocker'), 'name' => 'facebook_share_dialog', 'default' => false))), array('type' => 'form-group', 'id' => 'opanda-facebook-message-to-share', 'title' => __('Message To Share', 'sociallocker'), 'hint' => __('By default the message is extracted from the page content (from the <A href="http://davidwalsh.name/facebook-meta-tags" target="_blank">Open Graph Meta Tags</a>). But for the Feed Dialog you can set an own message.', 'sociallocker'), 'items' => array(array('type' => 'textbox', 'title' => __('Name', 'sociallocker'), 'hint' => __('Optional. The name of the link attachment.', 'sociallocker'), 'name' => 'facebook_share_message_name'), array('type' => 'textbox', 'title' => __('Caption', 'sociallocker'), 'hint' => __('Optional. The caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link.', 'sociallocker'), 'name' => 'facebook_share_message_caption'), array('type' => 'textbox', 'title' => __('Description', 'sociallocker'), 'hint' => __('Optional. The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page.', 'sociallocker'), 'name' => 'facebook_share_message_description'), array('type' => 'textbox', 'title' => __('Image', 'sociallocker'), 'hint' => __('Optional. The URL of a picture attached to this post. The picture must be at least 50px by 50px (though minimum 200px by 200px is preferred) and have a maximum aspect ratio of 3:1.', 'sociallocker'), 'name' => 'facebook_share_message_image')))))));
     // - Twitter Follow Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'twitter-follow', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'twitter-follow_available', 'default' => false), array('type' => 'url', 'title' => __('User to Follow', 'sociallocker'), 'hint' => __('Set an URL of your Twitter profile (for example, <a href="https://twitter.com/byonepress" target="_blank">https://twitter.com/byonepress</a>).', 'sociallocker'), 'name' => 'twitter_follow_url'), array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Hide Username', 'sociallocker'), 'hint' => __('Set On to hide your username on the button (makes the button shorter).', 'sociallocker'), 'name' => 'twitter_follow_hide_name'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'twitter_follow_title', 'default' => __('follow us', 'sociallocker'))));
     // - Google Share Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'google-share', 'items' => array(array('type' => 'html', 'html' => '<div class="alert alert-warning">' . __('<strong>Warning!</strong> The Google Share button will not appear on mobile devices because it\'s not possible to catch the moment when the mobile user clicks on the button. Also please pay attention the plugin cannot track whether the user shared actually or not. If the user closes the Share Dialog without sharing, the content will be unlocked.', 'sociallocker') . '</div>'), array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'google-share_available'), array('type' => 'url', 'title' => __('URL to share', 'sociallocker'), 'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'google_share_url'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'google_share_title', 'default' => __('share', 'sociallocker'))));
     // - YouTube Subscribe
     // if the user has not set the cliend id, show a notice
     $googleClientId = get_option('opanda_google_client_id', false);
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'youtube-subscribe', 'items' => array(array('off' => !empty($googleClientId), 'type' => 'html', 'html' => '<div class="alert alert-warning">' . sprintf(__(' The YouTube Button requires the Google Client ID linked to your domain. Before using the button, please <a href="%s" target="_blank">set the Client ID</a>.', 'sociallocker'), opanda_get_settings_url('social')) . '</div>'), array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'youtube-subscribe_available', 'default' => false), array('type' => 'textbox', 'title' => __('Channel ID', 'sociallocker'), 'hint' => __('Set a channel ID to subscribe (for example, <a href="http://www.youtube.com/channel/UCANLZYMidaCbLQFWXBC95Jg" target="_blank">UCANLZYMidaCbLQFWXBC95Jg</a>).', 'sociallocker'), 'name' => 'google_youtube_channel_id'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A visible title of the buttons that is used in some themes (by default only in the Secrets theme).', 'sociallocker'), 'name' => 'google_youtube_title', 'default' => __('Youtube', 'sociallocker'))));
     // - LinkedIn Share Tab
     $tabs['items'][] = array('type' => 'tab-item', 'name' => 'linkedin-share', 'items' => array(array('type' => 'checkbox', 'way' => 'buttons', 'title' => __('Available', 'sociallocker'), 'hint' => __('Set On, to activate the button.', 'sociallocker'), 'name' => 'linkedin-share_available', 'default' => false), array('type' => 'url', 'title' => __('URL to share', 'sociallocker'), 'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'), 'name' => 'linkedin_share_url'), array('type' => 'textbox', 'title' => __('Button Title', 'sociallocker'), 'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'), 'name' => 'linkedin_share_title', 'default' => __('share', 'sociallocker'))));
     $tabs = apply_filters('onp_sl_social_options', $tabs);
     $defaultOrder = array();
     if ($vkIsActiveByDefault) {
         $defaultOrder[] = 'vk-like';
     }
     if ($facebookIsActiveByDefault) {
         $defaultOrder[] = 'facebook-like';
     }
     if ($twitterActiveByDefault) {
         $defaultOrder[] = 'twitter-tweet';
     }
     if ($googleIsActiveByDefault) {
         $defaultOrder[] = 'google-plus';
     }
     $form->add(array(array('type' => 'checkbox', 'way' => 'buttons', 'name' => 'show_counters', 'title' => __('Show counters', 'sociallocker'), 'default' => true), array('type' => 'html', 'html' => '<div class="onp-sl-metabox-hint">
                             <strong>' . __('Hint', 'sociallocker') . '</strong>: ' . __('Drag and drop the tabs to change the order of the buttons.', 'sociallocker') . '</div>'), array('type' => 'hidden', 'name' => 'buttons_order', 'default' => implode(',', $defaultOrder)), $tabs));
 }
    /**
     * 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 
    }
Example #10
0
    public function exportAction()
    {
        global $bizpanda;
        $error = null;
        $warning = null;
        // getting a list of lockers
        $lockerIds = array();
        global $wpdb;
        $data = $wpdb->get_results("SELECT l.lead_item_id AS locker_id, COUNT(l.ID) AS count, p.post_title AS locker_title " . "FROM {$wpdb->prefix}opanda_leads AS l " . "LEFT JOIN {$wpdb->prefix}posts AS p ON p.ID = l.lead_item_id " . "GROUP BY l.lead_item_id", ARRAY_A);
        $lockerList = array(array('all', __('Mark All', 'bizpanda')));
        foreach ($data as $items) {
            $lockerList[] = array($items['locker_id'], $items['locker_title'] . ' (' . $items['count'] . ')');
            $lockerIds[] = $items['locker_id'];
        }
        // default values
        $status = 'all';
        $fields = array('lead_email', 'lead_name', 'lead_family');
        $delimiter = ',';
        // custom fields
        $customFields = OPanda_Leads::getCustomFields();
        $selectedCustomFields = array();
        $customFieldsForList = array();
        foreach ($customFields as $customField) {
            $customFieldsForList[] = array($customField->field_name, $customField->field_name);
        }
        // exporting
        if (isset($_POST['opanda_export'])) {
            // - delimiter
            $delimiter = isset($_POST['opanda_delimiter']) ? $_POST['opanda_delimiter'] : ',';
            if (!in_array($status, array(',', ';'))) {
                $status = ',';
            }
            // - channels
            $lockers = isset($_POST['opanda_lockers']) ? $_POST['opanda_lockers'] : array();
            $lockerIds = array();
            foreach ($lockers as $lockerId) {
                if ('all' == $lockerId) {
                    continue;
                }
                $lockerIds[] = intval($lockerId);
            }
            // - status
            $status = isset($_POST['opanda_status']) ? $_POST['opanda_status'] : 'all';
            if (!in_array($status, array('all', 'confirmed', 'not-confirmed'))) {
                $status = 'all';
            }
            // - fields
            $rawFields = isset($_POST['opanda_fields']) ? $_POST['opanda_fields'] : array();
            $fields = array();
            foreach ($rawFields as $field) {
                if (!in_array($field, array('lead_email', 'lead_display_name', 'lead_name', 'lead_family', 'lead_ip'))) {
                    continue;
                }
                $fields[] = $field;
            }
            // - custom fields
            $rawCustomFields = isset($_POST['opanda_custom_fields']) ? $_POST['opanda_custom_fields'] : array();
            $selectedCustomFields = array();
            foreach ($rawCustomFields as $customField) {
                $selectedCustomFields[] = $customField;
            }
            if (empty($lockers) || empty($fields)) {
                $error = __('Please make sure that you selected at least one channel and field.', 'bizpanda');
            } else {
                $sql = 'SELECT leads.ID,';
                $sqlFields = array();
                foreach ($fields as $field) {
                    $sqlFields[] = 'leads.' . $field;
                }
                $sql .= implode(',', $sqlFields);
                if (!empty($selectedCustomFields)) {
                    $sql .= ',fields.field_name,fields.field_value';
                }
                $sql .= ' FROM ' . $wpdb->prefix . 'opanda_leads AS leads ';
                if (!empty($selectedCustomFields)) {
                    $sql .= 'LEFT JOIN ' . $wpdb->prefix . 'opanda_leads_fields AS fields ON fields.lead_id = leads.ID ';
                }
                $sql .= 'WHERE leads.lead_item_id IN (' . implode(',', $lockerIds) . ')';
                if ('all' != $status) {
                    $sql .= ' AND leads.lead_email_confirmed = ' . ('confirmed' == $status ? '1' : '0');
                }
                $result = $wpdb->get_results($sql, ARRAY_A);
                $leads = array();
                foreach ($result as $item) {
                    $id = $item['ID'];
                    if (!isset($leads[$id])) {
                        $leads[$id] = array();
                        foreach ($fields as $field) {
                            $leads[$id][$field] = $item[$field];
                        }
                        foreach ($selectedCustomFields as $field) {
                            $leads[$id][$field] = null;
                        }
                    }
                    if (!empty($item['field_name']) && in_array($item['field_name'], $selectedCustomFields)) {
                        $leads[$id][$item['field_name']] = $item['field_value'];
                    }
                }
                if (empty($leads)) {
                    $warning = __('No leads found. Please try to change the settings of exporting.', 'bizpanda');
                } else {
                    $filename = 'leads-' . date('Y-m-d-H-i-s') . '.csv';
                    header("Content-Type: text/csv");
                    header("Content-Disposition: attachment; filename=" . $filename);
                    header("Cache-Control: no-cache, no-store, must-revalidate");
                    header("Pragma: no-cache");
                    header("Expires: 0");
                    $output = fopen("php://output", "w");
                    foreach ($leads as $row) {
                        fputcsv($output, $row, $delimiter);
                    }
                    fclose($output);
                    exit;
                }
            }
        }
        // creating a form
        $form = new FactoryForms328_Form(array('scope' => 'opanda', 'name' => 'exporting'), $bizpanda);
        $form->setProvider(new FactoryForms328_OptionsValueProvider(array('scope' => 'opanda')));
        $options = array(array('type' => 'separator'), array('type' => 'radio', 'name' => 'format', 'title' => __('Format', 'bizpanda'), 'hint' => __('Only the CSV format is available currently.'), 'data' => array(array('csv', __('CSV File', 'bizpanda'))), 'default' => 'csv'), array('type' => 'radio', 'name' => 'delimiter', 'title' => __('Delimiter', 'bizpanda'), 'hint' => __('Choose a delimiter for a CSV document.'), 'data' => array(array(',', __('Comma', 'bizpanda')), array(';', __('Semicolon', 'bizpanda'))), 'default' => $delimiter), array('type' => 'separator'), array('type' => 'list', 'way' => 'checklist', 'name' => 'lockers', 'title' => __('Channels', 'bizpanda'), 'hint' => __('Mark lockers which attracted leads you wish to export.'), 'data' => $lockerList, 'default' => implode(',', $lockerIds)), array('type' => 'radio', 'name' => 'status', 'title' => __('Email Status', 'bizpanda'), 'hint' => __('Choose the email status of leads to export.'), 'data' => array(array('all', __('All', 'bizpanda')), array('confirmed', __('Only Confirmed Emails', 'bizpanda')), array('not-confirmed', __('Only Not Confirmed', 'bizpanda'))), 'default' => $status), array('type' => 'separator'), array('type' => 'list', 'way' => 'checklist', 'name' => 'fields', 'title' => __('Fields To Export', 'bizpanda'), 'data' => array(array('lead_email', __('Email', 'bizpanda')), array('lead_display_name', __('Display Name', 'bizpanda')), array('lead_name', __('Firstname', 'bizpanda')), array('lead_family', __('Lastname', 'bizpanda')), array('lead_ip', __('IP', 'bizpanda'))), 'default' => implode(',', $fields)));
        if (!empty($customFieldsForList)) {
            $options[] = array('type' => 'list', 'way' => 'checklist', 'name' => 'custom_fields', 'title' => __('Custom Fields', 'bizpanda'), 'data' => $customFieldsForList, 'default' => implode(',', $selectedCustomFields));
        }
        $options[] = array('type' => 'separator');
        $form->add($options);
        ?>
            <div class="wrap" id="opanda-export-page">

                <h2>
                    <?php 
        _e('Exporting Leads', 'bizpanda');
        ?>
                </h2>

                <p style="margin-top: 0px;"> <?php 
        _e('Select leads you would like to export and click the button "Export Leads".', 'bizpanda');
        ?>
</p>

                <div class="factory-bootstrap-329 factory-fontawesome-320">

                    <?php 
        if ($error) {
            ?>
                    <div class="alert alert-danger"><?php 
            echo $error;
            ?>
</div>
                    <?php 
        }
        ?>

                    <?php 
        if ($warning) {
            ?>
                    <div class="alert alert-normal"><?php 
            echo $warning;
            ?>
</div>
                    <?php 
        }
        ?>
 

                    <form method="post" class="form-horizontal">
                        <?php 
        $form->html();
        ?>

                        <div class="form-group form-horizontal">
                            <label class="col-sm-2 control-label"> </label>
                            <div class="control-group controls col-sm-10">
                                <input name="opanda_export" class="btn btn-primary" type="submit" value="<?php 
        _e('Export Leads', 'bizpanda');
        ?>
"/>
                            </div>
                        </div>
                    </form> 
                </div>
            </div>
            <?php 
    }