Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New System Clangs API Endpoints
This PR adds a new API package for managing REDAXO languages (clangs) through the REST API. The implementation follows the established pattern of other API packages, while ensuring proper integration with REDAXO's internal language management system.
New Endpoints
/api/system/clangs
/api/system/clangs/{id}
/api/system/clangs
/api/system/clangs/{id}
/api/system/clangs/{id}
Beispiele
1. Sprachen abrufen
/api/system/clangs
Beschreibung: Ruft eine Liste aller Sprachen ab.
Parameter:
filter[status]
: Filtert nach Status (z.B.1
für aktiv).filter[code]
: Filtert nach Sprachcode (z.B.de
).filter[priority]
: Filtert nach Priorität.page
: Seitenzahl für Paginierung (optional).per_page
: Anzahl der Einträge pro Seite für Paginierung (optional).Beispiele:
2. Eine spezifische Sprache abrufen
/api/system/clangs/{id}
Beschreibung: Ruft eine spezifische Sprache anhand ihrer ID ab.
Parameter:
id
: Die ID der Sprache.Beispiel:
3. Eine neue Sprache hinzufügen
/api/system/clangs
Beschreibung: Erstellt eine neue Sprache.
Anfrage-Body (JSON):
code
(String, required): Der Sprachcode (z.B. "fr", "en", "de").name
(String, required): Der Name der Sprache.priority
(Integer, optional): Die Priorität der Sprache (z.B. 1, 2, 3).status
(Integer, optional): Der Status der Sprache (z.B.1
für aktiv,0
für inaktiv).Beispiel:
4. Eine Sprache aktualisieren
/api/system/clangs/{id}
Beschreibung: Aktualisiert eine bestehende Sprache.
Parameter:
id
: Die ID der Sprache, die aktualisiert werden soll.Anfrage-Body (JSON): Nur die Felder, die aktualisiert werden sollen (optional).
name
(String, optional): Der neue Name der Sprache.priority
(Integer, optional): Die neue Priorität der Sprache.status
(Integer, optional): Der neue Status der Sprache.Beispiel:
5. Eine Sprache löschen
/api/system/clangs/{id}
Beschreibung: Löscht eine Sprache.
Parameter:
id
: Die ID der Sprache, die gelöscht werden soll.Beispiel:
6. Eine Sprache löschen (z.B. ID = 2)
curl -X DELETE 'https://example.com/api/system/clangs/2'
-H 'Authorization: Bearer YOUR_API_TOKEN'
7. Pagination anwenden (z.B. Seite 2 mit 5 Einträgen pro Seite)
curl -X GET 'https://example.com/api/system/clangs?page=2&per_page=5'
-H 'Authorization: Bearer YOUR_API_TOKEN'
8. Komplexere Filterung (mehrere Parameter)
curl -X GET 'https://example.com/api/system/clangs?filter%5Bstatus%5D=1&filter%5Bcode%5D=de&filter%5Bpriority%5D=1'
-H 'Authorization: Bearer YOUR_API_TOKEN'
Key Features
CLANG_ADDED
,CLANG_UPDATED
,CLANG_DELETED
)Usage Examples
List all languages
Get a specific language
Create a new language
Update a language
Delete a language
Implementation Notes
Clangs.php
file with all endpoint handlersboot.php
to register the new route package