Commit ed528531 authored by Dries's avatar Dries

- CSS improvements: use form functions wrapped in a <div> instead of
  hard-coded form elements.  Modified patch by Kristjan.

  I added some CSS to drupal.css to center the text and ordered the
  list of CSS tags alphabetically.
parent 31c36b7f
.item-list .title { font-weight: bold; }
.item-list ul { margin: 0 0 0.75em 0; padding: 0; }
.item-list ul li { margin: 0 0 0.25em 1.5em; padding: 0; list-style: disc; }
.item-list .icon { color: #555; float: right; padding-left: 0.25em; }
.item-list .icon a { color: #000; text-decoration: none; }
.item-list .icon a:hover { color: #000; text-decoration: none; }
tr.dark { background-color: #ddd; }
tr.light { background-color: #eee; }
#tracker table { border-collapse: collapse; }
#tracker th { text-align: left; padding: 0.25em 1em; }
#tracker td { vertical-align: top; padding: 1em; }
#tracker td ul { margin-top: 0; margin-bottom: 0; }
#tracker td ul a { font-weight: normal; }
#tracker th { text-align: left; padding: 0.25em 1em; }
.poll .bar { height: 1em; }
.poll .bar .foreground { background-color: #000; float: left; height: 1em; }
.poll .bar .background { background-color: #ddd; float: left; height: 1em; }
.poll .percent { text-align: right; }
.poll .links { text-align: center; }
.poll .total { text-align: center; }
.calendar .row-week td a { display: block; }
.calendar .row-week td a:hover { background-color: #888; color: #fff; }
.calendar a { text-decoration: none; }
.calendar a:hover { text-decoration: none; }
.calendar table { border-collapse: collapse; }
.calendar td { text-align: center; border: 1px solid #000; padding: 1px; margin: 0; font-size: 0.8em; }
.calendar .row-week td a { display: block; }
.calendar .row-week td a:hover { background-color: #888; color: #fff; }
.form-item .title { font-weight: bold; margin-top: 1.1em; margin-bottom: 1px; }
.container-inline div { display: inline; }
.form-item .description { font-size: 0.85em; }
.form-item .title { font-weight: bold; margin-top: 1.1em; margin-bottom: 1px; }
.form-submit { margin-top: 1em; }
.container-inline div { display: inline; }
.item-list .icon { color: #555; float: right; padding-left: 0.25em; }
.item-list .icon a { color: #000; text-decoration: none; }
.item-list .icon a:hover { color: #000; text-decoration: none; }
.item-list .title { font-weight: bold; }
.item-list ul { margin: 0 0 0.75em 0; padding: 0; }
.item-list ul li { margin: 0 0 0.25em 1.5em; padding: 0; list-style: disc; }
.poll .bar { height: 1em; }
.poll .bar .background { background-color: #ddd; float: left; height: 1em; }
.poll .bar .foreground { background-color: #000; float: left; height: 1em; }
.poll .links { text-align: center; }
.poll .percent { text-align: right; }
.poll .total { text-align: center; }
.user-login-block { text-align: center; }
tr.dark { background-color: #ddd; }
tr.light { background-color: #eee; }
......@@ -311,8 +311,8 @@ function user_block($op = "list", $delta = 0) {
switch ($delta) {
case 0:
if (!$user->uid) {
$output = "<div align=\"center\">\n";
$output .= "<form action=\"". url("user/login") ."\" method=\"post\">\n";
$output = "<div class=\"user-login-block\">\n";
/*
** Save the referer. We record where the user came from such
** that we/ can redirect him after having completed the login
......@@ -324,19 +324,22 @@ function user_block($op = "list", $delta = 0) {
}
// NOTE: special care needs to be taken because on pages with forms, such as node and comment submission pages, the $edit variable might already be set.
$output .= "<input name=\"edit[destination]\" type=\"hidden\" value=\"" . $edit["destination"] . "\" />";
$output .= "<b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\" /><br />\n";
$output .= "<b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" type=\"password\" /><br />\n";
$form = form_hidden("destination", $edit["destination"]);
$form .= form_textfield(t("Username"), "name", $edit["name"], 15, 64);
$form .= form_password(t("Password"), "pass", $pass, 15, 64);
if (variable_get("user_remember", 0) == 0) {
$output .= "<input name=\"edit[remember_me]\" type=\"checkbox\" />". t("Remember me");
$form .= form_checkbox(t("Remember me"), "remember_me", 1, 0, 0);
}
elseif (variable_get("user_remember", 1) == 1) {
$output .= form_hidden("remember_me", 1);
$form .= form_hidden("remember_me", 1);
}
$output .= "<br />\n<input name=\"edit[op]\" type=\"submit\" value=\"". t("Log in") ."\" /><br />\n";
$output .= "</form></div>\n";
$form .= form_submit(t("Log in"));
$output .= form($form, "post", url("user/login"));
$output .= "</div>\n";
if (variable_get("user_register", 1)) {
$items[] = l(t("Create new account"), "user/register", array("title" => t("Create a new user account.")));
......
......@@ -311,8 +311,8 @@ function user_block($op = "list", $delta = 0) {
switch ($delta) {
case 0:
if (!$user->uid) {
$output = "<div align=\"center\">\n";
$output .= "<form action=\"". url("user/login") ."\" method=\"post\">\n";
$output = "<div class=\"user-login-block\">\n";
/*
** Save the referer. We record where the user came from such
** that we/ can redirect him after having completed the login
......@@ -324,19 +324,22 @@ function user_block($op = "list", $delta = 0) {
}
// NOTE: special care needs to be taken because on pages with forms, such as node and comment submission pages, the $edit variable might already be set.
$output .= "<input name=\"edit[destination]\" type=\"hidden\" value=\"" . $edit["destination"] . "\" />";
$output .= "<b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\" /><br />\n";
$output .= "<b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" type=\"password\" /><br />\n";
$form = form_hidden("destination", $edit["destination"]);
$form .= form_textfield(t("Username"), "name", $edit["name"], 15, 64);
$form .= form_password(t("Password"), "pass", $pass, 15, 64);
if (variable_get("user_remember", 0) == 0) {
$output .= "<input name=\"edit[remember_me]\" type=\"checkbox\" />". t("Remember me");
$form .= form_checkbox(t("Remember me"), "remember_me", 1, 0, 0);
}
elseif (variable_get("user_remember", 1) == 1) {
$output .= form_hidden("remember_me", 1);
$form .= form_hidden("remember_me", 1);
}
$output .= "<br />\n<input name=\"edit[op]\" type=\"submit\" value=\"". t("Log in") ."\" /><br />\n";
$output .= "</form></div>\n";
$form .= form_submit(t("Log in"));
$output .= form($form, "post", url("user/login"));
$output .= "</div>\n";
if (variable_get("user_register", 1)) {
$items[] = l(t("Create new account"), "user/register", array("title" => t("Create a new user account.")));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment