| 1 |
<?php |
| 2 |
/** |
| 3 |
* The /friends/ header |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
$search = ''; |
| 10 |
if ( isset( $_GET['s'] ) ) { |
| 11 |
$search = wp_unslash( $_GET['s'] ); |
| 12 |
} |
| 13 |
|
| 14 |
?><!DOCTYPE html> |
| 15 |
<html <?php language_attributes(); ?> class="no-js no-svg"> |
| 16 |
<head> |
| 17 |
<meta charset="<?php bloginfo( 'charset' ); ?>"> |
| 18 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 19 |
<?php wp_head(); ?> |
| 20 |
</head> |
| 21 |
|
| 22 |
<body <?php body_class( 'off-canvas off-canvas-sidebar-show' ); ?>> |
| 23 |
<div id="friends-sidebar" class="off-canvas-sidebar"> |
| 24 |
<div class="friends-brand"> |
| 25 |
<a class="friends-logo" href="<?php echo esc_url( home_url( '/friends/' ) ); ?>"><h2><?php esc_html_e( 'Friends', 'friends' ); ?></h2></a> |
| 26 |
</div> |
| 27 |
<div class="friends-nav accordion-container"> |
| 28 |
<?php dynamic_sidebar( 'friends-sidebar' ); ?> |
| 29 |
</div> |
| 30 |
</div> |
| 31 |
|
| 32 |
<a class="off-canvas-overlay" href="#close"></a> |
| 33 |
|
| 34 |
<div class="off-canvas-content"> |
| 35 |
<header class="<?php echo is_single() ? '' : 'navbar'; ?>"> |
| 36 |
<section class="navbar-section author"> |
| 37 |
<a class="off-canvas-toggle btn btn-primary bt-action" href="#friends-sidebar"> |
| 38 |
<span class="ab-icon dashicons dashicons-menu-alt2"></span> |
| 39 |
</a> |
| 40 |
<?php |
| 41 |
if ( $args['friend_user'] && $args['friend_user'] instanceof Friends\User && is_singular() ) { |
| 42 |
Friends\Friends::template_loader()->get_template_part( |
| 43 |
'frontend/single-header', |
| 44 |
$args['post_format'], |
| 45 |
$args |
| 46 |
); |
| 47 |
} elseif ( $args['friend_user'] && $args['friend_user'] instanceof Friends\User ) { |
| 48 |
Friends\Friends::template_loader()->get_template_part( |
| 49 |
'frontend/author-header', |
| 50 |
$args['post_format'], |
| 51 |
$args |
| 52 |
); |
| 53 |
} else { |
| 54 |
Friends\Friends::template_loader()->get_template_part( |
| 55 |
'frontend/main-feed-header', |
| 56 |
$args['post_format'], |
| 57 |
$args |
| 58 |
); |
| 59 |
} |
| 60 |
?> |
| 61 |
|
| 62 |
</section> |
| 63 |
<?php if ( ! is_singular() ) : ?> |
| 64 |
<section class="navbar-section"> |
| 65 |
<form class="input-group input-inline form-autocomplete" action="<?php echo esc_url( home_url( '/friends/' ) ); ?>"> |
| 66 |
<div class="form-autocomplete-input form-input"> |
| 67 |
<div class="has-icon-right"> |
| 68 |
<input class="form-input" type="text" tabindex="2" name="s" placeholder="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Search' ); ?>" value="<?php echo esc_attr( $search ); ?>" id="master-search" autocomplete="off"/> |
| 69 |
<i class="form-icon"></i> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
<ul class="menu" style="display: none"> |
| 73 |
</ul> |
| 74 |
<button class="btn btn-primary input-group-btn"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Search' ); ?></button> |
| 75 |
</form> |
| 76 |
</section> |
| 77 |
<?php endif; ?> |
| 78 |
</header> |
| 79 |
<form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="quick-post-panel" class="<?php echo isset( $_REQUEST['in_reply_to'] ) ? 'open' : ''; ?>"> |
| 80 |
<?php wp_nonce_field( 'friends_publish' ); ?> |
| 81 |
<input type="hidden" name="action" value="friends_publish" /> |
| 82 |
<input type="hidden" name="format" value="status" /> |
| 83 |
<input type="hidden" name="status" value="publish" /> |
| 84 |
<div class="form-group"> |
| 85 |
<div class="has-icon-right"> |
| 86 |
Reply to: <input class="form-input" type="url" name="in_reply_to" placeholder="<?php esc_attr_e( 'In reply to https://...', 'friends' ); ?>" value="<?php echo esc_attr( ! empty( $args['in_reply_to'] ) ? $args['in_reply_to']['url'] : '' ); ?>" id="friends_in_reply_to" autocomplete="off"/> |
| 87 |
<i class="form-icon"></i> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
<div id="in_reply_to_preview"><?php echo wp_kses_post( ! empty( $args['in_reply_to'] ) ? $args['in_reply_to']['html'] : '' ); ?></div> |
| 91 |
<p class="description">Click the mentions to copy them into your reply.</p> |
| 92 |
<div class="form-group<?php echo esc_attr( $args['blocks-everywhere'] ? ' blocks-everywhere iso-editor__loading' : '' ); ?>"> |
| 93 |
<textarea class="form-input friends-status-content<?php echo esc_attr( $args['blocks-everywhere'] ? ' blocks-everywhere-enabled' : '' ); ?>" name="content" rows="5" cols="70" placeholder="<?php echo /* translators: %s is a user display name. */ esc_attr( sprintf( __( "What's on your mind, %s?", 'friends' ), wp_get_current_user()->display_name ) ); ?>"><?php echo wp_kses_post( ! empty( $args['in_reply_to'] ) ? ( $args['blocks-everywhere'] ? '<!-- wp:paragraph -->' . PHP_EOL . '<p>' . $args['in_reply_to']['mention'] . PHP_EOL . '</p>' . PHP_EOL . '<!-- /wp:paragraph -->' . PHP_EOL : $args['in_reply_to']['mention'] . ' ' ) : '' ); ?></textarea><br /> |
| 94 |
<?php |
| 95 |
do_action( 'friends_post_status_form' ); |
| 96 |
?> |
| 97 |
</div> |
| 98 |
|
| 99 |
<div class="form-group col-4"> |
| 100 |
<select name="status" class="form-select"> |
| 101 |
<option value="publish"><?php esc_html_e( 'Visible to everyone', 'friends' ); ?></option> |
| 102 |
<option value="private"><?php esc_html_e( 'Only visible to my friends', 'friends' ); ?></option> |
| 103 |
</select> |
| 104 |
</div> |
| 105 |
|
| 106 |
<div class="form-group col-4"> |
| 107 |
<p> |
| 108 |
<?php |
| 109 |
echo esc_html( |
| 110 |
sprintf( |
| 111 |
// translators: %s is the name of a post format. |
| 112 |
__( 'Post Format: %s', 'friends' ), |
| 113 |
__( 'Status' ) // phpcs:ignore WordPress.WP.I18n.MissingArgDomain |
| 114 |
) |
| 115 |
); |
| 116 |
?> |
| 117 |
</p> |
| 118 |
</div> |
| 119 |
|
| 120 |
<div class="form-group"> |
| 121 |
<button class="btn"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Publish' ); ?></button> |
| 122 |
<a href="#" class="quick-post-panel-toggle"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Cancel' ); ?></a> |
| 123 |
</div> |
| 124 |
</form> |
| 125 |
<?php |
| 126 |
do_action( 'friends_after_header', $args ); |
| 127 |
|