From 8c672011a267d193fa47cd7cbb523e90a643ee32 Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Mon, 21 Jan 2002 17:31:13 +0000 Subject: - moved user block from theme.inc to user.module. * only problem is that the admin.php link is not available until the admin enables the block. * $theme->user is obsolete, will patch the themes properly in a later patch. - moved moderation block from theme.inc to queue.module. * removed theme_moderation_results(). - updated database/database.mysql. --- modules/user/user.module | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'modules/user') diff --git a/modules/user/user.module b/modules/user/user.module index 24a67d170..899901bda 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -454,6 +454,51 @@ function user_search($keys) { return $find; } +function user_block() { + global $user; + + if ($user->uid) { + // Display account settings: + $block[0]["subject"] = $user->name; + + $output .= "
\n"; + + foreach (module_list() as $name) { + if (module_hook($name, "link")) { + $links = module_invoke($name, "link", "menu"); + foreach ($links as $link) { + $output .= "$link
\n"; + } + } + } + + if (user_access("access administration pages")) { + $output .= "
\n"; + $output .= "". strtr(t("administer %a"), array("%a" => variable_get("site_name", "drupal"))) ."
\n"; + } + + $output .= "
"; + } + else { + $block[0]["subject"] = t("Log in"); + + $output .= "
\n"; + $output .= "
\n"; + $output .= " ". t("Username") .":

\n"; + $output .= " ". t("Password") .":

\n"; + $output .= form_checkbox(t("Remember me"), "remember_me", 1, 0); + $output .= "
\n"; + if (variable_get("account_register", 1)) $output .= " ". t("REGISTER") ."\n"; + $output .= "

\n"; + $output .= "
\n"; + } + $block[0]["content"] = $output; + $block[0]["info"] = t("User information"); + $block[0]["link"] = "module.php?mod=user"; + + return $block; +} + function user_link($type) { if ($type == "page") { $links[] = "". t("user account") .""; -- cgit v1.2.3