System plugin support: admin menu items, admin routes, API integration
- PluginManager: getAdminMenuItems(), handleAdminRoute(), getPluginType() - admin.php: load PluginManager, pass plugin_admin_menu to Twig - admin.php: route to plugin admin pages via handleAdminRoute() - admin.twig: show 'Plugins' sidebar section for system plugins - plugins-new.twig: choose content or system plugin type - handlePluginsNew: generate proper template based on type (content/system) - plugin-admin.twig: renders plugin output in admin layout - GeoIPInfo: example system plugin (admin page with GeoIP info) - System plugins: getAdminMenu(), getAdminRoutes(), handleAdminRoute() - Content plugins: getSidebarContent() (unchanged)
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 41 KiB |
@@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}CodePress Admin{% endblock %}</title>
|
||||
<link rel="icon" type="image/x-icon" href="/admin/assets/img/favicon.ico">
|
||||
<link rel="stylesheet" href="/admin/assets/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/admin/assets/css/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/admin/assets/css/style.css">
|
||||
@@ -124,6 +125,17 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if plugin_admin_menu is not empty %}
|
||||
<li class="nav-section">Plugins</li>
|
||||
{% for item in plugin_admin_menu %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ route == item.route ? 'active' : '' }}" href="/admin/{{ item.route }}">
|
||||
<i class="bi {{ item.icon|default('bi-gear') }}"></i> {{ item.label }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if has_permission('guide') %}
|
||||
<li class="nav-section">Help</li>
|
||||
<li class="nav-item">
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends "layouts/admin.twig" %}
|
||||
|
||||
{% block title %}{{ route|capitalize }} - CodePress Admin{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ plugin_content|raw }}
|
||||
{% endblock %}
|
||||
@@ -13,6 +13,21 @@
|
||||
<input type="text" class="form-control" id="name" name="name" required autofocus>
|
||||
<small class="form-text text-muted">Alleen letters, cijfers, underscores en streepjes.</small>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Plugin type</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="type" id="type-content" value="content" checked>
|
||||
<label class="form-check-label" for="type-content">
|
||||
<strong>Content plugin</strong> — Verschijnt in de sidebar op content pagina's
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="type" id="type-system" value="system">
|
||||
<label class="form-check-label" for="type-system">
|
||||
<strong>Systeem plugin</strong> — Voegt functionaliteit toe aan het CMS (admin menu, API)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
@@ -21,4 +36,4 @@
|
||||
<a href="/admin/plugins" class="btn btn-outline-secondary">Annuleren</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user