Welcome, Guest
Username: Password: Remember me

TOPIC: Truncating text in admin

Truncating text in admin 3 years 7 months ago #55871

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 171
  • Thank you received: 1
  • Karma: 3
When questions are long, the table header in the backend that shows the overview of all responses gets very tall.

I tried to set a thead height with css, but only firefox accepts it, not chrome or IE.

So I thought I could shorten the questions in the header with a function:
<?PHP
  $numwords = 8;
  preg_match("/(\S+\s*){0,$numwords}/", $description, $regs);
  $shortdesc = trim($regs[0]);
?>
Now; this looks like the table header in browse.php I would need to truncate:
$tableheader .= "\t<thead><tr valign='top'>\n"
            . "<th><input type='checkbox' id='selectall'></th>\n"
            . "<th>".$clang->gT('Actions')."</th>\n";
 
	foreach ($fnames as $fn)
    {
        if (!isset($currentgroup))  {$currentgroup = $fn[1]; $gbc = "oddrow";}
        if ($currentgroup != $fn[1])
        {
            $currentgroup = $fn[1];
            if ($gbc == "oddrow") {$gbc = "evenrow";}
            else {$gbc = "oddrow";}
            }
        $tableheader .= "<th class='$gbc'>"
                . FlattenText("$fn[1]")
                . "</th>\n";
    }
    $tableheader .= "\t</tr></thead>\n\n";
And I tried to add it in there somehow, without luck. Any tip?
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 3 years 7 months ago by waitz.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.186 seconds
Donation Image