if ($_REQUEST["relation"]) { if ($_REQUEST["category"]) { $entries = $resources->relationFindByFilter($_REQUEST["id"], $_REQUEST["relation"], $_REQUEST["category"], $offset, $format); $j->setTotalResults($resources->relationFilterCount($_REQUEST["id"], $_REQUEST["relation"], $_REQUEST["category"])); $j->addCategory($_REQUEST['category']); } else { $entries = $resources->relationFind($_REQUEST["id"], $_REQUEST["relation"], $offset, $format); if (count($entries) == 0) { header("HTTP/1.1 404 Not Found"); exit; } $j->setTotalResults($resources->relationCount($_REQUEST["id"], $_REQUEST["relation"])); } addAlternateFormatsToFeed($j, $format, $config["entities"][$_REQUEST["relation"]]["record_types"], $config["record_types"]); } else { $entries = $resources->find($_REQUEST["id"], $offset, $format); if (count($entries) == 0) { header("HTTP/1.1 404 Not Found"); exit; } $j->setTotalResults($resources->count($_REQUEST["id"])); addAlternateFormatsToFeed($j, $format, $config["entities"][$_REQUEST["resource"]]["record_types"], $config["record_types"]); } } else { if ($_REQUEST["category"]) { $entries = $resources->findByFilter($_REQUEST["category"], $offset, $format); $j->setTotalResults($resources->filterCount($_REQUEST["category"])); $j->addCategory($_REQUEST['category']); } elseif ($search) { $j->setTotalResults($resources->searchCount($_REQUEST["query"])); if ($j->totalResults > 0) {
public function media($filename, $default = null) { $file = Resources::find($filename); if ($file !== null) { return Resources::web($file); } return $default; }