Sprzątanie nieużywanych pluginów i załączenie tych wykorzystywanych: ToDo: przetłumaczenie do końca pluginów.
BIN
client-portal.1.0.4.zip
Normal file
BIN
client-portal/assets/logo_landing_pb_2x_red.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
26
client-portal/assets/style.css
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.cl-grid{
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: auto;
|
||||||
|
display: grid;
|
||||||
|
grid-gap: 40px;
|
||||||
|
grid-template-columns: 60% 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pb-pitch h2{
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight:normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pb-pitch h3{
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pb-pitch p, .pb-pitch ul{
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pb-pitch ul{
|
||||||
|
list-style-type: disc;
|
||||||
|
margin: 0 0 auto 20px;
|
||||||
|
}
|
555
client-portal/index.php
Normal file
@ -0,0 +1,555 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Plugin Name: Client Portal
|
||||||
|
* Plugin URI: http://www.cozmoslabs.com/
|
||||||
|
* Description: Build a company site with a client portal where clients login and see a restricted-access, personalized page of content with links and downloads.
|
||||||
|
* Version: 1.0.4
|
||||||
|
* Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian
|
||||||
|
* Author URI: http://www.cozmoslabs.com
|
||||||
|
* License: GPL2
|
||||||
|
*/
|
||||||
|
/* Copyright 2015 Cozmoslabs (www.cozmoslabs.com)
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License, version 2, as
|
||||||
|
published by the Free Software Foundation.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* Define plugin path
|
||||||
|
*/
|
||||||
|
|
||||||
|
define( 'CP_URL', plugin_dir_url( __FILE__ ) );
|
||||||
|
|
||||||
|
class CL_Client_Portal
|
||||||
|
{
|
||||||
|
private $slug;
|
||||||
|
private $defaults;
|
||||||
|
public $options;
|
||||||
|
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
$this->slug = 'cp-options';
|
||||||
|
$this->options = get_option( $this->slug );
|
||||||
|
$this->defaults = array(
|
||||||
|
'page-slug' => 'private-page',
|
||||||
|
'support-comments' => 'no',
|
||||||
|
'restricted-message' => __( 'You do not have permission to view this page.', 'client-portal' ),
|
||||||
|
'portal-log-in-message' => __( 'Please log in in order to access the client portal.', 'client-portal' ),
|
||||||
|
'default-page-content' => ''
|
||||||
|
);
|
||||||
|
|
||||||
|
/* register the post type */
|
||||||
|
add_action( 'init', array( $this, 'cp_create_post_type' ) );
|
||||||
|
/* action to create a private page when a user registers */
|
||||||
|
add_action( 'user_register', array( $this, 'cp_create_private_page' ) );
|
||||||
|
/* remove the page when a user is deleted */
|
||||||
|
add_action( 'deleted_user', array( $this, 'cp_delete_private_page' ), 10, 2 );
|
||||||
|
/* restrict the content of the page only to the user */
|
||||||
|
add_filter( 'the_content', array( $this, 'cp_restrict_content' ) );
|
||||||
|
/* add a link in the Users List Table in admin area to access the page */
|
||||||
|
add_filter( 'user_row_actions', array( $this, 'cp_add_link_to_private_page' ), 10, 2);
|
||||||
|
|
||||||
|
/* add bulk action to create private user pages */
|
||||||
|
add_filter( 'admin_footer-users.php', array( $this, 'cp_create_private_page_bulk_actions' ) );
|
||||||
|
add_action( 'admin_action_create_private_page', array( $this, 'cp_create_private_pages_in_bulk' ) );
|
||||||
|
|
||||||
|
/* create client portal extra information */
|
||||||
|
add_filter('the_content', array( $this, 'cp_add_private_page_info'));
|
||||||
|
|
||||||
|
/* create the shortcode for the main page */
|
||||||
|
add_shortcode( 'client-portal', array( $this, 'cp_shortcode' ) );
|
||||||
|
|
||||||
|
/* create the settings page */
|
||||||
|
add_action( 'admin_menu', array( $this, 'cp_add_settings_page' ) );
|
||||||
|
/* register the settings */
|
||||||
|
add_action( 'admin_init', array( $this, 'cp_register_settings' ) );
|
||||||
|
/* show notices on the admin settings page */
|
||||||
|
add_action( 'admin_notices', array( $this, 'cp_admin_notices' ) );
|
||||||
|
// Enqueue scripts on the admin side
|
||||||
|
add_action( 'admin_enqueue_scripts', array( $this, 'cp_enqueue_admin_scripts' ) );
|
||||||
|
/* flush the rewrite rules when settings saved in case page slug was changed */
|
||||||
|
add_action('init', array( $this, 'cp_flush_rules' ), 20 );
|
||||||
|
|
||||||
|
/* make sure we don't have post navigation on the private pages */
|
||||||
|
add_filter( "get_previous_post_where", array( $this, 'cp_exclude_from_post_navigation' ), 10, 5 );
|
||||||
|
add_filter( "get_next_post_where", array( $this, 'cp_exclude_from_post_navigation' ), 10, 5 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that registers the post type
|
||||||
|
*/
|
||||||
|
function cp_create_post_type() {
|
||||||
|
|
||||||
|
$labels = array(
|
||||||
|
'name' => _x( 'Private Pages', 'post type general name', 'client-portal' ),
|
||||||
|
'singular_name' => _x( 'Private Page', 'post type singular name', 'client-portal' ),
|
||||||
|
'menu_name' => _x( 'Private Page', 'admin menu', 'client-portal' ),
|
||||||
|
'name_admin_bar' => _x( 'Private Page', 'add new on admin bar', 'client-portal' ),
|
||||||
|
'add_new' => _x( 'Add New', 'private Page', 'client-portal' ),
|
||||||
|
'add_new_item' => __( 'Add New Private Page', 'client-portal' ),
|
||||||
|
'new_item' => __( 'New Private Page', 'client-portal' ),
|
||||||
|
'edit_item' => __( 'Edit Private Page', 'client-portal' ),
|
||||||
|
'view_item' => __( 'View Private Page', 'client-portal' ),
|
||||||
|
'all_items' => __( 'All Private Pages', 'client-portal' ),
|
||||||
|
'search_items' => __( 'Search Private Pages', 'client-portal' ),
|
||||||
|
'parent_item_colon' => __( 'Parent Private Page:', 'client-portal' ),
|
||||||
|
'not_found' => __( 'No Private Pages found.', 'client-portal' ),
|
||||||
|
'not_found_in_trash' => __( 'No Private Pages found in Trash.', 'client-portal' )
|
||||||
|
);
|
||||||
|
|
||||||
|
$args = array(
|
||||||
|
'labels' => $labels,
|
||||||
|
'description' => __( 'Description.', 'client-portal' ),
|
||||||
|
'public' => true,
|
||||||
|
'publicly_queryable' => true,
|
||||||
|
'show_ui' => true,
|
||||||
|
'show_in_menu' => false,
|
||||||
|
'query_var' => true,
|
||||||
|
'capability_type' => 'post',
|
||||||
|
'has_archive' => false,
|
||||||
|
'hierarchical' => true,
|
||||||
|
'supports' => array( 'title', 'editor', 'thumbnail' ),
|
||||||
|
'exclude_from_search' => true
|
||||||
|
);
|
||||||
|
|
||||||
|
if( !empty( $this->options['page-slug'] ) ){
|
||||||
|
$args['rewrite'] = array( 'slug' => $this->options['page-slug'] );
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$args['rewrite'] = array( 'slug' => $this->defaults['page-slug'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty( $this->options['support-comments'] ) && $this->options['support-comments'] == 'yes' )
|
||||||
|
$args['supports'][] = 'comments';
|
||||||
|
|
||||||
|
register_post_type( 'private-page', $args );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates the private page for a user
|
||||||
|
* @param $user_id the id of the user for which to create the page
|
||||||
|
*/
|
||||||
|
function cp_create_private_page( $user_id ){
|
||||||
|
|
||||||
|
/* check to see if we already have a page for the user */
|
||||||
|
$users_private_pages = $this->cp_get_private_page_for_user( $user_id );
|
||||||
|
if( !empty( $users_private_pages ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* make sure get_userdata() is available at this point */
|
||||||
|
if(is_admin()) require_once( ABSPATH . 'wp-includes/pluggable.php' );
|
||||||
|
|
||||||
|
$user = get_userdata( $user_id );
|
||||||
|
$display_name = '';
|
||||||
|
if( $user ){
|
||||||
|
$display_name = ($user->display_name) ? ($user->display_name) : ($user->user_login);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty( $this->options['default-page-content'] ) )
|
||||||
|
$post_content = $this->options['default-page-content'];
|
||||||
|
else
|
||||||
|
$post_content = $this->defaults['default-page-content'];
|
||||||
|
|
||||||
|
$private_page = array(
|
||||||
|
'post_title' => $display_name,
|
||||||
|
'post_status' => 'publish',
|
||||||
|
'post_type' => 'private-page',
|
||||||
|
'post_author' => $user_id,
|
||||||
|
'post_content' => $post_content
|
||||||
|
);
|
||||||
|
|
||||||
|
// Insert the post into the database
|
||||||
|
wp_insert_post( $private_page );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that deletes the private page when the user is deleted
|
||||||
|
* @param $id the id of the user which page we are deleting
|
||||||
|
* @param $reassign
|
||||||
|
*/
|
||||||
|
function cp_delete_private_page( $id, $reassign ){
|
||||||
|
$private_page_id = $this->cp_get_private_page_for_user( $id );
|
||||||
|
if( !empty( $private_page_id ) ){
|
||||||
|
wp_delete_post( $private_page_id, true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that restricts the content only to the author of the page
|
||||||
|
* @param $content the content of the page
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function cp_restrict_content( $content ){
|
||||||
|
global $post;
|
||||||
|
if( $post->post_type == 'private-page' ){
|
||||||
|
|
||||||
|
if( !empty( $this->options['restricted-message'] ) )
|
||||||
|
$message = $this->options['restricted-message'];
|
||||||
|
else
|
||||||
|
$message = $this->defaults['restricted-message'];
|
||||||
|
|
||||||
|
if( is_user_logged_in() ){
|
||||||
|
if( ( get_current_user_id() == $post->post_author ) || current_user_can('delete_user') ){
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
else return $message;
|
||||||
|
}
|
||||||
|
else return $message;
|
||||||
|
|
||||||
|
}
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds a link in the user listing in admin area to access the private page
|
||||||
|
* @param $actions The actions available on the user listing in admin area
|
||||||
|
* @param $user_object The user object
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function cp_add_link_to_private_page( $actions, $user_object ){
|
||||||
|
$private_page_id = $this->cp_get_private_page_for_user( $user_object->ID );
|
||||||
|
if( !empty( $private_page_id ) ){
|
||||||
|
$actions['private_page_link'] = "<a class='cp_private_page' href='" . admin_url( "post.php?post=$private_page_id&action=edit") . "'>" . __( 'Private Page', 'client-portal' ) . "</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates a private page extra information div
|
||||||
|
* @param $content the content of the private page
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function cp_add_private_page_info( $content ){
|
||||||
|
global $post;
|
||||||
|
if ( is_singular('private-page') && is_user_logged_in() ){
|
||||||
|
// logout link
|
||||||
|
$logout_link = wp_loginout( home_url(), false);
|
||||||
|
|
||||||
|
// author display name. Fallback to username if no display name is set.
|
||||||
|
$author_id=$post->post_author;
|
||||||
|
$user = get_user_by('id', $author_id);
|
||||||
|
$display_name = '';
|
||||||
|
if( $user ){
|
||||||
|
$display_name = ($user->display_name) ? ($user->display_name) : ($user->user_login);
|
||||||
|
}
|
||||||
|
|
||||||
|
$extra_info = "<p class='cp-logout' style='border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 0.5rem 0; text-align: right'> $logout_link - $display_name </p>";
|
||||||
|
|
||||||
|
return $extra_info . $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates a shortcode which redirects the user to its private page
|
||||||
|
* @param $atts the shortcode attributes
|
||||||
|
*/
|
||||||
|
function cp_shortcode( $atts ){
|
||||||
|
if( !is_user_logged_in() ){
|
||||||
|
if( !empty( $this->options['portal-log-in-message'] ) )
|
||||||
|
$message = $this->options['portal-log-in-message'];
|
||||||
|
else
|
||||||
|
$message = $this->defaults['portal-log-in-message'];
|
||||||
|
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$user_id = get_current_user_id();
|
||||||
|
$private_page_id = $this->cp_get_private_page_for_user( $user_id );
|
||||||
|
if( $private_page_id ) {
|
||||||
|
$private_page_link = get_permalink($private_page_id);
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
window.location.replace("<?php echo $private_page_link ?>");
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates the admin settings page under the Users menu
|
||||||
|
*/
|
||||||
|
function cp_add_settings_page(){
|
||||||
|
add_users_page( 'Client Portal Settings', 'Client Portal Settings', 'manage_options', 'client_portal_settings', array( $this, 'cp_settings_page_content' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that outputs the content for the settings page
|
||||||
|
*/
|
||||||
|
function cp_settings_page_content(){
|
||||||
|
/* if the user pressed the generate button then generate pages for existing users */
|
||||||
|
if( !empty( $_GET[ 'cp_generate_for_all' ] ) && $_GET[ 'cp_generate_for_all' ] == true ){
|
||||||
|
$this->cp_create_private_pages_for_all_users();
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<h2><?php _e( 'Client Portal Settings', 'client-portal'); ?></h2>
|
||||||
|
|
||||||
|
<?php settings_errors(); ?>
|
||||||
|
|
||||||
|
<div class="cl-grid">
|
||||||
|
<div class="cl-grid-item">
|
||||||
|
<form method="POST" action="options.php">
|
||||||
|
|
||||||
|
<?php settings_fields( $this->slug ); ?>
|
||||||
|
|
||||||
|
<table class="form-table">
|
||||||
|
<tbody>
|
||||||
|
<tr class="scp-form-field-wrapper">
|
||||||
|
<th scope="row"><label class="scp-form-field-label" for="page-slug"><?php echo __( 'Page Slug' , 'client-portal' ) ?></label></th>
|
||||||
|
<td>
|
||||||
|
<input type="text" class="regular-text" id="page-slug" name="cp-options[page-slug]" value="<?php echo ( isset( $this->options['page-slug'] ) ? esc_attr( $this->options['page-slug'] ) : 'private-page' ); ?>" />
|
||||||
|
<p class="description"><?php echo __( 'The slug of the pages.', 'client-portal' ); ?></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="scp-form-field-wrapper">
|
||||||
|
<th scope="row"><?php echo __( 'Support Comments' , 'client-portal' ) ?></th>
|
||||||
|
<td>
|
||||||
|
<label><input type="radio" id="support-comments" name="cp-options[support-comments]" value="no" <?php if( ( isset( $this->options['support-comments'] ) && $this->options['support-comments'] == 'no' ) || !isset( $this->options['support-comments'] ) ) echo 'checked="checked"' ?> /><?php _e( 'No', 'client-portal' ) ?></label><br />
|
||||||
|
<label><input type="radio" id="support-comments" name="cp-options[support-comments]" value="yes" <?php if( isset( $this->options['support-comments'] ) && $this->options['support-comments'] == 'yes' ) echo 'checked="checked"' ?> /><?php _e( 'Yes', 'client-portal' ) ?></label>
|
||||||
|
<p class="description"><?php echo __( 'Add comment support to the private page', 'client-portal' ); ?></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="scp-form-field-wrapper">
|
||||||
|
<th scope="row"><?php echo __( 'Generate pages' , 'client-portal' ) ?></th>
|
||||||
|
<td>
|
||||||
|
<a class="button" href="<?php echo add_query_arg( 'cp_generate_for_all', 'true', admin_url("/users.php?page=client_portal_settings") ) ?>"><?php _e( 'Generate pages for existing users' ); ?></a>
|
||||||
|
<p class="description"><?php echo __( 'Generate pages for already existing users.', 'client-portal' ); ?></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="scp-form-field-wrapper">
|
||||||
|
<th scope="row"><label class="scp-form-field-label" for="restricted-message"><?php echo __( 'Restricted Message' , 'client-portal' ) ?></label></th>
|
||||||
|
<td>
|
||||||
|
<textarea name="cp-options[restricted-message]" id="restricted-message" class="large-text" rows="10"><?php echo ( isset( $this->options['restricted-message'] ) ? esc_textarea( $this->options['restricted-message'] ) : $this->defaults['restricted-message'] ); ?></textarea>
|
||||||
|
<p class="description"><?php echo __( 'The default message showed on pages that are restricted.', 'client-portal' ); ?></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="scp-form-field-wrapper">
|
||||||
|
<th scope="row"><label class="scp-form-field-label" for="portal-log-in-message"><?php echo __( 'Portal Log In Message' , 'client-portal' ) ?></label></th>
|
||||||
|
<td>
|
||||||
|
<textarea name="cp-options[portal-log-in-message]" id="portal-log-in-message" class="large-text" rows="10"><?php echo ( isset( $this->options['portal-log-in-message'] ) ? esc_textarea( $this->options['portal-log-in-message'] ) : $this->defaults['portal-log-in-message'] ); ?></textarea>
|
||||||
|
<p class="description"><?php echo __( 'The default message showed on pages that are restricted.', 'client-portal' ); ?></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="scp-form-field-wrapper">
|
||||||
|
<th scope="row"><label class="scp-form-field-label" for="default-page-content"><?php echo __( 'Default Page Content' , 'client-portal' ) ?></label></th>
|
||||||
|
<td>
|
||||||
|
<textarea name="cp-options[default-page-content]" id="default-page-content" class="large-text" rows="10"><?php echo ( isset( $this->options['default-page-content'] ) ? esc_textarea( $this->options['default-page-content'] ) : $this->defaults['default-page-content'] ); ?></textarea>
|
||||||
|
<p class="description"><?php echo __( 'The default content on the private page.', 'client-portal' ); ?></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php submit_button( __( 'Save Settings', 'client_portal_settings' ) ); ?>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cl-grid-item pb-pitch">
|
||||||
|
<h2>Get the most out of Client Portal</h2>
|
||||||
|
<p>When building a place for your clients to access information, it can take a lot of time simply because there isn't enough flexibility
|
||||||
|
to build exactly what you need.</p>
|
||||||
|
<p>Wouldn't it be nice to be able to build the experience for your clients using simple modules that each does as few things as possible, but well?</p>
|
||||||
|
<p style="text-align: center;"><a href="https://wordpress.org/plugins/profile-builder/"><img src="<?php echo CP_URL; ?>assets/logo_landing_pb_2x_red.png" alt="Profile Builder Logo"/></a></p>
|
||||||
|
<p><strong>Client Portal</strong> was designed to work together with
|
||||||
|
<a href="https://wordpress.org/plugins/profile-builder/"><strong>Profile Builder</strong></a> so you can construct the client experience just as you need it.
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>add a login form with redirect <br/> <strong>[wppb-login redirect_url="http://www.yourdomain.com/page"]</strong></li>
|
||||||
|
<li>allow users to register <strong>[wppb-register]</strong></li>
|
||||||
|
<li>hide the WordPress admin bar for clients</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that registers the settings for the settings page with the Settings API
|
||||||
|
*/
|
||||||
|
public function cp_register_settings() {
|
||||||
|
register_setting( $this->slug, $this->slug, array( 'sanitize_callback' => array( $this, 'cp_sanitize_options' ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that sanitizes the options of the plugin
|
||||||
|
* @param $options
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function cp_sanitize_options( $options ){
|
||||||
|
if( !empty( $options ) ){
|
||||||
|
foreach( $options as $key => $value ){
|
||||||
|
if( $key == 'page-slug' || $key == 'support-comments' )
|
||||||
|
$options[$key] = sanitize_text_field( $value );
|
||||||
|
elseif( $key == 'restricted-message' || $key == 'portal-log-in-message' )
|
||||||
|
$options[$key] = wp_kses_post( $value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates the notice messages on the settings page
|
||||||
|
*/
|
||||||
|
function cp_admin_notices(){
|
||||||
|
if( !empty( $_GET['page'] ) && $_GET['page'] == 'client_portal_settings' ) {
|
||||||
|
if( !empty( $_GET['cp_generate_for_all'] ) && $_GET['cp_generate_for_all'] == true ) {
|
||||||
|
?>
|
||||||
|
<div class="notice notice-success is-dismissible">
|
||||||
|
<p><?php _e( 'Successfully generated private pages for existing users.', 'client-portal'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
if( !empty( $_REQUEST['settings-updated'] ) && $_GET['settings-updated'] == 'true' ) {
|
||||||
|
?>
|
||||||
|
<div class="notice notice-success is-dismissible">
|
||||||
|
<p><?php _e( 'Settings saved.', 'client-portal'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that enqueues the scripts on the admin settings page
|
||||||
|
*/
|
||||||
|
function cp_enqueue_admin_scripts() {
|
||||||
|
if( !empty( $_GET['page'] ) && $_GET['page'] == 'client_portal_settings' )
|
||||||
|
wp_enqueue_style( 'cp_style-back-end', plugins_url( 'assets/style.css', __FILE__ ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that flushes the rewrite rules when we save the settings page
|
||||||
|
*/
|
||||||
|
function cp_flush_rules(){
|
||||||
|
if( isset( $_GET['page'] ) && $_GET['page'] == 'client_portal_settings' && isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) {
|
||||||
|
flush_rewrite_rules(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that filters the WHERE clause in the select for adjacent posts so we exclude private pages
|
||||||
|
* @param $where
|
||||||
|
* @param $in_same_term
|
||||||
|
* @param $excluded_terms
|
||||||
|
* @param $taxonomy
|
||||||
|
* @param $post
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function cp_exclude_from_post_navigation( $where, $in_same_term, $excluded_terms, $taxonomy, $post ){
|
||||||
|
if( $post->post_type == 'private-page' ){
|
||||||
|
$where = str_replace( "'private-page'", "'do not show this'", $where );
|
||||||
|
}
|
||||||
|
return $where;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that returns the id for the private page for the provided user
|
||||||
|
* @param $user_id the user id for which we want to get teh private page for
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function cp_get_private_page_for_user( $user_id ){
|
||||||
|
$args = array(
|
||||||
|
'author' => $user_id,
|
||||||
|
'posts_per_page' => 1,
|
||||||
|
'post_type' => 'private-page',
|
||||||
|
);
|
||||||
|
$users_private_pages = get_posts( $args );
|
||||||
|
|
||||||
|
if( !empty( $users_private_pages ) ){
|
||||||
|
foreach( $users_private_pages as $users_private_page ){
|
||||||
|
return $users_private_page->ID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* we don't have a page */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that returns all the private pages post objects
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function cp_get_all_private_pages(){
|
||||||
|
$args = array(
|
||||||
|
'posts_per_page' => -1,
|
||||||
|
'numberposts' => -1,
|
||||||
|
'post_type' => 'private-page',
|
||||||
|
);
|
||||||
|
|
||||||
|
$users_private_pages = get_posts( $args );
|
||||||
|
return $users_private_pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates a custom action in the Bulk Dropdown on the Users screen
|
||||||
|
*/
|
||||||
|
function cp_create_private_page_bulk_actions(){
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function(){
|
||||||
|
jQuery('<option>').val('create_private_page').text( '<?php _e( 'Create Private Page', 'client-portal' ) ?>').appendTo("select[name='action'], select[name='action2']");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates a private page for the selected users in the bulk action
|
||||||
|
*/
|
||||||
|
function cp_create_private_pages_in_bulk(){
|
||||||
|
if ( !empty( $_REQUEST['users'] ) && is_array( $_REQUEST['users'] ) ) {
|
||||||
|
$users = array_map( 'absint', $_REQUEST['users'] );
|
||||||
|
foreach( $users as $user_id ){
|
||||||
|
$this->cp_create_private_page( $user_id );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates private pages for all existing users
|
||||||
|
*/
|
||||||
|
function cp_create_private_pages_for_all_users(){
|
||||||
|
$all_users = get_users( array( 'fields' => array( 'ID' ) ) );
|
||||||
|
if( !empty( $all_users ) ){
|
||||||
|
foreach( $all_users as $user ){
|
||||||
|
$users_private_pages = $this->cp_get_private_page_for_user( $user->ID );
|
||||||
|
if( !$users_private_pages ) {
|
||||||
|
$this->cp_create_private_page( $user->ID );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$CP_Object = new CL_Client_Portal();
|
57
client-portal/readme.txt
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
=== Client Portal - Private user pages and login ===
|
||||||
|
Contributors: cozmoslabs, madalin.ungureanu, sareiodata
|
||||||
|
Donate link: http://www.cozmoslabs.com/
|
||||||
|
Tags: client portal, private user page, private pages, private content, private client page, user restricted content
|
||||||
|
|
||||||
|
Requires at least: 3.1
|
||||||
|
Tested up to: 4.7.4
|
||||||
|
Stable tag: 1.0.4
|
||||||
|
License: GPLv2 or later
|
||||||
|
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
|
||||||
|
WordPress Client Portal Plugin that creates private pages for all users that only an administrator can edit.
|
||||||
|
|
||||||
|
== Description ==
|
||||||
|
|
||||||
|
The WordPress Client Portal plugin creates private pages for each user. The content for that page is accessible on the frontend only by the owner of the page
|
||||||
|
after he has logged in.
|
||||||
|
|
||||||
|
The plugin doesn't offer a login or registration form and it gives you the possibility to use a plugin of your choice.
|
||||||
|
|
||||||
|
The [client-portal] shortcode can be added to any page and when the logged in user will access that page he will be redirected to its private page.
|
||||||
|
|
||||||
|
For login and registration of users we recommend the free [Profile Builder](https://wordpress.org/plugins/profile-builder/) plugin.
|
||||||
|
|
||||||
|
You can then use the [wppb-login] shortcode in the same page as the [client-portal] shortcode.
|
||||||
|
|
||||||
|
== Installation ==
|
||||||
|
|
||||||
|
1. Upload and install the zip file via the built in WordPress plugin installer.
|
||||||
|
2. Activate the WordPress Client Portal plugin from the "Plugins" admin panel using the "Activate" link.
|
||||||
|
|
||||||
|
|
||||||
|
== Screenshots ==
|
||||||
|
1. Access the Private Page in the Users Listing in the admin area: screenshot-1.jpg
|
||||||
|
2. A Private Page in the admin area: screenshot-2.jpg
|
||||||
|
3. The Settings Page for the Plugin: screenshot-3.jpg
|
||||||
|
|
||||||
|
== Changelog ==
|
||||||
|
= 1.0.4 =
|
||||||
|
* We now have a default content option for pages
|
||||||
|
* Now private pages are excluded from appearing in frontend search
|
||||||
|
* Fixed a bug where the private page would reload indefinitely if the user hadn't a page created
|
||||||
|
* Fixed a bug where you could create duplicate pages for the same user
|
||||||
|
|
||||||
|
|
||||||
|
= 1.0.3 =
|
||||||
|
* Minor fixes and security improvements
|
||||||
|
|
||||||
|
= 1.0.2 =
|
||||||
|
* Added support for bulk Create Private Pages to Users page bulk actions
|
||||||
|
|
||||||
|
= 1.0.1 =
|
||||||
|
* Added support for comments on private user pages
|
||||||
|
* Settings page is now stylized
|
||||||
|
|
||||||
|
= 1.0.0 =
|
||||||
|
* Initial Version of the WordPress Client Portal plugin.
|
BIN
client-portal/screenshot-1.png
Normal file
After Width: | Height: | Size: 158 KiB |
BIN
client-portal/screenshot-2.png
Normal file
After Width: | Height: | Size: 73 KiB |
BIN
client-portal/screenshot-3.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
profile-builder.2.6.3.zip
Normal file
367
profile-builder/admin/add-ons.php
Normal file
@ -0,0 +1,367 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Function that creates the "Add-Ons" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.1.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function wppb_register_add_ons_submenu_page() {
|
||||||
|
add_submenu_page( 'profile-builder', __( 'Add-Ons', 'profile-builder' ), __( 'Add-Ons', 'profile-builder' ), 'manage_options', 'profile-builder-add-ons', 'wppb_add_ons_content' );
|
||||||
|
}
|
||||||
|
add_action( 'admin_menu', 'wppb_register_add_ons_submenu_page', 19 );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds content to the "Add-Ons" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.1.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_add_ons_content() {
|
||||||
|
|
||||||
|
$version = 'Free';
|
||||||
|
$version = ( ( PROFILE_BUILDER == 'Profile Builder Pro' ) ? 'Pro' : $version );
|
||||||
|
$version = ( ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ) ? 'Hobbyist' : $version );
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="wrap wppb-add-on-wrap">
|
||||||
|
|
||||||
|
<h2><?php _e( 'Add-Ons', 'profile-builder' ); ?></h2>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-activate-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Activate', 'profile-builder' ); ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-downloading-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Downloading and installing...', 'profile-builder' ); ?></span>
|
||||||
|
<span id="wppb-add-on-download-finished-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Installation complete', 'profile-builder' ); ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-activated-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Add-On is Active', 'profile-builder' ); ?></span>
|
||||||
|
<span id="wppb-add-on-activated-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Add-On has been activated', 'profile-builder' ) ?></span>
|
||||||
|
<span id="wppb-add-on-activated-error-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Retry Install', 'profile-builder' ) ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-is-active-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Add-On is <strong>active</strong>', 'profile-builder' ); ?></span>
|
||||||
|
<span id="wppb-add-on-is-not-active-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Add-On is <strong>inactive</strong>', 'profile-builder' ); ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-deactivate-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Deactivate', 'profile-builder' ) ?></span>
|
||||||
|
<span id="wppb-add-on-deactivated-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Add-On has been deactivated.', 'profile-builder' ) ?></span>
|
||||||
|
|
||||||
|
<div id="the-list">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$wppb_add_ons = wppb_add_ons_get_remote_content();
|
||||||
|
$wppb_get_all_plugins = get_plugins();
|
||||||
|
$wppb_get_active_plugins = get_option('active_plugins');
|
||||||
|
|
||||||
|
if( $wppb_add_ons === false ) {
|
||||||
|
|
||||||
|
echo __('Something went wrong, we could not connect to the server. Please try again later.', 'profile-builder');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
foreach( $wppb_add_ons as $key => $wppb_add_on ) {
|
||||||
|
|
||||||
|
$wppb_add_on_exists = 0;
|
||||||
|
$wppb_add_on_is_active = 0;
|
||||||
|
$wppb_add_on_is_network_active = 0;
|
||||||
|
|
||||||
|
// Check to see if add-on is in the plugins folder
|
||||||
|
foreach ($wppb_get_all_plugins as $wppb_plugin_key => $wppb_plugin) {
|
||||||
|
if (strpos(strtolower($wppb_plugin['Name']), strtolower($wppb_add_on['name'])) !== false && strpos(strtolower($wppb_plugin['AuthorName']), strtolower('Cozmoslabs')) !== false) {
|
||||||
|
$wppb_add_on_exists = 1;
|
||||||
|
|
||||||
|
if (in_array($wppb_plugin_key, $wppb_get_active_plugins)) {
|
||||||
|
$wppb_add_on_is_active = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Consider the add-on active if it's network active
|
||||||
|
if (is_plugin_active_for_network($wppb_plugin_key)) {
|
||||||
|
$wppb_add_on_is_network_active = 1;
|
||||||
|
$wppb_add_on_is_active = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$wppb_add_on['plugin_file'] = $wppb_plugin_key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<div class="plugin-card wppb-add-on">';
|
||||||
|
echo '<div class="plugin-card-top">';
|
||||||
|
|
||||||
|
echo '<a target="_blank" href="' . $wppb_add_on['url'] . '?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PB' . $version . '">';
|
||||||
|
echo '<img src="' . $wppb_add_on['thumbnail_url'] . '" />';
|
||||||
|
echo '</a>';
|
||||||
|
|
||||||
|
echo '<h3 class="wppb-add-on-title">';
|
||||||
|
echo '<a target="_blank" href="' . $wppb_add_on['url'] . '?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PB' . $version . '">';
|
||||||
|
echo $wppb_add_on['name'];
|
||||||
|
echo '</a>';
|
||||||
|
echo '</h3>';
|
||||||
|
|
||||||
|
//echo '<h3 class="wppb-add-on-price">' . $wppb_add_on['price'] . '</h3>';
|
||||||
|
if( $wppb_add_on['type'] == 'paid' )
|
||||||
|
echo '<h3 class="wppb-add-on-price">' . __( 'Available in Hobbyist and Pro Versions', 'profile-builder' ) . '</h3>';
|
||||||
|
else
|
||||||
|
echo '<h3 class="wppb-add-on-price">' . __( 'Available in All Versions', 'profile-builder' ) . '</h3>';
|
||||||
|
|
||||||
|
echo '<p class="wppb-add-on-description">' . $wppb_add_on['description'] . '</p>';
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
$wppb_version_validation = version_compare(PROFILE_BUILDER_VERSION, $wppb_add_on['product_version']);
|
||||||
|
|
||||||
|
($wppb_version_validation != -1) ? $wppb_version_validation_class = 'wppb-add-on-compatible' : $wppb_version_validation_class = 'wppb-add-on-not-compatible';
|
||||||
|
|
||||||
|
echo '<div class="plugin-card-bottom ' . $wppb_version_validation_class . '">';
|
||||||
|
|
||||||
|
// PB minimum version number is all good
|
||||||
|
if ($wppb_version_validation != -1) {
|
||||||
|
|
||||||
|
// PB version type does match
|
||||||
|
if (in_array(strtolower($version), $wppb_add_on['product_version_type'])) {
|
||||||
|
|
||||||
|
$ajax_nonce = wp_create_nonce("wppb-activate-addon");
|
||||||
|
|
||||||
|
if ($wppb_add_on_exists) {
|
||||||
|
|
||||||
|
// Display activate/deactivate buttons
|
||||||
|
if (!$wppb_add_on_is_active) {
|
||||||
|
echo '<a class="wppb-add-on-activate right button button-secondary" href="' . $wppb_add_on['plugin_file'] . '" data-nonce="' . $ajax_nonce . '">' . __('Activate', 'profile-builder') . '</a>';
|
||||||
|
|
||||||
|
// If add-on is network activated don't allow deactivation
|
||||||
|
} elseif (!$wppb_add_on_is_network_active) {
|
||||||
|
echo '<a class="wppb-add-on-deactivate right button button-secondary" href="' . $wppb_add_on['plugin_file'] . '" data-nonce="' . $ajax_nonce . '">' . __('Deactivate', 'profile-builder') . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display message to the user
|
||||||
|
if (!$wppb_add_on_is_active) {
|
||||||
|
echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . __('Add-On is <strong>inactive</strong>', 'profile-builder') . '</span>';
|
||||||
|
} else {
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Add-On is <strong>active</strong>', 'profile-builder') . '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
|
||||||
|
// handles the in-page download
|
||||||
|
($wppb_add_on['paid']) ? $wppb_paid_link_class = 'button-primary' : $wppb_paid_link_class = 'button-secondary';
|
||||||
|
($wppb_add_on['paid']) ? $wppb_paid_link_text = __('Learn More', 'profile-builder') : $wppb_paid_link_text = __('Download Now', 'profile-builder');
|
||||||
|
|
||||||
|
($wppb_add_on['paid']) ? $wppb_paid_href_utm_text = '?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page-buy-button&utm_campaign=PB' . $version : $wppb_paid_href_utm_text = '?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PB' . $version;
|
||||||
|
|
||||||
|
echo '<a target="_blank" class="right button ' . $wppb_paid_link_class . '" href="' . $wppb_add_on['url'] . $wppb_paid_href_utm_text . '" data-add-on-slug="profile-builder-' . $wppb_add_on['slug'] . '" data-add-on-name="' . $wppb_add_on['name'] . '" data-nonce="' . $ajax_nonce . '">' . $wppb_paid_link_text . '</a>';
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<div class="spinner"></div>';
|
||||||
|
|
||||||
|
// PB version type does not match
|
||||||
|
} else {
|
||||||
|
|
||||||
|
echo '<a target="_blank" class="button button-secondary right" href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page-upgrade-button&utm_campaign=PB' . $version . '">' . __('Upgrade Profile Builder', 'profile-builder') . '</a>';
|
||||||
|
echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . __('Not compatible with Profile Builder', 'profile-builder') . ' ' . $version . '</span>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// If PB version is older than the minimum required version of the add-on
|
||||||
|
echo ' ' . '<a class="button button-secondary right" href="' . admin_url('plugins.php') . '">' . __('Update', 'profile-builder') . '</a>';
|
||||||
|
echo '<span class="wppb-add-on-message">' . __('Not compatible with your version of Profile Builder.', 'profile-builder') . '</span><br />';
|
||||||
|
echo '<span class="wppb-add-on-message">' . __('Minimum required Profile Builder version:', 'profile-builder') . '<strong> ' . $wppb_add_on['product_version'] . '</strong></span>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// We had to put this error here because we need the url of the add-on
|
||||||
|
echo '<span class="wppb-add-on-user-messages wppb-error-manual-install">' . sprintf(__('Could not install add-on. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url($wppb_add_on['url'])) . '</span>';
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
} /* end $wppb_add_ons foreach */
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
<div>
|
||||||
|
<h2><?php _e( 'Recommended Plugins', 'profile-builder' ) ?></h2>
|
||||||
|
<?php
|
||||||
|
$pms_add_on_exists = 0;
|
||||||
|
$pms_add_on_is_active = 0;
|
||||||
|
$pms_add_on_is_network_active = 0;
|
||||||
|
// Check to see if add-on is in the plugins folder
|
||||||
|
foreach ($wppb_get_all_plugins as $wppb_plugin_key => $wppb_plugin) {
|
||||||
|
if( strtolower($wppb_plugin['Name']) == strtolower( 'Paid Member Subscriptions' ) && strpos(strtolower($wppb_plugin['AuthorName']), strtolower('Cozmoslabs')) !== false) {
|
||||||
|
$pms_add_on_exists = 1;
|
||||||
|
if (in_array($wppb_plugin_key, $wppb_get_active_plugins)) {
|
||||||
|
$pms_add_on_is_active = 1;
|
||||||
|
}
|
||||||
|
// Consider the add-on active if it's network active
|
||||||
|
if (is_plugin_active_for_network($wppb_plugin_key)) {
|
||||||
|
$pms_add_on_is_network_active = 1;
|
||||||
|
$pms_add_on_is_active = 1;
|
||||||
|
}
|
||||||
|
$plugin_file = $wppb_plugin_key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="plugin-card wppb-recommended-plugin wppb-add-on">
|
||||||
|
<div class="plugin-card-top">
|
||||||
|
<a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">
|
||||||
|
<img src="<?php echo plugins_url( '../assets/images/pms-recommended.png', __FILE__ ); ?>" width="100%">
|
||||||
|
</a>
|
||||||
|
<h3 class="wppb-add-on-title">
|
||||||
|
<a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">Paid Member Subscriptions</a>
|
||||||
|
</h3>
|
||||||
|
<h3 class="wppb-add-on-price"><?php _e( 'Free', 'profile-builder' ) ?></h3>
|
||||||
|
<p class="wppb-add-on-description">
|
||||||
|
<?php _e( 'Accept user payments, create subscription plans and restrict content on your membership site.', 'profile-builder' ) ?>
|
||||||
|
<a href="<?php admin_url();?>plugin-install.php?tab=plugin-information&plugin=paid-member-subscriptions&TB_iframe=true&width=772&height=875" class="thickbox" aria-label="More information about Paid Member Subscriptions - membership & content restriction" data-title="Paid Member Subscriptions - membership & content restriction"><?php _e( 'More Details' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="plugin-card-bottom wppb-add-on-compatible">
|
||||||
|
<?php
|
||||||
|
if ($pms_add_on_exists) {
|
||||||
|
|
||||||
|
// Display activate/deactivate buttons
|
||||||
|
if (!$pms_add_on_is_active) {
|
||||||
|
echo '<a class="wppb-add-on-activate right button button-secondary" href="' . $plugin_file . '" data-nonce="' . $ajax_nonce . '">' . __('Activate', 'profile-builder') . '</a>';
|
||||||
|
|
||||||
|
// If add-on is network activated don't allow deactivation
|
||||||
|
} elseif (!$pms_add_on_is_network_active) {
|
||||||
|
echo '<a class="wppb-add-on-deactivate right button button-secondary" href="' . $plugin_file . '" data-nonce="' . $ajax_nonce . '">' . __('Deactivate', 'profile-builder') . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display message to the user
|
||||||
|
if( !$pms_add_on_is_active ){
|
||||||
|
echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . __('Plugin is <strong>inactive</strong>', 'profile-builder') . '</span>';
|
||||||
|
} else {
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Plugin is <strong>active</strong>', 'profile-builder') . '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// handles the in-page download
|
||||||
|
$wppb_paid_link_class = 'button-secondary';
|
||||||
|
$wppb_paid_link_text = __('Download Now', 'profile-builder');
|
||||||
|
|
||||||
|
echo '<a target="_blank" class="right button ' . $wppb_paid_link_class . '" href="https://downloads.wordpress.org/plugin/paid-member-subscriptions.zip" data-add-on-slug="paid-member-subscriptions" data-add-on-name="Paid Member Subscriptions" data-nonce="' . $ajax_nonce . '">' . $wppb_paid_link_text . '</a>';
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="spinner"></div>
|
||||||
|
<span class="wppb-add-on-user-messages wppb-error-manual-install"><?php printf(__('Could not install plugin. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url( 'http://www.wordpress.org/plugins/paid-member-subscriptions' )) ?></a>.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that returns the array of add-ons from cozmoslabs.com if it finds the file
|
||||||
|
* If something goes wrong it returns false
|
||||||
|
*
|
||||||
|
* @since v.2.1.0
|
||||||
|
*/
|
||||||
|
function wppb_add_ons_get_remote_content() {
|
||||||
|
|
||||||
|
$response = wp_remote_get('https://www.cozmoslabs.com/wp-content/plugins/cozmoslabs-products-add-ons/profile-builder-add-ons.json');
|
||||||
|
|
||||||
|
if( is_wp_error($response) ) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
$json_file_contents = $response['body'];
|
||||||
|
$wppb_add_ons = json_decode( $json_file_contents, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !is_object( $wppb_add_ons ) && !is_array( $wppb_add_ons ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $wppb_add_ons;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that is triggered through Ajax to activate an add-on
|
||||||
|
*
|
||||||
|
* @since v.2.1.0
|
||||||
|
*/
|
||||||
|
function wppb_add_on_activate() {
|
||||||
|
check_ajax_referer( 'wppb-activate-addon', 'nonce' );
|
||||||
|
if( current_user_can( 'manage_options' ) ){
|
||||||
|
// Setup variables from POST
|
||||||
|
$wppb_add_on_to_activate = sanitize_text_field( $_POST['wppb_add_on_to_activate'] );
|
||||||
|
$response = filter_var( $_POST['wppb_add_on_index'], FILTER_SANITIZE_NUMBER_INT );
|
||||||
|
|
||||||
|
if( !empty( $wppb_add_on_to_activate ) && !is_plugin_active( $wppb_add_on_to_activate )) {
|
||||||
|
activate_plugin( $wppb_add_on_to_activate );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty( $response ) )
|
||||||
|
echo $response;
|
||||||
|
}
|
||||||
|
wp_die();
|
||||||
|
}
|
||||||
|
add_action( 'wp_ajax_wppb_add_on_activate', 'wppb_add_on_activate' );
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that is triggered through Ajax to deactivate an add-on
|
||||||
|
*
|
||||||
|
* @since v.2.1.0
|
||||||
|
*/
|
||||||
|
function wppb_add_on_deactivate() {
|
||||||
|
check_ajax_referer( 'wppb-activate-addon', 'nonce' );
|
||||||
|
if( current_user_can( 'manage_options' ) ){
|
||||||
|
// Setup variables from POST
|
||||||
|
$wppb_add_on_to_deactivate = sanitize_text_field( $_POST['wppb_add_on_to_deactivate'] );
|
||||||
|
$response = filter_var( $_POST['wppb_add_on_index'], FILTER_SANITIZE_NUMBER_INT );
|
||||||
|
|
||||||
|
if( !empty( $wppb_add_on_to_deactivate ))
|
||||||
|
deactivate_plugins( $wppb_add_on_to_deactivate );
|
||||||
|
|
||||||
|
if( !empty( $response ) )
|
||||||
|
echo $response;
|
||||||
|
}
|
||||||
|
wp_die();
|
||||||
|
|
||||||
|
}
|
||||||
|
add_action( 'wp_ajax_wppb_add_on_deactivate', 'wppb_add_on_deactivate' );
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that retrieves the data of the newly added plugin
|
||||||
|
*
|
||||||
|
* @since v.2.1.0
|
||||||
|
*/
|
||||||
|
function wppb_add_on_get_new_plugin_data() {
|
||||||
|
if(isset( $_POST['wppb_add_on_name'] ) ){
|
||||||
|
$wppb_add_on_name = sanitize_text_field( $_POST['wppb_add_on_name'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
$wppb_get_all_plugins = get_plugins();
|
||||||
|
foreach( $wppb_get_all_plugins as $wppb_plugin_key => $wppb_plugin ) {
|
||||||
|
|
||||||
|
if( strpos( $wppb_plugin['Name'], $wppb_add_on_name ) !== false && strpos( $wppb_plugin['AuthorName'], 'Cozmoslabs' ) !== false ) {
|
||||||
|
|
||||||
|
// Deactivate the add-on if it's active
|
||||||
|
if( is_plugin_active( $wppb_plugin_key )) {
|
||||||
|
deactivate_plugins( $wppb_plugin_key );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the plugin path
|
||||||
|
echo $wppb_plugin_key;
|
||||||
|
wp_die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wp_die();
|
||||||
|
}
|
||||||
|
add_action( 'wp_ajax_wppb_add_on_get_new_plugin_data', 'wppb_add_on_get_new_plugin_data' );
|
121
profile-builder/admin/admin-bar.php
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Function that creates the "Show/Hide the Admin Bar on the Front-End" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function wppb_show_hide_admin_bar_submenu_page() {
|
||||||
|
add_submenu_page( 'profile-builder', __( 'Show/Hide the Admin Bar on the Front-End', 'profile-builder' ), __( 'Admin Bar Settings', 'profile-builder' ), 'manage_options', 'profile-builder-admin-bar-settings', 'wppb_show_hide_admin_bar_content' );
|
||||||
|
}
|
||||||
|
add_action( 'admin_menu', 'wppb_show_hide_admin_bar_submenu_page', 4 );
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_generate_admin_bar_default_values( $roles ){
|
||||||
|
$wppb_display_admin_settings = get_option( 'wppb_display_admin_settings', 'not_found' );
|
||||||
|
|
||||||
|
if ( $wppb_display_admin_settings == 'not_found' ){
|
||||||
|
if( !empty( $roles ) ){
|
||||||
|
$admin_settings = array();
|
||||||
|
foreach ( $roles as $role ){
|
||||||
|
if( !empty( $role['name'] ) )
|
||||||
|
$admin_settings[$role['name']] = 'default';
|
||||||
|
}
|
||||||
|
|
||||||
|
update_option( 'wppb_display_admin_settings', $admin_settings );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds content to the "Show/Hide the Admin Bar on the Front-End" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_show_hide_admin_bar_content() {
|
||||||
|
global $wp_roles;
|
||||||
|
|
||||||
|
wppb_generate_admin_bar_default_values( $wp_roles );
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="wrap wppb-wrap wppb-admin-bar">
|
||||||
|
|
||||||
|
<h2><?php _e( 'Admin Bar Settings', 'profile-builder' );?></h2>
|
||||||
|
<p><?php _e( 'Choose which user roles view the admin bar in the front-end of the website.', 'profile-builder' ); ?>
|
||||||
|
<form method="post" action="options.php#show-hide-admin-bar">
|
||||||
|
<?php
|
||||||
|
$admin_bar_settings = get_option( 'wppb_display_admin_settings' );
|
||||||
|
settings_fields( 'wppb_display_admin_settings' );
|
||||||
|
?>
|
||||||
|
<table class="widefat">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="row-title" scope="col"><?php _e('User-Role', 'profile-builder');?></th>
|
||||||
|
<th scope="col"><?php _e('Visibility', 'profile-builder');?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$alt_i = 0;
|
||||||
|
foreach ( $wp_roles->roles as $role ) {
|
||||||
|
$alt_i++;
|
||||||
|
$key = $role['name'];
|
||||||
|
$setting_exists = !empty( $admin_bar_settings[$key] );
|
||||||
|
$alt_class = ( ( $alt_i%2 == 0 ) ? ' class="alternate"' : '' );
|
||||||
|
|
||||||
|
echo'<tr'.$alt_class.'>
|
||||||
|
<td>'.translate_user_role($key).'</td>
|
||||||
|
<td>
|
||||||
|
<span><input id="rd'.$key.'" type="radio" name="wppb_display_admin_settings['.$key.']" value="default"'.( ( !$setting_exists || $admin_bar_settings[$key] == 'default' ) ? ' checked' : '' ).'/><label for="rd'.$key.'">'.__( 'Default', 'profile-builder' ).'</label></span>
|
||||||
|
<span><input id="rs'.$key.'" type="radio" name="wppb_display_admin_settings['.$key.']" value="show"'.( ( $setting_exists && $admin_bar_settings[$key] == 'show') ? ' checked' : '' ).'/><label for="rs'.$key.'">'.__( 'Show', 'profile-builder' ).'</label></span>
|
||||||
|
<span><input id="rh'.$key.'" type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"'.( ( $setting_exists && $admin_bar_settings[$key] == 'hide') ? ' checked' : '' ).'/><label for="rh'.$key.'">'.__( 'Hide', 'profile-builder' ).'</label></span>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div id="wppb_submit_button_div">
|
||||||
|
<input type="hidden" name="action" value="update" />
|
||||||
|
<p class="submit">
|
||||||
|
<input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ) ?>" />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that changes the username on the top right menu (admin bar)
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_replace_username_on_admin_bar( $wp_admin_bar ) {
|
||||||
|
$wppb_general_settings = get_option( 'wppb_general_settings' );
|
||||||
|
|
||||||
|
if ( isset( $wppb_general_settings['loginWith'] ) && ( $wppb_general_settings['loginWith'] == 'email' ) ){
|
||||||
|
$current_user = wp_get_current_user();
|
||||||
|
|
||||||
|
if ( $current_user->ID != 0 ) {
|
||||||
|
$my_account_main = $wp_admin_bar->get_node('my-account');
|
||||||
|
$new_title1 = str_replace($current_user->display_name, $current_user->user_email, $my_account_main->title);
|
||||||
|
$wp_admin_bar->add_node(array('id' => 'my-account', 'title' => $new_title1));
|
||||||
|
|
||||||
|
$my_account_sub = $wp_admin_bar->get_node('user-info');
|
||||||
|
$wp_admin_bar->add_node(array('parent' => 'user-actions', 'id' => 'user-info', 'title' => get_avatar($current_user->ID, 64) . "<span class='display-name'>{$current_user->user_email}</span>", 'href' => get_edit_profile_url($current_user->ID), 'meta' => array('tabindex' => -1)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $wp_admin_bar;
|
||||||
|
}
|
||||||
|
add_filter( 'admin_bar_menu', 'wppb_replace_username_on_admin_bar', 25 );
|
209
profile-builder/admin/admin-functions.php
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Function which returns the same field-format over and over again.
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @param string $field
|
||||||
|
* @param string $field_title
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_field_format ( $field_title, $field ){
|
||||||
|
|
||||||
|
return trim( $field_title ).' ( '.trim( $field ).' )';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a notification for either the Username or the Email field letting the user know that, even though it is there, it won't do anything
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @param string $form
|
||||||
|
* @param integer $id
|
||||||
|
* @param string $value
|
||||||
|
*
|
||||||
|
* @return string $form
|
||||||
|
*/
|
||||||
|
|
||||||
|
function wppb_manage_fields_display_field_title_slug( $form ){
|
||||||
|
// add a notice to fields
|
||||||
|
global $wppb_results_field;
|
||||||
|
switch ($wppb_results_field){
|
||||||
|
case 'Default - Username':
|
||||||
|
$wppb_generalSettings = get_option( 'wppb_general_settings', 'not_found' );
|
||||||
|
if ( $wppb_generalSettings != 'not_found' && $wppb_generalSettings['loginWith'] == 'email' ) {
|
||||||
|
$form .= '<div id="wppb-login-email-nag" class="wppb-backend-notice">' . sprintf(__('Login is set to be done using the E-mail. This field will NOT appear in the front-end! ( you can change these settings under the "%s" tab )', 'profile-builder'), '<a href="' . admin_url('admin.php?page=profile-builder-general-settings') . '" target="_blank">' . __('General Settings', 'profile-builder') . '</a>') . '</div>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'Default - Display name publicly as':
|
||||||
|
$form .= '<div id="wppb-display-name-nag" class="wppb-backend-notice">' . __( 'Display name publicly as - only appears on the Edit Profile page!', 'profile-builder' ) . '</div>';
|
||||||
|
break;
|
||||||
|
case 'Default - Blog Details':
|
||||||
|
$form .= '<div id="wppb-blog-details-nag" class="wppb-backend-notice">' . __( 'Blog Details - only appears on the Registration page!', 'profile-builder' ) . '</div>';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $form;
|
||||||
|
}
|
||||||
|
|
||||||
|
add_filter( 'wck_after_content_element', 'wppb_manage_fields_display_field_title_slug' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if field type is 'Default - Display name publicly as' so we can add a notification for it
|
||||||
|
*
|
||||||
|
* @since v.2.2
|
||||||
|
*
|
||||||
|
* @param string $wck_element_class
|
||||||
|
* @param string $meta
|
||||||
|
* @param array $results
|
||||||
|
* @param integer $element_id
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function wppb_manage_fields_display_name_notice( $wck_element_class, $meta, $results, $element_id ) {
|
||||||
|
global $wppb_results_field;
|
||||||
|
|
||||||
|
$wppb_results_field = $results[$element_id]['field'];
|
||||||
|
}
|
||||||
|
add_filter( 'wck_element_class_wppb_manage_fields', 'wppb_manage_fields_display_name_notice', 10, 4 );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds a custom class to the existing container
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @param string $update_container_class - the new class name
|
||||||
|
* @param string $meta - the name of the meta
|
||||||
|
* @param array $results
|
||||||
|
* @param integer $element_id - the ID of the element
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_update_container_class( $update_container_class, $meta, $results, $element_id ) {
|
||||||
|
$wppb_element_type = Wordpress_Creation_Kit_PB::wck_generate_slug( $results[$element_id]["field"] );
|
||||||
|
|
||||||
|
return "class='wck_update_container update_container_$meta update_container_$wppb_element_type element_type_$wppb_element_type'";
|
||||||
|
}
|
||||||
|
add_filter( 'wck_update_container_class_wppb_manage_fields', 'wppb_update_container_class', 10, 4 );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds a custom class to the existing element
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @param string $element_class - the new class name
|
||||||
|
* @param string $meta - the name of the meta
|
||||||
|
* @param array $results
|
||||||
|
* @param integer $element_id - the ID of the element
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_element_class( $element_class, $meta, $results, $element_id ){
|
||||||
|
$wppb_element_type = Wordpress_Creation_Kit_PB::wck_generate_slug( $results[$element_id]["field"] );
|
||||||
|
|
||||||
|
return "class='element_type_$wppb_element_type added_fields_list'";
|
||||||
|
}
|
||||||
|
add_filter( 'wck_element_class_wppb_manage_fields', 'wppb_element_class', 10, 4 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Functions to check password length and strength
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*/
|
||||||
|
/* on add user and update profile from WP admin area */
|
||||||
|
add_action( 'user_profile_update_errors', 'wppb_password_check_on_profile_update', 0, 3 );
|
||||||
|
function wppb_password_check_on_profile_update( $errors, $update, $user ){
|
||||||
|
wppb_password_check_extra_conditions( $errors, $user );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* on reset password */
|
||||||
|
add_action( 'validate_password_reset', 'wppb_password_check_extra_conditions', 10, 2 );
|
||||||
|
function wppb_password_check_extra_conditions( $errors, $user ){
|
||||||
|
$password = ( isset( $_POST[ 'pass1' ] ) && trim( $_POST[ 'pass1' ] ) ) ? $_POST[ 'pass1' ] : false;
|
||||||
|
|
||||||
|
if( $password ){
|
||||||
|
$wppb_generalSettings = get_option( 'wppb_general_settings' );
|
||||||
|
if( !empty( $wppb_generalSettings['minimum_password_length'] ) ){
|
||||||
|
if( strlen( $password ) < $wppb_generalSettings['minimum_password_length'] )
|
||||||
|
$errors->add( 'pass', sprintf( __( '<strong>ERROR</strong>: The password must have the minimum length of %s characters', 'profile-builder' ), $wppb_generalSettings['minimum_password_length'] ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( isset( $_POST['wppb_password_strength'] ) && !empty( $wppb_generalSettings['minimum_password_strength'] ) ){
|
||||||
|
$password_strength_array = array( 'short' => 0, 'bad' => 1, 'good' => 2, 'strong' => 3 );
|
||||||
|
$password_strength_text = array( 'short' => __( 'Very weak', 'profile-builder' ), 'bad' => __( 'Weak', 'profile-builder' ), 'good' => __( 'Medium', 'profile-builder' ), 'strong' => __( 'Strong', 'profile-builder' ) );
|
||||||
|
|
||||||
|
foreach( $password_strength_text as $psr_key => $psr_text ){
|
||||||
|
if( $psr_text == sanitize_text_field( $_POST['wppb_password_strength'] ) ){
|
||||||
|
$password_strength_result_slug = $psr_key;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !empty( $password_strength_result_slug ) ){
|
||||||
|
if( $password_strength_array[$password_strength_result_slug] < $password_strength_array[$wppb_generalSettings['minimum_password_strength']] )
|
||||||
|
$errors->add( 'pass', sprintf( __( '<strong>ERROR</strong>: The password must have a minimum strength of %s', 'profile-builder' ), $password_strength_text[$wppb_generalSettings['minimum_password_strength']] ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we need to create a hidden field that contains the results of the password strength from the js strength tester */
|
||||||
|
add_action( 'admin_footer', 'wppb_add_hidden_password_strength_on_backend' );
|
||||||
|
add_action( 'login_footer', 'wppb_add_hidden_password_strength_on_backend' );
|
||||||
|
function wppb_add_hidden_password_strength_on_backend(){
|
||||||
|
if( $GLOBALS['pagenow'] == 'profile.php' || $GLOBALS['pagenow'] == 'user-new.php' || ( $GLOBALS['pagenow'] == 'wp-login.php' && isset( $_GET['action'] ) && ( $_GET['action'] == 'rp' || $_GET['action'] == 'resetpass' ) ) ){
|
||||||
|
$wppb_generalSettings = get_option( 'wppb_general_settings' );
|
||||||
|
if( !empty( $wppb_generalSettings['minimum_password_strength'] ) ){
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
jQuery( document ).ready( function() {
|
||||||
|
var passswordStrengthResult = jQuery( '#pass-strength-result' );
|
||||||
|
// Check for password strength meter
|
||||||
|
if ( passswordStrengthResult.length ) {
|
||||||
|
// Attach submit event to form
|
||||||
|
passswordStrengthResult.parents( 'form' ).on( 'submit', function() {
|
||||||
|
// Store check results in hidden field
|
||||||
|
jQuery( this ).append( '<input type="hidden" name="wppb_password_strength" value="' + passswordStrengthResult.text() + '">' );
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Modify the Add Entry buttons for WCK metaboxes according to context */
|
||||||
|
add_filter( 'wck_add_entry_button', 'wppb_change_add_entry_button', 10, 2 );
|
||||||
|
function wppb_change_add_entry_button( $string, $meta ){
|
||||||
|
if( $meta == 'wppb_manage_fields' || $meta == 'wppb_epf_fields' || $meta == 'wppb_rf_fields' ){
|
||||||
|
return __( "Add Field", 'profile-builder' );
|
||||||
|
}elseif( $meta == 'wppb_epf_page_settings' || $meta == 'wppb_rf_page_settings' || $meta == 'wppb_ul_page_settings' ){
|
||||||
|
return __( "Save Settings", 'profile-builder' );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add admin footer text for encouraging users to leave a review of the plugin on wordpress.org */
|
||||||
|
function wppb_admin_rate_us( $footer_text ) {
|
||||||
|
global $current_screen;
|
||||||
|
|
||||||
|
if ($current_screen->parent_base == 'profile-builder'){
|
||||||
|
$rate_text = sprintf( __( 'If you enjoy using <strong> %1$s </strong> please <a href="%2$s" target="_blank">rate us on WordPress.org</a>. More happy users means more features, less bugs and better support for everyone. ', 'profile-builder' ),
|
||||||
|
PROFILE_BUILDER,
|
||||||
|
'https://wordpress.org/support/view/plugin-reviews/profile-builder?filter=5#postform'
|
||||||
|
);
|
||||||
|
return '<span id="footer-thankyou">' .$rate_text . '</span>';
|
||||||
|
} else {
|
||||||
|
return $footer_text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_filter('admin_footer_text','wppb_admin_rate_us');
|
193
profile-builder/admin/basic-info.php
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Function that creates the "Basic Information" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function wppb_register_basic_info_submenu_page() {
|
||||||
|
add_submenu_page( 'profile-builder', __( 'Basic Information', 'profile-builder' ), __( 'Basic Information', 'profile-builder' ), 'manage_options', 'profile-builder-basic-info', 'wppb_basic_info_content' );
|
||||||
|
}
|
||||||
|
add_action( 'admin_menu', 'wppb_register_basic_info_submenu_page', 2 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds content to the "Basic Information" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_basic_info_content() {
|
||||||
|
|
||||||
|
$version = 'Free';
|
||||||
|
$version = ( ( PROFILE_BUILDER == 'Profile Builder Pro' ) ? 'Pro' : $version );
|
||||||
|
$version = ( ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ) ? 'Hobbyist' : $version );
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="wrap wppb-wrap wppb-info-wrap">
|
||||||
|
<div class="wppb-badge <?php echo $version; ?>"><span><?php printf( __( 'Version %s' ), PROFILE_BUILDER_VERSION ); ?></span></div>
|
||||||
|
<h1><?php echo __( '<strong>Profile Builder </strong>' . $version, 'profile-builder' ); ?></h1>
|
||||||
|
<p class="wppb-info-text"><?php printf( __( 'The best way to add front-end registration, edit profile and login forms.', 'profile-builder' ) ); ?></p>
|
||||||
|
<hr />
|
||||||
|
<h2 class="wppb-callout"><?php _e( 'For Modern User Interaction', 'profile-builder' ); ?></h2>
|
||||||
|
<div class="wppb-row wppb-3-col">
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Login', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php printf( __( 'Friction-less login using %s shortcode or a widget.', 'profile-builder' ), '<strong class="nowrap">[wppb-login]</strong>' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Registration', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php printf( __( 'Beautiful registration forms fully customizable using the %s shortcode.', 'profile-builder' ), '<strong class="nowrap">[wppb-register]</strong>' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Edit Profile', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php printf( __( 'Straight forward edit profile forms using %s shortcode.', 'profile-builder' ), '<strong class="nowrap">[wppb-edit-profile]</strong>' ); ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php ob_start(); ?>
|
||||||
|
<hr/>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Extra Features', 'profile-builder' );?></h3>
|
||||||
|
<p><?php _e( 'Features that give you more control over your users, increased security and help you fight user registration spam.', 'profile-builder' ); ?></p>
|
||||||
|
<p><a href="admin.php?page=profile-builder-general-settings" class="button"><?php _e( 'Enable extra features', 'profile-builder' ); ?></a></p>
|
||||||
|
</div>
|
||||||
|
<div class="wppb-row wppb-3-col">
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Recover Password', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php printf( __( 'Allow users to recover their password in the front-end using the %s.', 'profile-builder' ), '<strong class="nowrap">[wppb-recover-password]</strong>' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Admin Approval (*)', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'You decide who is a user on your website. Get notified via email or approve multiple users at once from the WordPress UI.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Email Confirmation', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Make sure users sign up with genuine emails. On registration users will receive a notification to confirm their email address.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Minimum Password Length and Strength Meter', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Eliminate weak passwords altogether by setting a minimum password length and enforcing a certain password strength.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Login with Email or Username', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Allow users to log in with their email or username when accessing your site.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Output here the Extra Features html for the Free version
|
||||||
|
$extra_features_html = ob_get_contents();
|
||||||
|
ob_end_clean();
|
||||||
|
if ( $version == 'Free' ) echo $extra_features_html; ?>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<div class="wppb-row wppb-2-col">
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Customize Your Forms The Way You Want (*)', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'With Extra Profile Fields you can create the exact registration form your project needs.', 'profile-builder' ); ?></p>
|
||||||
|
<?php if ($version == 'Free'){ ?>
|
||||||
|
<p><a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=basicinfo-extrafields&utm_campaign=PBFree" class="wppb-button-free"><?php _e( 'Extra Profile Fields are available in Hobbyist or PRO versions', 'profile-builder' ); ?></a></p>
|
||||||
|
<?php } else {?>
|
||||||
|
<p><a href="admin.php?page=manage-fields" class="button"><?php _e( 'Get started with extra fields', 'profile-builder' ); ?></a></p>
|
||||||
|
<?php } ?>
|
||||||
|
<ul style="float: left; margin-right: 50px;">
|
||||||
|
<li><?php _e( 'Avatar Upload', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Generic Uploads', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Agree To Terms Checkbox', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Datepicker', 'profile-builder' ); ?> </li>
|
||||||
|
<li><?php _e( 'Timepicker', 'profile-builder' ); ?> </li>
|
||||||
|
<li><?php _e( 'Colorpicker', 'profile-builder' ); ?> </li>
|
||||||
|
<li><?php _e( 'reCAPTCHA', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Country Select', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Currency Select', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Timezone Select', 'profile-builder' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul style="float: left;">
|
||||||
|
<li><?php _e( 'Input / Hidden Input', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Number', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Checkbox', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Select', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Radio Buttons', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Textarea', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Validation', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Map', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'HTML', 'profile-builder' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img src="<?php echo WPPB_PLUGIN_URL; ?>assets/images/pb_fields.png" alt="Profile Builder Extra Fields" class="wppb-fields-image" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Powerful Modules (**)', 'profile-builder' );?></h3>
|
||||||
|
<p><?php _e( 'Everything you will need to manage your users is probably already available using the Pro Modules.', 'profile-builder' ); ?></p>
|
||||||
|
<?php if( file_exists ( WPPB_PLUGIN_DIR.'/modules/modules.php' ) ): ?>
|
||||||
|
<p><a href="admin.php?page=profile-builder-modules" class="button"><?php _e( 'Enable your modules', 'profile-builder' ); ?></a></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($version == 'Free'){ ?>
|
||||||
|
<p><a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=basicinfo-modules&utm_campaign=PBFree" class="wppb-button-free"><?php _e( 'Find out more about PRO Modules', 'profile-builder' ); ?></a></p>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
<div class="wppb-row wppb-3-col">
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'User Listing', 'profile-builder' ); ?></h3>
|
||||||
|
<?php if ($version == 'Free'): ?>
|
||||||
|
<p><?php _e( 'Easy to edit templates for listing your website users as well as creating single user pages. Shortcode based, offering many options to customize your listings.', 'profile-builder' ); ?></p>
|
||||||
|
<?php else : ?>
|
||||||
|
<p><?php printf( __( 'To create a page containing the users registered to this current site/blog, insert the following shortcode in a page of your chosing: %s.', 'profile-builder' ), '<strong class="nowrap">[wppb-list-users]</strong>' ); ?></p>
|
||||||
|
<?php endif;?>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Email Customizer', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Personalize all emails sent to your users or admins. On registration, email confirmation, admin approval / un-approval.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Custom Redirects', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Keep your users out of the WordPress dashboard, redirect them to the front-page after login or registration, everything is just a few clicks away.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="wppb-row wppb-3-col">
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Multiple Registration Forms', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Set up multiple registration forms with different fields for certain user roles. Capture different information from different types of users.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Multiple Edit-profile Forms', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Allow different user roles to edit their specific information. Set up multiple edit-profile forms with different fields for certain user roles.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><?php _e( 'Repeater Fields', 'profile-builder' ); ?></h3>
|
||||||
|
<p><?php _e( 'Set up a repeating group of fields on register and edit profile forms. Limit the number of repeated groups for each user role.', 'profile-builder' ); ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
//Output here Extra Features html for Hobbyist or Pro versions
|
||||||
|
if ( $version != 'Free' ) echo $extra_features_html; ?>
|
||||||
|
<hr/>
|
||||||
|
<div class="wrap wppb-wrap wppb-1-3-col">
|
||||||
|
<div>
|
||||||
|
<a href="<?php echo admin_url('options.php?page=profile-builder-pms-promo'); ?>"><img src="<?php echo plugins_url( '../assets/images/pb-pms-cross-promotion.png', __FILE__ ); ?>" alt="paid member subscriptions"/></a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3>Paid user profiles with Profile Builder and Paid Member Subscriptions</h3>
|
||||||
|
<p>One of the most requested features in Profile Builder was for users to be able to pay for an account.</p>
|
||||||
|
<p>Now that's possible using the free WordPress plugin - <a href="<?php echo admin_url('options.php?page=profile-builder-pms-promo'); ?>">Paid Member Subscriptions</a>.</p>
|
||||||
|
<p><a href="<?php echo admin_url('options.php?page=profile-builder-pms-promo'); ?>" class="button">Find out how</a></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div>
|
||||||
|
<h3>Extra Notes</h3>
|
||||||
|
<ul>
|
||||||
|
<li><?php printf( __( ' * only available in the %1$sHobbyist and Pro versions%2$s.', 'profile-builder' ) ,'<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=basicinfo-extranotes&utm_campaign=PB'.$version.'" target="_blank">', '</a>' );?></li>
|
||||||
|
<li><?php printf( __( '** only available in the %1$sPro version%2$s.', 'profile-builder' ), '<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=basicinfo-extranotes&utm_campaign=PB'.$version.'" target="_blank">', '</a>' );?></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
290
profile-builder/admin/general-settings.php
Normal file
@ -0,0 +1,290 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Function that creates the "General Settings" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function wppb_register_general_settings_submenu_page() {
|
||||||
|
add_submenu_page( 'profile-builder', __( 'General Settings', 'profile-builder' ), __( 'General Settings', 'profile-builder' ), 'manage_options', 'profile-builder-general-settings', 'wppb_general_settings_content' );
|
||||||
|
}
|
||||||
|
add_action( 'admin_menu', 'wppb_register_general_settings_submenu_page', 3 );
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_generate_default_settings_defaults(){
|
||||||
|
add_option( 'wppb_general_settings', array( 'extraFieldsLayout' => 'default', 'emailConfirmation' => 'no', 'activationLandingPage' => '', 'adminApproval' => 'no', 'loginWith' => 'usernameemail', 'rolesEditor' => 'no' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds content to the "General Settings" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_general_settings_content() {
|
||||||
|
wppb_generate_default_settings_defaults();
|
||||||
|
?>
|
||||||
|
<div class="wrap wppb-wrap">
|
||||||
|
<form method="post" action="options.php#general-settings">
|
||||||
|
<?php $wppb_generalSettings = get_option( 'wppb_general_settings' ); ?>
|
||||||
|
<?php settings_fields( 'wppb_general_settings' ); ?>
|
||||||
|
|
||||||
|
<h2><?php _e( 'General Settings', 'profile-builder' ); ?></h2>
|
||||||
|
<table class="form-table">
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( "Load Profile Builder's own CSS file in the front-end:", "profile-builder" ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<label><input type="checkbox" name="wppb_general_settings[extraFieldsLayout]"<?php echo ( ( isset( $wppb_generalSettings['extraFieldsLayout'] ) && ( $wppb_generalSettings['extraFieldsLayout'] == 'default' ) ) ? ' checked' : '' ); ?> value="default" class="wppb-select"><?php _e( 'Yes', 'profile-builder' ); ?></label>
|
||||||
|
<ul>
|
||||||
|
<li class="description"><?php printf( __( 'You can find the default file here: %1$s', 'profile-builder' ), '<a href="'.dirname( plugin_dir_url( __FILE__ ) ).'/assets/css/style-front-end.css" target="_blank">'.dirname( dirname( plugin_basename( __FILE__ ) ) ).'\assets\css\style-front-end.css</a>' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( '"Email Confirmation" Activated:', 'profile-builder' );?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<select name="wppb_general_settings[emailConfirmation]" class="wppb-select" id="wppb_settings_email_confirmation" onchange="wppb_display_page_select(this.value)">
|
||||||
|
<option value="yes" <?php if ( $wppb_generalSettings['emailConfirmation'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profile-builder' ); ?></option>
|
||||||
|
<option value="no" <?php if ( $wppb_generalSettings['emailConfirmation'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profile-builder' ); ?></option>
|
||||||
|
</select>
|
||||||
|
<ul>
|
||||||
|
<li class="description"><?php _e( 'This works with front-end forms only. Recommended to redirect WP default registration to a Profile Builder one using "Custom Redirects" module.', 'profile-builder' ); ?></li>
|
||||||
|
<?php if ( $wppb_generalSettings['emailConfirmation'] == 'yes' ) { ?>
|
||||||
|
<li class="description dynamic1"><?php printf( __( 'You can find a list of unconfirmed email addresses %1$sUsers > All Users > Email Confirmation%2$s.', 'profile-builder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/users.php?page=unconfirmed_emails">', '</a>' )?></li>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="wppb-settings-activation-page">
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( '"Email Confirmation" Landing Page:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<select name="wppb_general_settings[activationLandingPage]" class="wppb-select">
|
||||||
|
<option value="" <?php if ( empty( $wppb_generalSettings['emailConfirmation'] ) ) echo 'selected'; ?>></option>
|
||||||
|
<optgroup label="<?php _e( 'Existing Pages', 'profile-builder' ); ?>">
|
||||||
|
<?php
|
||||||
|
$pages = get_pages( apply_filters( 'wppb_page_args_filter', array( 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'post_type' => 'page', 'post_status' => array( 'publish' ) ) ) );
|
||||||
|
|
||||||
|
foreach ( $pages as $key => $value ){
|
||||||
|
echo '<option value="'.$value->ID.'"';
|
||||||
|
if ( $wppb_generalSettings['activationLandingPage'] == $value->ID )
|
||||||
|
echo ' selected';
|
||||||
|
|
||||||
|
echo '>' . $value->post_title . '</option>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</optgroup>
|
||||||
|
</select>
|
||||||
|
<p class="description">
|
||||||
|
<?php _e( 'Specify the page where the users will be directed when confirming the email account. This page can differ from the register page(s) and can be changed at any time. If none selected, a simple confirmation page will be displayed for the user.', 'profile-builder' ); ?>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( file_exists( WPPB_PLUGIN_DIR.'/features/admin-approval/admin-approval.php' ) ){
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( '"Admin Approval" Activated:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<select id="adminApprovalSelect" name="wppb_general_settings[adminApproval]" class="wppb-select" onchange="wppb_display_page_select_aa(this.value)">
|
||||||
|
<option value="yes" <?php if( !empty( $wppb_generalSettings['adminApproval'] ) && $wppb_generalSettings['adminApproval'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profile-builder' ); ?></option>
|
||||||
|
<option value="no" <?php if( !empty( $wppb_generalSettings['adminApproval'] ) && $wppb_generalSettings['adminApproval'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profile-builder' ); ?></option>
|
||||||
|
</select>
|
||||||
|
<ul>
|
||||||
|
<li class="description dynamic2"><?php printf( __( 'You can find a list of users at %1$sUsers > All Users > Admin Approval%2$s.', 'profile-builder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/users.php?page=admin_approval&orderby=registered&order=desc">', '</a>' )?></li>
|
||||||
|
<ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="dynamic2">
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( '"Admin Approval" on User Role:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<div id="wrap">
|
||||||
|
<?php
|
||||||
|
$wppb_userRoles = wppb_adminApproval_onUserRole();
|
||||||
|
|
||||||
|
if( ! empty( $wppb_userRoles ) ) {
|
||||||
|
foreach( $wppb_userRoles as $role => $role_name ) {
|
||||||
|
echo '<label><input type="checkbox" id="adminApprovalOnUserRoleCheckbox" name="wppb_general_settings[adminApprovalOnUserRole][]" class="wppb-checkboxes" value="' . esc_attr( $role ) . '"';
|
||||||
|
if( ! empty( $wppb_generalSettings['adminApprovalOnUserRole'] ) && in_array( $role, $wppb_generalSettings['adminApprovalOnUserRole'] ) ) echo ' checked';
|
||||||
|
if( empty( $wppb_generalSettings['adminApprovalOnUserRole'] ) ) echo ' checked';
|
||||||
|
echo '>';
|
||||||
|
echo $role_name . '</label><br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<ul>
|
||||||
|
<li class="description"><?php printf( __( 'Select on what user roles to activate Admin Approval.', 'profile-builder' ) ) ?></li>
|
||||||
|
<ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if( file_exists( WPPB_PLUGIN_DIR.'/features/roles-editor/roles-editor.php' ) ) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( '"Roles Editor" Activated:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<select id="rolesEditorSelect" name="wppb_general_settings[rolesEditor]" class="wppb-select" onchange="wppb_display_page_select_re(this.value)">
|
||||||
|
<option value="no" <?php if( !empty( $wppb_generalSettings['rolesEditor'] ) && $wppb_generalSettings['rolesEditor'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profile-builder' ); ?></option>
|
||||||
|
<option value="yes" <?php if( !empty( $wppb_generalSettings['rolesEditor'] ) && $wppb_generalSettings['rolesEditor'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profile-builder' ); ?></option>
|
||||||
|
</select>
|
||||||
|
<ul>
|
||||||
|
<li class="description dynamic3"><?php printf( __( 'You can add / edit user roles at %1$sUsers > Roles Editor%2$s.', 'profile-builder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/edit.php?post_type=wppb-roles-editor">', '</a>' )?></li>
|
||||||
|
<ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( PROFILE_BUILDER == 'Profile Builder Free' ) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( '"Admin Approval" Feature:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<p><em> <?php printf( __( 'You decide who is a user on your website. Get notified via email or approve multiple users at once from the WordPress UI. Enable Admin Approval by upgrading to %1$sHobbyist or PRO versions%2$s.', 'profile-builder' ),'<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=general-settings-link&utm_campaign=PBFree">', '</a>' )?></em></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( 'Allow Users to Log in With:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<select name="wppb_general_settings[loginWith]" class="wppb-select">
|
||||||
|
<option value="usernameemail" <?php if ( $wppb_generalSettings['loginWith'] == 'usernameemail' ) echo 'selected'; ?>><?php _e( 'Username and Email', 'profile-builder' ); ?></option>
|
||||||
|
<option value="username" <?php if ( $wppb_generalSettings['loginWith'] == 'username' ) echo 'selected'; ?>><?php _e( 'Username', 'profile-builder' ); ?></option>
|
||||||
|
<option value="email" <?php if ( $wppb_generalSettings['loginWith'] == 'email' ) echo 'selected'; ?>><?php _e( 'Email', 'profile-builder' ); ?></option>
|
||||||
|
</select>
|
||||||
|
<ul>
|
||||||
|
<li class="description"><?php _e( '"Username and Email" - users can Log In with both Username and Email.', 'profile-builder' ); ?></li>
|
||||||
|
<li class="description"><?php _e( '"Username" - users can Log In only with Username.', 'profile-builder' ); ?></li>
|
||||||
|
<li class="description"><?php _e( '"Email" - users can Log In only with Email.', 'profile-builder' ); ?></li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( 'Minimum Password Length:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="wppb_general_settings[minimum_password_length]" class="wppb-text" value="<?php if( !empty( $wppb_generalSettings['minimum_password_length'] ) ) echo esc_attr( $wppb_generalSettings['minimum_password_length'] ); ?>"/>
|
||||||
|
<ul>
|
||||||
|
<li class="description"><?php _e( 'Enter the minimum characters the password should have. Leave empty for no minimum limit', 'profile-builder' ); ?> </li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<?php _e( 'Minimum Password Strength:', 'profile-builder' ); ?>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<select name="wppb_general_settings[minimum_password_strength]" class="wppb-select">
|
||||||
|
<option value=""><?php _e( 'Disabled', 'profile-builder' ); ?></option>
|
||||||
|
<option value="short" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'short' ) echo 'selected'; ?>><?php _e( 'Very weak', 'profile-builder' ); ?></option>
|
||||||
|
<option value="bad" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'bad' ) echo 'selected'; ?>><?php _e( 'Weak', 'profile-builder' ); ?></option>
|
||||||
|
<option value="good" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'good' ) echo 'selected'; ?>><?php _e( 'Medium', 'profile-builder' ); ?></option>
|
||||||
|
<option value="strong" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'strong' ) echo 'selected'; ?>><?php _e( 'Strong', 'profile-builder' ); ?></option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php do_action( 'wppb_extra_general_settings', $wppb_generalSettings ); ?>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" name="action" value="update" />
|
||||||
|
<p class="submit"><input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ); ?>" /></p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that sanitizes the general settings
|
||||||
|
*
|
||||||
|
* @param array $wppb_generalSettings
|
||||||
|
*
|
||||||
|
* @since v.2.0.7
|
||||||
|
*/
|
||||||
|
function wppb_general_settings_sanitize( $wppb_generalSettings ) {
|
||||||
|
$wppb_generalSettings = apply_filters( 'wppb_general_settings_sanitize_extra', $wppb_generalSettings );
|
||||||
|
|
||||||
|
if( !empty( $wppb_generalSettings ) ){
|
||||||
|
foreach( $wppb_generalSettings as $settings_name => $settings_value ){
|
||||||
|
if( $settings_name == "minimum_password_length" || $settings_name == "activationLandingPage" )
|
||||||
|
$wppb_generalSettings[$settings_name] = filter_var( $settings_value, FILTER_SANITIZE_NUMBER_INT );
|
||||||
|
elseif( $settings_name == "extraFieldsLayout" || $settings_name == "emailConfirmation" || $settings_name == "adminApproval" || $settings_name == "loginWith" || $settings_name == "minimum_password_strength" )
|
||||||
|
$wppb_generalSettings[$settings_name] = filter_var( $settings_value, FILTER_SANITIZE_STRING );
|
||||||
|
elseif( $settings_name == "adminApprovalOnUserRole" ){
|
||||||
|
if( is_array( $settings_value ) && !empty( $settings_value ) ){
|
||||||
|
foreach( $settings_value as $key => $value ){
|
||||||
|
$wppb_generalSettings[$settings_name][$key] = filter_var( $value, FILTER_SANITIZE_STRING );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $wppb_generalSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that pushes settings errors to the user
|
||||||
|
*
|
||||||
|
* @since v.2.0.7
|
||||||
|
*/
|
||||||
|
function wppb_general_settings_admin_notices() {
|
||||||
|
settings_errors( 'wppb_general_settings' );
|
||||||
|
}
|
||||||
|
add_action( 'admin_notices', 'wppb_general_settings_admin_notices' );
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that return user roles
|
||||||
|
*
|
||||||
|
* @since v.2.2.0
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function wppb_adminApproval_onUserRole() {
|
||||||
|
global $wp_roles;
|
||||||
|
|
||||||
|
$wp_roles = new WP_Roles();
|
||||||
|
|
||||||
|
$roles = $wp_roles->get_names();
|
||||||
|
|
||||||
|
unset( $roles['administrator'] );
|
||||||
|
|
||||||
|
return $roles;
|
||||||
|
}
|
1381
profile-builder/admin/manage-fields.php
Normal file
243
profile-builder/admin/pms-cross-promotion.php
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Function that creates the "Paid Accounts" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function wppb_register_pms_cross_promo() {
|
||||||
|
add_submenu_page( 'null', __( 'Paid Accounts', 'profile-builder' ), __( 'Paid Accounts', 'profile-builder' ), 'manage_options', 'profile-builder-pms-promo', 'wppb_pms_cross_promo' );
|
||||||
|
}
|
||||||
|
add_action( 'admin_menu', 'wppb_register_pms_cross_promo', 2 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds content to the "Paid Accounts" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_pms_cross_promo() {
|
||||||
|
?>
|
||||||
|
<div class="wrap wppb-wrap wppb-info-wrap">
|
||||||
|
<div class="wppb-badge wppb-pb-pms"></div>
|
||||||
|
<h1>Users can pay for an account with<br/> <small style="font-size: 30px; letter-spacing: 0.008em;">Profile Builder and Paid Member Subscriptions</small></h1>
|
||||||
|
<hr />
|
||||||
|
<div class="wppb-row">
|
||||||
|
<p>One of the most requested features in Profile Builder was for users to be able to pay for an account.</p>
|
||||||
|
<p>Now that's possible using the free WordPress plugin - <a href="https://www.cozmoslabs.com/wordpress-paid-member-subscriptions/?utm_source=wpbackend&utm_medium=clientsite&utm_content=pb-pms-promo&utm_campaign=PBFree">Paid Member Subscriptions</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 class="wppb-callout"><?php _e( 'Paid Member Subscriptions - a free WordPress plugin', 'profile-builder' ); ?></h2>
|
||||||
|
<hr/>
|
||||||
|
<div class="wppb-row wppb-2-col">
|
||||||
|
<div>
|
||||||
|
<p><?php _e( 'With the new Subscriptions Field in Profile Builder, your registration forms will allow your users to sign up for paid accounts.', 'profile-builder' ); ?></p>
|
||||||
|
<p>Other features of Paid Member Subscriptions are:</p>
|
||||||
|
<ul>
|
||||||
|
<li><?php _e( 'Paid & Free Subscriptions', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Restrict Content', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Member Management', 'profile-builder' ); ?></li>
|
||||||
|
<li><?php _e( 'Email Templates', 'profile-builder' ); ?> </li>
|
||||||
|
<li><?php _e( 'Account Management', 'profile-builder' ); ?> </li>
|
||||||
|
<li><?php _e( 'Subscription Management', 'profile-builder' ); ?> </li>
|
||||||
|
<li><?php _e( 'Payment Management', 'profile-builder' ); ?> </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<?php
|
||||||
|
$wppb_get_all_plugins = get_plugins();
|
||||||
|
$wppb_get_active_plugins = get_option('active_plugins');
|
||||||
|
|
||||||
|
$ajax_nonce = wp_create_nonce("wppb-activate-addon");
|
||||||
|
|
||||||
|
$pms_add_on_exists = 0;
|
||||||
|
$pms_add_on_is_active = 0;
|
||||||
|
$pms_add_on_is_network_active = 0;
|
||||||
|
// Check to see if add-on is in the plugins folder
|
||||||
|
foreach ($wppb_get_all_plugins as $wppb_plugin_key => $wppb_plugin) {
|
||||||
|
if( strtolower($wppb_plugin['Name']) == strtolower( 'Paid Member Subscriptions' ) && strpos(strtolower($wppb_plugin['AuthorName']), strtolower('Cozmoslabs')) !== false) {
|
||||||
|
$pms_add_on_exists = 1;
|
||||||
|
if (in_array($wppb_plugin_key, $wppb_get_active_plugins)) {
|
||||||
|
$pms_add_on_is_active = 1;
|
||||||
|
}
|
||||||
|
// Consider the add-on active if it's network active
|
||||||
|
if (is_plugin_active_for_network($wppb_plugin_key)) {
|
||||||
|
$pms_add_on_is_network_active = 1;
|
||||||
|
$pms_add_on_is_active = 1;
|
||||||
|
}
|
||||||
|
$plugin_file = $wppb_plugin_key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-activate-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Activate', 'profile-builder' ); ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-downloading-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Downloading and installing...', 'profile-builder' ); ?></span>
|
||||||
|
<span id="wppb-add-on-download-finished-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Installation complete', 'profile-builder' ); ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-activated-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Plugin is Active', 'profile-builder' ); ?></span>
|
||||||
|
<span id="wppb-add-on-activated-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Plugin has been activated', 'profile-builder' ) ?></span>
|
||||||
|
<span id="wppb-add-on-activated-error-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Retry Install', 'profile-builder' ) ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-is-active-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Plugin is <strong>active</strong>', 'profile-builder' ); ?></span>
|
||||||
|
<span id="wppb-add-on-is-not-active-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Plugin is <strong>inactive</strong>', 'profile-builder' ); ?></span>
|
||||||
|
|
||||||
|
<span id="wppb-add-on-deactivate-button-text" class="wppb-add-on-user-messages"><?php echo __( 'Deactivate', 'profile-builder' ) ?></span>
|
||||||
|
<span id="wppb-add-on-deactivated-message-text" class="wppb-add-on-user-messages"><?php echo __( 'Plugin has been deactivated.', 'profile-builder' ) ?></span>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="plugin-card wppb-recommended-plugin wppb-add-on" style="width: 111%;">
|
||||||
|
<div class="plugin-card-top">
|
||||||
|
<a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">
|
||||||
|
<img src="<?php echo plugins_url( '../assets/images/pms-recommended.png', __FILE__ ); ?>" width="100%">
|
||||||
|
</a>
|
||||||
|
<h3 class="wppb-add-on-title">
|
||||||
|
<a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">Paid Member Subscriptions</a>
|
||||||
|
</h3>
|
||||||
|
<h3 class="wppb-add-on-price"><?php _e( 'Free', 'profile-builder' ) ?></h3>
|
||||||
|
<p class="wppb-add-on-description">
|
||||||
|
<?php _e( 'Accept user payments, create subscription plans and restrict content on your website.', 'profile-builder' ) ?>
|
||||||
|
<a href="<?php admin_url();?>plugin-install.php?tab=plugin-information&plugin=paid-member-subscriptions&TB_iframe=true&width=772&height=875" class="thickbox" aria-label="More information about Paid Member Subscriptions - membership & content restriction" data-title="Paid Member Subscriptions - membership & content restriction"><?php _e( 'More Details' ); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="plugin-card-bottom wppb-add-on-compatible">
|
||||||
|
<?php
|
||||||
|
if ($pms_add_on_exists) {
|
||||||
|
|
||||||
|
// Display activate/deactivate buttons
|
||||||
|
if (!$pms_add_on_is_active) {
|
||||||
|
echo '<a class="wppb-add-on-activate right button button-primary" href="' . $plugin_file . '" data-nonce="' . $ajax_nonce . '">' . __('Activate', 'profile-builder') . '</a>';
|
||||||
|
|
||||||
|
// If add-on is network activated don't allow deactivation
|
||||||
|
} elseif (!$pms_add_on_is_network_active) {
|
||||||
|
echo '<a class="wppb-add-on-deactivate right button button-primary" href="' . $plugin_file . '" data-nonce="' . $ajax_nonce . '">' . __('Deactivate', 'profile-builder') . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display message to the user
|
||||||
|
if( !$pms_add_on_is_active ){
|
||||||
|
echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . __('Plugin is <strong>inactive</strong>', 'profile-builder') . '</span>';
|
||||||
|
} else {
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Plugin is <strong>active</strong>', 'profile-builder') . '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
|
||||||
|
// handles the in-page download
|
||||||
|
if (is_multisite()) {
|
||||||
|
$wppb_paid_link_class = 'button-primary';
|
||||||
|
$wppb_paid_link_text = __('Download Now', 'profile-builder' );
|
||||||
|
} else {
|
||||||
|
$wppb_paid_link_class = 'button-primary wppb-add-on-download';
|
||||||
|
$wppb_paid_link_text = __('Install Now', 'profile-builder');
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<a target="_blank" class="right button ' . $wppb_paid_link_class . '" href="https://downloads.wordpress.org/plugin/paid-member-subscriptions.zip" data-add-on-slug="paid-member-subscriptions" data-add-on-name="Paid Member Subscriptions" data-nonce="' . $ajax_nonce . '">' . $wppb_paid_link_text . '</a>';
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="spinner"></div>
|
||||||
|
<span class="wppb-add-on-user-messages wppb-error-manual-install"><?php printf(__('Could not install plugin. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url( 'http://www.wordpress.org/plugins/paid-member-subscriptions' )) ?></a>.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 class="wppb-callout"><?php _e( 'Step by Step Quick Setup', 'profile-builder' ); ?></h2>
|
||||||
|
<hr/>
|
||||||
|
<p>Setting up Paid Member Subscriptions opens the door to paid user accounts. </p>
|
||||||
|
<div class="wrap wppb-wrap wppb-1-3-col">
|
||||||
|
<div><h3>Create Subscription Plans</h3>
|
||||||
|
<p>With Paid Member Subscriptions it’s fairly easy to create tiered subscription plans for your users. </p>
|
||||||
|
<p>Adding a new subscription gives you access to the following options to set up: subscription name, description, duration, the price, status and user role.</p>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<p><img src="<?php echo WPPB_PLUGIN_URL; ?>assets/images/pms_all_subscriptions-600x336.jpg" alt="paid subscription plans"/></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="wrap wppb-wrap wppb-1-3-col">
|
||||||
|
<div><h3>Add Subscriptions field to Profile Builder -> Manage Fields</h3>
|
||||||
|
<p>The new Subscription Plans field will add a list of radio buttons with membership details to Profile Builder registration forms.</p>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<p><img src="<?php echo WPPB_PLUGIN_URL; ?>assets/images/pms_pb_add_subscription-600x471.png" alt="manage fields subscription plans"/></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="wrap wppb-wrap wppb-1-3-col">
|
||||||
|
<div><h3>Start getting user payments</h3>
|
||||||
|
<p>To finalize registration for a paid account, users will need to complete the payment.</p>
|
||||||
|
<p>Members created with Profile Builder registration form will have the user role of the selected subscription.</p>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<p><img src="<?php echo WPPB_PLUGIN_URL; ?>assets/images/pms_pb_register_page-600x618.png" alt="register payed accounts"/></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="pms-bottom-install" class="wppb-add-on">
|
||||||
|
<div class="plugin-card-bottom wppb-add-on-compatible">
|
||||||
|
<?php
|
||||||
|
if ($pms_add_on_exists) {
|
||||||
|
|
||||||
|
// Display activate/deactivate buttons
|
||||||
|
if (!$pms_add_on_is_active) {
|
||||||
|
echo '<a class="wppb-add-on-activate right button button-secondary" href="' . $plugin_file . '" data-nonce="' . $ajax_nonce . '">' . __('Activate', 'profile-builder') . '</a>';
|
||||||
|
|
||||||
|
// If add-on is network activated don't allow deactivation
|
||||||
|
} elseif (!$pms_add_on_is_network_active) {
|
||||||
|
echo '<a class="wppb-add-on-deactivate right button button-secondary" href="' . $plugin_file . '" data-nonce="' . $ajax_nonce . '">' . __('Deactivate', 'profile-builder') . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display message to the user
|
||||||
|
if( !$pms_add_on_is_active ){
|
||||||
|
echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . __('Plugin is <strong>inactive</strong>', 'profile-builder') . '</span>';
|
||||||
|
} else {
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Plugin is <strong>active</strong>', 'profile-builder') . '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
|
||||||
|
// handles the in-page download
|
||||||
|
if (is_multisite()) {
|
||||||
|
$wppb_paid_link_class = 'button-secondary';
|
||||||
|
$wppb_paid_link_text = __('Download Now', 'profile-builder' );
|
||||||
|
} else {
|
||||||
|
$wppb_paid_link_class = 'button-secondary wppb-add-on-download';
|
||||||
|
$wppb_paid_link_text = __('Install Now', 'profile-builder');
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<a target="_blank" class="right button ' . $wppb_paid_link_class . '" href="https://downloads.wordpress.org/plugin/paid-member-subscriptions.zip" data-add-on-slug="paid-member-subscriptions" data-add-on-name="Paid Member Subscriptions" data-nonce="' . $ajax_nonce . '">' . $wppb_paid_link_text . '</a>';
|
||||||
|
echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . __('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="spinner"></div>
|
||||||
|
<?php /* <span class="wppb-add-on-user-messages wppb-error-manual-install"><?php printf(__('Could not install plugin. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url( 'http://www.wordpress.org/plugins/paid-member-subscriptions' )) ?></a>.</span> */ ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Instantiate a new notification for the PMS cross Promotion
|
||||||
|
*
|
||||||
|
* @Since 2.2.5
|
||||||
|
*/
|
||||||
|
if ( !isset($_GET['page']) || $_GET['page'] != 'profile-builder-pms-promo'){
|
||||||
|
new WPPB_Add_General_Notices('wppb_pms_cross_promo',
|
||||||
|
sprintf(__('Allow your users to have <strong>paid accounts with Profile Builder</strong>. %1$sFind out how >%2$s %3$sDismiss%4$s', 'profile-builder'), "<a href='" . admin_url('options.php?page=profile-builder-pms-promo') . "'>", "</a>", "<a class='wppb-dismiss-notification' href='" . esc_url( add_query_arg('wppb_pms_cross_promo_dismiss_notification', '0') ) . "'>", "</a>"),
|
||||||
|
'pms-cross-promo');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
252
profile-builder/admin/register-version.php
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Function that creates the "Register your version" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
|
||||||
|
if( !is_multisite() ){
|
||||||
|
function wppb_register_your_version_submenu_page()
|
||||||
|
{
|
||||||
|
if (PROFILE_BUILDER != 'Profile Builder Free')
|
||||||
|
add_submenu_page('profile-builder', __('Register Your Version', 'profile-builder'), __('Register Version', 'profile-builder'), 'manage_options', 'profile-builder-register', 'wppb_register_your_version_content');
|
||||||
|
}
|
||||||
|
add_action('admin_menu', 'wppb_register_your_version_submenu_page', 20);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
function wppb_multisite_register_your_version_page()
|
||||||
|
{
|
||||||
|
if (PROFILE_BUILDER != 'Profile Builder Free')
|
||||||
|
add_menu_page(__('Profile Builder Register', 'profile-builder'), __('Profile Builder Register', 'profile-builder'), 'manage_options', 'profile-builder-register', 'wppb_register_your_version_content', WPPB_PLUGIN_URL . 'assets/images/pb-menu-icon.png');
|
||||||
|
}
|
||||||
|
add_action('network_admin_menu', 'wppb_multisite_register_your_version_page', 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that adds content to the "Register your Version" submenu page
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function wppb_register_your_version_content() {
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="wrap wppb-wrap">
|
||||||
|
<?php
|
||||||
|
if ( PROFILE_BUILDER == 'Profile Builder Pro' ){
|
||||||
|
wppb_serial_form('pro', 'Profile Builder Pro');
|
||||||
|
}elseif ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ){
|
||||||
|
wppb_serial_form('hobbyist', 'Profile Builder Hobbyist');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that creates the "Register your version" form depending on Pro or Hobbyist version
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function wppb_serial_form($version, $fullname){
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h2><?php _e( "Register your version of $fullname", 'profile-builder' ); ?></h2>
|
||||||
|
|
||||||
|
<form method="post" action="<?php echo get_admin_url( 1, 'options.php' ) ?>">
|
||||||
|
|
||||||
|
<?php $wppb_profile_builder_serial = get_option( 'wppb_profile_builder_'.$version.'_serial' ); ?>
|
||||||
|
<?php $wppb_profile_builder_serial_status = get_option( 'wppb_profile_builder_'.$version.'_serial_status' ); ?>
|
||||||
|
<?php settings_fields( 'wppb_profile_builder_'.$version.'_serial' ); ?>
|
||||||
|
|
||||||
|
<p><?php printf( __( "Now that you acquired a copy of %s, you should take the time and register it with the serial number you received", 'profile-builder'), $fullname);?></p>
|
||||||
|
<p><?php _e( "If you register this version of Profile Builder, you'll receive information regarding upgrades, patches, and technical support.", 'profile-builder' );?></p>
|
||||||
|
<p class="wppb-serial-wrap">
|
||||||
|
<label for="wppb_profile_builder_<?php echo $version; ?>_serial"><?php _e(' Serial Number:', 'profile-builder' );?></label>
|
||||||
|
<input type="password" size="50" name="wppb_profile_builder_<?php echo $version; ?>_serial" id="wppb_profile_builder_<?php echo $version; ?>_serial" class="regular-text" <?php if ( $wppb_profile_builder_serial != ''){ echo ' value="'.$wppb_profile_builder_serial.'"';} ?>/>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if( $wppb_profile_builder_serial_status == 'found' )
|
||||||
|
echo '<span class="validateStatus"><img src="'.WPPB_PLUGIN_URL.'/assets/images/accept.png" title="'.__( 'The serial number was successfully validated!', 'profile-builder' ).'"/></span>';
|
||||||
|
elseif ( $wppb_profile_builder_serial_status == 'notFound' )
|
||||||
|
echo '<span class="validateStatus"><img src="'.WPPB_PLUGIN_URL.'/assets/images/icon_error.png" title="'.__( 'The serial number entered couldn\'t be validated!','profile-builder' ).'"/></span>';
|
||||||
|
elseif ( strpos( $wppb_profile_builder_serial_status, 'aboutToExpire') !== false )
|
||||||
|
echo '<span class="validateStatus"><img src="' . WPPB_PLUGIN_URL . '/assets/images/icon_error.png" title="' . __('The serial number is about to expire soon!', 'profile-builder') . '"/>'. sprintf( __(' Your serial number is about to expire, please %1$s Renew Your License%2$s.','profile-builder'), "<a href='https://www.cozmoslabs.com/downloads/profile-builder-". $version ."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' >", "</a>").'</span>';
|
||||||
|
elseif ( $wppb_profile_builder_serial_status == 'expired' )
|
||||||
|
echo '<span class="validateStatus"><img src="'.WPPB_PLUGIN_URL.'/assets/images/icon_error.png" title="'.__( 'The serial number couldn\'t be validated because it expired!','profile-builder' ).'"/>'. sprintf( __(' Your serial number is expired, please %1$s Renew Your License%2$s.','profile-builder'), "<a href='https://www.cozmoslabs.com/downloads/profile-builder-". $version ."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' >", "</a>").'</span>';
|
||||||
|
elseif ( $wppb_profile_builder_serial_status == 'serverDown' )
|
||||||
|
echo '<span class="validateStatus"><img src="'.WPPB_PLUGIN_URL.'/assets/images/icon_error.png" title="'.__( 'The serial number couldn\'t be validated because process timed out. This is possible due to the server being down. Please try again later!','profile-builder' ).'"/></span>';
|
||||||
|
?>
|
||||||
|
<span class="wppb-serialnumber-descr"><?php _e( '(e.g. RMPB-15-SN-253a55baa4fbe7bf595b2aabb8d72985)', 'profile-builder' );?></span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="wppb_submit_button_div">
|
||||||
|
<input type="hidden" name="action" value="update" />
|
||||||
|
<p class="submit">
|
||||||
|
<?php wp_nonce_field( 'wppb_register_version_nonce', 'wppb_register_version_nonce' ); ?>
|
||||||
|
<input type="submit" name="wppb_serial_number_activate" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//the function to check the validity of the serial number and save a variable in the DB; purely visual
|
||||||
|
function wppb_check_serial_number($oldVal, $newVal){
|
||||||
|
|
||||||
|
$serial_number_set = $newVal;
|
||||||
|
|
||||||
|
|
||||||
|
$response = wp_remote_get( 'http://updatemetadata.cozmoslabs.com/checkserial/?serialNumberSent='.$serial_number_set );
|
||||||
|
if ( PROFILE_BUILDER == 'Profile Builder Pro' ){
|
||||||
|
wppb_update_serial_status($response, 'pro');
|
||||||
|
wp_clear_scheduled_hook( "check_plugin_updates-profile-builder-pro-update" );
|
||||||
|
} else {
|
||||||
|
wppb_update_serial_status($response, 'hobbyist');
|
||||||
|
wp_clear_scheduled_hook( "check_plugin_updates-profile-builder-hobbyist-update" );
|
||||||
|
}
|
||||||
|
$user_ID = get_current_user_id();
|
||||||
|
delete_user_meta( $user_ID, 'wppb_dismiss_notification' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action( 'update_option_wppb_profile_builder_pro_serial', 'wppb_check_serial_number', 10, 2 );
|
||||||
|
add_action( 'update_option_wppb_profile_builder_hobbyist_serial', 'wppb_check_serial_number', 10, 2 );
|
||||||
|
|
||||||
|
add_action( 'add_option_wppb_profile_builder_pro_serial', 'wppb_check_serial_number', 10, 2 );
|
||||||
|
add_action( 'add_option_wppb_profile_builder_hobbyist_serial', 'wppb_check_serial_number', 10, 2 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $response
|
||||||
|
*/
|
||||||
|
function wppb_update_serial_status($response, $version)
|
||||||
|
{
|
||||||
|
if (is_wp_error($response)) {
|
||||||
|
update_option('wppb_profile_builder_'.$version.'_serial_status', 'serverDown'); //server down
|
||||||
|
} elseif ((trim($response['body']) != 'notFound') && (trim($response['body']) != 'found') && (trim($response['body']) != 'expired') && (strpos( $response['body'], 'aboutToExpire' ) === false)) {
|
||||||
|
update_option('wppb_profile_builder_'.$version.'_serial_status', 'serverDown'); //unknown response parameter
|
||||||
|
update_option('wppb_profile_builder_'.$version.'_serial', ''); //reset the entered password, since the user will need to try again later
|
||||||
|
|
||||||
|
} else {
|
||||||
|
update_option('wppb_profile_builder_'.$version.'_serial_status', trim($response['body'])); //either found, notFound or expired
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//the update didn't work when the old value = new value, so we need to apply a filter on get_option (that is run before update_option), that resets the old value
|
||||||
|
function wppb_check_serial_number_fix($newvalue, $oldvalue){
|
||||||
|
|
||||||
|
if ( $newvalue == $oldvalue )
|
||||||
|
wppb_check_serial_number( $oldvalue, $newvalue );
|
||||||
|
|
||||||
|
return $newvalue;
|
||||||
|
}
|
||||||
|
add_filter( 'pre_update_option_wppb_profile_builder_pro_serial', 'wppb_check_serial_number_fix', 10, 2 );
|
||||||
|
add_filter( 'pre_update_option_wppb_profile_builder_hobbyist_serial', 'wppb_check_serial_number_fix', 10, 2 );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class that adds a notice when either the serial number wasn't found, or it has expired
|
||||||
|
*
|
||||||
|
* @since v.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
class wppb_add_notices{
|
||||||
|
public $pluginPrefix = '';
|
||||||
|
public $pluginName = '';
|
||||||
|
public $notificaitonMessage = '';
|
||||||
|
public $pluginSerialStatus = '';
|
||||||
|
|
||||||
|
function __construct( $pluginPrefix, $pluginName, $notificaitonMessage, $pluginSerialStatus ){
|
||||||
|
$this->pluginPrefix = $pluginPrefix;
|
||||||
|
$this->pluginName = $pluginName;
|
||||||
|
$this->notificaitonMessage = $notificaitonMessage;
|
||||||
|
$this->pluginSerialStatus = $pluginSerialStatus;
|
||||||
|
|
||||||
|
add_action( 'admin_notices', array( $this, 'add_admin_notice' ) );
|
||||||
|
add_action( 'admin_init', array( $this, 'dismiss_notification' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Display a notice that can be dismissed in case the serial number is inactive
|
||||||
|
function add_admin_notice() {
|
||||||
|
global $current_user ;
|
||||||
|
global $pagenow;
|
||||||
|
|
||||||
|
$user_id = $current_user->ID;
|
||||||
|
|
||||||
|
do_action( $this->pluginPrefix.'_before_notification_displayed', $current_user, $pagenow );
|
||||||
|
|
||||||
|
if ( current_user_can( 'manage_options' ) ){
|
||||||
|
|
||||||
|
$plugin_serial_status = get_option( $this->pluginSerialStatus );
|
||||||
|
if ( $plugin_serial_status != 'found' ){
|
||||||
|
// Check that the user hasn't already clicked to ignore the message
|
||||||
|
if ( ! get_user_meta($user_id, $this->pluginPrefix.'_dismiss_notification' ) ) {
|
||||||
|
echo $finalMessage = apply_filters($this->pluginPrefix.'_notification_message','<div class="error wppb-serial-notification" >'.$this->notificaitonMessage.'</div>', $this->notificaitonMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
do_action( $this->pluginPrefix.'_notification_displayed', $current_user, $pagenow, $plugin_serial_status );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
do_action( $this->pluginPrefix.'_after_notification_displayed', $current_user, $pagenow );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function dismiss_notification() {
|
||||||
|
global $current_user;
|
||||||
|
|
||||||
|
$user_id = $current_user->ID;
|
||||||
|
|
||||||
|
do_action( $this->pluginPrefix.'_before_notification_dismissed', $current_user );
|
||||||
|
|
||||||
|
// If user clicks to ignore the notice, add that to their user meta
|
||||||
|
if ( isset( $_GET[$this->pluginPrefix.'_dismiss_notification']) && '0' == $_GET[$this->pluginPrefix.'_dismiss_notification'] )
|
||||||
|
add_user_meta( $user_id, $this->pluginPrefix.'_dismiss_notification', 'true', true );
|
||||||
|
|
||||||
|
do_action( $this->pluginPrefix.'_after_notification_dismissed', $current_user );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( is_multisite() && function_exists( 'switch_to_blog' ) )
|
||||||
|
switch_to_blog(1);
|
||||||
|
|
||||||
|
if ( PROFILE_BUILDER == 'Profile Builder Pro' ){
|
||||||
|
$wppb_profile_builder_pro_hobbyist_serial_status = get_option( 'wppb_profile_builder_pro_serial_status', 'empty' );
|
||||||
|
$version = 'pro';
|
||||||
|
|
||||||
|
} elseif( PROFILE_BUILDER == 'Profile Builder Hobbyist' ) {
|
||||||
|
$wppb_profile_builder_pro_hobbyist_serial_status = get_option( 'wppb_profile_builder_hobbyist_serial_status', 'empty' );
|
||||||
|
$version = 'hobbyist';
|
||||||
|
}
|
||||||
|
if( is_multisite() && function_exists( 'restore_current_blog' ) )
|
||||||
|
restore_current_blog();
|
||||||
|
|
||||||
|
if ( $wppb_profile_builder_pro_hobbyist_serial_status == 'notFound' || $wppb_profile_builder_pro_hobbyist_serial_status == 'empty' ){
|
||||||
|
if( !is_multisite() )
|
||||||
|
$register_url = 'admin.php?page=profile-builder-register';
|
||||||
|
else
|
||||||
|
$register_url = network_admin_url( 'admin.php?page=profile-builder-register' );
|
||||||
|
|
||||||
|
new wppb_add_notices( 'wppb', 'profile_builder_pro', sprintf( __( '<p>Your <strong>Profile Builder</strong> serial number is invalid or missing. <br/>Please %1$sregister your copy%2$s to receive access to automatic updates and support. Need a license key? %3$sPurchase one now%4$s</p>', 'profile-builder'), "<a href='". $register_url ."'>", "</a>", "<a href='https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-SN-Purchase' target='_blank' class='button-primary'>", "</a>" ), 'wppb_profile_builder_pro_serial_status' );
|
||||||
|
}
|
||||||
|
elseif ( $wppb_profile_builder_pro_hobbyist_serial_status == 'expired' ){
|
||||||
|
new wppb_add_notices( 'wppb_expired', 'profile_builder_pro', sprintf( __( '<p>Your <strong>Profile Builder</strong> license has expired. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 40% off %4$s %5$sDismiss%6$s</p>', 'profile-builder'), "<a href='https://www.cozmoslabs.com/downloads/profile-builder-". $version ."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank'>", "</a>", "<a href='https://www.cozmoslabs.com/downloads/profile-builder-".$version."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank' class='button-primary'>", "</a>", "<a href='". esc_url( add_query_arg( 'wppb_expired_dismiss_notification', '0' ) ) ."' class='wppb-dismiss-notification'>", "</a>" ), 'wppb_profile_builder_pro_serial_status' );
|
||||||
|
}
|
||||||
|
elseif( strpos( $wppb_profile_builder_pro_hobbyist_serial_status, 'aboutToExpire' ) === 0 ){
|
||||||
|
$serial_status_parts = explode( '#', $wppb_profile_builder_pro_hobbyist_serial_status );
|
||||||
|
$date = $serial_status_parts[1];
|
||||||
|
new wppb_add_notices( 'wppb_about_to_expire', 'profile_builder_pro', sprintf( __( '<p>Your <strong>Profile Builder</strong> license is about to expire on %5$s. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 40% off %4$s %6$sDismiss%7$s</p>', 'profile-builder'), "<a href='https://www.cozmoslabs.com/downloads/profile-builder-". $version ."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank'>", "</a>", "<a href='https://www.cozmoslabs.com/downloads/profile-builder-".$version."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank' class='button-primary'>", "</a>", $date, "<a href='". esc_url( add_query_arg( 'wppb_about_to_expire_dismiss_notification', '0' ) )."' class='wppb-dismiss-notification'>", "</a>" ), 'wppb_profile_builder_pro_serial_status' );
|
||||||
|
}
|
60
profile-builder/assets/css/rtl.css
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
.wppb-user-forms .wppb-wysiwyg .wp-editor-wrap {
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
#wppb-search-fields{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
.wppb-form-field label,
|
||||||
|
#wppb-login-wrap .login-username label,
|
||||||
|
#wppb-login-wrap .login-password label{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
.wppb-form-field input,
|
||||||
|
.wppb-form-field input[type="text"], .wppb-form-field input[type="email"], .wppb-form-field input[type="url"], .wppb-form-field input[type="password"], .wppb-form-field input[type="search"],
|
||||||
|
.wppb-form-field select,
|
||||||
|
.wppb-form-field textarea,
|
||||||
|
.wppb-checkboxes,
|
||||||
|
.wppb-radios,
|
||||||
|
#wppb-login-wrap .login-username input,
|
||||||
|
#wppb-login-wrap .login-password input{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
.wppb-table th{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
ul.wppb-profile li label{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
ul.wppb-profile li span{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and ( max-width: 720px ) {
|
||||||
|
.wppb-table td {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.wppb-table .wppb-posts,
|
||||||
|
.wppb-table .wppb-moreinfo{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.wppb-table td:before {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 400px) {
|
||||||
|
.wppb-form-field input,
|
||||||
|
.wppb-form-field select,
|
||||||
|
.wppb-form-field textarea,
|
||||||
|
.wppb-checkboxes,
|
||||||
|
.wppb-radios,
|
||||||
|
#wppb-login-wrap .login-username input,
|
||||||
|
#wppb-login-wrap .login-password input,
|
||||||
|
ul.wppb-profile li span{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pass-strength-result {
|
||||||
|
float: right;
|
||||||
|
}
|
1
profile-builder/assets/css/select2/select2.min.css
vendored
Normal file
44
profile-builder/assets/css/serial-notice.css
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
.wppb-serial-wrap{
|
||||||
|
margin:40px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-dismiss-notification{
|
||||||
|
position:absolute;
|
||||||
|
right:0px;
|
||||||
|
top:50%;
|
||||||
|
margin-top:-7px;
|
||||||
|
}
|
||||||
|
.pms-cross-promo .wppb-dismiss-notification{
|
||||||
|
right: 10px;
|
||||||
|
margin-top:-10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.wppb-serial-notification p{
|
||||||
|
padding-right: 50px;
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
.pms-cross-promo{
|
||||||
|
position: relative;
|
||||||
|
background-color: #fff;
|
||||||
|
border-left: 4px solid #d54e21;
|
||||||
|
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
display: block;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 19px;
|
||||||
|
margin: 35px 20px 0 2px;
|
||||||
|
padding: 11px 15px;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
color: #fff;
|
||||||
|
background: #5693d3;
|
||||||
|
}
|
||||||
|
.pms-cross-promo a{
|
||||||
|
padding: 0 3px;
|
||||||
|
color:#fff;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
.pms-cross-promo a:hover{
|
||||||
|
background: #fff;
|
||||||
|
color: #5693d3;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
647
profile-builder/assets/css/style-back-end.css
Normal file
@ -0,0 +1,647 @@
|
|||||||
|
.wppb-wrap{
|
||||||
|
clear: both;
|
||||||
|
margin: 10px 0px 0 2px;
|
||||||
|
}
|
||||||
|
.wppb-wrap,
|
||||||
|
.wppb-wrap p{
|
||||||
|
font-size: 15px;
|
||||||
|
max-width: 1050px;
|
||||||
|
}
|
||||||
|
.wppb-info-wrap{
|
||||||
|
max-width:1050px;
|
||||||
|
margin:25px 40px 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap h1 {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 2.8em;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.2em;
|
||||||
|
margin:0;
|
||||||
|
padding-top:35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap .wppb-callout{
|
||||||
|
font-size: 2em;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1.3;
|
||||||
|
margin:1.1em 0 0.2em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap hr{
|
||||||
|
display:block;
|
||||||
|
clear:both;
|
||||||
|
margin:20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-text{
|
||||||
|
font-size:1.1em;
|
||||||
|
margin-top:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap ul{
|
||||||
|
list-style-type:circle;
|
||||||
|
list-style-position:inside;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap li.description{
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-badge{
|
||||||
|
float: right;
|
||||||
|
color: #fff;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
text-align: center;
|
||||||
|
text-rendering: optimizelegibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-badge.Pro{
|
||||||
|
background:url(../images/pb-logo-pro.png) center no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-badge.Hobbyist{
|
||||||
|
background:url(../images/pb-logo-hobbyist.png) center no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-badge.Free{
|
||||||
|
background:url(../images/pb-logo-free.png) center no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-badge.wppb-pb-pms{
|
||||||
|
background:url(../images/pb-pms-cross-promotion-icon.png) center center no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-badge {
|
||||||
|
background-size: cover !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-badge span {
|
||||||
|
display: inline-block;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 110px;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Userlist page */
|
||||||
|
.wppb-ul-templates > textarea,
|
||||||
|
.wppb-single-ul-templates > textarea {
|
||||||
|
float: left;
|
||||||
|
width: 60%;
|
||||||
|
max-width: 100%;
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.update_container_wppb_ul_faceted_settings .row-facet-behaviour,
|
||||||
|
.update_container_wppb_ul_faceted_settings .row-facet-limit,
|
||||||
|
#container_wppb_ul_faceted_settings .row-facet-behaviour,
|
||||||
|
#container_wppb_ul_faceted_settings .row-facet-behaviour,
|
||||||
|
#container_wppb_ul_faceted_settings .row-facet-limit{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_ul_faceted_settings .facet_type_checkboxes .row-facet-behaviour,
|
||||||
|
#container_wppb_ul_faceted_settings .facet_type_checkboxes .row-facet-limit,
|
||||||
|
#container_wppb_ul_faceted_settings .update_container_wppb_ul_faceted_settings.facet_checkboxes .row-facet-behaviour,
|
||||||
|
#container_wppb_ul_faceted_settings .update_container_wppb_ul_faceted_settings.facet_checkboxes .row-facet-limit{
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Extra Stuff */
|
||||||
|
.nowrap {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-fields-image{
|
||||||
|
margin-top:60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Shortcode */
|
||||||
|
.wppb-shortcode {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
background: #fff !important;
|
||||||
|
padding: 5px 10px;
|
||||||
|
margin-top: 5px;
|
||||||
|
border: 1px solid #e1e1e1;
|
||||||
|
box-shadow: none !important;
|
||||||
|
font-family: 'Arial';
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-shortcode.textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
resize: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-shortcode:focus {
|
||||||
|
border-color: #e1e1e1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-shortcode-temp {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 11px;
|
||||||
|
font-family: 'Arial';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Manage Fields page */
|
||||||
|
.profile-builder_page_manage-fields .metabox-holder .column-1{
|
||||||
|
/* margin-right:0; */
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields li strong{
|
||||||
|
display:none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields li .description strong {
|
||||||
|
display: inline !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields .added_fields_list li.row-meta-name{
|
||||||
|
display:list-item !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields li.row-field-title pre,
|
||||||
|
#container_wppb_manage_fields li.row-meta-name pre{
|
||||||
|
min-height:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_manage_fields .ui-sortable label,
|
||||||
|
#container_wppb_manage_fields .ui-sortable label {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_manage_fields .sortable-handle,
|
||||||
|
#container_wppb_manage_fields .sortable-handle {
|
||||||
|
display: inline-block;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background: url('../images/sorting-icon-dots.png') no-repeat center center;;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-right: 7px;
|
||||||
|
cursor: move;
|
||||||
|
margin-top: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields pre{
|
||||||
|
display:block;
|
||||||
|
float:left;
|
||||||
|
width:27%;
|
||||||
|
font-family:"Open Sans", Arial, sans-serif;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields pre.wppb-mb-head-required,
|
||||||
|
#container_wppb_manage_fields li.row-required pre{
|
||||||
|
width:auto;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields thead tr{
|
||||||
|
background:#f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields thead tr:hover {
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields tr.update_container_wppb_manage_fields:hover{
|
||||||
|
background:#fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_manage_fields tr:hover{
|
||||||
|
background:#def6ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_manage_fields_info{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Extra Registration and Edit Profile fields */
|
||||||
|
#container_wppb_epf_fields li strong,
|
||||||
|
#container_wppb_rf_fields li strong{
|
||||||
|
display:none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_epf_fields pre,
|
||||||
|
#container_wppb_rf_fields pre{
|
||||||
|
display:block;
|
||||||
|
font-family:"Open Sans", Arial, sans-serif;
|
||||||
|
font-size:14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_epf_fields thead tr,
|
||||||
|
#container_wppb_rf_fields thead tr {
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
#container_wppb_epf_fields thead tr:hover,
|
||||||
|
#container_wppb_rf_fields thead tr:hover {
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
#container_wppb_epf_fields thead .wppb-delete-all-fields,
|
||||||
|
#container_wppb_rf_fields thead .wppb-delete-all-fields {
|
||||||
|
color: #333;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_epf_fields tbody .wck-delete,
|
||||||
|
#container_wppb_rf_fields tbody .wck-delete {
|
||||||
|
padding: 8px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_epf_fields tr.update_container_wppb_epf_fields:hover,
|
||||||
|
#container_wppb_rf_fields tr.update_container_wppb_rf_fields:hover{
|
||||||
|
background:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_epf_fields tr:hover,
|
||||||
|
#container_wppb_rf_fields tr:hover{
|
||||||
|
background:#def6ff;
|
||||||
|
}
|
||||||
|
#container_wppb_epf_fields .wck-content{
|
||||||
|
content: "" !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_rf_page_settings .row-url, #wppb_rf_page_settings .row-display-messages, .update_container_wppb_rf_page_settings.redirect_ .row-url,
|
||||||
|
.update_container_wppb_rf_page_settings.redirect_ .row-display-messages, .update_container_wppb_rf_page_settings.redirect_no .row-url,
|
||||||
|
.update_container_wppb_rf_page_settings.redirect_no .row-display-messages{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_rf_page_settings.update_container_wppb_rf_page_settings.redirect_yes .row-url, #wppb_rf_page_settings.update_container_wppb_rf_page_settings.redirect_yes .row-display-messages{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_epf_page_settings .row-url, #wppb_epf_page_settings .row-display-messages, .update_container_wppb_epf_page_settings.redirect_ .row-url,
|
||||||
|
.update_container_wppb_epf_page_settings.redirect_ .row-display-messages, .update_container_wppb_epf_page_settings.redirect_no .row-url,
|
||||||
|
.update_container_wppb_epf_page_settings.redirect_no .row-display-messages{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_epf_page_settings.update_container_wppb_epf_page_settings.redirect_yes .row-url, #wppb_epf_page_settings.update_container_wppb_epf_page_settings.redirect_yes .row-display-messages{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Columns :) */
|
||||||
|
.wppb-row{
|
||||||
|
overflow:hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-3-col > div {
|
||||||
|
float:left;
|
||||||
|
width:28%;
|
||||||
|
margin-right:5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-2-col > div {
|
||||||
|
float:left;
|
||||||
|
width:45%;
|
||||||
|
margin-right:5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-3-col > div:last-child,
|
||||||
|
.wppb-2-col > div:last-child{
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-1-3-col > div {
|
||||||
|
float:left;
|
||||||
|
width:28%;
|
||||||
|
margin-right:5%;
|
||||||
|
}
|
||||||
|
.wppb-1-3-col > div:last-child{
|
||||||
|
float:right;
|
||||||
|
width: 67%;
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
/* Extra Form Styles */
|
||||||
|
.wppb-text{
|
||||||
|
min-width: 16.4em;
|
||||||
|
}
|
||||||
|
.wppb-select {
|
||||||
|
min-width:18em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap .form-table th {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-metabox label{
|
||||||
|
display:inline-block;
|
||||||
|
min-width:15em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Admin Bar Page */
|
||||||
|
.wppb-admin-bar label{
|
||||||
|
margin-right:30px;
|
||||||
|
padding:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* modules Page */
|
||||||
|
.wppb-modules label{
|
||||||
|
margin-right:30px;
|
||||||
|
padding:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Metabox Clone. We need this in various places to simulate the css of a normal metabox. */
|
||||||
|
.wppb-side{
|
||||||
|
width:300px;
|
||||||
|
float:right;
|
||||||
|
clear:both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-metabox h3{
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 0;
|
||||||
|
padding:8px 12px;
|
||||||
|
cursor:default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-normal{
|
||||||
|
margin-right:320px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-metabox textarea{
|
||||||
|
resize:vertical;
|
||||||
|
background-color: #ecf8fd;
|
||||||
|
font-family: Consolas,Monaco,monospace;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-metabox .inline-wrap{
|
||||||
|
width:280px;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
.wppb-highlight{
|
||||||
|
background:#333333;
|
||||||
|
background:#222222;
|
||||||
|
background:#fff;
|
||||||
|
padding:20px;
|
||||||
|
}
|
||||||
|
.wppb-userlisting-slider, .wppb-list-users-slider{
|
||||||
|
display:block;
|
||||||
|
padding:10px;
|
||||||
|
border:1px solid #ccc;
|
||||||
|
font-family: Consolas,Monaco,monospace;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-top:20px;
|
||||||
|
}
|
||||||
|
#wppb_manage_fields .mb-list-entry-fields .field-label{
|
||||||
|
max-width: 179px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#container_wppb_epf_fields .row-id,
|
||||||
|
#wppb_epf_fields .row-id,
|
||||||
|
#container_wppb_rf_fields .row-id,
|
||||||
|
#wppb_rf_fields .row-id{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap #serial_number{
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.3;
|
||||||
|
padding: 20px 10px 20px 0;
|
||||||
|
text-align: left;
|
||||||
|
color: #222222;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_profile_builder_pro_serial{
|
||||||
|
width:460px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-wrap .wppb-serialnumber-descr{
|
||||||
|
display: block;
|
||||||
|
padding: 0px 0px 0px 95px
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-backend-notice{
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 16px;
|
||||||
|
padding: 11px;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: left;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
background-color: #fff9e8;
|
||||||
|
border:1px solid #ffba00;
|
||||||
|
border-radius:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* hide "View post" link from update messages on internal post types */
|
||||||
|
.post-type-wppb-ul-cpt #message.updated a, .post-type-wppb-rf-cpt #message.updated a, .post-type-wppb-epf-cpt #message.updated a{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#wppb_ul_page_settings .row-visible-to-following-roles, .update_container_wppb_ul_page_settings.visible_to_logged_ .row-visible-to-following-roles{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_ul_page_settings.update_container_wppb_ul_page_settings.visible_to_logged_yes .row-visible-to-following-roles{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add-Ons page */
|
||||||
|
.wppb-add-on-user-messages{ display: none; }
|
||||||
|
|
||||||
|
.wppb-add-on-wrap .plugin-card-bottom:after {
|
||||||
|
display: block;
|
||||||
|
content: '';
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on .spinner {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on a:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on .wppb-add-on-title {
|
||||||
|
letter-spacing: -0.7px;
|
||||||
|
margin-bottom: 7px;
|
||||||
|
margin-top: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on .wppb-add-on-title a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on .wppb-add-on-price {
|
||||||
|
font-size: 1.1em;
|
||||||
|
letter-spacing: -0.7px;
|
||||||
|
margin-top: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on-compatible span {
|
||||||
|
line-height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on-not-compatible {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on-not-compatible:before {
|
||||||
|
display: block;
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 4px;
|
||||||
|
height: 100%;
|
||||||
|
background: #d54e21;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on .button {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on .button.wppb-add-on-deactivate {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on .spinner {
|
||||||
|
display: block;
|
||||||
|
margin-top: 4px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-add-on-spinner {
|
||||||
|
opacity: 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
margin-top: -10px;
|
||||||
|
margin-left: -10px;
|
||||||
|
display: block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
background: url('../images/spinner.gif') no-repeat center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-recommended-plugin{
|
||||||
|
width:100%;
|
||||||
|
margin:0 8px 16px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1600px){
|
||||||
|
.wppb-recommended-plugin{
|
||||||
|
width:66%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-confirmation-success {
|
||||||
|
color: #27ae60;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-confirmation-error {
|
||||||
|
color: #c0392b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Manage Fields Responsive CSS */
|
||||||
|
@media screen and ( max-width: 1125px ) {
|
||||||
|
/* Manage Fields Responsive */
|
||||||
|
#container_wppb_manage_fields th.wck-content pre{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
#container_wppb_manage_fields li strong{
|
||||||
|
display: inline-block !important;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: "Open Sans",Arial,sans-serif;
|
||||||
|
}
|
||||||
|
#container_wppb_manage_fields pre{
|
||||||
|
display: inline;
|
||||||
|
float:none;
|
||||||
|
width:auto;
|
||||||
|
}
|
||||||
|
#container_wppb_manage_fields li strong{
|
||||||
|
width:100px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Basic Information Buttons - for Free to Pro upgrade*/
|
||||||
|
.wppb-button-free {
|
||||||
|
border-radius: 3px;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 13px;
|
||||||
|
height: 29px;
|
||||||
|
line-height: 26px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 10px 1px;
|
||||||
|
text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
background: none repeat scroll 0 0 #e14d43;
|
||||||
|
border-color: #b2401b;
|
||||||
|
-webkit-box-shadow: 0 1px 0 #ba281e !important;
|
||||||
|
box-shadow: 0 1px 0 #ba281e !important;
|
||||||
|
color: #fff !important;
|
||||||
|
vertical-align:top;
|
||||||
|
text-shadow: 0 -1px 1px #ba281e,1px 0 1px #ba281e,0 1px 1px #ba281e,-1px 0 1px #ba281e !important;
|
||||||
|
}
|
||||||
|
p .wppb-button-free {
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
.wppb-button-free:hover {
|
||||||
|
background: #e14d43;
|
||||||
|
border-color: #ba281e;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PMS Compatibility page */
|
||||||
|
#pms-bottom-install .plugin-card-bottom{
|
||||||
|
border:none;
|
||||||
|
background: #e86054;
|
||||||
|
color:#fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pms-bottom-install .plugin-card-bottom span{
|
||||||
|
display: inline-block;
|
||||||
|
margin-top:7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pms-bottom-install .wppb-add-on-download, #pms-bottom-install a{
|
||||||
|
font-size: 130%;
|
||||||
|
padding: 10px 20px;
|
||||||
|
height: auto;
|
||||||
|
color: #e86054;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pms-bottom-install a:hover{
|
||||||
|
background: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pms-bottom-install .wppb-confirmation-success{
|
||||||
|
color:#FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_ul_search_settings .wck-checkboxes > div{
|
||||||
|
display: inline-block;
|
||||||
|
margin-left:7px;
|
||||||
|
}
|
775
profile-builder/assets/css/style-front-end.css
Normal file
@ -0,0 +1,775 @@
|
|||||||
|
/* Register & Edit Profile Forms*/
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
>>> TABLE OF CONTENTS:
|
||||||
|
----------------------------------------------------------------
|
||||||
|
1.0 - Reset
|
||||||
|
2.0 - Forms
|
||||||
|
3.0 - Alignments
|
||||||
|
4.0 - Errors & Notices
|
||||||
|
5.0 - User Listing
|
||||||
|
6.0 - Media Queries
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
1.0 Reset
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
.wppb-user-forms,
|
||||||
|
.wppb-user-forms *{
|
||||||
|
-webkit-box-sizing: border-box !important; /* Safari/Chrome, other WebKit */
|
||||||
|
-moz-box-sizing: border-box !important; /* Firefox, other Gecko */
|
||||||
|
box-sizing: border-box !important; /* Opera/IE 8+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
2.0 Forms
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
.wppb-user-forms input:not([type="button"]):not([type="reset"]):not([type="submit"]),
|
||||||
|
.wppb-user-forms select,
|
||||||
|
.wppb-user-forms textarea{
|
||||||
|
font-size: 100%; /* Corrects font size not being inherited in all browsers */
|
||||||
|
margin: 0; /* Addresses margins set differently in IE6/7, F3/4, S5, Chrome */
|
||||||
|
vertical-align: baseline; /* Improves appearance and consistency in all browsers */
|
||||||
|
}
|
||||||
|
.wppb-user-forms input[type="checkbox"],
|
||||||
|
.wppb-user-forms input[type="radio"] {
|
||||||
|
padding: 0; /* Addresses excess padding in IE8/9 */
|
||||||
|
}
|
||||||
|
.wppb-user-forms input[type="search"] {
|
||||||
|
-webkit-appearance: textfield; /* Addresses appearance set to searchfield in S5, Chrome */
|
||||||
|
-webkit-box-sizing: content-box; /* Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof) */
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
.wppb-user-forms input[type="search"]::-webkit-search-decoration { /* Corrects inner padding displayed oddly in S5, Chrome on OSX */
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
.wppb-user-forms button::-moz-focus-inner,
|
||||||
|
.wppb-user-forms input::-moz-focus-inner { /* Corrects inner padding and border displayed oddly in FF3/4 www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ */
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.wppb-user-forms input[type="text"],
|
||||||
|
.wppb-user-forms input[type="number"],
|
||||||
|
.wppb-user-forms input[type="email"],
|
||||||
|
.wppb-user-forms input[type="url"],
|
||||||
|
.wppb-user-forms input[type="password"],
|
||||||
|
.wppb-user-forms input[type="search"],
|
||||||
|
.wppb-user-forms textarea{
|
||||||
|
color: #666;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.wppb-user-forms input[type="text"]:focus,
|
||||||
|
.wppb-user-forms input[type="number"]:focus,
|
||||||
|
.wppb-user-forms input[type="email"]:focus,
|
||||||
|
.wppb-user-forms input[type="url"]:focus,
|
||||||
|
.wppb-user-forms input[type="password"]:focus,
|
||||||
|
.wppb-user-forms input[type="search"]:focus,
|
||||||
|
.wppb-user-forms textarea:focus {
|
||||||
|
color: #111;
|
||||||
|
}
|
||||||
|
.wppb-user-forms input[type="text"],
|
||||||
|
.wppb-user-forms input[type="number"],
|
||||||
|
.wppb-user-forms input[type="email"],
|
||||||
|
.wppb-user-forms input[type="url"],
|
||||||
|
.wppb-user-forms input[type="password"],
|
||||||
|
.wppb-user-forms input[type="search"] {
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
.wppb-user-forms textarea {
|
||||||
|
overflow: auto; /* Removes default vertical scrollbar in IE6/7/8/9 */
|
||||||
|
padding-left: 3px;
|
||||||
|
vertical-align: top; /* Improves readability and alignment in all browsers */
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.wppb-user-forms .wppb-wysiwyg .wp-editor-wrap { /* properly align wysiwyg editor among form fields */
|
||||||
|
float:left;
|
||||||
|
width:69.9%;
|
||||||
|
}
|
||||||
|
.wppb-user-forms .wppb-wysiwyg button:hover{ /* wysiwyg - overwrite the theme inherited background color on hover*/
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
.wppb-user-forms .wppb-wysiwyg div.mce-tinymce.mce-panel{ /*Display the borders for the TinyMCE editor - Visual tab*/
|
||||||
|
border: 1px solid #ccc !important;
|
||||||
|
color: #666 !important;
|
||||||
|
}
|
||||||
|
.wppb-user-forms .wppb-wysiwyg div.mce-panel.mce-first{
|
||||||
|
border-width: 0 0 1px 0 !important;
|
||||||
|
}
|
||||||
|
.wppb-user-forms .wppb-wysiwyg div.mce-panel.mce-last{
|
||||||
|
border-width: 1px 0 !important;
|
||||||
|
}
|
||||||
|
.wppb-user-forms .wppb-wysiwyg .quicktags-toolbar { /*Display the borders for the TinyMCE editor - Text tab*/
|
||||||
|
border: 1px solid #dedede;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
#wp-link label input[type="text"] { /*Fix the looks of the Add Link window for TinyMCE editor*/
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb-search-fields{
|
||||||
|
min-width: 250px;
|
||||||
|
float:left;
|
||||||
|
margin-right:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms .wppb-search-button{
|
||||||
|
margin-right:10px;
|
||||||
|
padding:7px 20px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-search-users-wrap{
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms .extra_field_heading {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
3.0 Alignments
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
.wppb-user-forms ul{
|
||||||
|
max-width:900px;
|
||||||
|
list-style:none;
|
||||||
|
margin-left:0;
|
||||||
|
margin-right:0;
|
||||||
|
padding-left:0;
|
||||||
|
padding-right:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms ul li{
|
||||||
|
list-style:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb-login-wrap p,
|
||||||
|
#select_user_to_edit_form p{
|
||||||
|
overflow:hidden;
|
||||||
|
margin:0;
|
||||||
|
padding-bottom:14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms ul li{
|
||||||
|
margin:0;
|
||||||
|
padding-bottom:14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms ul li:after{
|
||||||
|
content: "";
|
||||||
|
clear: both;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms .wppb-input-hidden {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms.wppb-user-role-administrator .wppb-input-hidden {
|
||||||
|
padding-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms .wppb-form-field > ul {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field label,
|
||||||
|
#wppb-login-wrap .login-username label,
|
||||||
|
#wppb-login-wrap .login-password label{
|
||||||
|
width:30%;
|
||||||
|
float:left;
|
||||||
|
min-height:1px;
|
||||||
|
}
|
||||||
|
.wppb-form-field input,
|
||||||
|
.wppb-form-field input[type="text"], .wppb-form-field input[type="number"], .wppb-form-field input[type="email"], .wppb-form-field input[type="url"], .wppb-form-field input[type="password"], .wppb-form-field input[type="search"],
|
||||||
|
.wppb-form-field select,
|
||||||
|
.wppb-form-field textarea,
|
||||||
|
.wppb-checkboxes,
|
||||||
|
.wppb-radios,
|
||||||
|
#wppb-login-wrap .login-username input,
|
||||||
|
#wppb-login-wrap .login-password input{
|
||||||
|
width:69.9%;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field.wppb-timepicker select {
|
||||||
|
width: auto;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms .wppb-wysiwyg .wp-editor-wrap .wp-editor-tabs *{
|
||||||
|
box-sizing: content-box !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms .wp-editor-wrap input {
|
||||||
|
float: none;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
input#send_credentials_via_email{
|
||||||
|
float:none;
|
||||||
|
width:auto;
|
||||||
|
margin-right:10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-send-credentials-checkbox label{
|
||||||
|
width:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field > span{
|
||||||
|
display:block;
|
||||||
|
clear:both;
|
||||||
|
margin-left:30%;
|
||||||
|
font-size:80%;
|
||||||
|
font-style:italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field > span.custom_field_html {
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field.wppb-timepicker > span.wppb-timepicker-separator {
|
||||||
|
display: inline-block;
|
||||||
|
float: left;
|
||||||
|
clear: none;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 5px;
|
||||||
|
font-size: 100%;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb_upload_button{
|
||||||
|
display:inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-user-forms .wppb-checkboxes li,
|
||||||
|
.wppb-user-forms .wppb-radios li{
|
||||||
|
display:inline-block;
|
||||||
|
padding:0 20px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field .wppb-checkboxes label,
|
||||||
|
.wppb-form-field .wppb-radios label{
|
||||||
|
float:none;
|
||||||
|
min-width:0;
|
||||||
|
padding-left:5px;
|
||||||
|
width:auto;
|
||||||
|
display:inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-checkbox-terms-and-conditions input,
|
||||||
|
.wppb-checkboxes li input,
|
||||||
|
.wppb-radios li input{
|
||||||
|
min-width:0;
|
||||||
|
float:none;
|
||||||
|
width:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-edit-user .wppb-checkbox-terms-and-conditions {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field.wppb-heading span,
|
||||||
|
.wppb-default-about-yourself-heading span,
|
||||||
|
.wppb-default-contact-info-heading span,
|
||||||
|
.wppb-default-name-heading span,
|
||||||
|
.wppb-checkbox-terms-and-conditions span{
|
||||||
|
margin-left:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-checkbox-terms-and-conditions label {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field.wppb-checkbox-terms-and-conditions input[type="checkbox"].custom_field_toa {
|
||||||
|
float:none;
|
||||||
|
width:auto;
|
||||||
|
margin-right:10px
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.g-recaptcha{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.g-recaptcha iframe{
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field input.wppb-map-search-box {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px !important;
|
||||||
|
height: 34px;
|
||||||
|
width: 50%;
|
||||||
|
min-width: 250px;
|
||||||
|
background: #fff;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 1px;
|
||||||
|
padding: 0 10px;
|
||||||
|
box-shadow: 0 1px 1px 0 #c1c1c1;
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-create-new-site{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
input#wppb_create_new_site_checkbox{
|
||||||
|
width: auto;
|
||||||
|
margin-right: 10px;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
label[for=wppb_create_new_site_checkbox]{
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
label[for=blog-privacy]{
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
4.0 Errors & Notices
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#wppb_general_top_error_message,
|
||||||
|
.wppb-error,
|
||||||
|
.wppb-warning {
|
||||||
|
padding: 6px 9px;
|
||||||
|
margin: 0 auto 25px;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #ffebe8;
|
||||||
|
border: 1px solid #C00;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_general_top_error_message,
|
||||||
|
.wppb-error,
|
||||||
|
.wppb-warning{
|
||||||
|
color:#222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_general_top_error_message a,
|
||||||
|
.wppb-error a,
|
||||||
|
.wppb-warning a{
|
||||||
|
color:#007acc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-required{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-required,
|
||||||
|
.wppb-checkbox-terms-and-conditions span.wppb-required{
|
||||||
|
margin-left:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb_form_success_message,
|
||||||
|
.wppb-success {
|
||||||
|
padding: 6px 9px;
|
||||||
|
margin: 0 auto 25px;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #e7f7d3;
|
||||||
|
border: 1px solid #6c3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-register-user .wppb-field-error,
|
||||||
|
.wppb-edit-user .wppb-field-error,
|
||||||
|
#wppb-recover-password .wppb-field-error{
|
||||||
|
background-color: #FFDFDF;
|
||||||
|
border: 1px dotted #C89797;
|
||||||
|
margin-bottom: 6px !important;
|
||||||
|
padding: 6px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-field-error > input,
|
||||||
|
.wppb-field-error > select,
|
||||||
|
.wppb-field-error > textarea,
|
||||||
|
.wppb-field-error > label{
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-field-error img{
|
||||||
|
box-shadow: none;
|
||||||
|
-webkit-box-shadow:none;
|
||||||
|
border:none;
|
||||||
|
border-radius:0px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-top: -3px;
|
||||||
|
padding-left:5px;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field > span.wppb-form-error{
|
||||||
|
margin-top:10px;
|
||||||
|
padding-top: 5px;
|
||||||
|
border-top:1px dotted #c89797;
|
||||||
|
font-size:100%;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove global Blog Details Field error */
|
||||||
|
#wppb-register-user .wppb-default-blog-details.wppb-field-error{
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0px !important;
|
||||||
|
}
|
||||||
|
.wppb-default-blog-details > span.wppb-form-error{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.wppb-blog-details-heading span {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
5.0 User Listing
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
.wppb-table *{
|
||||||
|
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.wppb-table{
|
||||||
|
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
|
||||||
|
border-spacing: 0.5rem;
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table th{
|
||||||
|
background: #f4f4f4;
|
||||||
|
padding: 7px;
|
||||||
|
border:1px solid #e1e1e1;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table thead tr:hover{
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table .wppb-sorting .wppb-sorting-default {
|
||||||
|
display: inline-block;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background: url('../images/sorting-default.png') no-repeat center center;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table .wppb-sorting .wppb-sorting-ascending {
|
||||||
|
background-image: url('../images/sorting-ascending.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table .wppb-sorting .wppb-sorting-descending {
|
||||||
|
background-image: url('../images/sorting-descending.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table tr:hover{
|
||||||
|
background: #f1fcff;
|
||||||
|
}
|
||||||
|
.wppb-table td{
|
||||||
|
padding: 7px;
|
||||||
|
border:1px solid #e1e1e1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table .wppb-posts,
|
||||||
|
.wppb-table .wppb-moreinfo{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-avatar img {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-profile{
|
||||||
|
list-style-type: none;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
padding-left:0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-profile li{
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-profile li label{
|
||||||
|
display: block;
|
||||||
|
width:30%;
|
||||||
|
float:left;
|
||||||
|
min-height:1px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-profile li span{
|
||||||
|
display: block;
|
||||||
|
width:69.9%;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-profile li h3,
|
||||||
|
ul.wppb-profile li h3:first-child{
|
||||||
|
margin:20px 0;
|
||||||
|
padding-top:20px;
|
||||||
|
border-top:1px solid #d2d2d2;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-faceted-list{
|
||||||
|
list-style: none;
|
||||||
|
margin:0 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-faceted-list:after{
|
||||||
|
visibility: hidden;
|
||||||
|
display: block;
|
||||||
|
font-size: 0;
|
||||||
|
content: " ";
|
||||||
|
clear: both;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-faceted-list > li{
|
||||||
|
float:left;
|
||||||
|
margin-right: 15px;
|
||||||
|
max-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-faceted-list > li:first-child{
|
||||||
|
float:none;
|
||||||
|
clear:both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-userlisting-container .wppb-faceted-list li h5{
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-faceted-list label > *{
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-faceted-list input[type="checkbox"]{
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-userlisting-container.wppb-spinner{
|
||||||
|
position:relative;
|
||||||
|
opacity: 0.5
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-userlisting-container.wppb-spinner:after{
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
margin-top: -16px;
|
||||||
|
margin-left: -16px;
|
||||||
|
display: block;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
/*background: url('../images/ajax-loader.gif') no-repeat center;*/
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.wppb-faceted-list .hide-this{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wppb-remove-facets-container{
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-remove-facet:before, .wppb-remove-all-facets:before {
|
||||||
|
content: "x";
|
||||||
|
display: inline-block;
|
||||||
|
border-right: 1px dotted #D3CCC9;
|
||||||
|
border-right: 1px dotted #6F6F6F;
|
||||||
|
padding-right: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-userlisting-container .wppb-ul-range-values{
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-userlisting-container:after {
|
||||||
|
visibility: hidden;
|
||||||
|
display: block;
|
||||||
|
font-size: 0;
|
||||||
|
content: " ";
|
||||||
|
clear: both;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-float-left{
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-float-right{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-facet-float-left{
|
||||||
|
float:left;
|
||||||
|
max-width:300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-facet-float-right{
|
||||||
|
float:right;
|
||||||
|
max-width:300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and ( max-width: 720px ) {
|
||||||
|
|
||||||
|
.wppb-table {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table thead {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table tr {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table td {
|
||||||
|
display: block;
|
||||||
|
text-align: right;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table td:last-of-type {
|
||||||
|
border-bottom: 1px solid #e1e1e1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table .wppb-posts,
|
||||||
|
.wppb-table .wppb-moreinfo{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table td:before {
|
||||||
|
content: attr(data-label);
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-table td:after {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
6.0 Media Queries
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@media screen and (max-width: 400px) {
|
||||||
|
|
||||||
|
.wppb-form-field label,
|
||||||
|
#wppb-login-wrap .login-username label,
|
||||||
|
#wppb-login-wrap .login-password label,
|
||||||
|
ul.wppb-profile li label{
|
||||||
|
width:100%;
|
||||||
|
display:block;
|
||||||
|
float:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field input,
|
||||||
|
.wppb-form-field select,
|
||||||
|
.wppb-form-field textarea,
|
||||||
|
.wppb-checkboxes,
|
||||||
|
.wppb-radios,
|
||||||
|
#wppb-login-wrap .login-username input,
|
||||||
|
#wppb-login-wrap .login-password input,
|
||||||
|
ul.wppb-profile li span{
|
||||||
|
width:100%;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field > span{
|
||||||
|
margin-left:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-checkboxes li label,
|
||||||
|
.wppb-radios li label{
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field .wppb-avatar-nofile,
|
||||||
|
.wppb-form-field .wppb-avatar-file,
|
||||||
|
.wppb-form-field .wppb-upload-nofile,
|
||||||
|
.wppb-form-field .wppb-upload-file{
|
||||||
|
margin-left:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------
|
||||||
|
7.0 Password Strength
|
||||||
|
--------------------------------------------------------------*/
|
||||||
|
#pass-strength-result {
|
||||||
|
background-color: #eee;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
display: none;
|
||||||
|
float: left;
|
||||||
|
margin: 13px 5px 5px 30%;
|
||||||
|
padding: 3px 5px;
|
||||||
|
text-align: center;
|
||||||
|
width: 200px;
|
||||||
|
height:28px;
|
||||||
|
}
|
||||||
|
#pass-strength-result.short {
|
||||||
|
background-color: #ffa0a0;
|
||||||
|
border-color: #f04040;
|
||||||
|
}
|
||||||
|
#pass-strength-result.bad {
|
||||||
|
background-color: #ffb78c;
|
||||||
|
border-color: #ff853c;
|
||||||
|
}
|
||||||
|
#pass-strength-result.good {
|
||||||
|
background-color: #ffec8b;
|
||||||
|
border-color: #fc0;
|
||||||
|
}
|
||||||
|
#pass-strength-result.strong {
|
||||||
|
background-color: #c3ff88;
|
||||||
|
border-color: #8dff1c;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************/
|
||||||
|
/* Profile Builder Subscription Plans Field
|
||||||
|
/**************************************************/
|
||||||
|
.wppb-form-field.wppb-subscription-plans label {
|
||||||
|
width: 100%;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field.wppb-subscription-plans input {
|
||||||
|
display: inline-block;
|
||||||
|
width: auto;
|
||||||
|
float: none;
|
||||||
|
margin-right: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wppb-form-field.wppb-subscription-plans span.description {
|
||||||
|
display: block;
|
||||||
|
font-size: 100%;
|
||||||
|
font-style: italic;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************/
|
||||||
|
/* This is very weird: if in the css there is a rule on table of border-collapse:collapse; then on FFox and Edge the Media upload won't open
|
||||||
|
/**************************************************/
|
||||||
|
table{
|
||||||
|
border-collapse:separate;
|
||||||
|
}
|
BIN
profile-builder/assets/images/accept.png
Normal file
After Width: | Height: | Size: 781 B |
BIN
profile-builder/assets/images/ad_image.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
profile-builder/assets/images/ajax-loader.gif
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
profile-builder/assets/images/arrow.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
profile-builder/assets/images/arrow_left.png
Normal file
After Width: | Height: | Size: 345 B |
BIN
profile-builder/assets/images/arrow_right.png
Normal file
After Width: | Height: | Size: 349 B |
BIN
profile-builder/assets/images/attachment.png
Normal file
After Width: | Height: | Size: 660 B |
BIN
profile-builder/assets/images/bad.png
Normal file
After Width: | Height: | Size: 868 B |
BIN
profile-builder/assets/images/basic_info_pms_cross_promo.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
profile-builder/assets/images/black_px.png
Normal file
After Width: | Height: | Size: 108 B |
BIN
profile-builder/assets/images/btn.png
Normal file
After Width: | Height: | Size: 147 B |
BIN
profile-builder/assets/images/buy_now_button.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
profile-builder/assets/images/empty.gif
Normal file
After Width: | Height: | Size: 45 B |
BIN
profile-builder/assets/images/good.png
Normal file
After Width: | Height: | Size: 863 B |
BIN
profile-builder/assets/images/header.png
Normal file
After Width: | Height: | Size: 156 B |
BIN
profile-builder/assets/images/header_classic.png
Normal file
After Width: | Height: | Size: 179 B |
BIN
profile-builder/assets/images/icon_add.png
Normal file
After Width: | Height: | Size: 733 B |
BIN
profile-builder/assets/images/icon_arrow.png
Normal file
After Width: | Height: | Size: 226 B |
BIN
profile-builder/assets/images/icon_delete.png
Normal file
After Width: | Height: | Size: 715 B |
BIN
profile-builder/assets/images/icon_delete_disabled.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
profile-builder/assets/images/icon_edit.png
Normal file
After Width: | Height: | Size: 618 B |
BIN
profile-builder/assets/images/icon_error.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
profile-builder/assets/images/icon_header.png
Normal file
After Width: | Height: | Size: 500 B |
BIN
profile-builder/assets/images/icon_up.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
profile-builder/assets/images/icon_up_down.png
Normal file
After Width: | Height: | Size: 219 B |
BIN
profile-builder/assets/images/logo_free.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
profile-builder/assets/images/logo_hobby.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
profile-builder/assets/images/logo_pro.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
profile-builder/assets/images/pb+pms.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
profile-builder/assets/images/pb-icon-16x16.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
profile-builder/assets/images/pb-logo-free.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
profile-builder/assets/images/pb-logo-hobbyist.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
profile-builder/assets/images/pb-logo-pro.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
profile-builder/assets/images/pb-menu-icon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
profile-builder/assets/images/pb-pms-cross-promotion-icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
profile-builder/assets/images/pb-pms-cross-promotion.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
profile-builder/assets/images/pb.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
profile-builder/assets/images/pb2.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
profile-builder/assets/images/pb_fields.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
profile-builder/assets/images/pb_menu_icon.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
profile-builder/assets/images/pb_menu_icon_bk.png
Normal file
After Width: | Height: | Size: 301 B |
BIN
profile-builder/assets/images/pencil_delete.png
Normal file
After Width: | Height: | Size: 454 B |
BIN
profile-builder/assets/images/pencil_delete2.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
profile-builder/assets/images/pms-recommended.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
profile-builder/assets/images/pms_all_subscriptions-600x336.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 55 KiB |
BIN
profile-builder/assets/images/pms_pb_register_page-600x618.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
profile-builder/assets/images/pms_recommended.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
profile-builder/assets/images/pre_bg.gif
Normal file
After Width: | Height: | Size: 48 B |
BIN
profile-builder/assets/images/pre_classic_bg.gif
Normal file
After Width: | Height: | Size: 48 B |
BIN
profile-builder/assets/images/select.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
profile-builder/assets/images/sorting-ascending.png
Normal file
After Width: | Height: | Size: 978 B |
BIN
profile-builder/assets/images/sorting-default.png
Normal file
After Width: | Height: | Size: 1006 B |
BIN
profile-builder/assets/images/sorting-descending.png
Normal file
After Width: | Height: | Size: 978 B |
BIN
profile-builder/assets/images/sorting-icon-dots.png
Normal file
After Width: | Height: | Size: 954 B |
BIN
profile-builder/assets/images/spinner.gif
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
profile-builder/assets/images/tabs_bg.png
Normal file
After Width: | Height: | Size: 117 B |
BIN
profile-builder/assets/images/tabs_bg_classic.png
Normal file
After Width: | Height: | Size: 117 B |
BIN
profile-builder/assets/images/toggle_tabs.png
Normal file
After Width: | Height: | Size: 358 B |
BIN
profile-builder/assets/images/white-grad.png
Normal file
After Width: | Height: | Size: 210 B |
BIN
profile-builder/assets/images/white_px.png
Normal file
After Width: | Height: | Size: 109 B |
16
profile-builder/assets/js/jquery-edit-profile.js
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
function confirmDelete( nonceField, currentUser, customFieldID, customFieldName, returnTo, ajaxurl, what, fileName, text ) {
|
||||||
|
if (confirm(text)) {
|
||||||
|
jQuery.post( ajaxurl , { action:"hook_wppb_delete", currentUser:currentUser, customFieldID:customFieldID, customFieldName:customFieldName, what:what, _ajax_nonce:nonceField }, function( response ) {
|
||||||
|
if( jQuery.trim(response)=="done" ){
|
||||||
|
if ( what == 'avatar' ){
|
||||||
|
alert( ep.avatar );
|
||||||
|
}else{
|
||||||
|
alert( ep.attachment +' '+ fileName );
|
||||||
|
}
|
||||||
|
window.location=returnTo;
|
||||||
|
}else{
|
||||||
|
alert(jQuery.trim(response));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
53
profile-builder/assets/js/jquery-email-confirmation.js
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
function wppb_display_page_select( value ){
|
||||||
|
if ( value == 'yes' ){
|
||||||
|
jQuery ( '#wppb-settings-activation-page' ).show();
|
||||||
|
jQuery ( '.dynamic1' ).show();
|
||||||
|
|
||||||
|
}else{
|
||||||
|
jQuery ( '#wppb-settings-activation-page' ).hide();
|
||||||
|
jQuery ( '.dynamic1' ).hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_display_page_select_aa( value ){
|
||||||
|
if ( value == 'yes' )
|
||||||
|
jQuery ( '.dynamic2' ).show();
|
||||||
|
|
||||||
|
else
|
||||||
|
jQuery ( '.dynamic2' ).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
function wppb_display_page_select_re( value ){
|
||||||
|
if ( value == 'yes' )
|
||||||
|
jQuery ( '.dynamic3' ).show();
|
||||||
|
|
||||||
|
else
|
||||||
|
jQuery ( '.dynamic3' ).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
jQuery(function() {
|
||||||
|
if ( ( jQuery( '#wppb_settings_email_confirmation' ).val() == 'yes' ) || ( jQuery( '#wppb_general_settings_hidden' ).val() == 'multisite' ) ){
|
||||||
|
jQuery ( '#wppb-settings-activation-page' ).show();
|
||||||
|
jQuery ( '.dynamic1' ).show();
|
||||||
|
|
||||||
|
}else{
|
||||||
|
jQuery ( '#wppb-settings-activation-page' ).hide();
|
||||||
|
jQuery ( '.dynamic1' ).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ( jQuery( '#adminApprovalSelect' ).val() == 'yes' )
|
||||||
|
jQuery ( '.dynamic2' ).show();
|
||||||
|
|
||||||
|
else
|
||||||
|
jQuery ( '.dynamic2' ).hide();
|
||||||
|
|
||||||
|
|
||||||
|
if ( jQuery( '#rolesEditorSelect' ).val() == 'yes' )
|
||||||
|
jQuery ( '.dynamic3' ).show();
|
||||||
|
|
||||||
|
else
|
||||||
|
jQuery ( '.dynamic3' ).hide();
|
||||||
|
});
|
166
profile-builder/assets/js/jquery-epf-rf.js
vendored
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
function wppb_epf_rf_disable_live_select ( selector ){
|
||||||
|
jQuery( selector ).attr( 'disabled', true );
|
||||||
|
}
|
||||||
|
|
||||||
|
function wppb_rf_epf_change_id( field, container_name, fieldObj ) {
|
||||||
|
var buttonInContainer = jQuery( '.button-primary', fieldObj.parent().parent().parent() );
|
||||||
|
buttonInContainer.attr('disabled',true);
|
||||||
|
buttonInContainer.attr('tempclick', buttonInContainer.attr("onclick") );
|
||||||
|
buttonInContainer.removeAttr('onclick');
|
||||||
|
|
||||||
|
jQuery.post( ajaxurl , { action:"wppb_handle_rf_epf_id_change", field:field }, function(response) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* since version 2.0.2 we have the id directly on the option in the select so this ajax function is a little
|
||||||
|
redundant but can't be sure of the impact on other features so we will just add this
|
||||||
|
*/
|
||||||
|
id = fieldObj.find(":selected").attr( 'data-id' );
|
||||||
|
if( !id ){
|
||||||
|
id = response;
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery( '#id', fieldObj.parent().parent().parent() ).val( id );
|
||||||
|
buttonInContainer.attr('onclick', buttonInContainer.attr("tempclick") );
|
||||||
|
buttonInContainer.removeAttr('tempclick');
|
||||||
|
|
||||||
|
if( ( fieldObj.parents('.update_container_wppb_rf_fields').length || fieldObj.parents('.update_container_wppb_epf_fields').length ) && buttonInContainer.attr('disabled') ) {
|
||||||
|
buttonInContainer.text('Save Changes');
|
||||||
|
}
|
||||||
|
|
||||||
|
buttonInContainer.removeAttr('disabled');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery(function(){
|
||||||
|
wppb_disable_delete_on_default_mandatory_fields();
|
||||||
|
wppb_disable_select_field_options();
|
||||||
|
|
||||||
|
jQuery(document).on( 'change', '#wppb_rf_fields .mb-list-entry-fields #field', function () {
|
||||||
|
wppb_rf_epf_change_id( jQuery(this).val(), '#wppb_rf_fields', jQuery(this) );
|
||||||
|
});
|
||||||
|
jQuery(document).on( 'change', '.update_container_wppb_rf_fields .mb-list-entry-fields #field', function () {
|
||||||
|
wppb_rf_epf_change_id( jQuery(this).val(), '.update_container_wppb_rf_fields', jQuery(this) );
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery(document).on( 'change', '#wppb_epf_fields .mb-list-entry-fields #field', function () {
|
||||||
|
wppb_rf_epf_change_id( jQuery(this).val(), '#wppb_epf_fields', jQuery(this) );
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery(document).on( 'change', '.update_container_wppb_epf_fields .mb-list-entry-fields #field', function () {
|
||||||
|
wppb_rf_epf_change_id( jQuery(this).val(), '.update_container_wppb_epf_fields', jQuery(this) );
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/* function that removes the delete button and disables changing the field type on edit for username,password and email default fields */
|
||||||
|
function wppb_disable_delete_on_default_mandatory_fields(){
|
||||||
|
jQuery( '#container_wppb_rf_fields [class$="default-username added_fields_list"] .mbdelete, #container_wppb_rf_fields [class$="default-e-mail added_fields_list"] .mbdelete, #container_wppb_rf_fields [class$="default-password added_fields_list"] .mbdelete' ).hide(); // PB specific line
|
||||||
|
jQuery( '[class$="default-username"] #field, [class$="default-e-mail"] #field, [class$="default-password"] #field' ).attr( 'disabled', true ); // PB specific line
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Disables the options in the field select drop-down that are also present in the table below */
|
||||||
|
function wppb_disable_select_field_options() {
|
||||||
|
jQuery('#field option').each( function() {
|
||||||
|
$optionField = jQuery(this);
|
||||||
|
$optionField.removeAttr('disabled');
|
||||||
|
|
||||||
|
var optionFieldId = jQuery(this).attr('data-id');
|
||||||
|
|
||||||
|
jQuery('#container_wppb_rf_fields .row-id pre, #container_wppb_epf_fields .row-id pre').each( function() {
|
||||||
|
if( jQuery(this).text() == optionFieldId ) {
|
||||||
|
$optionField.attr('disabled', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
wppb_check_options_disabled_add_field();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check to see if the selected field in the add new field to the list select drop-down is disabled
|
||||||
|
* We don't want this to happen, so select the first option instead
|
||||||
|
*/
|
||||||
|
function wppb_check_options_disabled_add_field() {
|
||||||
|
if( jQuery('#wppb_rf_fields #field option:selected, #wppb_epf_fields #field option:selected').is(':disabled') ) {
|
||||||
|
jQuery('#wppb_rf_fields #field option, #wppb_epf_fields #field option').first().attr('selected', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run through all the field drop-downs, in edit mode, and check if the selected option is disabled
|
||||||
|
* If it is, disable the save button and if the date-id of the selected option matches the id of the field
|
||||||
|
* change the text of the button
|
||||||
|
*/
|
||||||
|
function wppb_check_options_disabled_edit_field() {
|
||||||
|
jQuery('.update_container_wppb_rf_fields #field, .update_container_wppb_epf_fields #field').each( function() {
|
||||||
|
|
||||||
|
$selectedOption = jQuery(this).children('option:selected');
|
||||||
|
$primaryButton = jQuery(this).parents('.mb-list-entry-fields').find('.button-primary');
|
||||||
|
|
||||||
|
if( $selectedOption.is(':disabled') ) {
|
||||||
|
$rowId = parseInt( jQuery(this).parents('tr').prev().find('.row-id pre').text() );
|
||||||
|
|
||||||
|
$primaryButton.attr('disabled', true);
|
||||||
|
$primaryButton[0].onclick = null;
|
||||||
|
|
||||||
|
if( $rowId != parseInt( $selectedOption.attr('data-id') ) ) {
|
||||||
|
$primaryButton.text('This field has already been added to the form');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$primaryButton.attr('disabled', false);
|
||||||
|
|
||||||
|
var tempBtnOnClick = $primaryButton.attr('onclick');
|
||||||
|
$primaryButton.text('Save Changes').removeAttr('onclick').attr('onclick', tempBtnOnClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check to see if the selected field in the edit field select drop-down is disabled
|
||||||
|
* If it is we want to disable saving, because no changes have been made
|
||||||
|
*/
|
||||||
|
function wppb_check_update_field_options_disabled() {
|
||||||
|
jQuery('.update_container_wppb_rf_fields #field, .update_container_wppb_epf_fields #field').each( function() {
|
||||||
|
if( jQuery(this).find('option:selected').is(':disabled') ) {
|
||||||
|
jQuery(this).parents('.mb-list-entry-fields').find('.button-primary').attr('disabled', true);
|
||||||
|
jQuery(this).parents('.mb-list-entry-fields').find('.button-primary')[0].onclick = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that sends an ajax request to delete all items(fields) from a form
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function wppb_rf_epf_delete_all_fields(event, delete_all_button_id, nonce) {
|
||||||
|
event.preventDefault();
|
||||||
|
$deleteButton = jQuery('#' + delete_all_button_id);
|
||||||
|
|
||||||
|
var response = confirm( "Are you sure you want to delete all items ?" );
|
||||||
|
|
||||||
|
if( response == true ) {
|
||||||
|
$tableParent = $deleteButton.parents('table');
|
||||||
|
|
||||||
|
var meta = $tableParent.attr('id').replace('container_', '');
|
||||||
|
var post_id = parseInt( $tableParent.attr('post') );
|
||||||
|
|
||||||
|
$tableParent.parent().css({'opacity':'0.4', 'position':'relative'}).append('<div id="mb-ajax-loading"></div>');
|
||||||
|
|
||||||
|
jQuery.post( ajaxurl, { action: "wppb_rf_epf_delete_all_fields", meta: meta, id: post_id, _ajax_nonce: nonce }, function(response) {
|
||||||
|
|
||||||
|
/* refresh the list */
|
||||||
|
jQuery.post( wppbWckAjaxurl, { action: "wck_refresh_list"+meta, meta: meta, id: post_id}, function(response) {
|
||||||
|
jQuery('#container_'+meta).replaceWith(response);
|
||||||
|
$tableParent = jQuery('#container_'+meta);
|
||||||
|
|
||||||
|
$tableParent.find('tbody td').css('width', function(){ return jQuery(this).width() });
|
||||||
|
|
||||||
|
mb_sortable_elements();
|
||||||
|
$tableParent.parent().css('opacity','1');
|
||||||
|
|
||||||
|
jQuery('#mb-ajax-loading').remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
741
profile-builder/assets/js/jquery-manage-fields-live-change.js
vendored
Normal file
@ -0,0 +1,741 @@
|
|||||||
|
var fields = {
|
||||||
|
'Default - Name (Heading)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Contact Info (Heading)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - About Yourself (Heading)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Username': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
},
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - First Name': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : 'first_name'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Last Name': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : 'last_name'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Nickname': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : 'nickname'
|
||||||
|
},
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - E-mail': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
},
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Website': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - AIM': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : 'aim'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Yahoo IM': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : 'yim'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Jabber / Google Talk': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : 'jabber'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Password': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
},
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Repeat Password': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
},
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Biographical Info': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-row-count',
|
||||||
|
'.row-default-content',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : 'description'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Display name publicly as': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Default - Blog Details': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Heading': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-heading-tag'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Input': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Number': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-min-number-value',
|
||||||
|
'.row-max-number-value',
|
||||||
|
'.row-number-step-value',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'Input (Hidden)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Textarea': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-content',
|
||||||
|
'.row-required',
|
||||||
|
'.row-row-count',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'WYSIWYG': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-content',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'Phone': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-phone-format',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'Select': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-option',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing',
|
||||||
|
'.row-options',
|
||||||
|
'.row-labels'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'Select (Multiple)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-options',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing',
|
||||||
|
'.row-options',
|
||||||
|
'.row-labels'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Select (Country)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-option-country',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Select (Currency)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-show-currency-symbol',
|
||||||
|
'.row-default-option-currency',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Select (Timezone)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-option-timezone',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'Select (CPT)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-option',
|
||||||
|
'.row-cpt',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Checkbox': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-options',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing',
|
||||||
|
'.row-options',
|
||||||
|
'.row-labels'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Checkbox (Terms and Conditions)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
],
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Radio': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-option',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing',
|
||||||
|
'.row-options',
|
||||||
|
'.row-labels'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Upload': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-allowed-extensions',
|
||||||
|
'.row-required',
|
||||||
|
'.row-allowed-upload-extensions'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Avatar': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-allowed-image-extensions',
|
||||||
|
'.row-avatar-size',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Datepicker': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-default-value',
|
||||||
|
'.row-required',
|
||||||
|
'.row-date-format',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'Timepicker': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-required',
|
||||||
|
'.row-time-format',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'Colorpicker': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-required',
|
||||||
|
'.row-overwrite-existing'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'Validation': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-validation-possible-values',
|
||||||
|
'.row-custom-error-message',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
'reCAPTCHA': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-public-key',
|
||||||
|
'.row-private-key',
|
||||||
|
'.row-captcha-pb-forms',
|
||||||
|
'.row-captcha-wp-forms',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'required' : [
|
||||||
|
true
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Select (User Role)': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-user-roles',
|
||||||
|
'.row-required'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'Map': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-description',
|
||||||
|
'.row-map-api-key',
|
||||||
|
'.row-map-default-lat',
|
||||||
|
'.row-map-default-lng',
|
||||||
|
'.row-map-default-zoom',
|
||||||
|
'.row-map-height',
|
||||||
|
'.row-required'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'HTML': { 'show_rows' : [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-description',
|
||||||
|
'.row-html-content'
|
||||||
|
],
|
||||||
|
'properties': {
|
||||||
|
'meta_name_value' : ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var fields_to_show = [
|
||||||
|
'.row-field-title',
|
||||||
|
'.row-field',
|
||||||
|
'.row-meta-name',
|
||||||
|
'.row-required'
|
||||||
|
]
|
||||||
|
|
||||||
|
function wppb_hide_properties_for_already_added_fields( container_name ){
|
||||||
|
|
||||||
|
jQuery( container_name + ' tr:not(.update_container_wppb_manage_fields)' ).each(function() {
|
||||||
|
|
||||||
|
field = jQuery('.row-field pre', this).text();
|
||||||
|
|
||||||
|
jQuery( 'li', this ).each(function() {
|
||||||
|
var class_name = '';
|
||||||
|
|
||||||
|
class_name = jQuery(this).attr('class');
|
||||||
|
jQuery(this).hide();
|
||||||
|
|
||||||
|
if ( ( field in fields ) ){
|
||||||
|
var to_show = fields[field]['show_rows'];
|
||||||
|
for (var key in to_show) {
|
||||||
|
if ('.'+class_name == fields_to_show[key]){
|
||||||
|
jQuery(this).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/* hide the delete button for username,password and email fields */
|
||||||
|
jQuery( container_name + ' ' + '.element_type_default-e-mail .mbdelete,' + ' ' + container_name + ' ' + '.element_type_default-password .mbdelete,' + ' ' + container_name + ' ' + '.element_type_default-username .mbdelete' ).hide(); // PB specific line
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_hide_all ( container_name ){
|
||||||
|
jQuery( container_name + ' ' + '.mb-list-entry-fields > li' ).each(function() {
|
||||||
|
if ( !( ( jQuery(this).hasClass('row-field') ) || ( jQuery(this).children().hasClass('button-primary') ) ) ){
|
||||||
|
jQuery(this).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).attr( 'disabled', true );
|
||||||
|
|
||||||
|
jQuery( container_name + ' ' + '.element_type_default-e-mail .mbdelete,' + ' ' + container_name + ' ' + '.element_type_default-password .mbdelete,' + ' ' + container_name + ' ' + '.element_type_default-username .mbdelete' ).hide(); // PB specific line
|
||||||
|
jQuery( container_name + ' ' + '.element_type_default-e-mail #field' + ', ' + container_name + ' ' + '.element_type_default-password #field' + ', ' + container_name + ' ' + '.element_type_default-username #field' + ', ' + container_name + ' ' + '.element_type_default-e-mail #required' + ', ' + container_name + ' ' + '.element_type_default-password #required,' + container_name + ' ' + '.element_type_default-username #required,' + container_name + ' ' + '.element_type_checkbox-terms-and-conditions #required,' + container_name + ' ' + '.element_type_recaptcha #required,' + container_name + ' ' + '.element_type_woocommerce-customer-billing-address #field, ' + container_name + ' ' + '.element_type_woocommerce-customer-shipping-address #field').attr( 'disabled', true ); // PB specific line
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_disable_add_entry_button( container_name ){
|
||||||
|
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).each( function(){
|
||||||
|
|
||||||
|
//jQuery(this).data('myclick', this.onclick );
|
||||||
|
this.onclick = function(event) {
|
||||||
|
if ( jQuery(this).attr( 'disabled' ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/* changed this in version 2.5.0 because the commented line generated stack exceeded error when multiple fields were opened with edit */
|
||||||
|
if ( typeof( event.currentTarget ) == 'undefined' ){
|
||||||
|
// Repeater field triggered the click event of the "Add Field" / "Save changes" buttons, so the onclick attribute is in the target, not currentTarget
|
||||||
|
eval(event.target.getAttribute('onclick'));
|
||||||
|
}else {
|
||||||
|
// normal Manage Fields Add Field button press
|
||||||
|
eval(event.currentTarget.getAttribute('onclick'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//jQuery(this).data('myclick').call(this, event || window.event);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_edit_form_properties( container_name, element_id ){
|
||||||
|
wppb_hide_all ( container_name );
|
||||||
|
wppb_disable_add_entry_button ( container_name );
|
||||||
|
|
||||||
|
field = jQuery( container_name + ' #' + element_id + ' ' + '#field' ).val();
|
||||||
|
|
||||||
|
if ( ( field in fields ) ){
|
||||||
|
var to_show = fields[jQuery.trim(field)]['show_rows'];
|
||||||
|
for (var key in to_show)
|
||||||
|
jQuery( container_name + ' #' + element_id + ' ' + to_show[key] ).show();
|
||||||
|
|
||||||
|
var properties = fields[ jQuery.trim(field) ]['properties'];
|
||||||
|
if( typeof properties !== 'undefined' && properties ) {
|
||||||
|
for( var key in properties ) {
|
||||||
|
if( typeof properties['meta_name_value'] !== 'undefined' ) {
|
||||||
|
jQuery( container_name + ' ' + '#meta-name').attr( 'readonly', true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).removeAttr( 'disabled' );
|
||||||
|
|
||||||
|
//Handle user role sorting
|
||||||
|
wppb_handle_user_role_field( container_name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_display_needed_fields( index, container_name, current_field_select ){
|
||||||
|
var show_rows = fields[jQuery.trim(index)]['show_rows'];
|
||||||
|
for (var key in show_rows) {
|
||||||
|
jQuery( show_rows[key], jQuery( current_field_select ).parents( '.mb-list-entry-fields' ) ).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
var properties = fields[jQuery.trim(index)]['properties'];
|
||||||
|
if ( ( ( typeof properties !== 'undefined' ) && ( properties ) ) ) { //the extra (second) condition is a particular case since only the username is defined in our global array that has no meta-name
|
||||||
|
for (var key in properties) {
|
||||||
|
if ( ( typeof properties['meta_name_value'] !== 'undefined' ) ){
|
||||||
|
jQuery( container_name + ' ' + '#meta-name' ).val( properties['meta_name_value'] );
|
||||||
|
jQuery( container_name + ' ' + '#meta-name' ).attr( 'readonly', true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
/* meta value when editing a field shouldn't change so we take it from the current entered value which is displayed above the edit form */
|
||||||
|
if( jQuery( current_field_select).parents('.update_container_wppb_manage_fields').length != 0 ){
|
||||||
|
meta_value = jQuery( '.row-meta-name pre', jQuery( current_field_select).parents( '.update_container_wppb_manage_fields' ).prev() ).text();
|
||||||
|
}
|
||||||
|
/* for the add form it should change */
|
||||||
|
else{
|
||||||
|
|
||||||
|
// Repeater fields have different meta name prefixes, stored in the GET parameter 'wppb_field_metaname_prefix'.
|
||||||
|
var get_parameter_prefix = wppb_get_parameter_by_name( 'wppb_field_metaname_prefix' );
|
||||||
|
var field_metaname_prefix = ( get_parameter_prefix == null ) ? 'custom_field' : get_parameter_prefix;
|
||||||
|
|
||||||
|
numbers = new Array();
|
||||||
|
jQuery( '#container_wppb_manage_fields .row-meta-name pre').each(function(){
|
||||||
|
meta_name = jQuery(this).text();
|
||||||
|
if( meta_name.indexOf( field_metaname_prefix ) !== -1 ){
|
||||||
|
var meta_name = meta_name.replace(field_metaname_prefix, '' );
|
||||||
|
/* we should have an underscore present in custom_field_# so remove it */
|
||||||
|
meta_name = meta_name.replace('_', '' );
|
||||||
|
|
||||||
|
if( isNaN( meta_name ) ){
|
||||||
|
meta_name = Math.floor((Math.random() * 200) + 100);
|
||||||
|
}
|
||||||
|
numbers.push( parseInt(meta_name) );
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
if( numbers.length > 0 ){
|
||||||
|
numbers.sort( function(a, b){return a-b} );
|
||||||
|
numbers.reverse();
|
||||||
|
meta_number = parseInt(numbers[0])+1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
meta_number = 1;
|
||||||
|
|
||||||
|
meta_value = field_metaname_prefix + '_' + meta_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery( container_name + ' ' + '#meta-name' ).val( meta_value );
|
||||||
|
jQuery( container_name + ' ' + '#meta-name' ).attr( 'readonly', false );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Handle user role sorting
|
||||||
|
wppb_handle_user_role_field( container_name );
|
||||||
|
|
||||||
|
var set_required = fields[jQuery.trim(index)]['required'];
|
||||||
|
if ( ( typeof set_required !== 'undefined' ) && ( set_required ) ){
|
||||||
|
jQuery( container_name + ' ' + '#required' ).val( 'Yes' );
|
||||||
|
jQuery( container_name + ' ' + '#required' ).attr( 'disabled', true );
|
||||||
|
|
||||||
|
}else{
|
||||||
|
jQuery( container_name + ' ' + '#required' ).val( 'No' );
|
||||||
|
jQuery( container_name + ' ' + '#required' ).attr( 'disabled', false );
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).removeAttr( 'disabled' );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function wppb_get_parameter_by_name(name, url) {
|
||||||
|
if (!url) url = window.location.href;
|
||||||
|
name = name.replace(/[\[\]]/g, "\\$&");
|
||||||
|
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
||||||
|
results = regex.exec(url);
|
||||||
|
if (!results) return null;
|
||||||
|
if (!results[2]) return null;
|
||||||
|
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that handles the sorting of the user roles from the Select (User Role)
|
||||||
|
* extra field
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function wppb_handle_user_role_field( container_name ) {
|
||||||
|
|
||||||
|
jQuery( container_name + ' ' + '.row-user-roles .wck-checkboxes').sortable({
|
||||||
|
|
||||||
|
//Assign a custom handle for the drag and drop
|
||||||
|
handle: '.sortable-handle',
|
||||||
|
|
||||||
|
create: function( event, ui ) {
|
||||||
|
|
||||||
|
//Add the custom handle for drag and drop
|
||||||
|
jQuery(this).find('div').each( function() {
|
||||||
|
jQuery(this).prepend('<span class="sortable-handle"></span>');
|
||||||
|
});
|
||||||
|
|
||||||
|
$sortOrderInput = jQuery(this).parents('.row-user-roles').siblings('.row-user-roles-sort-order').find('input[type=text]');
|
||||||
|
|
||||||
|
if( $sortOrderInput.val() == '' ) {
|
||||||
|
jQuery(this).find('input[type=checkbox]').each( function() {
|
||||||
|
$sortOrderInput.val( $sortOrderInput.val() + ', ' + jQuery(this).val() );
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sortOrderElements = $sortOrderInput.val().split(', ');
|
||||||
|
sortOrderElements.shift();
|
||||||
|
|
||||||
|
for( var i=0; i < sortOrderElements.length; i++ ) {
|
||||||
|
jQuery( container_name + ' ' + '.row-user-roles .wck-checkboxes').append( jQuery( container_name + ' ' + '.row-user-roles .wck-checkboxes input[value="' + sortOrderElements[i] + '"]').parent().parent().get(0) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
update: function( event, ui ) {
|
||||||
|
$sortOrderInput = ui.item.parents('.row-user-roles').siblings('.row-user-roles-sort-order').find('input[type=text]');
|
||||||
|
$sortOrderInput.val('');
|
||||||
|
|
||||||
|
ui.item.parent().find('input[type=checkbox]').each( function() {
|
||||||
|
$sortOrderInput.val( $sortOrderInput.val() + ', ' + jQuery(this).val() );
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function wppb_initialize_live_select( container_name ){
|
||||||
|
wppb_hide_all( container_name );
|
||||||
|
jQuery(document).on( 'change', container_name + ' ' + '.mb-list-entry-fields #field', function () {
|
||||||
|
field = jQuery(this).val();
|
||||||
|
|
||||||
|
if ( field != ''){
|
||||||
|
wppb_hide_all( container_name );
|
||||||
|
wppb_display_needed_fields( field, container_name, this );
|
||||||
|
}else{
|
||||||
|
wppb_hide_all( container_name );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery(function(){
|
||||||
|
wppb_initialize_live_select ( '#wppb_manage_fields' );
|
||||||
|
wppb_initialize_live_select ( '#container_wppb_manage_fields' );
|
||||||
|
|
||||||
|
wppb_hide_properties_for_already_added_fields( '#container_wppb_manage_fields' );
|
||||||
|
wppb_disable_add_entry_button ( '#wppb_manage_fields' );
|
||||||
|
});
|
237
profile-builder/assets/js/jquery-pb-add-ons.js
vendored
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Function to download/activate add-ons on button click
|
||||||
|
*/
|
||||||
|
jQuery('.wppb-add-on .button').on( 'click', function(e) {
|
||||||
|
if( jQuery(this).attr('disabled') ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activate add-on
|
||||||
|
if( jQuery(this).hasClass('wppb-add-on-activate') ) {
|
||||||
|
e.preventDefault();
|
||||||
|
wppb_add_on_activate( jQuery(this) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deactivate add-on
|
||||||
|
if( jQuery(this).hasClass('wppb-add-on-deactivate') ) {
|
||||||
|
e.preventDefault();
|
||||||
|
wppb_add_on_deactivate( jQuery(this) );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make deactivate button from Add-On is Active message button
|
||||||
|
*/
|
||||||
|
jQuery('.wppb-add-on').on( 'hover', function() {
|
||||||
|
|
||||||
|
$button = jQuery(this).find('.wppb-add-on-deactivate');
|
||||||
|
|
||||||
|
if( $button.length > 0 ) {
|
||||||
|
$button
|
||||||
|
.animate({
|
||||||
|
opacity: 1
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make Add-On is Active message button from deactivate button
|
||||||
|
*/
|
||||||
|
jQuery('.wppb-add-on').on( 'mouseleave', function() {
|
||||||
|
|
||||||
|
$button = jQuery(this).find('.wppb-add-on-deactivate');
|
||||||
|
|
||||||
|
if( $button.length > 0 ) {
|
||||||
|
$button
|
||||||
|
.animate({
|
||||||
|
opacity: 0
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that activates the add-on
|
||||||
|
*/
|
||||||
|
function wppb_add_on_activate( $button ) {
|
||||||
|
$activate_button = $button;
|
||||||
|
|
||||||
|
var fade_in_out_speed = 300;
|
||||||
|
var plugin = $activate_button.attr('href');
|
||||||
|
var add_on_index = $activate_button.parents('.wppb-add-on').index('.wppb-add-on');
|
||||||
|
var nonce = $activate_button.data('nonce');
|
||||||
|
|
||||||
|
$activate_button
|
||||||
|
.attr('disabled', true);
|
||||||
|
|
||||||
|
$spinner = $activate_button.siblings('.spinner');
|
||||||
|
|
||||||
|
$spinner.animate({
|
||||||
|
opacity: 0.7
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
// Remove the current displayed message
|
||||||
|
wppb_add_on_remove_status_message( $activate_button, fade_in_out_speed);
|
||||||
|
|
||||||
|
jQuery.post( ajaxurl, { action: 'wppb_add_on_activate', wppb_add_on_to_activate: plugin, wppb_add_on_index: add_on_index, nonce: nonce }, function( response ) {
|
||||||
|
|
||||||
|
add_on_index = response;
|
||||||
|
|
||||||
|
$activate_button = jQuery('.wppb-add-on').eq( add_on_index ).find('.button');
|
||||||
|
|
||||||
|
$activate_button
|
||||||
|
.blur()
|
||||||
|
.removeClass('wppb-add-on-activate')
|
||||||
|
.addClass('wppb-add-on-deactivate')
|
||||||
|
.removeAttr('disabled')
|
||||||
|
.text( jQuery('#wppb-add-on-deactivate-button-text').text() );
|
||||||
|
|
||||||
|
$spinner = $activate_button.siblings('.spinner');
|
||||||
|
|
||||||
|
$spinner.animate({
|
||||||
|
opacity: 0
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
// Set status confirmation message
|
||||||
|
wppb_add_on_set_status_message( $activate_button, 'dashicons-yes', jQuery('#wppb-add-on-activated-message-text').text(), fade_in_out_speed, 0, true );
|
||||||
|
wppb_add_on_remove_status_message( $activate_button, fade_in_out_speed, 2000 );
|
||||||
|
|
||||||
|
// Set is active message
|
||||||
|
wppb_add_on_set_status_message( $activate_button, 'dashicons-yes', jQuery('#wppb-add-on-is-active-message-text').html(), fade_in_out_speed, 2000 + fade_in_out_speed );
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function that deactivates the add-on
|
||||||
|
*/
|
||||||
|
function wppb_add_on_deactivate( $button ) {
|
||||||
|
|
||||||
|
var fade_in_out_speed = 300;
|
||||||
|
var plugin = $button.attr('href');
|
||||||
|
var add_on_index = $button.parents('.wppb-add-on').index('.wppb-add-on');
|
||||||
|
var nonce = $button.data('nonce');
|
||||||
|
|
||||||
|
$button
|
||||||
|
.removeClass('wppb-add-on-deactivate')
|
||||||
|
.attr('disabled', true);
|
||||||
|
|
||||||
|
$spinner = $button.siblings('.spinner');
|
||||||
|
|
||||||
|
$spinner.animate({
|
||||||
|
opacity: 0.7
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
// Remove the current displayed message
|
||||||
|
wppb_add_on_remove_status_message( $button, fade_in_out_speed );
|
||||||
|
|
||||||
|
jQuery.post( ajaxurl, { action: 'wppb_add_on_deactivate', wppb_add_on_to_deactivate: plugin, wppb_add_on_index: add_on_index, nonce: nonce }, function( response ) {
|
||||||
|
|
||||||
|
add_on_index = response;
|
||||||
|
|
||||||
|
$button = jQuery('.wppb-add-on').eq( add_on_index ).find('.button');
|
||||||
|
|
||||||
|
$button
|
||||||
|
.blur()
|
||||||
|
.removeClass('wppb-add-on-is-active')
|
||||||
|
.addClass('wppb-add-on-activate')
|
||||||
|
.attr( 'disabled', false )
|
||||||
|
.text( jQuery('#wppb-add-on-activate-button-text').text() );
|
||||||
|
|
||||||
|
$spinner = $button.siblings('.spinner');
|
||||||
|
|
||||||
|
$spinner.animate({
|
||||||
|
opacity: 0
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
// Set status confirmation message
|
||||||
|
wppb_add_on_set_status_message( $button, 'dashicons-yes', jQuery('#wppb-add-on-deactivated-message-text').text(), fade_in_out_speed, 0, true );
|
||||||
|
wppb_add_on_remove_status_message( $button, fade_in_out_speed, 2000 );
|
||||||
|
|
||||||
|
// Set is active message
|
||||||
|
wppb_add_on_set_status_message( $button, 'dashicons-no-alt', jQuery('#wppb-add-on-is-not-active-message-text').html(), fade_in_out_speed, 2000 + fade_in_out_speed );
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function used to remove the status message of an add-on
|
||||||
|
*
|
||||||
|
* @param object $button - The jQuery object of the add-on box button that was pressed
|
||||||
|
* @param int fade_in_out_speed - The speed of the fade in and out animations
|
||||||
|
* @param int delay - Delay removing of the message
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function wppb_add_on_remove_status_message( $button, fade_in_out_speed, delay ) {
|
||||||
|
|
||||||
|
if( typeof( delay ) == 'undefined' ) {
|
||||||
|
delay = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout( function() {
|
||||||
|
|
||||||
|
$button.siblings('.dashicons')
|
||||||
|
.animate({
|
||||||
|
opacity: 0
|
||||||
|
}, fade_in_out_speed );
|
||||||
|
|
||||||
|
$button.siblings('.wppb-add-on-message')
|
||||||
|
.animate({
|
||||||
|
opacity: 0
|
||||||
|
}, fade_in_out_speed );
|
||||||
|
|
||||||
|
}, delay);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function used to remove the status message of an add-on
|
||||||
|
*
|
||||||
|
* @param object $button - The jQuery object of the add-on box button that was pressed
|
||||||
|
* @param string message_icon_class - The string name of the class we want the icon to have
|
||||||
|
* @param string message_text - The text we want the user to see
|
||||||
|
* @param int fade_in_out_speed - The speed of the fade in and out animations
|
||||||
|
* @param bool success - If true adds a class to style the message as a success one, if false adds a class to style the message as a failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function wppb_add_on_set_status_message( $button, message_icon_class, message_text, fade_in_out_speed, delay, success ) {
|
||||||
|
|
||||||
|
if( typeof( delay ) == 'undefined' ) {
|
||||||
|
delay = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
|
||||||
|
$button.siblings('.dashicons')
|
||||||
|
.css('opacity', 0)
|
||||||
|
.attr('class', 'dashicons')
|
||||||
|
.addClass( message_icon_class )
|
||||||
|
.animate({ opacity: 1}, fade_in_out_speed);
|
||||||
|
|
||||||
|
$button.siblings('.wppb-add-on-message')
|
||||||
|
.css('opacity', 0)
|
||||||
|
.attr( 'class', 'wppb-add-on-message' )
|
||||||
|
.html( message_text )
|
||||||
|
.animate({ opacity: 1}, fade_in_out_speed);
|
||||||
|
|
||||||
|
if( typeof( success ) != 'undefined' ) {
|
||||||
|
if( success == true ) {
|
||||||
|
$button.siblings('.dashicons')
|
||||||
|
.addClass('wppb-confirmation-success');
|
||||||
|
$button.siblings('.wppb-add-on-message')
|
||||||
|
.addClass('wppb-confirmation-success');
|
||||||
|
} else if( success == false ) {
|
||||||
|
$button.siblings('.dashicons')
|
||||||
|
.addClass('wppb-confirmation-error');
|
||||||
|
$button.siblings('.wppb-add-on-message')
|
||||||
|
.addClass('wppb-confirmation-error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, delay );
|
||||||
|
|
||||||
|
}
|
133
profile-builder/assets/js/jquery-pb-sitewide.js
vendored
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
/**
|
||||||
|
* Add a negative letter spacing to Profile Builder email customizer menus.
|
||||||
|
*/
|
||||||
|
|
||||||
|
jQuery( document ).ready(function(){
|
||||||
|
jQuery('li a[href$="admin-email-customizer"]').css("letter-spacing", "-0.7px");
|
||||||
|
jQuery('li a[href$="user-email-customizer"]').css("letter-spacing", "-0.7px");
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the width of the shortcode input based on an element that
|
||||||
|
* has the width of its contents
|
||||||
|
*/
|
||||||
|
function setShortcodeInputWidth( $inputField ) {
|
||||||
|
var tempSpan = document.createElement('span');
|
||||||
|
tempSpan.className = "wppb-shortcode-temp";
|
||||||
|
tempSpan.innerHTML = $inputField.val();
|
||||||
|
document.body.appendChild(tempSpan);
|
||||||
|
var tempWidth = tempSpan.scrollWidth;
|
||||||
|
document.body.removeChild(tempSpan);
|
||||||
|
|
||||||
|
$inputField.outerWidth( tempWidth );
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery( document ).ready( function() {
|
||||||
|
|
||||||
|
jQuery('.wppb-shortcode.input').each( function() {
|
||||||
|
setShortcodeInputWidth( jQuery(this) );
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery('.wppb-shortcode.textarea').each( function() {
|
||||||
|
jQuery(this).outerHeight( jQuery(this)[0].scrollHeight + parseInt( jQuery(this).css('border-top-width') ) * 2 );
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery('.wppb-shortcode').click( function() {
|
||||||
|
this.select();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/* make sure that we don;t leave the page without having a title in the Post Title field, otherwise we loose data */
|
||||||
|
jQuery( function(){
|
||||||
|
if( jQuery( 'body').hasClass('post-new-php') ){
|
||||||
|
|
||||||
|
if( jQuery( 'body').hasClass('post-type-wppb-rf-cpt') || jQuery( 'body').hasClass('post-type-wppb-epf-cpt') || jQuery( 'body').hasClass('post-type-wppb-ul-cpt') ){
|
||||||
|
|
||||||
|
if( jQuery('#title').val() == '' ){
|
||||||
|
jQuery(window).bind('beforeunload',function() {
|
||||||
|
return "This page is asking you to confirm that you want to leave - data you have entered may not be saved";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* remove beforeunload event when entering a title or pressing the puclish button */
|
||||||
|
jQuery( '#title').keypress(function() {
|
||||||
|
jQuery(window).unbind('beforeunload');
|
||||||
|
});
|
||||||
|
jQuery( '#publish').click( function() {
|
||||||
|
jQuery(window).unbind('beforeunload');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/* show hide fields based on selected options */
|
||||||
|
jQuery( function(){
|
||||||
|
jQuery( '#wppb-rf-settings-args').on('change', '#redirect', function(){
|
||||||
|
if( jQuery(this).val() == 'Yes' ){
|
||||||
|
jQuery( '.row-url, .row-display-messages', jQuery(this).parent().parent().parent()).show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
jQuery( '.row-url, .row-display-messages', jQuery(this).parent().parent().parent()).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery( '#wppb-epf-settings-args').on('change', '#redirect', function(){
|
||||||
|
if( jQuery(this).val() == 'Yes' ){
|
||||||
|
jQuery( '.row-url, .row-display-messages', jQuery(this).parent().parent().parent()).show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
jQuery( '.row-url, .row-display-messages', jQuery(this).parent().parent().parent()).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
jQuery( '#wppb-ul-settings-args').on('click', '#visible-only-to-logged-in-users_yes', function(){
|
||||||
|
jQuery( '.row-visible-to-following-roles', jQuery(this).parent().parent().parent().parent().parent().parent()).toggle();
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery( '#wppb-ul-faceted-args').on('change', '#facet-type', function(){
|
||||||
|
if( jQuery(this).val() == 'checkboxes' ){
|
||||||
|
jQuery( '.row-facet-behaviour, .row-facet-limit', jQuery(this).parent().parent().parent()).show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
jQuery( '.row-facet-behaviour, .row-facet-limit', jQuery(this).parent().parent().parent()).hide();
|
||||||
|
jQuery( '.row-facet-behaviour #facet-behaviour', jQuery(this).parent().parent().parent()).val('narrow');
|
||||||
|
}
|
||||||
|
if( jQuery(this).val() == 'search' ){
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_country"] ').hide();
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_country"] ').hide();
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_state"] ').hide();
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_state"] ').hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_country"] ').show();
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_country"] ').show();
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_state"] ').show();
|
||||||
|
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_state"] ').show()
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dialog boxes throughout Profile Builder
|
||||||
|
*/
|
||||||
|
jQuery( function() {
|
||||||
|
if ( jQuery.fn.dialog ) {
|
||||||
|
jQuery('.wppb-modal-box').dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
modal: true,
|
||||||
|
draggable: false,
|
||||||
|
minWidth: 450,
|
||||||
|
minHeight: 450
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery('.wppb-open-modal-box').click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
jQuery('#' + jQuery(this).attr('href')).dialog('open');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
3
profile-builder/assets/js/select2/i18n/ar.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="الرجاء حذف "+t+" عناصر";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="الرجاء إضافة "+t+" عناصر";return n},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){var t="تستطيع إختيار "+e.maximum+" بنود فقط";return t},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/az.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/bg.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/ca.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/cs.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/da.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/de.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/el.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/en.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/es.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
|
3
profile-builder/assets/js/select2/i18n/et.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||||
|
|
||||||
|
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
|