improve admin ui
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 47s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Failing after 51s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m2s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m4s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Successful in 1m3s

This commit is contained in:
André Menrath 2024-12-15 14:08:16 +01:00
parent 6e92f2a5b8
commit 96e0d0937c
3 changed files with 34 additions and 3 deletions

View file

@ -207,3 +207,13 @@ code.event-bridge-for-activitypub-settings-example-url {
.event_bridge_for_activitypub-admin-table-top > a {
display: inline-block;
}
.settings_page_event-bridge-for-activitypub .notice-warning {
background: #fff;
border: 1px solid #c3c4c7;
border-left-width: 4px;
box-shadow: 0 1px 1px rgba(0,0,0,.04);
margin: 5px 15px 2px;
padding: 1px 12px;
border-left-color: #dba617;
}

View file

@ -3,7 +3,7 @@
* Plugin Name: Event Bridge for ActivityPub
* Description: Integrating popular event plugins with the ActivityPub plugin.
* Plugin URI: https://event-federation.eu/
* Version: 0.3.2.4
* Version: 0.3.2.6
* Author: André Menrath
* Author URI: https://graz.social/@linos
* Text Domain: event-bridge-for-activitypub

View file

@ -103,7 +103,7 @@ $current_category_mapping = \get_option( 'event_bridge_for_activitypub_ev
<div class="box">
<h2><?php \esc_html_e( 'Event Sources', 'event-bridge-for-activitypub' ); ?></h2>
<?php
if ( count( $event_plugins_supporting_event_sources ) ) {
if ( ! \Activitypub\is_user_type_disabled( 'blog' ) && count( $event_plugins_supporting_event_sources ) ) {
?>
<table class="form-table">
<tbody>
@ -179,7 +179,7 @@ $current_category_mapping = \get_option( 'event_bridge_for_activitypub_ev
<tbody>
</table>
<?php
} else {
} elseif ( ! \Activitypub\is_user_type_disabled( 'blog' ) ) {
?>
<p><?php esc_html_e( 'You do not have an Event Plugin installed that supports this feature', 'event-bridge-for-activitypub' ); ?></p>
<p><?php esc_html_e( 'The following Event Plugins are supported:', 'event-bridge-for-activitypub' ); ?></p>
@ -191,6 +191,27 @@ $current_category_mapping = \get_option( 'event_bridge_for_activitypub_ev
}
echo '</ul>';
return;
} else {
$activitypub_plugin_data = get_plugin_data( ACTIVITYPUB_PLUGIN_FILE );
$notice = sprintf(
/* translators: 1: The name of the ActivityPub plugin. */
_x(
'In order to use this feature your have to enable the Blog-Actor in the the <a href="%1$s">%2$s settings</a>.',
'admin notice',
'event-bridge-for-activitypub'
),
admin_url( 'options-general.php?page=activitypub&tab=settings' ),
esc_html( $activitypub_plugin_data['Name'] )
);
$allowed_html = array(
'a' => array(
'href' => true,
'title' => true,
),
);
echo '<div class="notice-warning"><p>' . \wp_kses( $notice, $allowed_html ) . '</p></div>';
}
?>
</div>