This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/themes/material/user.theme.php
William Crandell 6fb43eab19 On Develop branch
Sorry about that
2015-10-26 08:51:02 -04:00

29 lines
1 KiB
PHP

<?php
class CustomUserPageTheme extends UserPageTheme {
public function display_user_block(Page $page, User $user, $parts) {
$h_name = html_escape($user->name);
$html = " | ";
foreach($parts as $part) {
$html .= "<a href='{$part["link"]}'>{$part["name"]}</a> | ";
}
$page->add_block(new Block("Logged in as $h_name", $html, "drawer", 90));
}
public function display_login_block(Page $page) {
global $config;
$html = "
<form action='".make_link("user_admin/login")."' method='POST'>
<table summary='Login Form' align='center'>
<tr><td width='70'>Name</td><td width='70'><input type='text' name='user'></td></tr>
<tr><td>Password</td><td><input type='password' name='pass'></td></tr>
<tr><td colspan='2'><input type='submit' name='gobu' value='Log In'></td></tr>
</table>
</form>
";
if($config->get_bool("login_signup_enabled")) {
$html .= "<small><a href='".make_link("user_admin/create")."'>Create Account</a></small>";
}
$page->add_block(new Block("Login", $html, "head", 90));
}
}