'; } // --------------------------------------------------------------------------- // CONTENT // --------------------------------------------------------------------------- function dsc01_content() { if (function_exists('head_add_css')) { head_add_css('/addon/dsc01/view/css/dsc01.css'); } if (function_exists('head_add_js')) { head_add_js('/addon/dsc01/view/js/dsc01.js'); } $association_slug = argv(1) ?? ''; $access = dsc01_access_state($association_slug); // dsc01 is public — access wall only gates submission, not reading if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($access === 'public') { return dsc01_access_wall($association_slug); } // TODO: handle POST submission return dsc01_access_wall($association_slug); } return dsc01_render_main($access); } // --------------------------------------------------------------------------- // RENDER // --------------------------------------------------------------------------- function dsc01_render_main($access) { $out = '
'; $out .= '
'; $out .= '

Categories

'; $out .= '

The legal surfaces where HOA governance disputes manifest, organized from the homeowner\'s perspective.

'; $out .= '
'; // TODO: render DSC categories $out .= '
Content forthcoming.
'; $out .= '
'; return $out; } // --------------------------------------------------------------------------- // CONFIG // --------------------------------------------------------------------------- function dsc01_load_config() { $path = 'addon/dsc01/config.json'; $raw = @file_get_contents($path); if ($raw === false) return []; $data = json_decode($raw, true); return (json_last_error() === JSON_ERROR_NONE) ? $data : []; } // --------------------------------------------------------------------------- // CSRF // --------------------------------------------------------------------------- function dsc01_csrf_token() { if (empty($_SESSION['dsc01_csrf'])) { $_SESSION['dsc01_csrf'] = bin2hex(random_bytes(16)); } return ''; } function dsc01_verify_csrf() { return isset($_POST['dsc01_csrf'], $_SESSION['dsc01_csrf']) && hash_equals($_SESSION['dsc01_csrf'], $_POST['dsc01_csrf']); }