/** * Returns an array of the pages of the section 'How to use?'. * * @since 1.0.0 * @return mixed[] */ protected function getPages() { if ($this->_pages !== false) { return $this->_pages; } $items = array(array('name' => 'social-apps', 'title' => __('Creating Social Apps', 'bizpanda'), 'hollow' => true, 'items' => array(array('name' => 'facebook-app', 'title' => __('Creating Facebook App', 'bizpanda')), array('name' => 'twitter-app', 'title' => __('Creating Twitter App', 'bizpanda')), array('name' => 'google-client-id', 'title' => __('Getting Google Client ID', 'bizpanda')))), array('name' => 'troubleshooting', 'title' => __('Troubleshooting', 'bizpanda'))); if (BizPanda::hasFeature('linkedin')) { $items[0]['items'][] = array('name' => 'linkedin-api-key', 'title' => __('Getting LinkedIn API Key', 'bizpanda')); } $this->_pages = apply_filters('opanda_help_pages', $items); return $this->_pages; }
/** * 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; }
/** * Returns subscription options. * * @since 1.0.0 * @return mixed[] */ public function getOptions() { $languages = array(array('ca_ES', __('Catalan', 'bizpanda')), array('cs_CZ', __('Czech', 'bizpanda')), array('cy_GB', __('Welsh', 'bizpanda')), array('da_DK', __('Danish', 'bizpanda')), array('de_DE', __('German', 'bizpanda')), array('eu_ES', __('Basque', 'bizpanda')), array('en_US', __('English', 'bizpanda')), array('es_ES', __('Spanish', 'bizpanda')), array('fi_FI', __('Finnish', 'bizpanda')), array('fr_FR', __('French', 'bizpanda')), array('gl_ES', __('Galician', 'bizpanda')), array('hu_HU', __('Hungarian', 'bizpanda')), array('it_IT', __('Italian', 'bizpanda')), array('ja_JP', __('Japanese', 'bizpanda')), array('ko_KR', __('Korean', 'bizpanda')), array('nb_NO', __('Norwegian', 'bizpanda')), array('nl_NL', __('Dutch', 'bizpanda')), array('pl_PL', __('Polish', 'bizpanda')), array('pt_BR', __('Portuguese (Brazil)', 'bizpanda')), array('pt_PT', __('Portuguese (Portugal)', 'bizpanda')), array('ro_RO', __('Romanian', 'bizpanda')), array('ru_RU', __('Russian', 'bizpanda')), array('sk_SK', __('Slovak', 'bizpanda')), array('sl_SI', __('Slovenian', 'bizpanda')), array('sv_SE', __('Swedish', 'bizpanda')), array('th_TH', __('Thai', 'bizpanda')), array('tr_TR', __('Turkish', 'bizpanda')), array('ku_TR', __('Kurdish', 'bizpanda')), array('zh_CN', __('Simplified Chinese (China)', 'bizpanda')), array('zh_HK', __('Traditional Chinese (Hong Kong)', 'bizpanda')), array('zh_TW', __('Traditional Chinese (Taiwan)', 'bizpanda')), array('af_ZA', __('Afrikaans', 'bizpanda')), array('sq_AL', __('Albanian', 'bizpanda')), array('hy_AM', __('Armenian', 'bizpanda')), array('az_AZ', __('Azeri', 'bizpanda')), array('be_BY', __('Belarusian', 'bizpanda')), array('bn_IN', __('Bengali', 'bizpanda')), array('bs_BA', __('Bosnian', 'bizpanda')), array('bg_BG', __('Bulgarian', 'bizpanda')), array('hr_HR', __('Croatian', 'bizpanda')), array('nl_BE', __('Dutch (Belgie)', 'bizpanda')), array('eo_EO', __('Esperanto', 'bizpanda')), array('et_EE', __('Estonian', 'bizpanda')), array('fo_FO', __('Faroese', 'bizpanda')), array('ka_GE', __('Georgian', 'bizpanda')), array('el_GR', __('Greek', 'bizpanda')), array('gu_IN', __('Gujarati', 'bizpanda')), array('hi_IN', __('Hindi', 'bizpanda')), array('is_IS', __('Icelandic', 'bizpanda')), array('id_ID', __('Indonesian', 'bizpanda')), array('ga_IE', __('Irish', 'bizpanda')), array('jv_ID', __('Javanese', 'bizpanda')), array('kn_IN', __('Kannada', 'bizpanda')), array('kk_KZ', __('Kazakh', 'bizpanda')), array('la_VA', __('Latin', 'bizpanda')), array('lv_LV', __('Latvian', 'bizpanda')), array('li_NL', __('Limburgish', 'bizpanda')), array('lt_LT', __('Lithuanian', 'bizpanda')), array('mk_MK', __('Macedonian', 'bizpanda')), array('mg_MG', __('Malagasy', 'bizpanda')), array('ms_MY', __('Malay', 'bizpanda')), array('mt_MT', __('Maltese', 'bizpanda')), array('mr_IN', __('Marathi', 'bizpanda')), array('mn_MN', __('Mongolian', 'bizpanda')), array('ne_NP', __('Nepali', 'bizpanda')), array('pa_IN', __('Punjabi', 'bizpanda')), array('rm_CH', __('Romansh', 'bizpanda')), array('sa_IN', __('Sanskrit', 'bizpanda')), array('sr_RS', __('Serbian', 'bizpanda')), array('so_SO', __('Somali', 'bizpanda')), array('sw_KE', __('Swahili', 'bizpanda')), array('tl_PH', __('Filipino', 'bizpanda')), array('ta_IN', __('Tamil', 'bizpanda')), array('tt_RU', __('Tatar', 'bizpanda')), array('te_IN', __('Telugu', 'bizpanda')), array('ml_IN', __('Malayalam', 'bizpanda')), array('uk_UA', __('Ukrainian', 'bizpanda')), array('uz_UZ', __('Uzbek', 'bizpanda')), array('vi_VN', __('Vietnamese', 'bizpanda')), array('xh_ZA', __('Xhosa', 'bizpanda')), array('zu_ZA', __('Zulu', 'bizpanda')), array('km_KH', __('Khmer', 'bizpanda')), array('tg_TJ', __('Tajik', 'bizpanda')), array('ar_AR', __('Arabic', 'bizpanda')), array('he_IL', __('Hebrew', 'bizpanda')), array('ur_PK', __('Urdu', 'bizpanda')), array('fa_IR', __('Persian', 'bizpanda')), array('sy_SY', __('Syriac', 'bizpanda')), array('yi_DE', __('Yiddish', 'bizpanda')), array('gn_PY', __('Guarani', 'bizpanda')), array('qu_PE', __('Quechua', 'bizpanda')), array('ay_BO', __('Aymara', 'bizpanda')), array('se_NO', __('Northern Sami', 'bizpanda')), array('ps_AF', __('Pashto', 'bizpanda'))); $options = array(); $options[] = array('type' => 'separator'); $options[] = array('type' => 'dropdown', 'name' => 'lang', 'title' => __('Language of Buttons', 'bizpanda'), 'data' => $languages, 'hint' => __('Select the language that will be used for the social buttons in Social Lockers.', 'bizpanda')); $options[] = array('type' => 'separator'); $options[] = array('type' => 'textbox', 'name' => 'facebook_appid', 'title' => __('Facebook App ID', 'bizpanda'), 'hint' => sprintf(__('By default, the developer app id is set. If you want to use the Facebook Share or Facebook Sign-In buttons you need to <a href="%s">register another app</a> id for your website.', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app')), 'after' => sprintf(__('<a href="%s" class="btn btn-default">Register App</a>', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app'))); $options[] = array('type' => 'dropdown', 'way' => 'buttons', 'name' => 'facebook_version', 'title' => __('Facebook API Version', 'bizpanda'), 'default' => 'v2.4', 'data' => array(array('v1.0', 'v1.0'), array('v2.0', 'v2.0'), array('v2.3', 'v2.3'), array('v2.4', 'v2.4')), 'hint' => __('Optional. Use the most recent version of the API (v2.4) but if Facebook buttons or widgets don\'t work on your website try to switch to other versions.', 'bizpanda')); $options[] = array('type' => 'separator'); $options[] = array('type' => 'dropdown', 'name' => 'twitter_use_dev_keys', 'title' => __('Twitter API Keys', 'bizpanda'), 'data' => array(array('default', __('Use the default keys', 'bizpanda')), array('custom', __('Use my own Twitter App', 'bizpanda'))), 'after' => sprintf(__('<a href="%s" class="btn btn-default">Register App</a>', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=twitter-app')), 'hint' => sprintf(__('The Twitter Sign-In button requires a Twitter App. We prepared one for you by default. But if you worry about security, you can <a href="%s">create an own app</a>. Also by creating your own Twitter app you will be able to change the title, description and image for the "Sign In" popup window.', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=twitter-app'))); $options[] = array('type' => 'div', 'id' => 'opanda-twitter-custom-options', 'class' => 'opanda-hidden', 'items' => array(array('type' => 'textbox', 'name' => 'twitter_consumer_key', 'title' => __('Twitter Consumer Key', 'bizpanda'), 'hint' => __('The Twitter Consumer Key of your Twitter App.', 'bizpanda'), 'for' => array(__('Connect Locker', 'bizpanda'))), array('type' => 'textbox', 'name' => 'twitter_consumer_secret', 'title' => __('Twitter Consumer Secret', 'bizpanda'), 'hint' => __('The Twitter Consumer Secret of your Twitter App.', 'bizpanda'), 'for' => array(__('Connect Locker', 'bizpanda'))))); $options[] = array('type' => 'separator'); $options[] = array('type' => 'textbox', 'name' => 'google_client_id', 'title' => __('Google Client ID', 'bizpanda'), 'after' => sprintf(__('<a href="%s" class="btn btn-default">Get Client ID</a>', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=google-client-id')), 'hint' => sprintf(__('If you want to use the YouTube Subscribe or Google Sign-In buttons, please <a href="%s">create a Client ID</a> for your website.', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=google-client-id'))); if (BizPanda::hasFeature('linkedin')) { $options[] = array('type' => 'separator'); $options[] = array('type' => 'textbox', 'name' => 'linkedin_api_key', 'title' => __('LinkedIn Client ID', 'bizpanda'), 'after' => sprintf(__('<a href="%s" class="btn btn-default">Get Client ID</a>', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=linkedin-api-key')), 'hint' => sprintf(__('If you want to use the LinkedIn Sign-In button, please <a href="%s">get a Client ID</a> for your website.', 'bizpanda'), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=linkedin-api-key'))); } $options[] = array('type' => 'separator'); return $options; }
/** * 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 }
/** * 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 }