Check out the LimeSurvey source code on GitHub!

Truncating text in admin

6 years 1 month ago - 6 years 1 month ago #55871 by waitz
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:
  $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: 6 years 1 month ago by waitz.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form