Let plugins run their own PHP code
A plugin can now bring a plugin.php that registers hooks, scheduled tasks, its own tables, public pages and admin screens. Failures stay contained to the plugin; a form on a plugin page can be submitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b61f958ca1
commit
9825bac3b3
17 files changed
+897
-19
No files matched your search
@@ -0,0 +1,19 @@
|
||||
{% extends 'admin/shell.html.twig' %}
|
||||
{% set nav = 'plugins' %}
|
||||
{% block title %}{{ page.title }}{% endblock %}
|
||||
{% block heading %}{{ page.title }}{% endblock %}
|
||||
{% block lead %}{{ plugin.title }} · <a href="{{ path('admin_plugins') }}">Zurück zu den Plugins</a>{% endblock %}
|
||||
{% block content %}
|
||||
{% if actions %}
|
||||
<div class="favicon-actions">
|
||||
{% for action in actions %}
|
||||
<form method="post" action="{{ path('admin_plugin_action', {name: plugin.name, key: action.key}) }}">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('plugins') }}">
|
||||
<input type="hidden" name="zurueck" value="{{ page.key }}">
|
||||
<button class="secondary" type="submit">{{ action.label }}</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include page.template with data only %}
|
||||
{% endblock %}
|
||||
@@ -56,6 +56,9 @@
|
||||
<dd>{% if plugin.active %}<a href="{{ route.path }}">{{ route.path }}</a>{% else %}<code>{{ route.path }}</code>{% endif %} · {{ route.type }}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% if plugin.main %}<p class="muted">Führt eigenen PHP-Code mit den vollen Rechten der Website aus. Nur einschalten, wenn du der Quelle vertraust.</p>{% endif %}
|
||||
{% if runtimeErrors[plugin.name] is defined %}<p class="field-error">Fehler im Plugin: {{ runtimeErrors[plugin.name] }}</p>{% endif %}
|
||||
{% for page in admin[plugin.name].pages %}<p><a href="{{ path('admin_plugin_page', {name: plugin.name, key: page.key}) }}">{{ page.title }}</a></p>{% endfor %}
|
||||
{% if plugin.active and plugin.settings is not empty %}
|
||||
<form method="post" action="{{ path('admin_plugin_settings', {name: plugin.name}) }}" class="plugin-settings">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('plugins') }}">
|
||||
|
||||
Reference in new issue
Block a user