settings: moved slug into const var

This commit is contained in:
ruru4143 2024-07-18 16:23:34 +02:00
parent d0e63fc859
commit 098b1f578b
2 changed files with 6 additions and 5 deletions

View file

@ -36,6 +36,7 @@ class Settings_Page {
*/
const static = 'Activitypub_Event_Extensions\Admin\Settings_Page';
const settings_slug = 'activitypub-events';
/**
* Warning if the plugin is Active and the ActivityPub plugin is not.

View file

@ -3,14 +3,14 @@ currently reusing activitypub classes which is kinda nice, because it has a cons
-->
<div class="activitypub-settings-header">
<div class="activitypub-settings-title-section">
<h1><?php \esc_html_e( 'Activitypub Events Plugin', 'activitypub-events' ); ?></h1>
<h1><?php \esc_html_e( 'Activitypub Events Plugin', $args['slug'] ); ?></h1>
</div>
<nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', 'activitypub-events' ); ?>">
<nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', $args['slug'] ); ?>">
<!-- todo loop through settings pages of Extractors -->
<?php foreach ( $args as $slug => $plugin ) { ?>
<a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub-events&tab=' . $slug ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $plugin['active'] ? 'active' : '' ); ?>">
<?php \esc_html_e( $plugin['name'], 'activitypub-events' ); ?> <!-- Todo better name handling -->
<?php foreach ( $args['options'] as $tabslug => $plugin ) { ?>
<a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page='. $args['slug'] .'&tab=' . $tabslug ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $plugin['active'] ? 'active' : '' ); ?>">
<?php \esc_html_e( $plugin['name'], $args['slug'] ); ?> <!-- Todo better name handling -->
</a>
<?php } ?>