feat: dienst-ID im Dienste-tab anzeigen + shortcode-hilfe fuer text/style (v1.4.9)

- Unter jedem dienstnamen wird jetzt die auto-erzeugte ID angezeigt
  (z. B. "ID: eigenes-matomo") - kopierbar, fuer den consent-shortcode.
  Bei neuen diensten live-vorschau aus dem namen (slugify, spiegelt
  sanitize_title); bei gespeicherten die stabile ID.
- Shortcode-tab: [content_blocker_consent] erklaert jetzt id/text/style einzeln
  mit beispielen (button vs. link).

+ i18n DE/EN ergaenzt (131 strings). version 1.4.9.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
s4luorth
2026-06-08 14:00:22 +02:00
parent d0ced7b179
commit c796400492
7 changed files with 83 additions and 12 deletions

View File

@@ -384,12 +384,33 @@ class CB_Settings {
padding: 4px 6px;
color: #50575e;
}
.cb-admin-wrap .cb-service-title {
.cb-admin-wrap .cb-service-headmain {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 1px;
}
.cb-admin-wrap .cb-service-title {
font-weight: 600;
cursor: pointer;
user-select: none;
}
.cb-admin-wrap .cb-service-idline {
font-size: 11px;
color: #787c82;
user-select: text;
}
.cb-admin-wrap .cb-service-idline code {
font-size: 11px;
background: #f0f0f1;
padding: 1px 5px;
border-radius: 3px;
}
.cb-admin-wrap .cb-service-idline:empty,
.cb-admin-wrap .cb-service-id:empty::before {
content: "";
}
.cb-admin-wrap .cb-service-grid {
display: grid;
grid-template-columns: 1fr 1fr;
@@ -556,7 +577,10 @@ class CB_Settings {
<div class="cb-service-box" data-cb-index="<?php echo $idx; ?>">
<div class="cb-service-head">
<button type="button" class="cb-service-toggle" aria-expanded="false" aria-label="<?php esc_attr_e( 'Details anzeigen/ausblenden', 'gdpr-content-blocker' ); ?>">▸</button>
<span class="cb-service-title"><?php echo esc_html( $headname ); ?></span>
<span class="cb-service-headmain">
<span class="cb-service-title"><?php echo esc_html( $headname ); ?></span>
<span class="cb-service-idline"><?php esc_html_e( 'ID:', 'gdpr-content-blocker' ); ?> <code class="cb-service-id"><?php echo esc_html( $id ); ?></code></span>
</span>
<label class="cb-switch" title="<?php esc_attr_e( 'Blocker aktiv/inaktiv', 'gdpr-content-blocker' ); ?>">
<input type="checkbox" class="cb-input-enabled" name="cb_services[<?php echo $idx; ?>][enabled]"
@@ -676,8 +700,13 @@ class CB_Settings {
</tr>
<tr>
<td style="vertical-align:top;"><strong><?php esc_html_e( 'Einwilligungs-Button (für reine Skript-Dienste)', 'gdpr-content-blocker' ); ?></strong><br>
<?php echo $code( '[content_blocker_consent id="youtube" text="…"]' ); ?></td>
<td><?php esc_html_e( 'Erteilt die Einwilligung für einen Dienst und lädt die Seite neu. Gedacht für Dienste, die nur Skripte blockieren und keinen sichtbaren Platzhalter haben. Optionen: id="…" (Dienst-ID, Pflicht), text="…", style="button|link".', 'gdpr-content-blocker' ); ?></td>
<?php echo $code( '[content_blocker_consent id="eigenes-matomo" text="Statistik aktivieren"]' ); ?><br>
<?php echo $code( '[content_blocker_consent id="eigenes-matomo" text="Aktivieren" style="link"]' ); ?></td>
<td><?php esc_html_e( 'Erteilt die Einwilligung für einen Dienst (z. B. einen reinen Skript-Blocker ohne sichtbaren Platzhalter) und lädt die Seite neu, sodass das Skript freigegeben wird.', 'gdpr-content-blocker' ); ?>
<br><br>
<strong><?php echo esc_html( 'id' ); ?></strong> – <?php esc_html_e( 'Pflicht. Die ID des Dienstes (siehe Tab „Dienste", klein unter dem Namen), z. B. eigenes-matomo.', 'gdpr-content-blocker' ); ?><br>
<strong><?php echo esc_html( 'text' ); ?></strong> – <?php esc_html_e( 'Die Beschriftung der Schaltfläche bzw. des Links, z. B. text="Statistik aktivieren".', 'gdpr-content-blocker' ); ?><br>
<strong><?php echo esc_html( 'style' ); ?></strong> – <?php esc_html_e( 'style="button" zeigt eine Schaltfläche (Standard), style="link" einen schlichten Textlink.', 'gdpr-content-blocker' ); ?></td>
</tr>
</tbody>
</table>