Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master #6

Merged
merged 3 commits into from
Sep 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bp-compliments-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct() {

parent::start(
'compliments',
__( 'Compliments', BP_COMP_TEXTDOMAIN ),
__( 'Compliments', 'bp-compliments' ),
constant( 'BP_COMPLIMENTS_DIR' ) . '/includes',
$this->params
);
Expand Down
18 changes: 9 additions & 9 deletions bp-compliments.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Plugin Name: BuddyPress Compliments
Plugin URI: http://wpgeodirectory.com/
Description: Compliments module for BuddyPress.
Version: 0.0.7
Version: 0.0.8
Author: GeoDirectory
Author URI: http://wpgeodirectory.com
*/
Expand All @@ -19,7 +19,7 @@
if ( !defined( 'ABSPATH' ) ) exit;

// Define the plugin version.
define( 'BP_COMPLIMENTS_VER', '0.0.7' );
define( 'BP_COMPLIMENTS_VER', '0.0.8' );

/**
* BuddyPress compliments text domain.
Expand All @@ -28,9 +28,9 @@
/**
* BuddyPress compliments names.
*/
define( 'BP_COMP_SINGULAR_NAME', trim(esc_attr( get_option('bp_compliment_singular_name', __( 'Compliment', BP_COMP_TEXTDOMAIN )))) );
define( 'BP_COMP_PLURAL_NAME', trim(esc_attr( get_option('bp_compliment_plural_name', __( 'Compliments', BP_COMP_TEXTDOMAIN )))) );
define( 'BP_COMPLIMENTS_SLUG', strtolower(trim(esc_attr( get_option('bp_compliment_slug', __( 'compliments', BP_COMP_TEXTDOMAIN ))))) );
define( 'BP_COMP_SINGULAR_NAME', trim(esc_attr( get_option('bp_compliment_singular_name', __( 'Compliment', 'bp-compliments' )))) );
define( 'BP_COMP_PLURAL_NAME', trim(esc_attr( get_option('bp_compliment_plural_name', __( 'Compliments', 'bp-compliments' )))) );
define( 'BP_COMPLIMENTS_SLUG', strtolower(trim(esc_attr( get_option('bp_compliment_slug', __( 'compliments', 'bp-compliments' ))))) );


/**
Expand Down Expand Up @@ -68,7 +68,7 @@ function bp_compliments_init() {

// show admin notice for users on BP 1.2.x
} else {
$older_version_notice = __( "Hey! BP Compliments requires BuddyPress 1.5 or higher.", BP_COMP_TEXTDOMAIN );
$older_version_notice = __( "Hey! BP Compliments requires BuddyPress 1.5 or higher.", 'bp-compliments' );

add_action( 'admin_notices', create_function( '', "
echo '<div class=\"error\"><p>' . $older_version_notice . '</p></div>';
Expand Down Expand Up @@ -136,10 +136,10 @@ function bp_compliments_localization() {
* @since 0.0.1
* @package BuddyPress_Compliments
*/
$locale = apply_filters('plugin_locale', get_locale(), BP_COMP_TEXTDOMAIN);
$locale = apply_filters('plugin_locale', get_locale(), 'bp-compliments');

load_textdomain(BP_COMP_TEXTDOMAIN, WP_LANG_DIR . '/' . BP_COMP_TEXTDOMAIN . '/' . BP_COMP_TEXTDOMAIN . '-' . $locale . '.mo');
load_plugin_textdomain(BP_COMP_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages');
load_textdomain('bp-compliments', WP_LANG_DIR . '/' . 'bp-compliments' . '/' . 'bp-compliments' . '-' . $locale . '.mo');
load_plugin_textdomain('bp-compliments', false, dirname( plugin_basename( __FILE__ ) ) . '/languages');

}
add_action( 'plugins_loaded', 'bp_compliments_localization' );
Expand Down
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Option added to enable/disable notifications component - ADDED
Added placeholder text to message textarea - ADDED
Compliments in activity dropdown filter is ambiguous - FIXED
Undefined property ID notice - FIXED
Changed textdomain from defined constant to a string - CHANGED

v0.0.7
Compliments can be renamed to anything Ex: "Gifts" - ADDED
Expand Down
4 changes: 2 additions & 2 deletions includes/bp-compliments-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ function handle_compliments_form_data() {
$redirect_url = bp_core_get_user_domain($receiver_id);

if ( ! bp_compliments_start_compliment($args)) {
bp_core_add_message( sprintf( __( 'There was a problem when trying to send %s to %s, please contact administrator.', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ), 'error' );
bp_core_add_message( sprintf( __( 'There was a problem when trying to send %s to %s, please contact administrator.', 'bp-compliments' ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ), 'error' );
} else {
bp_core_add_message( sprintf( __( 'Your %s sent to %s.', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ) );
bp_core_add_message( sprintf( __( 'Your %s sent to %s.', 'bp-compliments' ), strtolower(BP_COMP_SINGULAR_NAME), $receiver_name ) );
}

$bp_compliment_can_see_others_comp_value = esc_attr( get_option('bp_compliment_can_see_others_comp'));
Expand Down
12 changes: 6 additions & 6 deletions includes/bp-compliments-activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function compliments_register_activity_actions() {
bp_activity_set_action(
$bp->compliments->id,
'compliment_received',
sprintf( __( '%s Received', BP_COMP_TEXTDOMAIN ), BP_COMP_SINGULAR_NAME ),
sprintf( __( '%s Received', 'bp-compliments' ), BP_COMP_SINGULAR_NAME ),
'compliments_format_activity_action_compliment_received',
BP_COMP_PLURAL_NAME,
array( 'activity' )
Expand All @@ -112,7 +112,7 @@ function compliments_register_activity_actions() {
bp_activity_set_action(
$bp->compliments->id,
'compliment_sent',
sprintf( __( '%s Sent', BP_COMP_TEXTDOMAIN ), BP_COMP_SINGULAR_NAME ),
sprintf( __( '%s Sent', 'bp-compliments' ), BP_COMP_SINGULAR_NAME ),
'compliments_format_activity_action_compliment_sent',
BP_COMP_PLURAL_NAME,
array( 'activity' )
Expand Down Expand Up @@ -155,9 +155,9 @@ function compliments_format_activity_action_compliment_received( $action, $activ
}

if ($bp_compliment_can_see_others_comp == 'yes') {
$action = sprintf( __( '%1$s has received a %2$s from %3$s', BP_COMP_TEXTDOMAIN ), $receiver_link, $compliment_link, $sender_link );
$action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, $compliment_link, $sender_link );
} else {
$action = sprintf( __( '%1$s has received a %2$s from %3$s', BP_COMP_TEXTDOMAIN ), $receiver_link, strtolower(BP_COMP_SINGULAR_NAME), $sender_link );
$action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, strtolower(BP_COMP_SINGULAR_NAME), $sender_link );
}


Expand Down Expand Up @@ -199,9 +199,9 @@ function compliments_format_activity_action_compliment_sent( $action, $activity
}

if ($bp_compliment_can_see_others_comp == 'yes') {
$action = sprintf( __( '%1$s has sent a %2$s to %3$s', BP_COMP_TEXTDOMAIN ), $sender_link, $compliment_link, $receiver_link );
$action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, $compliment_link, $receiver_link );
} else {
$action = sprintf( __( '%1$s has sent a %2$s to %3$s', BP_COMP_TEXTDOMAIN ), $sender_link, strtolower(BP_COMP_SINGULAR_NAME), $receiver_link );
$action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, strtolower(BP_COMP_SINGULAR_NAME), $receiver_link );
}

/**
Expand Down
8 changes: 4 additions & 4 deletions includes/bp-compliments-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function bp_compliments_modal_form($pid = 0, $receiver_id = 0) {
<div class="comp-modal">
<div class="comp-modal-content-wrap">
<div class="comp-modal-title">
<h2><?php echo sprintf( __( 'Choose Your %s Type:', BP_COMP_TEXTDOMAIN ), BP_COMP_SINGULAR_NAME ); ?></h2>
<h2><?php echo sprintf( __( 'Choose Your %s Type:', 'bp-compliments' ), BP_COMP_SINGULAR_NAME ); ?></h2>
</div>
<div class="comp-modal-content">
<form action="" method="post">
Expand Down Expand Up @@ -55,13 +55,13 @@ function bp_compliments_modal_form($pid = 0, $receiver_id = 0) {
echo '</ul>';

?>
<textarea placeholder="<?php echo __( 'Type your message here', BP_COMP_TEXTDOMAIN ); ?>" name="message" maxchar="1000"></textarea>
<textarea placeholder="<?php echo __( 'Type your message here', 'bp-compliments' ); ?>" name="message" maxchar="1000"></textarea>
<input type="hidden" name="post_id" value="<?php echo $pid; ?>"/>
<input type="hidden" name="receiver_id" value="<?php echo $receiver_id; ?>"/>
<?php wp_nonce_field( 'handle_compliments_form_data','handle_compliments_nonce' ); ?>
<div class="bp-comp-pop-buttons">
<button type="submit" class="comp-submit-btn" name="comp-modal-form" value="submit"><?php echo __( 'Send', BP_COMP_TEXTDOMAIN ); ?></button>
<a class="bp-comp-cancel" href="#"><?php echo __( 'Cancel', BP_COMP_TEXTDOMAIN ); ?></a>
<button type="submit" class="comp-submit-btn" name="comp-modal-form" value="submit"><?php echo __( 'Send', 'bp-compliments' ); ?></button>
<a class="bp-comp-cancel" href="#"><?php echo __( 'Cancel', 'bp-compliments' ); ?></a>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
Expand Down
14 changes: 7 additions & 7 deletions includes/bp-compliments-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function bp_compliments_format_notifications( $action, $item_id, $secondary_item
$text = false;

if ( 1 == $total_items ) {
$text = sprintf( __( '%s has sent you a %s', BP_COMP_TEXTDOMAIN ), bp_core_get_user_displayname( $item_id ), strtolower(BP_COMP_SINGULAR_NAME) );
$text = sprintf( __( '%s has sent you a %s', 'bp-compliments' ), bp_core_get_user_displayname( $item_id ), strtolower(BP_COMP_SINGULAR_NAME) );
$link = bp_core_get_user_domain( $bp->loggedin_user->id ) .BP_COMPLIMENTS_SLUG. '/?bpc_read=true&bpc_sender_id='.$item_id;
}
break;
Expand Down Expand Up @@ -182,12 +182,12 @@ function bp_compliments_new_compliment_email_notification() {
// Set up and send the message
$to = $receiver_ud->user_email;

$subject = '[' . wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES ) . '] ' . sprintf( __( '%s has sent you a %s', BP_COMP_TEXTDOMAIN ), $sender_name, strtolower(BP_COMP_SINGULAR_NAME) );
$subject = '[' . wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES ) . '] ' . sprintf( __( '%s has sent you a %s', 'bp-compliments' ), $sender_name, strtolower(BP_COMP_SINGULAR_NAME) );

$message = sprintf( __(
'%s has sent you a %s.

To view %s\'s %s: %s', BP_COMP_TEXTDOMAIN ), $sender_name, strtolower(BP_COMP_SINGULAR_NAME), $sender_name, strtolower(BP_COMP_SINGULAR_NAME), $compliment_link );
To view %s\'s %s: %s', 'bp-compliments' ), $sender_name, strtolower(BP_COMP_SINGULAR_NAME), $sender_name, strtolower(BP_COMP_SINGULAR_NAME), $compliment_link );

// Add notifications link if settings component is enabled
if ( bp_is_active( 'settings' ) ) {
Expand All @@ -196,7 +196,7 @@ function bp_compliments_new_compliment_email_notification() {

---------------------
To disable these notifications please log in and go to:
%s', BP_COMP_TEXTDOMAIN ), $settings_link );
%s', 'bp-compliments' ), $settings_link );
}

// Send the message
Expand Down Expand Up @@ -275,15 +275,15 @@ function bp_compliments_screen_notification_settings() {
<tr>
<th class="icon"></th>
<th class="title"><?php echo BP_COMP_PLURAL_NAME; ?></th>
<th class="yes"><?php _e( 'Yes', BP_COMP_TEXTDOMAIN ) ?></th>
<th class="no"><?php _e( 'No', BP_COMP_TEXTDOMAIN )?></th>
<th class="yes"><?php _e( 'Yes', 'bp-compliments' ) ?></th>
<th class="no"><?php _e( 'No', 'bp-compliments' )?></th>
</tr>
</thead>

<tbody>
<tr>
<td></td>
<td><?php echo sprintf( __( 'A member sends you a %s', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_SINGULAR_NAME)); ?></td>
<td><?php echo sprintf( __( 'A member sends you a %s', 'bp-compliments' ), strtolower(BP_COMP_SINGULAR_NAME)); ?></td>
<td class="yes"><input type="radio" name="notifications[notification_on_compliments]" value="yes" <?php checked( $notify, 'yes', true ) ?>/></td>
<td class="no"><input type="radio" name="notifications[notification_on_compliments]" value="no" <?php checked( $notify, 'no', true ) ?>/></td>
</tr>
Expand Down
36 changes: 18 additions & 18 deletions includes/bp-compliments-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function bp_compliments_register_settings() {
function bp_compliments_settings_page() {
?>
<div class="wrap">
<h2><?php echo sprintf( __( 'BuddyPress %s - Settings', BP_COMP_TEXTDOMAIN ), BP_COMP_PLURAL_NAME ); ?></h2>
<h2><?php echo sprintf( __( 'BuddyPress %s - Settings', 'bp-compliments' ), BP_COMP_PLURAL_NAME ); ?></h2>
<form method="post" action="options.php">
<?php settings_fields( 'bp-compliment-settings' ); ?>
<?php do_settings_sections( 'bp-compliment-settings' );
Expand All @@ -60,59 +60,59 @@ function bp_compliments_settings_page() {
?>
<table class="widefat fixed" style="padding:10px;margin-top: 10px;">
<tr valign="top">
<th scope="row"><?php echo __( 'Singlular name ( e.g. Gift. Default: Compliment )', BP_COMP_TEXTDOMAIN ); ?></th>
<th scope="row"><?php echo __( 'Singlular name ( e.g. Gift. Default: Compliment )', 'bp-compliments' ); ?></th>
<td><input type="text" class="widefat" name="bp_compliment_singular_name" value="<?php echo BP_COMP_SINGULAR_NAME; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php echo __( 'Plural name ( e.g. Gifts. Default: Compliments )', BP_COMP_TEXTDOMAIN ); ?></th>
<th scope="row"><?php echo __( 'Plural name ( e.g. Gifts. Default: Compliments )', 'bp-compliments' ); ?></th>
<td><input type="text" class="widefat" name="bp_compliment_plural_name" value="<?php echo BP_COMP_PLURAL_NAME; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php echo __( 'Slug ( e.g. gifts. Default: compliments. must be lowercase )', BP_COMP_TEXTDOMAIN ); ?></th>
<th scope="row"><?php echo __( 'Slug ( e.g. gifts. Default: compliments. must be lowercase )', 'bp-compliments' ); ?></th>
<td><input type="text" class="widefat" name="bp_compliment_slug" value="<?php echo BP_COMPLIMENTS_SLUG; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Members can see other members %s page?', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_SINGULAR_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Members can see other members %s page?', 'bp-compliments' ), strtolower(BP_COMP_SINGULAR_NAME) ); ?></th>
<td>
<select id="bp_compliment_can_see_others_comp" name="bp_compliment_can_see_others_comp">
<option value="yes" <?php selected( $bp_compliment_can_see_others_comp, 'yes' ); ?>><?php echo __( 'Yes', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="no" <?php selected( $bp_compliment_can_see_others_comp, 'no' ); ?>><?php echo __( 'No', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="yes" <?php selected( $bp_compliment_can_see_others_comp, 'yes' ); ?>><?php echo __( 'Yes', 'bp-compliments' ); ?></option>
<option value="no" <?php selected( $bp_compliment_can_see_others_comp, 'no' ); ?>><?php echo __( 'No', 'bp-compliments' ); ?></option>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Members can delete %s received?', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Members can delete %s received?', 'bp-compliments' ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<td>
<select id="bp_compliment_can_delete" name="bp_compliment_can_delete">
<option value="yes" <?php selected( $bp_compliment_can_delete, 'yes' ); ?>><?php echo __( 'Yes', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="no" <?php selected( $bp_compliment_can_delete, 'no' ); ?>><?php echo __( 'No', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="yes" <?php selected( $bp_compliment_can_delete, 'yes' ); ?>><?php echo __( 'Yes', 'bp-compliments' ); ?></option>
<option value="no" <?php selected( $bp_compliment_can_delete, 'no' ); ?>><?php echo __( 'No', 'bp-compliments' ); ?></option>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Enable activity component for %s ?', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Enable activity component for %s ?', 'bp-compliments' ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<td>
<select id="bp_compliment_enable_activity" name="bp_compliment_enable_activity">
<option value="yes" <?php selected( $bp_compliment_enable_activity, 'yes' ); ?>><?php echo __( 'Yes', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="no" <?php selected( $bp_compliment_enable_activity, 'no' ); ?>><?php echo __( 'No', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="yes" <?php selected( $bp_compliment_enable_activity, 'yes' ); ?>><?php echo __( 'Yes', 'bp-compliments' ); ?></option>
<option value="no" <?php selected( $bp_compliment_enable_activity, 'no' ); ?>><?php echo __( 'No', 'bp-compliments' ); ?></option>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Enable notification component for %s ?', BP_COMP_TEXTDOMAIN ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Enable notification component for %s ?', 'bp-compliments' ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<td>
<select id="bp_compliment_enable_notifications" name="bp_compliment_enable_notifications">
<option value="yes" <?php selected( $bp_compliment_enable_notifications, 'yes' ); ?>><?php echo __( 'Yes', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="no" <?php selected( $bp_compliment_enable_notifications, 'no' ); ?>><?php echo __( 'No', BP_COMP_TEXTDOMAIN ); ?></option>
<option value="yes" <?php selected( $bp_compliment_enable_notifications, 'yes' ); ?>><?php echo __( 'Yes', 'bp-compliments' ); ?></option>
<option value="no" <?php selected( $bp_compliment_enable_notifications, 'no' ); ?>><?php echo __( 'No', 'bp-compliments' ); ?></option>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Number of %s to display per page?', BP_COMP_TEXTDOMAIN ), BP_COMP_PLURAL_NAME ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Number of %s to display per page?', 'bp-compliments' ), BP_COMP_PLURAL_NAME ); ?></th>
<td><input type="number" class="widefat" name="bp_comp_per_page" value="<?php echo $comp_per_page; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php echo __( 'Custom CSS styles', BP_COMP_TEXTDOMAIN ); ?></th>
<th scope="row"><?php echo __( 'Custom CSS styles', 'bp-compliments' ); ?></th>
<td><textarea class="widefat" rows="5" name="bp_comp_custom_css"><?php echo $comp_custom_css; ?></textarea></td>
</tr>
<tr valign="top">
Expand Down
Loading