Update from Git Manager GUI
This commit is contained in:
111
templates/admin/article-form.php
Normal file
111
templates/admin/article-form.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
$is_edit = isset( $article ) && $article;
|
||||
$page_title = $is_edit ? 'Artikel bearbeiten' : 'Neuer Artikel';
|
||||
$article_id = $is_edit ? $article->ID : 0;
|
||||
$a_title = $is_edit ? $article->post_title : '';
|
||||
$a_content = $is_edit ? $article->post_content : '';
|
||||
$a_excerpt = $is_edit ? $article->post_excerpt : '';
|
||||
$a_wiki_id = $is_edit ? (int)get_post_meta($article_id,'_wmw_wiki_id',true) : $wiki_id;
|
||||
$a_order = $is_edit ? (int)get_post_meta($article_id,'_wmw_order',true) : 0;
|
||||
$a_status = $is_edit ? $article->post_status : 'publish';
|
||||
$a_cats = $is_edit ? wp_list_pluck((array)get_the_terms($article_id,'wmw_category'),'term_id') : array();
|
||||
$a_tags = $is_edit ? implode(', ', wp_list_pluck((array)get_the_terms($article_id,'wmw_tag'),'name')) : '';
|
||||
$all_cats = get_terms(array('taxonomy'=>'wmw_category','hide_empty'=>false));
|
||||
?>
|
||||
<div class="wrap wmw-admin-wrap">
|
||||
<div class="wmw-admin-header wmw-admin-header--small">
|
||||
<div class="wmw-admin-header__logo">
|
||||
<span class="wmw-admin-header__icon">📄</span>
|
||||
<div>
|
||||
<h1><?php echo esc_html($page_title); ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-articles' . ($a_wiki_id ? '&wiki_id='.$a_wiki_id : '')); ?>" class="button">← Zurück</a>
|
||||
</div>
|
||||
|
||||
<div class="wmw-form-layout">
|
||||
<div class="wmw-form-main">
|
||||
<div class="wmw-card">
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Artikeltitel <span class="required">*</span></label>
|
||||
<input type="text" id="wmw_a_title" name="wmw_a_title" class="large-text" value="<?php echo esc_attr($a_title); ?>" placeholder="Titel des Artikels…">
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Inhalt</label>
|
||||
<?php
|
||||
wp_editor( $a_content, 'wmw_content', array(
|
||||
'textarea_name' => 'wmw_content',
|
||||
'media_buttons' => true,
|
||||
'textarea_rows' => 20,
|
||||
'tinymce' => true,
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-form-sidebar">
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">📁 Zuordnung</h3>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Wiki <span class="required">*</span></label>
|
||||
<select id="wmw_a_wiki_id" name="wmw_a_wiki_id" class="widefat">
|
||||
<option value="">— Wiki wählen —</option>
|
||||
<?php foreach( $wikis as $w ): ?>
|
||||
<option value="<?php echo $w->ID; ?>" <?php selected($a_wiki_id,$w->ID); ?>>
|
||||
<?php echo wmw_get_wiki_icon($w->ID); ?> <?php echo esc_html($w->post_title); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Kategorien</label>
|
||||
<div class="wmw-cat-list">
|
||||
<?php foreach( (array)$all_cats as $cat ): if(is_wp_error($cat)) continue; ?>
|
||||
<label class="wmw-checkbox">
|
||||
<input type="checkbox" name="wmw_categories[]" value="<?php echo $cat->term_id; ?>" <?php checked(in_array($cat->term_id, $a_cats)); ?>>
|
||||
<?php echo esc_html($cat->name); ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-categories'); ?>" class="description">+ Neue Kategorie</a>
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Tags <span class="description">(kommagetrennt)</span></label>
|
||||
<input type="text" id="wmw_a_tags" name="wmw_a_tags" class="widefat" value="<?php echo esc_attr($a_tags); ?>" placeholder="tag1, tag2, tag3">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">⚙️ Optionen</h3>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Status</label>
|
||||
<select id="wmw_a_status" name="wmw_a_status" class="widefat">
|
||||
<option value="publish" <?php selected($a_status,'publish'); ?>>✅ Veröffentlicht</option>
|
||||
<option value="draft" <?php selected($a_status,'draft'); ?>>📝 Entwurf</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Reihenfolge</label>
|
||||
<input type="number" id="wmw_a_order" name="wmw_a_order" class="small-text" value="<?php echo $a_order; ?>" min="0">
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Kurzbeschreibung</label>
|
||||
<textarea id="wmw_a_excerpt" name="wmw_a_excerpt" rows="3" class="widefat"><?php echo esc_textarea($a_excerpt); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-card">
|
||||
<button type="button" id="wmw-save-article" class="button button-primary button-large wmw-btn-full"
|
||||
data-id="<?php echo $article_id; ?>">
|
||||
<?php echo $is_edit ? '💾 Artikel speichern' : '🚀 Artikel erstellen'; ?>
|
||||
</button>
|
||||
<?php if ( $is_edit ) : ?>
|
||||
<a href="<?php echo get_permalink($article_id); ?>" target="_blank" class="button button-large wmw-btn-full wmw-mt-sm">
|
||||
🔗 Im Frontend ansehen
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
85
templates/admin/article-list.php
Normal file
85
templates/admin/article-list.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||
<div class="wrap wmw-admin-wrap">
|
||||
<div class="wmw-admin-header wmw-admin-header--small">
|
||||
<div class="wmw-admin-header__logo">
|
||||
<span class="wmw-admin-header__icon">📋</span>
|
||||
<div>
|
||||
<h1>Wiki-Artikel</h1>
|
||||
<p><?php echo count($articles); ?> Artikel</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wmw-admin-header__actions">
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-new-article' . ($wiki_filter ? '&wiki_id='.$wiki_filter : '')); ?>" class="button button-primary">➕ Neuer Artikel</a>
|
||||
<a href="<?php echo admin_url('admin.php?page=wp-multi-wiki'); ?>" class="button">← Dashboard</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filter by Wiki -->
|
||||
<div class="wmw-filter-bar">
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-articles'); ?>" class="button <?php echo !$wiki_filter ? 'button-primary' : ''; ?>">Alle Wikis</a>
|
||||
<?php foreach( $wikis as $w ): ?>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-articles&wiki_id='.$w->ID); ?>"
|
||||
class="button <?php echo $wiki_filter == $w->ID ? 'button-primary' : ''; ?>"
|
||||
style="<?php echo $wiki_filter == $w->ID ? '--wiki-color:'.wmw_get_wiki_color($w->ID) : ''; ?>">
|
||||
<?php echo wmw_get_wiki_icon($w->ID); ?> <?php echo esc_html($w->post_title); ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( empty($articles) ): ?>
|
||||
<div class="wmw-empty-state">
|
||||
<div class="wmw-empty-state__icon">📄</div>
|
||||
<h2>Keine Artikel vorhanden</h2>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-new-article' . ($wiki_filter ? '&wiki_id='.$wiki_filter : '')); ?>" class="button button-primary button-hero">Ersten Artikel erstellen</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="wmw-article-table-wrap">
|
||||
<input type="text" id="wmw-filter-articles" placeholder="🔍 Artikel filtern…" class="regular-text wmw-mb">
|
||||
<table class="wp-list-table widefat fixed striped wmw-article-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:40%">Titel</th>
|
||||
<th>Wiki</th>
|
||||
<th>Kategorien</th>
|
||||
<th>Status</th>
|
||||
<th>Reihenfolge</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach( $articles as $article ):
|
||||
$art_wiki = wmw_get_article_wiki($article->ID);
|
||||
$cats = get_the_terms($article->ID,'wmw_category');
|
||||
$cats_str = $cats && !is_wp_error($cats) ? implode(', ', wp_list_pluck($cats,'name')) : '—';
|
||||
$order = (int)get_post_meta($article->ID,'_wmw_order',true);
|
||||
?>
|
||||
<tr data-title="<?php echo esc_attr(strtolower($article->post_title)); ?>">
|
||||
<td>
|
||||
<strong><a href="<?php echo admin_url('admin.php?page=wmw-edit-article&id='.$article->ID); ?>"><?php echo esc_html($article->post_title); ?></a></strong>
|
||||
<div class="row-actions">
|
||||
<span><a href="<?php echo admin_url('admin.php?page=wmw-edit-article&id='.$article->ID); ?>">Bearbeiten</a></span> |
|
||||
<span><a href="<?php echo get_permalink($article->ID); ?>" target="_blank">Ansehen</a></span> |
|
||||
<span><a href="#" class="wmw-delete-article" data-id="<?php echo $article->ID; ?>" style="color:#a00">Löschen</a></span>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo $art_wiki ? wmw_get_wiki_icon($art_wiki->ID).' '.esc_html($art_wiki->post_title) : '—'; ?></td>
|
||||
<td><?php echo esc_html($cats_str); ?></td>
|
||||
<td>
|
||||
<?php if($article->post_status==='publish'): ?>
|
||||
<span class="wmw-badge wmw-badge--green">Veröffentlicht</span>
|
||||
<?php else: ?>
|
||||
<span class="wmw-badge wmw-badge--gray">Entwurf</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo $order; ?></td>
|
||||
<td>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-edit-article&id='.$article->ID); ?>" class="button button-small">✏️</a>
|
||||
<a href="#" class="button button-small wmw-delete-article" data-id="<?php echo $article->ID; ?>">🗑️</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
45
templates/admin/categories.php
Normal file
45
templates/admin/categories.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
$terms = get_terms(array('taxonomy'=>'wmw_category','hide_empty'=>false,'orderby'=>'name','order'=>'ASC'));
|
||||
?>
|
||||
<div class="wrap wmw-admin-wrap">
|
||||
<div class="wmw-admin-header wmw-admin-header--small">
|
||||
<div class="wmw-admin-header__logo">
|
||||
<span class="wmw-admin-header__icon">🏷️</span>
|
||||
<div><h1>Wiki-Kategorien</h1></div>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('admin.php?page=wp-multi-wiki'); ?>" class="button">← Dashboard</a>
|
||||
</div>
|
||||
<div class="wmw-form-layout">
|
||||
<div class="wmw-form-main">
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">Vorhandene Kategorien</h3>
|
||||
<?php if(empty($terms) || is_wp_error($terms)): ?>
|
||||
<p class="description">Noch keine Kategorien. Füge unten deine erste hinzu.</p>
|
||||
<?php else: ?>
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead><tr><th>Name</th><th>Slug</th><th>Artikel</th><th>Aktionen</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach($terms as $term): ?>
|
||||
<tr>
|
||||
<td><strong><?php echo esc_html($term->name); ?></strong></td>
|
||||
<td><?php echo esc_html($term->slug); ?></td>
|
||||
<td><?php echo $term->count; ?></td>
|
||||
<td>
|
||||
<a href="<?php echo admin_url('edit-tags.php?action=edit&taxonomy=wmw_category&tag_ID='.$term->term_id); ?>" class="button button-small">✏️ Bearbeiten</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wmw-form-sidebar">
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">➕ Neue Kategorie</h3>
|
||||
<p><a href="<?php echo admin_url('edit-tags.php?taxonomy=wmw_category'); ?>" class="button button-primary wmw-btn-full">Kategorien in WordPress verwalten</a></p>
|
||||
<p class="description">Kategorien können über die Standard-WordPress-Taxonomieseite erstellt und bearbeitet werden.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
147
templates/admin/dashboard.php
Normal file
147
templates/admin/dashboard.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||
<div class="wrap wmw-admin-wrap">
|
||||
|
||||
<div class="wmw-admin-header">
|
||||
<div class="wmw-admin-header__logo">
|
||||
<span class="wmw-admin-header__icon">📚</span>
|
||||
<div>
|
||||
<h1>WP Multi Wiki</h1>
|
||||
<p>Verwalte alle deine Plugin-Wikis an einem Ort.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wmw-admin-header__actions">
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-new-wiki'); ?>" class="button button-primary wmw-btn-lg">
|
||||
➕ Neues Wiki erstellen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stats Bar -->
|
||||
<div class="wmw-stats-bar">
|
||||
<div class="wmw-stat">
|
||||
<span class="wmw-stat__num"><?php echo count($wikis); ?></span>
|
||||
<span class="wmw-stat__label">Wikis</span>
|
||||
</div>
|
||||
<div class="wmw-stat">
|
||||
<span class="wmw-stat__num"><?php echo $total_articles; ?></span>
|
||||
<span class="wmw-stat__label">Artikel gesamt</span>
|
||||
</div>
|
||||
<div class="wmw-stat">
|
||||
<span class="wmw-stat__num"><?php echo wp_count_terms('wmw_category'); ?></span>
|
||||
<span class="wmw-stat__label">Kategorien</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick Search -->
|
||||
<div class="wmw-admin-search-bar">
|
||||
<input type="text" id="wmw-filter-wikis" placeholder="🔍 Wikis filtern…" class="regular-text">
|
||||
</div>
|
||||
|
||||
<?php if ( empty( $wikis ) ) : ?>
|
||||
<div class="wmw-empty-state">
|
||||
<div class="wmw-empty-state__icon">📖</div>
|
||||
<h2>Noch keine Wikis vorhanden</h2>
|
||||
<p>Erstelle dein erstes Wiki für dein Plugin!</p>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-new-wiki'); ?>" class="button button-primary button-hero">
|
||||
Erstes Wiki erstellen
|
||||
</a>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
|
||||
<div class="wmw-wiki-grid" id="wmw-wiki-grid">
|
||||
<?php foreach ( $wikis as $wiki ) :
|
||||
$wiki_id = $wiki->ID;
|
||||
$articles = wmw_get_articles( $wiki_id );
|
||||
$article_count = count( $articles );
|
||||
$icon = wmw_get_wiki_icon( $wiki_id );
|
||||
$color = wmw_get_wiki_color( $wiki_id );
|
||||
$version = get_post_meta( $wiki_id, '_wmw_version', true ) ?: '1.0.0';
|
||||
$edit_url = admin_url( 'admin.php?page=wmw-edit-wiki&id=' . $wiki_id );
|
||||
$new_art_url = admin_url( 'admin.php?page=wmw-new-article&wiki_id=' . $wiki_id );
|
||||
$articles_url = admin_url( 'admin.php?page=wmw-articles&wiki_id=' . $wiki_id );
|
||||
$view_url = get_permalink( $wiki_id );
|
||||
?>
|
||||
<div class="wmw-wiki-card" data-title="<?php echo esc_attr( strtolower( $wiki->post_title ) ); ?>" style="--wiki-color: <?php echo esc_attr($color); ?>">
|
||||
<div class="wmw-wiki-card__header">
|
||||
<span class="wmw-wiki-card__icon"><?php echo $icon; ?></span>
|
||||
<div class="wmw-wiki-card__meta">
|
||||
<span class="wmw-wiki-card__version">v<?php echo esc_html($version); ?></span>
|
||||
<span class="wmw-wiki-card__status <?php echo $wiki->post_status === 'publish' ? 'is-live' : 'is-draft'; ?>">
|
||||
<?php echo $wiki->post_status === 'publish' ? '● Live' : '○ Entwurf'; ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="wmw-wiki-card__title"><?php echo esc_html( $wiki->post_title ); ?></h3>
|
||||
<?php if ( $wiki->post_excerpt ) : ?>
|
||||
<p class="wmw-wiki-card__desc"><?php echo esc_html( wp_trim_words( $wiki->post_excerpt, 12 ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
<div class="wmw-wiki-card__stats">
|
||||
<span>📄 <?php echo $article_count; ?> Artikel</span>
|
||||
</div>
|
||||
<div class="wmw-wiki-card__actions">
|
||||
<a href="<?php echo esc_url($edit_url); ?>" class="button button-small">✏️ Bearbeiten</a>
|
||||
<a href="<?php echo esc_url($articles_url); ?>" class="button button-small">📋 Artikel</a>
|
||||
<a href="<?php echo esc_url($new_art_url); ?>" class="button button-small button-primary">➕ Artikel</a>
|
||||
<a href="<?php echo esc_url($view_url); ?>" target="_blank" class="button button-small">🔗 Ansehen</a>
|
||||
<button class="button button-small wmw-delete-wiki" data-id="<?php echo $wiki_id; ?>" data-title="<?php echo esc_attr($wiki->post_title); ?>">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Shortcode Reference -->
|
||||
<div class="wmw-shortcode-ref">
|
||||
<h3>📋 Shortcode-Referenz</h3>
|
||||
<div class="wmw-shortcode-grid">
|
||||
<div class="wmw-shortcode-item">
|
||||
<code>[wmw_wiki_list]</code>
|
||||
<span>Alle Wikis als Karten anzeigen</span>
|
||||
</div>
|
||||
<div class="wmw-shortcode-item">
|
||||
<code>[wmw_wiki id="1"]</code>
|
||||
<span>Ein Wiki mit allen Artikeln</span>
|
||||
</div>
|
||||
<div class="wmw-shortcode-item">
|
||||
<code>[wmw_wiki slug="mein-plugin"]</code>
|
||||
<span>Wiki per Slug einbinden</span>
|
||||
</div>
|
||||
<div class="wmw-shortcode-item">
|
||||
<code>[wmw_search wiki_id="1"]</code>
|
||||
<span>Suchfeld für ein Wiki</span>
|
||||
</div>
|
||||
<div class="wmw-shortcode-item">
|
||||
<code>[wmw_article id="5"]</code>
|
||||
<span>Einzelnen Artikel einbetten</span>
|
||||
</div>
|
||||
<div class="wmw-shortcode-item">
|
||||
<code>[wmw_breadcrumb]</code>
|
||||
<span>Breadcrumb-Navigation</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Suchindex -->
|
||||
<div class="wmw-shortcode-ref" style="margin-top:16px">
|
||||
<h3>🔍 Suchindex</h3>
|
||||
<p class="description">Falls die Suche keine Ergebnisse liefert (z.B. nach einem Gitea-Import), den Index neu aufbauen.</p>
|
||||
<button id="wmw-reindex-btn" class="button button-secondary">🔄 Suchindex neu aufbauen</button>
|
||||
<span id="wmw-reindex-result" style="margin-left:12px;font-weight:600"></span>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
$('#wmw-reindex-btn').on('click', function(){
|
||||
var $btn = $(this);
|
||||
var $res = $('#wmw-reindex-result');
|
||||
$btn.prop('disabled', true).text('⏳ Läuft…');
|
||||
$.post(wmwAdmin.ajaxUrl, { action: 'wmw_reindex', nonce: wmwAdmin.nonce }, function(res){
|
||||
$btn.prop('disabled', false).text('🔄 Suchindex neu aufbauen');
|
||||
if(res.success){ $res.css('color','#2e7d32').text('✅ ' + res.data.message); }
|
||||
else { $res.css('color','#c62828').text('❌ Fehler'); }
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
254
templates/admin/gitea-importer.php
Normal file
254
templates/admin/gitea-importer.php
Normal file
@@ -0,0 +1,254 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin-Seite: Gitea Wiki Importer
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
$wikis = wmw_get_wikis();
|
||||
$result = null;
|
||||
$preview = null;
|
||||
|
||||
// ── Handle Preview ────────────────────────────────────────────────────────────
|
||||
if ( isset( $_POST['wmw_gitea_preview'] ) && wp_verify_nonce( $_POST['wmw_gitea_nonce'] ?? '', 'wmw_gitea_import' ) && current_user_can( 'manage_options' ) ) {
|
||||
|
||||
$gitea_url = esc_url_raw( $_POST['gitea_url'] ?? '' );
|
||||
$owner = sanitize_text_field( $_POST['gitea_owner'] ?? '' );
|
||||
$repo = sanitize_text_field( $_POST['gitea_repo'] ?? '' );
|
||||
$token = sanitize_text_field( $_POST['gitea_token'] ?? '' );
|
||||
|
||||
if ( $gitea_url && $owner && $repo ) {
|
||||
$importer = new WMW_Gitea_Importer( $gitea_url, $owner, $repo, $token );
|
||||
$preview = $importer->list_pages();
|
||||
}
|
||||
}
|
||||
|
||||
// ── Handle Import ─────────────────────────────────────────────────────────────
|
||||
if ( isset( $_POST['wmw_gitea_import'] ) && wp_verify_nonce( $_POST['wmw_gitea_nonce'] ?? '', 'wmw_gitea_import' ) && current_user_can( 'manage_options' ) ) {
|
||||
|
||||
$gitea_url = esc_url_raw( $_POST['gitea_url'] ?? '' );
|
||||
$owner = sanitize_text_field( $_POST['gitea_owner'] ?? '' );
|
||||
$repo = sanitize_text_field( $_POST['gitea_repo'] ?? '' );
|
||||
$token = sanitize_text_field( $_POST['gitea_token'] ?? '' );
|
||||
$wiki_id = absint( $_POST['wmw_wiki_id'] ?? 0 );
|
||||
$skip_pages = array_map( 'sanitize_text_field', array_filter( explode( "\n", str_replace( "\r", '', $_POST['skip_pages'] ?? '' ) ) ) );
|
||||
$update_exist = isset( $_POST['update_existing'] );
|
||||
|
||||
if ( $gitea_url && $owner && $repo && $wiki_id ) {
|
||||
$importer = new WMW_Gitea_Importer( $gitea_url, $owner, $repo, $token );
|
||||
$result = $importer->import_all( $wiki_id, $skip_pages, $update_exist );
|
||||
} else {
|
||||
$result = array( 'errors' => array( 'Bitte alle Pflichtfelder ausfüllen.' ) );
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="wrap wmw-admin-wrap">
|
||||
|
||||
<div class="wmw-admin-header">
|
||||
<div class="wmw-admin-header__logo">
|
||||
<span class="wmw-admin-header__icon">🐙</span>
|
||||
<div>
|
||||
<h1>Gitea Wiki Importer</h1>
|
||||
<p>Importiere Wiki-Seiten direkt aus deiner Gitea-Instanz in WP Multi Wiki.</p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('admin.php?page=wp-multi-wiki'); ?>" class="button">← Dashboard</a>
|
||||
</div>
|
||||
|
||||
<?php if ( $result !== null ) : ?>
|
||||
<div class="wmw-import-result <?php echo empty($result['errors']) ? 'wmw-import-result--success' : 'wmw-import-result--warn'; ?>">
|
||||
<h3>📊 Import-Ergebnis</h3>
|
||||
<div class="wmw-import-stats">
|
||||
<div class="wmw-import-stat">
|
||||
<span class="wmw-import-stat__num"><?php echo $result['imported']; ?></span>
|
||||
<span>Neu importiert</span>
|
||||
</div>
|
||||
<div class="wmw-import-stat">
|
||||
<span class="wmw-import-stat__num"><?php echo $result['updated']; ?></span>
|
||||
<span>Aktualisiert</span>
|
||||
</div>
|
||||
<div class="wmw-import-stat">
|
||||
<span class="wmw-import-stat__num"><?php echo $result['skipped']; ?></span>
|
||||
<span>Übersprungen</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( ! empty( $result['errors'] ) ) : ?>
|
||||
<div class="wmw-import-errors">
|
||||
<strong>⚠️ Fehler:</strong>
|
||||
<ul><?php foreach( $result['errors'] as $e ): ?><li><?php echo esc_html($e); ?></li><?php endforeach; ?></ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( isset($_POST['wmw_wiki_id']) ) : ?>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-articles&wiki_id='.absint($_POST['wmw_wiki_id'])); ?>" class="button button-primary" style="margin-top:12px">
|
||||
📋 Importierte Artikel ansehen
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wmw-form-layout">
|
||||
<div class="wmw-form-main">
|
||||
|
||||
<form method="post" id="wmw-gitea-form">
|
||||
<?php wp_nonce_field( 'wmw_gitea_import', 'wmw_gitea_nonce' ); ?>
|
||||
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">🔗 Gitea-Quelle</h3>
|
||||
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Gitea-Server URL <span class="required">*</span></label>
|
||||
<input type="url" name="gitea_url" class="large-text" required
|
||||
value="<?php echo esc_attr( $_POST['gitea_url'] ?? 'https://git.viper.ipv64.net' ); ?>"
|
||||
placeholder="https://git.viper.ipv64.net">
|
||||
<p class="description">Nur die Basis-URL deiner Gitea-Instanz (ohne /api oder /wiki).</p>
|
||||
</div>
|
||||
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:16px">
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Owner / Nutzer <span class="required">*</span></label>
|
||||
<input type="text" name="gitea_owner" class="regular-text" required
|
||||
value="<?php echo esc_attr( $_POST['gitea_owner'] ?? 'M_Viper' ); ?>"
|
||||
placeholder="M_Viper">
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Repository <span class="required">*</span></label>
|
||||
<input type="text" name="gitea_repo" class="regular-text" required
|
||||
value="<?php echo esc_attr( $_POST['gitea_repo'] ?? 'NexusLobby' ); ?>"
|
||||
placeholder="NexusLobby">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Access Token <span class="description">(nur für private Repos nötig)</span></label>
|
||||
<input type="password" name="gitea_token" class="regular-text"
|
||||
value="<?php echo esc_attr( $_POST['gitea_token'] ?? '' ); ?>"
|
||||
placeholder="gitea_token_…">
|
||||
<p class="description">Token unter Gitea → Einstellungen → Anwendungen → Access Token erstellen.</p>
|
||||
</div>
|
||||
|
||||
<button type="submit" name="wmw_gitea_preview" class="button button-secondary">
|
||||
🔍 Seiten vorab laden
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<?php if ( $preview !== null ) : ?>
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">📋 Gefundene Wiki-Seiten</h3>
|
||||
<?php if ( is_wp_error( $preview ) ) : ?>
|
||||
<div class="notice notice-error inline"><p>❌ <?php echo esc_html( $preview->get_error_message() ); ?></p></div>
|
||||
<?php elseif ( empty( $preview ) ) : ?>
|
||||
<p class="description">Keine Seiten gefunden.</p>
|
||||
<?php else : ?>
|
||||
<div class="wmw-preview-grid">
|
||||
<?php foreach( $preview as $p ): ?>
|
||||
<div class="wmw-preview-item">
|
||||
<span class="wmw-preview-item__icon">📄</span>
|
||||
<span class="wmw-preview-item__title"><?php echo esc_html($p['title']); ?></span>
|
||||
<span class="wmw-preview-item__date"><?php echo esc_html(substr($p['last_updated'],0,10)); ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<p class="description" style="margin-top:10px">✅ <?php echo count($preview); ?> Seiten bereit zum Import.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">🎯 Import-Ziel</h3>
|
||||
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Ziel-Wiki <span class="required">*</span></label>
|
||||
<select name="wmw_wiki_id" class="regular-text" required>
|
||||
<option value="">— Wiki wählen —</option>
|
||||
<?php foreach( $wikis as $w ): ?>
|
||||
<option value="<?php echo $w->ID; ?>" <?php selected( absint($_POST['wmw_wiki_id'] ?? 0), $w->ID ); ?>>
|
||||
<?php echo wmw_get_wiki_icon($w->ID); ?> <?php echo esc_html($w->post_title); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<p class="description">Alle Seiten werden als Artikel in diesem Wiki angelegt.</p>
|
||||
</div>
|
||||
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Seiten überspringen <span class="description">(eine pro Zeile)</span></label>
|
||||
<textarea name="skip_pages" rows="5" class="large-text"><?php
|
||||
echo esc_textarea( $_POST['skip_pages'] ?? "Home\n_Sidebar" );
|
||||
?></textarea>
|
||||
<p class="description">Diese Seiten werden nicht importiert (z.B. Home, _Sidebar).</p>
|
||||
</div>
|
||||
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-checkbox">
|
||||
<input type="checkbox" name="update_existing" value="1" <?php checked( isset($_POST['update_existing']) ); ?>>
|
||||
Bereits vorhandene Artikel aktualisieren
|
||||
</label>
|
||||
<p class="description" style="margin-left:22px">Wenn deaktiviert, werden bestehende Artikel übersprungen.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-card">
|
||||
<button type="submit" name="wmw_gitea_import" class="button button-primary button-large" style="width:100%">
|
||||
🚀 Wiki jetzt importieren
|
||||
</button>
|
||||
<p class="description" style="text-align:center;margin-top:8px">
|
||||
Der Import kann je nach Wiki-Größe einige Sekunden dauern.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="wmw-form-sidebar">
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">ℹ️ Wie funktioniert's?</h3>
|
||||
<ol style="margin:0;padding-left:18px;font-size:13px;line-height:2">
|
||||
<li>Gitea-URL, Owner & Repo eingeben</li>
|
||||
<li>Auf <strong>Seiten vorab laden</strong> klicken</li>
|
||||
<li>Ziel-Wiki auswählen</li>
|
||||
<li>Seiten auswählen die übersprungen werden sollen</li>
|
||||
<li><strong>Importieren</strong> klicken</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">🔐 Private Repos</h3>
|
||||
<p style="font-size:13px">Für private Repositories brauchst du einen <strong>Access Token</strong>:</p>
|
||||
<ol style="margin:0;padding-left:18px;font-size:13px;line-height:2">
|
||||
<li>In Gitea anmelden</li>
|
||||
<li>Einstellungen → Anwendungen</li>
|
||||
<li>„Token generieren" mit <code>read:wiki</code> Scope</li>
|
||||
<li>Token oben eintragen</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">📝 Markdown-Konvertierung</h3>
|
||||
<p style="font-size:13px">Folgende Elemente werden automatisch konvertiert:</p>
|
||||
<ul style="margin:0;padding-left:18px;font-size:13px;line-height:1.8">
|
||||
<li>Überschriften H1–H6</li>
|
||||
<li>Fett, Kursiv, Durchgestrichen</li>
|
||||
<li>Code-Blöcke (mit Syntax-Highlighting)</li>
|
||||
<li>Tabellen</li>
|
||||
<li>Links & Bilder</li>
|
||||
<li>Blockquotes</li>
|
||||
<li>Aufzählungslisten</li>
|
||||
<li>Gitea-interne <code>[[Links]]</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.wmw-preview-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:8px; }
|
||||
.wmw-preview-item { display:flex; align-items:center; gap:8px; padding:8px 10px; background:var(--wmw-admin-bg); border-radius:6px; border:1px solid var(--wmw-admin-border); }
|
||||
.wmw-preview-item__icon { font-size:16px; }
|
||||
.wmw-preview-item__title { font-size:13px; font-weight:600; flex:1; }
|
||||
.wmw-preview-item__date { font-size:11px; color:#888; }
|
||||
.wmw-import-result { padding:20px 24px; border-radius:8px; margin-bottom:20px; }
|
||||
.wmw-import-result--success { background:#e8f5e9; border:1px solid #a5d6a7; }
|
||||
.wmw-import-result--warn { background:#fff8e1; border:1px solid #ffe082; }
|
||||
.wmw-import-result h3 { margin:0 0 12px; }
|
||||
.wmw-import-stats { display:flex; gap:16px; margin-bottom:12px; flex-wrap:wrap; }
|
||||
.wmw-import-stat { text-align:center; background:#fff; padding:10px 20px; border-radius:6px; border:1px solid rgba(0,0,0,.08); }
|
||||
.wmw-import-stat__num { display:block; font-size:24px; font-weight:700; color:#2e7d32; }
|
||||
.wmw-import-errors { background:#fff3e0; border:1px solid #ffcc80; border-radius:6px; padding:10px 14px; margin-top:10px; }
|
||||
.wmw-import-errors ul { margin:6px 0 0 18px; font-size:13px; }
|
||||
</style>
|
||||
67
templates/admin/settings.php
Normal file
67
templates/admin/settings.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||
<div class="wrap wmw-admin-wrap">
|
||||
<div class="wmw-admin-header wmw-admin-header--small">
|
||||
<div class="wmw-admin-header__logo">
|
||||
<span class="wmw-admin-header__icon">⚙️</span>
|
||||
<div><h1>WP Multi Wiki – Einstellungen</h1></div>
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('wmw_save_settings','wmw_settings_nonce'); ?>
|
||||
<div class="wmw-form-layout">
|
||||
<div class="wmw-form-main">
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">🖥️ Darstellung</h3>
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th>Inhaltsverzeichnis (TOC)</th>
|
||||
<td><label><input type="checkbox" name="show_toc" value="1" <?php checked($settings['show_toc']??1,1); ?>> Automatisches TOC aus Überschriften generieren</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Breadcrumbs</th>
|
||||
<td><label><input type="checkbox" name="show_breadcrumbs" value="1" <?php checked($settings['show_breadcrumbs']??1,1); ?>> Breadcrumb-Navigation anzeigen</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Verwandte Artikel</th>
|
||||
<td><label><input type="checkbox" name="show_related" value="1" <?php checked($settings['show_related']??1,1); ?>> Ähnliche Artikel am Ende anzeigen</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Suchfeld</th>
|
||||
<td><label><input type="checkbox" name="show_search" value="1" <?php checked($settings['show_search']??1,1); ?>> Suchfeld im Wiki anzeigen</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Sidebar-Position</th>
|
||||
<td>
|
||||
<select name="sidebar_position">
|
||||
<option value="left" <?php selected($settings['sidebar_position']??'left','left'); ?>>Links</option>
|
||||
<option value="right" <?php selected($settings['sidebar_position']??'left','right'); ?>>Rechts</option>
|
||||
<option value="none" <?php selected($settings['sidebar_position']??'left','none'); ?>>Keine Sidebar</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Artikel pro Seite</th>
|
||||
<td><input type="number" name="articles_per_page" value="<?php echo esc_attr($settings['articles_per_page']??20); ?>" class="small-text" min="5" max="100"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">🎨 Custom CSS</h3>
|
||||
<p class="description">Eigenes CSS für das Wiki-Frontend. Hier kannst du das Design anpassen.</p>
|
||||
<textarea name="custom_css" rows="10" class="large-text code"><?php echo esc_textarea($settings['custom_css']??''); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wmw-form-sidebar">
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">💾 Speichern</h3>
|
||||
<?php submit_button('Einstellungen speichern','primary','submit',false); ?>
|
||||
</div>
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">ℹ️ Plugin-Info</h3>
|
||||
<p><strong>WP Multi Wiki</strong><br>Version <?php echo WMW_VERSION; ?></p>
|
||||
<p>Autor: <strong>M_Viper</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
102
templates/admin/wiki-form.php
Normal file
102
templates/admin/wiki-form.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
$is_edit = isset( $wiki ) && $wiki;
|
||||
$page_title = $is_edit ? 'Wiki bearbeiten' : 'Neues Wiki erstellen';
|
||||
$wiki_id = $is_edit ? $wiki->ID : 0;
|
||||
$wiki_title = $is_edit ? $wiki->post_title : '';
|
||||
$wiki_desc = $is_edit ? $wiki->post_content : '';
|
||||
$wiki_excerpt= $is_edit ? $wiki->post_excerpt : '';
|
||||
$wiki_icon = $is_edit ? get_post_meta($wiki_id,'_wmw_icon',true) : '📖';
|
||||
$wiki_color = $is_edit ? get_post_meta($wiki_id,'_wmw_color',true) : '#2271b1';
|
||||
$wiki_ver = $is_edit ? get_post_meta($wiki_id,'_wmw_version',true) : '1.0.0';
|
||||
$wiki_status = $is_edit ? $wiki->post_status : 'publish';
|
||||
?>
|
||||
<div class="wrap wmw-admin-wrap">
|
||||
<div class="wmw-admin-header wmw-admin-header--small">
|
||||
<div class="wmw-admin-header__logo">
|
||||
<span class="wmw-admin-header__icon">📝</span>
|
||||
<div>
|
||||
<h1><?php echo esc_html($page_title); ?></h1>
|
||||
<p><?php echo $is_edit ? 'Passe dein Wiki an.' : 'Lege ein neues Wiki für dein Plugin an.'; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="<?php echo admin_url('admin.php?page=wp-multi-wiki'); ?>" class="button">← Zurück</a>
|
||||
</div>
|
||||
|
||||
<div class="wmw-form-layout">
|
||||
<div class="wmw-form-main">
|
||||
<div class="wmw-card">
|
||||
<div class="wmw-field">
|
||||
<label for="wmw_title" class="wmw-label">Wiki-Name <span class="required">*</span></label>
|
||||
<input type="text" id="wmw_title" name="wmw_title" class="large-text" value="<?php echo esc_attr($wiki_title); ?>" placeholder="z.B. My Awesome Plugin">
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label for="wmw_excerpt" class="wmw-label">Kurzbeschreibung</label>
|
||||
<input type="text" id="wmw_excerpt" name="wmw_excerpt" class="large-text" value="<?php echo esc_attr($wiki_excerpt); ?>" placeholder="Kurze Beschreibung des Plugins…">
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Beschreibung / Intro-Text</label>
|
||||
<?php
|
||||
wp_editor( $wiki_desc, 'wmw_description', array(
|
||||
'textarea_name' => 'wmw_description',
|
||||
'media_buttons' => false,
|
||||
'textarea_rows' => 8,
|
||||
'tinymce' => true,
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-form-sidebar">
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">🎨 Erscheinungsbild</h3>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Icon (Emoji)</label>
|
||||
<input type="text" id="wmw_icon" name="wmw_icon" value="<?php echo esc_attr($wiki_icon); ?>" style="font-size:24px;width:80px;text-align:center;">
|
||||
<p class="description">Ein Emoji-Icon für dein Wiki</p>
|
||||
<div class="wmw-emoji-picker">
|
||||
<?php $emojis = ['📖','📚','🔌','⚙️','🛠️','💡','🚀','🔧','📦','🎯','🔑','📊','🖥️','💻','📝','🌐','🔒','⚡','🎮','📱'];
|
||||
foreach($emojis as $e): ?>
|
||||
<button type="button" class="wmw-emoji-btn" data-emoji="<?php echo $e; ?>"><?php echo $e; ?></button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Akzentfarbe</label>
|
||||
<input type="text" id="wmw_color" name="wmw_color" value="<?php echo esc_attr($wiki_color); ?>" class="wmw-color-picker">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-card">
|
||||
<h3 class="wmw-card__title">⚙️ Plugin-Info</h3>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Plugin-Version</label>
|
||||
<input type="text" name="wmw_version" value="<?php echo esc_attr($wiki_ver); ?>" class="regular-text" placeholder="1.0.0">
|
||||
</div>
|
||||
<div class="wmw-field">
|
||||
<label class="wmw-label">Status</label>
|
||||
<select name="wmw_status" class="regular-text">
|
||||
<option value="publish" <?php selected($wiki_status,'publish'); ?>>✅ Veröffentlicht</option>
|
||||
<option value="draft" <?php selected($wiki_status,'draft'); ?>>📝 Entwurf</option>
|
||||
<option value="private" <?php selected($wiki_status,'private'); ?>>🔒 Privat</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wmw-card">
|
||||
<button type="button" id="wmw-save-wiki" class="button button-primary button-large wmw-btn-full"
|
||||
data-id="<?php echo $wiki_id; ?>">
|
||||
<?php echo $is_edit ? '💾 Wiki speichern' : '🚀 Wiki erstellen'; ?>
|
||||
</button>
|
||||
<?php if ( $is_edit ) : ?>
|
||||
<a href="<?php echo get_permalink($wiki_id); ?>" target="_blank" class="button button-large wmw-btn-full wmw-mt-sm">
|
||||
🔗 Im Frontend ansehen
|
||||
</a>
|
||||
<a href="<?php echo admin_url('admin.php?page=wmw-new-article&wiki_id='.$wiki_id); ?>" class="button wmw-btn-full wmw-mt-sm">
|
||||
➕ Artikel hinzufügen
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user