| @@ -1,13 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Admin header template. | |
| 4 | - * | |
| 5 | - * @package Activitypub | |
| 6 | - */ | |
| 7 | - | |
| 8 | -/* @var array $args Template arguments. */ | |
| 9 | -$args = wp_parse_args( $args ?? array() ); | |
| 2 | +// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable | |
| 10 | 3 | ?> |
| 11 | 4 | <div class="activitypub-settings-header"> |
| 12 | 5 | <div class="activitypub-settings-title-section"> |
| 13 | 6 | <h1><?php \esc_html_e( 'ActivityPub', 'activitypub' ); ?></h1> |
| @@ -12,24 +5,27 @@ | ||
| 12 | 5 | <div class="activitypub-settings-title-section"> |
| 13 | 6 | <h1><?php \esc_html_e( 'ActivityPub', 'activitypub' ); ?></h1> |
| 14 | 7 | </div> |
| 15 | 8 | |
| 16 | - <div class="activitypub-settings-tabs-scroller"> | |
| 17 | - <nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', 'activitypub' ); ?>"> | |
| 18 | - <?php | |
| 19 | - foreach ( $args['tabs'] as $slug => $label ) : | |
| 20 | - $url = add_query_arg( | |
| 21 | - array( 'tab' => 'welcome' !== $slug ? $slug : false ), | |
| 22 | - \admin_url( 'options-general.php?page=activitypub' ) | |
| 23 | - ); | |
| 24 | - ?> | |
| 9 | + <nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', 'activitypub' ); ?>"> | |
| 10 | + <a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub' ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args['welcome'] ); ?>"> | |
| 11 | + <?php \esc_html_e( 'Welcome', 'activitypub' ); ?> | |
| 12 | + </a> | |
| 25 | 13 | |
| 26 | - <a href="<?php echo \esc_url( $url ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args[ $slug ] ); ?>"> | |
| 27 | - <?php echo \esc_html( $label ); ?> | |
| 28 | - </a> | |
| 14 | + <a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub&tab=settings' ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args['settings'] ); ?>"> | |
| 15 | + <?php \esc_html_e( 'Settings', 'activitypub' ); ?> | |
| 16 | + </a> | |
| 29 | 17 | |
| 30 | - <?php | |
| 31 | - endforeach; | |
| 32 | - ?> | |
| 33 | - </nav> | |
| 34 | - </div> | |
| 18 | + <?php if ( ! \Activitypub\is_user_disabled( \Activitypub\Collection\Users::BLOG_USER_ID ) ) : ?> | |
| 19 | + | |
| 20 | + <a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub&tab=blog-profile' ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args['blog-profile'] ); ?>"> | |
| 21 | + <?php \esc_html_e( 'Blog-Profile', 'activitypub' ); ?> | |
| 22 | + </a> | |
| 23 | + | |
| 24 | + <a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub&tab=followers' ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args['followers'] ); ?>"> | |
| 25 | + <?php \esc_html_e( 'Followers', 'activitypub' ); ?> | |
| 26 | + </a> | |
| 27 | + | |
| 28 | + <?php endif; ?> | |
| 29 | + </nav> | |
| 35 | 30 | </div> |
| 31 | +<hr class="wp-header-end"> | |