diff msite.inc.php @ 135:eecac02579c4

Move stChop() to site module and rename it to stStrChop().
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Oct 2013 21:55:12 +0300
parents 73608dc4123f
children 75cf14ee99a7
line wrap: on
line diff
--- a/msite.inc.php	Tue Oct 22 21:50:02 2013 +0300
+++ b/msite.inc.php	Tue Oct 22 21:55:12 2013 +0300
@@ -540,4 +540,17 @@
 
   return stChkSetting("allowRegister") && ($maxAttendeesHard <= 0 || $numAttendees < $maxAttendeesHard);
 }
+
+
+function stStrChop($str, $len)
+{
+  if (strlen($str) > $len)
+    $s = substr($str, 0, $len - 3)."...";
+  else
+    $s = $str;
+  return sprintf("%-".$len."s", $s);
+}
+
+
+
 ?>
\ No newline at end of file