'; $out .= '
'; $out .= '

Diagnostic Surface Categories

'; $out .= '

The legal surfaces where HOA governance disputes manifest, organized from the homeowner\'s perspective. Select an association to apply this checklist to a case.

'; $out .= '
'; if (empty($categories)) { $out .= '
No categories defined.
'; $out .= ''; return $out; } $out .= ''; // Association picker — list associations from vs01/config.json $raw = @file_get_contents('addon/vs01/config.json'); $cfg = $raw ? json_decode($raw, true) : []; $associations = $cfg['associations'] ?? []; if (!empty($associations)) { $out .= '
'; $out .= '

Apply this checklist

'; $out .= '
'; } $out .= ''; return $out; } // --------------------------------------------------------------------------- // RENDER — ASSOCIATION LANDING (checklist form) // --------------------------------------------------------------------------- function dsc01_render_landing($association_slug, $access, $submitted_codes = [], $submitted_narrative = '') { $raw = @file_get_contents('addon/vs01/config.json'); $cfg = $raw ? json_decode($raw, true) : []; $assoc = $cfg['associations'][$association_slug] ?? []; $name = dsc01_h($assoc['name'] ?? $association_slug); $categories = dsc01_load_categories(); $out = '
'; $out .= '
'; $out .= '

' . $name . '

'; $out .= '

Diagnostic Surface Categories checklist. Select every category that applies to your situation.

'; $out .= '
'; if ($access === 'public') { $out .= dsc01_render_checklist_readonly($categories); $out .= '
'; $out .= 'DSC Categories are public. '; $out .= 'Complete the SASE process '; $out .= 'to submit a checklist for this association.'; $out .= '
'; $out .= '
'; return $out; } $form_url = z_root() . '/dsc01/' . dsc01_h($association_slug); $out .= '
'; $out .= dsc01_csrf_token(); foreach ($categories as $code => $meta) { $checked = in_array($code, $submitted_codes, true) ? ' checked' : ''; $title = dsc01_h($meta['title'] ?? $code); $out .= '
'; $out .= ''; if (!empty($meta['diagnostic_questions'])) { $out .= '
'; $out .= 'Diagnostic questions'; $out .= '
    '; foreach ($meta['diagnostic_questions'] as $q) { $out .= '
  • ' . dsc01_h($q) . '
  • '; } $out .= '
'; $out .= '
'; } $out .= '
'; } $out .= '
'; $out .= ''; $out .= '

Please keep your description focused on the categories you selected above.

'; $out .= ''; $out .= '
'; $out .= '
'; $out .= ''; $out .= '
'; $out .= '
'; $out .= ''; return $out; } // --------------------------------------------------------------------------- // RENDER — READ-ONLY CHECKLIST (public access) // --------------------------------------------------------------------------- function dsc01_render_checklist_readonly($categories) { $out = '
'; foreach ($categories as $code => $meta) { $title = dsc01_h($meta['title'] ?? $code); $out .= '
'; $out .= '' . dsc01_h($code) . ' — ' . $title; if (!empty($meta['diagnostic_questions'])) { $out .= '
'; $out .= 'Diagnostic questions'; $out .= '
    '; foreach ($meta['diagnostic_questions'] as $q) { $out .= '
  • ' . dsc01_h($q) . '
  • '; } $out .= '
'; $out .= '
'; } $out .= '
'; } $out .= '
'; return $out; } // --------------------------------------------------------------------------- // RENDER — MANAGE (stub, operator only) // --------------------------------------------------------------------------- function dsc01_render_manage($association_slug) { $raw = @file_get_contents('addon/vs01/config.json'); $cfg = $raw ? json_decode($raw, true) : []; $assoc = $cfg['associations'][$association_slug] ?? []; $name = dsc01_h($assoc['name'] ?? $association_slug); $out = '
'; $out .= '

Manage — ' . $name . '

'; $out .= '

DSC record review forthcoming.

'; $out .= '
'; return $out; }