Пример #1
0
 /**
  * Returns all registered themes.
  * 
  * @since 3.3.3
  * @param string $format the format of the output array, available values: 'dropdown'.
  * @return mixed[]
  */
 public static function getThemes($item = null, $format = null)
 {
     $themes = array();
     if (!self::$themesRegistered) {
         do_action('onp_sl_register_themes', $item);
         self::$themesRegistered = true;
     }
     $themes = self::$themes;
     if ($item) {
         $allThemes = $themes;
         $themes = array();
         foreach ($allThemes as $themeName => $themeData) {
             if (isset($themeData['items']) && !in_array($item, $themeData['items'])) {
                 continue;
             }
             $themes[$themeName] = $themeData;
         }
     }
     if ('dropdown' === $format) {
         $output = array();
         foreach ($themes as $theme) {
             $output[] = array('title' => $theme['title'], 'value' => $theme['name'], 'hint' => isset($theme['hint']) ? $theme['hint'] : null, 'data' => array('preview' => isset($theme['preview']) ? $theme['preview'] : null, 'previewHeight' => isset($theme['previewHeight']) ? $theme['previewHeight'] : null));
         }
         return $output;
     }
     return $themes;
 }
Пример #2
0
/**
 * Registers default themes.
 * 
 * We don't need to include the file containing the file OPanda_ThemeManager because this function will
 * be called from the hook defined inside the class OPanda_ThemeManager.
 * 
 * @see onp_sl_register_themes
 * @see OPanda_ThemeManager
 * 
 * @since 1.0.0
 * @return void 
 */
function opanda_register_social_locker_themes()
{
    OPanda_ThemeManager::registerTheme(array('name' => 'starter', 'title' => 'Starter', 'path' => OPANDA_BIZPANDA_DIR . '/themes/starter', 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'secrets', 'title' => 'Secrets', 'path' => OPANDA_BIZPANDA_DIR . '/themes/secrets', 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'dandyish', 'title' => 'Dandyish [Premium]', 'preview' => 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/preview/dansyish.png', 'hint' => sprintf(__('This theme is available only in the <a href="%s" target="_blank">premium version</a> of the plugin', 'sociallocker'), opanda_get_premium_url(null, 'themes')), 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'glass', 'title' => 'Glass [Premium]', 'preview' => 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/preview/glass.png', 'hint' => sprintf(__('This theme is available only in the <a href="%s" target="_blank">premium version</a> of the plugin', 'sociallocker'), opanda_get_premium_url(null, 'themes')), 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'flat', 'title' => 'Flat [Premium]', 'preview' => 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/preview/flat.png', 'hint' => sprintf(__('This theme is available only in the <a href="%s" target="_blank">premium version</a> of the plugin', 'sociallocker'), opanda_get_premium_url(null, 'themes')), 'items' => array('social-locker')));
}
Пример #3
0
/**
 * Registers default themes.
 * 
 * We don't need to include the file containing the file OPanda_ThemeManager because this function will
 * be called from the hook defined inside the class OPanda_ThemeManager.
 * 
 * @see onp_sl_register_themes
 * @see OPanda_ThemeManager
 * 
 * @since 1.0.0
 * @return void 
 */
function opanda_register_social_locker_themes()
{
    OPanda_ThemeManager::registerTheme(array('name' => 'starter', 'title' => 'Starter', 'path' => OPANDA_BIZPANDA_DIR . '/themes/starter', 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'secrets', 'title' => 'Secrets', 'path' => OPANDA_BIZPANDA_DIR . '/themes/secrets', 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'dandyish', 'title' => 'Dandyish', 'path' => OPANDA_BIZPANDA_DIR . '/themes/dandyish', 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'glass', 'title' => 'Glass', 'path' => OPANDA_BIZPANDA_DIR . '/themes/glass', 'items' => array('social-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'flat', 'title' => 'Flat', 'path' => OPANDA_BIZPANDA_DIR . '/themes/flat', 'items' => array('social-locker')));
}
 /**
  * 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;
     }
     $form->add(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'))));
     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')));
 }
Пример #5
0
/**
 * Registers default themes.
 * 
 * We don't need to include the file containing the file OPanda_ThemeManager because this function will
 * be called from the hook defined inside the class OPanda_ThemeManager.
 * 
 * @see onp_sl_register_themes
 * @see OPanda_ThemeManager
 * 
 * @since 1.0.0
 * @return void 
 */
function opanda_register_signin_locker_themes($item = 'signin-locker')
{
    OPanda_ThemeManager::registerTheme(array('name' => 'great-attractor', 'title' => 'Great Attractor', 'path' => OPANDA_BIZPANDA_DIR . '/themes/great-attractor', 'items' => array('signin-locker', 'email-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'friendly-giant', 'title' => 'Friendly Giant [Premium]', 'preview' => 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/preview/friendly-giant.png', 'previewHeight' => 400, 'hint' => sprintf(__('This theme is available only in the <a href="%s" target="_blank">premium version</a> of the plugin', 'signinlocker'), opanda_get_premium_url(null, 'themes')), 'items' => array('signin-locker', 'email-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'dark-force', 'title' => 'Dark Force [Premium]', 'preview' => 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/preview/dark-force.png', 'previewHeight' => 400, 'hint' => sprintf(__('This theme is available only in the <a href="%s" target="_blank">premium version</a> of the plugin', 'signinlocker'), opanda_get_premium_url(null, 'themes')), 'items' => array('signin-locker', 'email-locker')));
}
Пример #6
0
/**
 * Registers default themes.
 * 
 * We don't need to include the file containing the file OPanda_ThemeManager because this function will
 * be called from the hook defined inside the class OPanda_ThemeManager.
 * 
 * @see onp_sl_register_themes
 * @see OPanda_ThemeManager
 * 
 * @since 1.0.0
 * @return void 
 */
function opanda_register_signin_locker_themes($item = 'signin-locker')
{
    OPanda_ThemeManager::registerTheme(array('name' => 'great-attractor', 'title' => 'Great Attractor', 'path' => OPANDA_BIZPANDA_DIR . '/themes/great-attractor', 'items' => array('signin-locker', 'email-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'friendly-giant', 'title' => 'Friendly Giant', 'path' => OPANDA_BIZPANDA_DIR . '/themes/friendly-giant', 'items' => array('signin-locker', 'email-locker')));
    OPanda_ThemeManager::registerTheme(array('name' => 'dark-force', 'title' => 'Dark Force', 'path' => OPANDA_BIZPANDA_DIR . '/themes/dark-force', 'items' => array('signin-locker', 'email-locker')));
}