forked from Cavemanon/cavepaintings
PSR-2. I'm not a huge fan, but ugly consistency beats no consistency...
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
<?php
|
||||
|
||||
class CustomUserPageTheme extends UserPageTheme {
|
||||
public function display_login_page(Page $page) {
|
||||
global $config;
|
||||
$page->set_title("Login");
|
||||
$page->set_heading("Login");
|
||||
$page->disable_left();
|
||||
$html = "
|
||||
class CustomUserPageTheme extends UserPageTheme
|
||||
{
|
||||
public function display_login_page(Page $page)
|
||||
{
|
||||
global $config;
|
||||
$page->set_title("Login");
|
||||
$page->set_heading("Login");
|
||||
$page->disable_left();
|
||||
$html = "
|
||||
<form action='".make_link("user_admin/login")."' method='POST'>
|
||||
<table summary='Login Form'>
|
||||
<tr>
|
||||
@@ -21,41 +23,50 @@ class CustomUserPageTheme extends UserPageTheme {
|
||||
</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, "main", 90));
|
||||
}
|
||||
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, "main", 90));
|
||||
}
|
||||
|
||||
public function display_user_links(Page $page, User $user, $parts) {
|
||||
// no block in this theme
|
||||
}
|
||||
public function display_login_block(Page $page) {
|
||||
// no block in this theme
|
||||
}
|
||||
public function display_user_links(Page $page, User $user, $parts)
|
||||
{
|
||||
// no block in this theme
|
||||
}
|
||||
public function display_login_block(Page $page)
|
||||
{
|
||||
// no block in this theme
|
||||
}
|
||||
|
||||
public function display_user_block(Page $page, User $user, $parts) {
|
||||
$html = "";
|
||||
$blocked = array("Pools", "Pool Changes", "Alias Editor", "My Profile");
|
||||
foreach($parts as $part) {
|
||||
if(in_array($part["name"], $blocked)) continue;
|
||||
$html .= "<a href='{$part["link"]}' class='tab'>{$part["name"]}</a>";
|
||||
}
|
||||
$page->add_block(new Block("User Links", $html, "user", 90));
|
||||
}
|
||||
public function display_user_block(Page $page, User $user, $parts)
|
||||
{
|
||||
$html = "";
|
||||
$blocked = ["Pools", "Pool Changes", "Alias Editor", "My Profile"];
|
||||
foreach ($parts as $part) {
|
||||
if (in_array($part["name"], $blocked)) {
|
||||
continue;
|
||||
}
|
||||
$html .= "<a href='{$part["link"]}' class='tab'>{$part["name"]}</a>";
|
||||
}
|
||||
$page->add_block(new Block("User Links", $html, "user", 90));
|
||||
}
|
||||
|
||||
public function display_signup_page(Page $page) {
|
||||
global $config;
|
||||
$tac = $config->get_string("login_tac", "");
|
||||
public function display_signup_page(Page $page)
|
||||
{
|
||||
global $config;
|
||||
$tac = $config->get_string("login_tac", "");
|
||||
|
||||
$tfe = new TextFormattingEvent($tac);
|
||||
send_event($tfe);
|
||||
$tac = $tfe->formatted;
|
||||
$tfe = new TextFormattingEvent($tac);
|
||||
send_event($tfe);
|
||||
$tac = $tfe->formatted;
|
||||
|
||||
if(empty($tac)) {$html = "";}
|
||||
else {$html = "<p>$tac</p>";}
|
||||
if (empty($tac)) {
|
||||
$html = "";
|
||||
} else {
|
||||
$html = "<p>$tac</p>";
|
||||
}
|
||||
|
||||
$html .= "
|
||||
$html .= "
|
||||
<form action='".make_link("user_admin/create")."' method='POST'>
|
||||
<table style='width: 300px;'>
|
||||
<tr><td>Name</td><td><input type='text' name='name'></td></tr>
|
||||
@@ -67,32 +78,33 @@ class CustomUserPageTheme extends UserPageTheme {
|
||||
</form>
|
||||
";
|
||||
|
||||
$page->set_title("Create Account");
|
||||
$page->set_heading("Create Account");
|
||||
$page->disable_left();
|
||||
$page->add_block(new Block("Signup", $html));
|
||||
}
|
||||
$page->set_title("Create Account");
|
||||
$page->set_heading("Create Account");
|
||||
$page->disable_left();
|
||||
$page->add_block(new Block("Signup", $html));
|
||||
}
|
||||
|
||||
public function display_ip_list(Page $page, array $uploads, array $comments) {
|
||||
$html = "<table id='ip-history' style='width: 400px;'>";
|
||||
$html .= "<tr><td>Uploaded from: ";
|
||||
foreach($uploads as $ip => $count) {
|
||||
$html .= "<br>$ip ($count)";
|
||||
}
|
||||
$html .= "</td><td>Commented from:";
|
||||
foreach($comments as $ip => $count) {
|
||||
$html .= "<br>$ip ($count)";
|
||||
}
|
||||
$html .= "</td></tr>";
|
||||
$html .= "<tr><td colspan='2'>(Most recent at top)</td></tr></table>";
|
||||
public function display_ip_list(Page $page, array $uploads, array $comments)
|
||||
{
|
||||
$html = "<table id='ip-history' style='width: 400px;'>";
|
||||
$html .= "<tr><td>Uploaded from: ";
|
||||
foreach ($uploads as $ip => $count) {
|
||||
$html .= "<br>$ip ($count)";
|
||||
}
|
||||
$html .= "</td><td>Commented from:";
|
||||
foreach ($comments as $ip => $count) {
|
||||
$html .= "<br>$ip ($count)";
|
||||
}
|
||||
$html .= "</td></tr>";
|
||||
$html .= "<tr><td colspan='2'>(Most recent at top)</td></tr></table>";
|
||||
|
||||
$page->add_block(new Block("IPs", $html));
|
||||
}
|
||||
$page->add_block(new Block("IPs", $html));
|
||||
}
|
||||
|
||||
public function display_user_page(User $duser, $stats) {
|
||||
global $page;
|
||||
$page->disable_left();
|
||||
parent::display_user_page($duser, $stats);
|
||||
}
|
||||
public function display_user_page(User $duser, $stats)
|
||||
{
|
||||
global $page;
|
||||
$page->disable_left();
|
||||
parent::display_user_page($duser, $stats);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user