12 lines
522 B
PHP
12 lines
522 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
/** Katalog für DeskHub: catalog.php?type=plugins oder catalog.php?type=themes (JSON). */
|
|
require_once __DIR__ . '/inc/lib.php';
|
|
site_require_access();
|
|
|
|
$type = ($_GET['type'] ?? 'plugins') === 'themes' ? 'theme' : 'plugin';
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
header('Cache-Control: public, max-age=300');
|
|
header('X-Content-Type-Options: nosniff');
|
|
echo json_encode(site_catalog($type), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
|