$query */ public function url(string $page, array $query = []): string { $url = $this->baseUrl() . '/' . ltrim($page, '/'); if ($query !== []) { $url .= '?' . http_build_query($query); } return $url; } public function t(string $key): string { return $this->lang->t($key); } public function post(string $key, string $default = ''): string { return Http::getString($_POST, $key, $default); } public function query(string $key, string $default = ''): string { return Http::getString($_GET, $key, $default); } public function requirePost(): void { if (!Http::isPost()) { throw new RuntimeException('Method not allowed'); } } public function csrfField(string $intent): string { $issued = $this->csrf->issue($intent); return '' . '' . ''; } public function requireCsrf(string $intent): void { if (!$this->csrf->validate($intent, $this->post('csrf_ts'), $this->post('csrf_token'), 3600, $this->post('csrf_sid'))) { throw new RuntimeException('Nieprawidłowy lub wygasły token CSRF.'); } } public function render(string $title, string $body, array $ok = [], array $errors = []): void { header('Content-Type: text/html; charset=UTF-8'); $alerts = ''; foreach ($ok as $msg) { $alerts .= '
' . self::e($this->t('Manage automatic replies for account mailboxes')) . '