summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/drupal.css48
-rw-r--r--modules/user.module21
-rw-r--r--modules/user/user.module21
3 files changed, 49 insertions, 41 deletions
diff --git a/misc/drupal.css b/misc/drupal.css
index 249b872e4..85e82ea32 100644
--- a/misc/drupal.css
+++ b/misc/drupal.css
@@ -1,36 +1,38 @@
-.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; }
+
diff --git a/modules/user.module b/modules/user.module
index 369c1cc0a..fc5333c36 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -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.")));
diff --git a/modules/user/user.module b/modules/user/user.module
index 369c1cc0a..fc5333c36 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -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.")));