Move rendering into private templates
Add an explicit template renderer with HTML views and partials for the app, bootstrap, package, and catalog pages. Move shared reporting setup into config/reporting.php and relocate stylesheet assets under css/.
This commit is contained in:
+9
-13
@@ -14,6 +14,8 @@
|
||||
* Outside code should not inspect DB rows directly.
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/Template.php';
|
||||
|
||||
class RacketSandboxAuthException extends Exception
|
||||
{
|
||||
}
|
||||
@@ -696,7 +698,7 @@ class RacketSandboxAuth
|
||||
$this->messageHtml(
|
||||
'Login required',
|
||||
'Please log in to continue.',
|
||||
'<p><a href="/login.php">Login</a></p>'
|
||||
RacketSandboxTemplate::renderFile('partials/login-link.html', array('login_label' => 'Login'))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -705,18 +707,12 @@ class RacketSandboxAuth
|
||||
http_response_code(200);
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
echo '<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>' . htmlspecialchars($title, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>' . htmlspecialchars($title, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</h1>
|
||||
<p>' . htmlspecialchars($message, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</p>
|
||||
' . $extra . '
|
||||
</body>
|
||||
</html>';
|
||||
echo RacketSandboxTemplate::renderFile('simple-message.html', array(
|
||||
'language' => 'en',
|
||||
'title' => $title,
|
||||
'message' => $message,
|
||||
'extra_html' => $extra,
|
||||
));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user