load_listings($path); return $this->render_directory($listings, $config); } private function load_listings($path) { // Loads listings.json from the operator-configured path. if (!$path) return ['core' => [], 'tier1' => [], 'tier2' => [], 'other' => []]; $raw = @file_get_contents($path); if ($raw === false) return ['core' => [], 'tier1' => [], 'tier2' => [], 'other' => []]; $data = json_decode($raw, true); return (json_last_error() === JSON_ERROR_NONE) ? $data : ['core' => [], 'tier1' => [], 'tier2' => [], 'other' => []]; } private function render_directory($listings, $config) { // Renders the four-tab Bootstrap directory widget. $default_tab = $config['directory_default_tab'] ?? 'core'; $uid = 'cry01-dir-' . substr(md5(uniqid()), 0, 6); $tabs = [ 'core' => 'Core', 'tier1' => 'Tier-I', 'tier2' => 'Tier-II', 'other' => 'Other', ]; $out = '
No ' . $this->h($label) . ' listings yet.
'; } $out = ''; foreach ($entries as $entry) { $name = $this->h($entry['name'] ?? ''); $role = $this->h($entry['role'] ?? ''); $url = $entry['url'] ?? ''; $desc = $this->h($entry['description'] ?? ''); $out .= '