function printContentDirectory($path) { $files = scandir($path); $output = '<table>'; foreach ($files as $file) { $output_type = getOutputType($path . $file); $output = $output . '<tr>'; $output = $output . '<td>' . $file . "</td>"; $output = $output . '<td>' . $output_type . "</td>"; $output = $output . '</tr>'; } $output = $output . '</table>'; echo $output; }
} else { if (!empty($_GET['_search'])) { $data = $Store->search($_GET['_search'], false, $pageSize, $offset); } else { $documentUri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $documentUri = array_shift(explode('?', $documentUri)); $data = $Store->get($documentUri); } } } } $facets = $Store->getFacetsForLastQuery(); $resultCount = $Store->getResultsCountForLastQuery(); $showMap = strpos($query, '_near') !== false || isset($_GET['_near']) ? true : false; header("Access-Control-Allow-Origin: *"); $output = getOutputType(); if ($output == 'html') { $innerTemplate = 'browser.html'; require 'templates/outer.html'; exit; } if ($output == 'json' || $output == 'turtle') { require 'metadata.php'; $namespaces = $Store->getNamespaces(); $data = \Trilby\addMetadata($data, $Config, $types, $facets, $namespaces); if ($output == 'json') { header("Content-type: application/json"); echo json_encode($data); exit; } else { require_once 'vendor/kwijibo/arc2/ARC2.php';