+////////// just return a truncated text
+function truncate ($text,$numb,$etc = "...") {
+ if (strlen($text) <= $numb) return $text;
+ return substr($text, 0, $numb).$etc;
+}
+// ditto but in case the text is too lare, returns a <span> with its 'title' set to the full value
+function truncate_and_popup ($text,$numb,$etc = "...") {
+ if (strlen($text) <= $numb) return $text;
+ $display=substr($text, 0, $numb).$etc;
+ return sprintf("<span title='%s'>%s</span>",$text,$display);
+}
+
+// generates <(atom) class=(class)> (text) </(atom)>
+function html_atom ($atom,$text,$class="") {
+ $html="<$atom";
+ if ($class) $html .= " class='$class'";
+ $html .= ">$text</$atom>";
+ return $html;
+}
+function html_div ($text,$class="") { return html_atom ('div',$text,$class); }
+function html_span ($text,$class="") { return html_atom ('span',$text,$class); }
+