| 1 |
<?php |
| 2 |
/** |
| 3 |
* Header template for ElasticPress settings page |
| 4 |
* |
| 5 |
* @since 2.1 |
| 6 |
* @package elasticpress |
| 7 |
*/ |
| 8 |
|
| 9 |
use ElasticPress\Elasticsearch; |
| 10 |
use ElasticPress\Screen; |
| 11 |
use ElasticPress\Utils; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; // Exit if accessed directly. |
| 15 |
} |
| 16 |
|
| 17 |
$base_url = ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) ? admin_url( 'network/admin.php?page=' ) : admin_url( 'admin.php?page=' ); |
| 18 |
$is_sync_page = 'sync' === Screen::factory()->get_current_screen(); |
| 19 |
?> |
| 20 |
|
| 21 |
<div class="ep-header-menu"> |
| 22 |
<a href="<?php echo esc_url( $base_url . 'elasticpress' ); ?>"><img width="150" src="<?php echo esc_url( plugins_url( '/images/logo.svg', dirname( __DIR__ ) ) ); ?>"></a> |
| 23 |
|
| 24 |
<?php if ( Utils\is_top_level_admin_context() ) : ?> |
| 25 |
<div class="icons"> |
| 26 |
<span class="sync-status"></span> |
| 27 |
<?php if ( $is_sync_page ) : ?> |
| 28 |
|
| 29 |
<a class="dashicons resume-sync dashicons-controls-play" title ="<?php esc_attr_e( 'Resume Sync', 'elasticpress' ); ?>" aria-label="<?php esc_attr_e( 'Resume Sync', 'elasticpress' ); ?>"></a> |
| 30 |
<a class="dashicons cancel-sync dashicons-no" title="<?php esc_attr_e( 'Cancel Sync', 'elasticpress' ); ?>" aria-label="<?php esc_attr_e( 'Cancel Sync', 'elasticpress' ); ?>"></a> |
| 31 |
<?php endif; ?> |
| 32 |
<?php if ( Elasticsearch::factory()->get_elasticsearch_version() && defined( 'EP_DASHBOARD_SYNC' ) && EP_DASHBOARD_SYNC && ! $is_sync_page ) : ?> |
| 33 |
<a |
| 34 |
class="dashicons start-sync dashicons-update" |
| 35 |
title="<?php esc_attr_e( 'Sync Page', 'elasticpress' ); ?>" |
| 36 |
aria-label="<?php esc_attr_e( 'Sync Page', 'elasticpress' ); ?>" |
| 37 |
<?php echo ( $is_sync_page ) ? '' : 'href="' . esc_url( $base_url . 'elasticpress-sync' ) . '"'; ?> |
| 38 |
></a> |
| 39 |
<?php endif; ?> |
| 40 |
<a href="<?php echo esc_url( $base_url . 'elasticpress-settings' ); ?>" class="dashicons dashicons-admin-generic" title="<?php esc_attr_e( 'Settings Page', 'elasticpress' ); ?>" aria-label="<?php esc_attr_e( 'Settings Page', 'elasticpress' ); ?>"></a> |
| 41 |
</div> |
| 42 |
|
| 43 |
<div class="progress-bar"></div> |
| 44 |
<?php endif; ?> |
| 45 |
</div> |
| 46 |
|
| 47 |
<hr id="ep-wp-header-end" class="wp-header-end"> |
| 48 |
|