diff --git a/app/Utils.inc b/app/Utils.inc
index 76ccc7fe..d248dee1 100644
--- a/app/Utils.inc
+++ b/app/Utils.inc
@@ -46,6 +46,38 @@
return htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
}
+
+ /**
+ * Cut a string to the given length but only word boundaries.
+ *
+ * @static
+ * @param string $string String to cut
+ * @param int $length Length to cut string
+ * @param int $scope Maximum length to cut string regardless word boundaries
+ * @return string Cutted string
+ */
+ public static function shortenString($string, $length, $scope)
+ {
+ // Determine length
+ $length = min($length, strlen($string));
+
+ // Look for word boundary
+ if(($pos = strpos($string, ' ', $length)) !== false)
+ {
+ // Check if boundary is outside of scope
+ if($pos > $length + $scope) {
+ $pos = strrpos(substr($string, 0, $pos), ' ');
+ }
+ }
+ else {
+ $pos = strlen($string);
+ }
+
+
+ // Cut string and return it
+ return substr($string, 0, $pos);
+ }
+
}
?>
diff --git a/controllers/SeminariesController.inc b/controllers/SeminariesController.inc
index bf89b9f2..571e636f 100644
--- a/controllers/SeminariesController.inc
+++ b/controllers/SeminariesController.inc
@@ -100,9 +100,21 @@
// Get Questgroups
$hierarchy['questgroups'] = $this->Questgroups->getQuestgroupsForHierarchy($hierarchy['id']);
- // Check permission of Questgroups
- for($i=1; $i =\hhu\z\Utils::t($seminary['description'])?> 350 / 450 XP Einleitungstext: Mit völlig verseuchtem Tagewerk machst du dich an die Arbeit und stellst schnell fest... =$group['text']?>=_('Seminaries')?>
=$seminary['title']?>
-Beschreibung
+=_('Description')?>
=sprintf(_('created by %s on %s'), $seminary['creator']['username'], $dateFormatter->format(new \DateTime($seminary['created'])))?> -
\ No newline at end of file +