<?php if (!isset($TEMPLATE)) { $TITLE = 'Catalogs'; $NAVIGATION = true; include 'template.inc.php'; } include_once '../_functions.inc.php'; $catalogs = get_json_metadata('.', 'index.json'); echo '<ul>'; foreach ($catalogs as $catalog) { $id = $catalog['id']; $title = $catalog['title']; echo '<li>' . '<a href="' . $id . '/">' . strtoupper($id) . ' - ' . $title . '</a>' . '</li>'; } echo '</ul>';
<?php include_once '../_functions.inc.php'; $contributors = get_json_metadata('.', 'index.json'); // one day $CACHE_MAXAGE = 86400; include '../../../../lib/cache.inc.php'; header('Content-type: application/json'); $base_url = get_host_url_prefix() . '/data/comcat'; $output = array(); foreach ($contributors as $contributor) { // copy selected properties $c = array(); $id = $contributor['id']; $c['id'] = $id; $c['title'] = $contributor['title']; $c['aliases'] = $contributor['aliases']; // link to contributor page $c['url'] = $base_url . '/contributor/' . $id . '/'; // logo if it exists $logo = 'logos/' . $id . '.svg'; if (file_exists('../' . $logo)) { $c['logo'] = $base_url . '/' . $logo; } $output[] = $c; } echo json_encode($output);