summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc16
-rw-r--r--includes/tablesort.inc2
2 files changed, 15 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 60a383603..e5c23fcab 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -822,11 +822,23 @@ function format_date($timestamp, $type = "medium", $format = "") {
function format_name($object) {
if ($object->uid && $object->name) {
+ /*
+ ** Shorten the name when it is too long or it will break many
+ ** tables.
+ */
+
+ if (strlen($object->name) > 20) {
+ $name = substr($object->name, 0, 15) ."...";
+ }
+ else {
+ $name = $object->name;
+ }
+
if (arg(0) == "admin") {
- $output = l($object->name, "admin/user/edit/$object->uid", array("title" => t("Administer user profile.")));
+ $output = l($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.")));
+ $output = l($name, "user/view/$object->uid", array("title" => t("View user profile.")));
}
}
else if ($object->name) {
diff --git a/includes/tablesort.inc b/includes/tablesort.inc
index 184176114..8b7fdd2a6 100644
--- a/includes/tablesort.inc
+++ b/includes/tablesort.inc
@@ -31,7 +31,7 @@ function tablesort($cell, $header) {
$cell["class"] = "cell-highlight";
$image = "&nbsp;<img src=\"". $theme->image("arrow-". $ts["sort"]. ".gif"). "\"></img>";
}
- $cell["data"] = l($cell["data"], $_GET["q"], array(), "sort=". $ts["sort"]. "&order=". urlencode($cell["data"]). $ts["query_string"]). $image;
+ $cell["data"] = l($cell["data"] . $image, $_GET["q"], array(), "sort=". $ts["sort"]. "&order=". urlencode($cell["data"]). $ts["query_string"]);
return $cell;
}