summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-02-02 10:13:13 +0000
committerDries Buytaert <dries@buytaert.net>2003-02-02 10:13:13 +0000
commite4ff41061466343e79efc74cd35c278e79353141 (patch)
tree148bae0054a206feb281b93d2aaabdef00e2fa7e /includes/common.inc
parent6fcadb8ef5a6decd2b5d144105cef676474519f1 (diff)
downloadbrdo-e4ff41061466343e79efc74cd35c278e79353141.tar.gz
brdo-e4ff41061466343e79efc74cd35c278e79353141.tar.bz2
- Patch by Moshe: sometimes modules display content composed by people who
are not members of the site. Two examples are listhandler and import modules. There is no easy way for these modules to display the true author of the content. Usually, the content appears as if authored by Anonymous User. This 3 line patch enables modules to override the author name in their _view() hook.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 16d1bef5d..05a9f4833 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -689,16 +689,25 @@ function format_date($timestamp, $type = "medium", $format = "") {
}
function format_name($object) {
- global $PHP_SELF;
if ($object->uid && $object->name) {
- if (strstr($PHP_SELF, "admin")) {
+ if (arg(0) == "admin") {
$output = l($object->name, "admin/user/edit/$object->uid", array("title" => t("Administer user profile.")));
}
else {
$output = l($object->name, "user/view/$object->uid", array("title" => t("View user profile.")));
}
}
+ else if ($object->name) {
+ /*
+ ** Sometimes modules display content composed by people who are
+ ** not registers members of the site (i.e. mailing list or news
+ ** aggregator modules). This clause enables modules to display
+ ** the true author of the content.
+ */
+
+ $output = $object->name;
+ }
else {
$output = t(variable_get(anonymous, "Anonymous"));
}