public static function init() { if (!self::$initiated) { self::$initiated = true; if (isset($_GET['type'])) { if ($_GET['type'] === 'community' || $_GET['type'] === 'enterprise') { update_option('livefyre_apps-initial_modal_shown', true); update_option('livefyre_apps-package_type', sanitize_text_field($_GET['type'])); wp_redirect(self::get_page_url('livefyre_apps') . '&settings-updated=environment_changed'); } } self::init_hooks(); self::init_apps(); } }
/** * Run Livefyre Comments page */ public static function menu_comments() { //hide import message call if (isset($_GET['hide_import_message'])) { update_option('livefyre_apps-livefyre_import_status', 'complete'); wp_redirect(Livefyre_Apps_Admin::get_page_url('livefyre_apps_comments')); exit; } //check for import status updates if (isset($_GET['status'])) { update_option('livefyre_apps-' . 'livefyre_import_status', sanitize_text_field($_GET['status'])); if (isset($_GET['message'])) { update_option('livefyre_apps-' . 'livefyre_import_message', urldecode(sanitize_text_field($_GET['message']))); } } if (isset($_GET['allow_comments_id'])) { $allow_id = sanitize_text_field($_GET['allow_comments_id']); if ($allow_id == 'all_posts') { self::update_posts_nc(false); } else { if ($allow_id == 'all_pages') { self::update_posts_nc(false); } else { self::update_posts_nc($allow_id, false); } } } //process settings form if (isset($_POST['livefyre_comments_general']) && check_admin_referer('form-livefyre_comments_general')) { $excludes = array('_builtin' => false); $post_types = get_post_types($args = $excludes); $post_types = array_merge(array('post' => 'post', 'page' => 'page'), $post_types); foreach ($post_types as $post_type) { $post_type_name = 'livefyre_display_' . $post_type; if (isset($_POST[$post_type_name])) { update_option('livefyre_apps-' . $post_type_name, true); } else { update_option('livefyre_apps-' . $post_type_name, false); } } Livefyre_Apps::$form_saved = true; } LFAPPS_View::render('general', array(), 'comments'); }
echo get_option('livefyre_apps-package_type') === 'enterprise' ? 'checked' : ''; ?> > <?php esc_html_e('Enterprise', 'lfapps'); ?> </h4> <p><?php esc_html_e('For high-volume publishers and brands who want access to all Livefyre apps, enterprise support and ownership of user data. Enterprise API key required. Learn more >', 'lfapps'); ?> <a href='http://web.livefyre.com/streamhub/'>Streamhub</a></p> </label> </div> </div> <div class="lfapps-env-submit"> <input type="hidden" id="lfapps-env-url" value="<?php echo esc_url(Livefyre_Apps_Admin::get_page_url('livefyre_apps')); ?> "/> <a href="#" id="lfapps-env-submit-btn" class="button button-primary"><?php esc_html_e('Save Changes'); ?> </a> <?php if (get_option('livefyre_apps-initial_modal_shown')) { ?> <a href="#" id="lfapps-env-cancel-btn" class="button button-secondary"><?php esc_html_e('Cancel'); ?> </a> <?php }