Index: classes/preview/class.tx_templavoila_preview_type_bullets.php
===================================================================
--- classes/preview/class.tx_templavoila_preview_type_bullets.php (revision 36219)
+++ classes/preview/class.tx_templavoila_preview_type_bullets.php (working copy)
@@ -34,12 +34,21 @@ class tx_templavoila_preview_type_bullets extends tx_templavoila_preview_type_te
* @see classes/preview/tx_templavoila_preview_type_text#getPreviewData($row)
*/
protected function getPreviewData($row) {
-
+ if (isset($this->parentObj->modTSconfig['properties']['previewDataMaxLen'])) {
+ $max = intval($this->parentObj->modTSconfig['properties']['previewDataMaxLen']);
+ } else {
+ $max = 2000;
+ }
$htmlBullets = '';
$bulletsArr = explode ("\n", $this->preparePreviewData($row['bodytext']));
if (is_array ($bulletsArr)) {
foreach ($bulletsArr as $listItem) {
- $htmlBullets .= '
' . htmlspecialchars(trim(strip_tags($listItem))) . '';
+ $processedItem = t3lib_div::fixed_lgd_cs(trim(strip_tags($listItem)), $max);
+ $max -= strlen($processedItem);
+ $htmlBullets .= '' . htmlspecialchars($processedItem) . '';
+ if (!$max) {
+ break;
+ }
}
}
return '';
Index: classes/preview/class.tx_templavoila_preview_type_html.php
===================================================================
--- classes/preview/class.tx_templavoila_preview_type_html.php (revision 36219)
+++ classes/preview/class.tx_templavoila_preview_type_html.php (working copy)
@@ -32,7 +32,7 @@ class tx_templavoila_preview_type_html extends tx_templavoila_preview_type_text
* @see classes/preview/tx_templavoila_preview_type_text#getPreviewData($row)
*/
protected function getPreviewData($row) {
- return $this->preparePreviewData($row[$this->previewField], 2000, FALSE);
+ return $this->preparePreviewData($row[$this->previewField], null, FALSE);
}
}
Index: classes/preview/class.tx_templavoila_preview_type_list.php
===================================================================
--- classes/preview/class.tx_templavoila_preview_type_list.php (revision 36219)
+++ classes/preview/class.tx_templavoila_preview_type_list.php (working copy)
@@ -35,6 +35,7 @@ class tx_templavoila_preview_type_list extends tx_templavoila_preview_type_text
*/
protected function getPreviewData($row) {
+ $this->parentObj = $ref;
$info = htmlspecialchars($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','list_type',$row['list_type'])));
$info .= ' – ';
$info .= htmlspecialchars($this->getExtraInfo($row));
Index: classes/preview/class.tx_templavoila_preview_type_text.php
===================================================================
--- classes/preview/class.tx_templavoila_preview_type_text.php (revision 36219)
+++ classes/preview/class.tx_templavoila_preview_type_text.php (working copy)
@@ -27,6 +27,8 @@ class tx_templavoila_preview_type_text {
protected $previewField = 'bodytext';
+ protected $parentObj;
+
/**
*
* @param array $row
@@ -37,6 +39,7 @@ class tx_templavoila_preview_type_text {
* @return string
*/
public function render_previewContent ($row, $table, $output, $alreadyRendered, &$ref) {
+ $this->parentObj = $ref;
$label = $this->getPreviewLabel();
$data = $this->getPreviewData($row);
if ($ref->currentElementBelongsToCurrentPage) {
@@ -71,10 +74,14 @@ class tx_templavoila_preview_type_text {
* @param boolean $stripTags: HTML-blocks usually keep their tags
* @return string the properly prepared string
*/
- protected function preparePreviewData($str, $max = 2000, $stripTags = true) {
+ protected function preparePreviewData($str, $max = null, $stripTags = true) {
//Enable to omit that parameter
if ($max === null) {
- $max = 2000;
+ if (isset($this->parentObj->modTSconfig['properties']['previewDataMaxLen'])) {
+ $max = intval($this->parentObj->modTSconfig['properties']['previewDataMaxLen']);
+ } else {
+ $max = 2000;
+ }
}
if ($stripTags) {
//remove tags but avoid that the output is concatinated without spaces (#8375)
Index: classes/preview/class.tx_templavoila_preview_type_textpic.php
===================================================================
--- classes/preview/class.tx_templavoila_preview_type_textpic.php (revision 36219)
+++ classes/preview/class.tx_templavoila_preview_type_textpic.php (working copy)
@@ -35,6 +35,7 @@ class tx_templavoila_preview_type_textpic extends tx_templavoila_preview_type_te
*/
public function render_previewContent ($row, $table, $output, $alreadyRendered, &$ref) {
+ $this->parentObj = $ref;
$thumbnail = ''.$GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','image'),1).'
';
$thumbnail .= t3lib_BEfunc::thumbCode($row, 'tt_content', 'image', $ref->doc->backPath);