From cefb123e24e29636a4bb845ff7be687782b960a0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 23 Aug 2003 18:27:05 +0000 Subject: [PATCH] - Updated the profile module to use the new help system. Patch by Michael. --- modules/profile.module | 23 ++++++++++++++++++++--- modules/profile/profile.module | 23 ++++++++++++++++++++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/modules/profile.module b/modules/profile.module index cb6dfb145b1..fbea78419c9 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -36,10 +36,27 @@ function _profile_init() { $GLOBALS["profile_months"] = array(0 => t("month"), 1 => t("January"), 2 => t("February"), 3 => t("March"), 4 => t("April"), 5 => t("May"), 6 => t("June"), 7 => t("July"), 8 => t("August"), 9 => t("September"), 10 => t("October"), 11 => t("November"), 12 => t("December")); } +function profile_help($section) { + $output = ""; + + switch ($section) { + case 'admin/system/modules': + $output = "Support for configurable user profiles."; + break; + case 'admin/system/modules/profile': + $output = strtr("When a user creates an account you can ask them to give you some extra information about themselves, as well as letting them use a small picture, called an avatar.
Notes:", array("%edit" => l(t("edit their account"), "user/edit") )); + break; + } + return t($output); +} + function profile_system($field) { - $system["description"] = t("Support for configurable user profiles."); - $system["admin_help"] = t("When a user creates an account you can ask them to give you some extra information about themselves, as well as letting them use a small picture, called an avatar.
Notes:"); - return $system[$field]; + $output = ""; + + if ($field == "description") {$output = profile_help("admin/system/modules"); } + else if ($field == "admin_help") {$output = profile_help("admin/system/modules/profile"); }; + + return $output; } function profile_settings() { diff --git a/modules/profile/profile.module b/modules/profile/profile.module index cb6dfb145b1..fbea78419c9 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -36,10 +36,27 @@ function _profile_init() { $GLOBALS["profile_months"] = array(0 => t("month"), 1 => t("January"), 2 => t("February"), 3 => t("March"), 4 => t("April"), 5 => t("May"), 6 => t("June"), 7 => t("July"), 8 => t("August"), 9 => t("September"), 10 => t("October"), 11 => t("November"), 12 => t("December")); } +function profile_help($section) { + $output = ""; + + switch ($section) { + case 'admin/system/modules': + $output = "Support for configurable user profiles."; + break; + case 'admin/system/modules/profile': + $output = strtr("When a user creates an account you can ask them to give you some extra information about themselves, as well as letting them use a small picture, called an avatar.
Notes:", array("%edit" => l(t("edit their account"), "user/edit") )); + break; + } + return t($output); +} + function profile_system($field) { - $system["description"] = t("Support for configurable user profiles."); - $system["admin_help"] = t("When a user creates an account you can ask them to give you some extra information about themselves, as well as letting them use a small picture, called an avatar.
Notes:"); - return $system[$field]; + $output = ""; + + if ($field == "description") {$output = profile_help("admin/system/modules"); } + else if ($field == "admin_help") {$output = profile_help("admin/system/modules/profile"); }; + + return $output; } function profile_settings() {