/**
 * Registers metaboxes for Social Locker.
 * 
 * @see opanda_item_type_metaboxes
 * @since 1.0.0
 */
function opanda_socail_locker_metaboxes($metaboxes)
{
    $metaboxes[] = array('class' => 'OPanda_SocialOptionsMetaBox', 'path' => BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/metaboxes/social-options.php');
    if (OPanda_Items::isCurrentFree()) {
        $metaboxes[] = array('class' => 'OPanda_SocialLockerMoreFeaturesMetaBox', 'path' => BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/metaboxes/more-features.php');
    }
    return $metaboxes;
}
 /**
  * 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);
 }
 /**
  * Replaces the 'blurring' overlap with 'transparence' in the free version.
  * 
  * @since 1.0.0
  * @param type $postId
  */
 public function onSavingForm($postId)
 {
     if (!OPanda_Items::isCurrentFree()) {
         return;
     }
     $overlap = isset($_POST['opanda_overlap']) ? $_POST['opanda_overlap'] : null;
     if ($overlap == 'blurring') {
         $_POST['opanda_overlap'] = 'transparence';
     }
 }