Exemplo n.º 1
0
 /**
  * Extracts the sample description text from the content array.
  *
  * @param array Content array
  * @return string Description string
  */
 public function bodyDescription($contentArr)
 {
     // Setting description
     $maxL = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->conf['index_descrLgd'], 0, 255, 200);
     if ($maxL) {
         $bodyDescription = str_replace(array(' ', TAB, CR, LF), ' ', $contentArr['body']);
         // Shorten the string:
         $bodyDescription = $this->csObj->strtrunc('utf-8', $bodyDescription, $maxL);
     }
     return $bodyDescription;
 }
Exemplo n.º 2
0
 /**
  * Extracts the sample description text from the content array.
  *
  * @param array $contentArr Content array
  * @return string Description string
  */
 public function bodyDescription($contentArr)
 {
     // Setting description
     $maxL = MathUtility::forceIntegerInRange($this->conf['index_descrLgd'], 0, 255, 200);
     if ($maxL) {
         $bodyDescription = preg_replace('/\\s+/u', ' ', $contentArr['body']);
         // Shorten the string:
         $bodyDescription = $this->csObj->strtrunc('utf-8', $bodyDescription, $maxL);
     }
     return $bodyDescription;
 }