| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template contains the notification manager. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( $args['no_new_post_notification'] ) : ?> |
| 10 |
<p class="description"><?php esc_html_e( 'You have generally disabled new post notifications for yourself.', 'friends' ); ?> <a href="<?php echo esc_url( $args['friends_settings_url'] ); ?>"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( '(Edit)' ); ?></a></p> |
| 11 |
<?php endif; ?> |
| 12 |
|
| 13 |
<p class="description"> |
| 14 |
<span> |
| 15 |
<?php |
| 16 |
if ( $args['active_keywords'] ) { |
| 17 |
echo esc_html( |
| 18 |
sprintf( |
| 19 |
// translators: %1$s is the number of active keywords, %2$s is the list of those keywords. |
| 20 |
_n( 'There is %1$s active keyword: %2$s', 'There are %1$s active keywords: %2$s', count( $args['active_keywords'] ), 'friends' ), |
| 21 |
count( $args['active_keywords'] ), |
| 22 |
esc_html( implode( ', ', $args['active_keywords'] ) ) |
| 23 |
) |
| 24 |
); |
| 25 |
} else { |
| 26 |
esc_html_e( 'No notification keywords have been specified.', 'friends' ); |
| 27 |
} |
| 28 |
?> |
| 29 |
</span> |
| 30 |
<a href="<?php echo esc_url( $args['friends_settings_url'] ); ?>"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( '(Edit)' ); ?></a> |
| 31 |
</p> |
| 32 |
|
| 33 |
<form method="post"> |
| 34 |
<?php wp_nonce_field( 'notification-manager' ); ?> |
| 35 |
<table class="wp-list-table widefat fixed striped" style="margin-top: 2em; margin-bottom: 2em; margin-right: 1em"> |
| 36 |
<thead> |
| 37 |
<tr> |
| 38 |
<th class="column-primary column-friend"><?php esc_html_e( 'Friend', 'friends' ); ?></th> |
| 39 |
<th class="column-friends-page-feeds"><?php esc_html_e( 'Show on friends page', 'friends' ); ?></th> |
| 40 |
<th class="column-email-notification"><?php esc_html_e( 'E-Mail Notification', 'friends' ); ?></th> |
| 41 |
<th class="column-email-notification"><?php esc_html_e( 'Keyword Notification', 'friends' ); ?></th> |
| 42 |
<?php do_action( 'friends_notification_manager_header' ); ?> |
| 43 |
</tr> |
| 44 |
</thead> |
| 45 |
<tbody> |
| 46 |
<?php foreach ( $args['friend_users'] as $friend_user ) : ?> |
| 47 |
<tr> |
| 48 |
<td class="column-friend"> |
| 49 |
<a href="<?php echo esc_url( Friends\Admin::get_edit_friend_link( $friend_user->user_login ) ); ?>"><?php echo esc_html( $friend_user->display_name ); ?></a> |
| 50 |
<input type="hidden" name="friend_listed[]" value="<?php echo esc_attr( $friend_user->user_login ); ?>" /> |
| 51 |
</td> |
| 52 |
<td class="column-friends-page-feeds"> |
| 53 |
<input name="show_on_friends_page[<?php echo esc_attr( $friend_user->user_login ); ?>]" type="checkbox" id="show_on_friends_page" value="1" <?php checked( '1', ! in_array( $friend_user->user_login, $args['hide_from_friends_page'] ) ); ?> /> |
| 54 |
</td> |
| 55 |
<td class="column-email-notification"> |
| 56 |
<input name="new_post_notification[<?php echo esc_attr( $friend_user->user_login ); ?>]" type="checkbox" id="friends_new_post_notification" value="1" <?php checked( '1', ! get_user_option( 'friends_no_new_post_notification_' . $friend_user->user_login ) ); ?> <?php echo $args['no_new_post_notification'] ? 'disabled="disabled"' : ''; ?> |
| 57 |
/> |
| 58 |
</td> |
| 59 |
<td class="column-keyword-notification"> |
| 60 |
<input name="keyword_notification[<?php echo esc_attr( $friend_user->user_login ); ?>]" type="checkbox" id="friends_keyword_notification" value="1" <?php checked( '1', ! get_user_option( 'friends_no_keyword_notification_' . $friend_user->user_login ) ); ?> <?php echo $args['no_keyword_notification'] ? 'disabled="disabled"' : ''; ?> |
| 61 |
/> |
| 62 |
</td> |
| 63 |
<?php do_action( 'friends_notification_manager_row', $friend_user ); ?> |
| 64 |
</tr> |
| 65 |
<?php endforeach; ?> |
| 66 |
</tbody> |
| 67 |
</table> |
| 68 |
<p class="submit"> |
| 69 |
<input type="submit" id="submit" class="button button-primary" value="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Save Changes' ); ?>"> |
| 70 |
</p> |
| 71 |
</form> |
| 72 |
|