示例#1
0
 /**
  * Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
  * Do NOT htmlspecialchar the string from this function - has already been done.
  *
  * @param array $row The input row array (where the key "title" is used for the title)
  * @param int $titleLen Title length (30)
  * @return string The title.
  */
 public function getTitleStr($row, $titleLen = 30)
 {
     if ($this->ext_showNavTitle && trim($row['nav_title']) !== '') {
         $title = '<span title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xlf:title', TRUE) . ' ' . htmlspecialchars(trim($row['title'])) . '">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)) . '</span>';
     } else {
         $title = htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $titleLen));
         if (trim($row['nav_title']) !== '') {
             $title = '<span title="' . $GLOBALS['LANG']->sL('LLL:EXT:cms/locallang_tca.xlf:pages.nav_title', TRUE) . ' ' . htmlspecialchars(trim($row['nav_title'])) . '">' . $title . '</span>';
         }
         $title = trim($row['title']) === '' ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : $title;
     }
     return $title;
 }
示例#2
0
 /**
  * Will bring down the length of strings to < 150 chars if they were longer than 200 chars. This done by preserving the 70 first and last chars and concatenate those strings with "..." and a number indicating the string length
  *
  * @param string $clearBuffer The input string.
  * @param bool $last If set, it indicates that the string should just end with ... (thus no "complete" ending)
  * @return string Processed string.
  * @access private
  */
 public function addClearBuffer($clearBuffer, $last = 0)
 {
     if (strlen($clearBuffer) > 200) {
         $clearBuffer = ($this->clearBufferIdx ? GeneralUtility::fixed_lgd_cs($clearBuffer, 70) : '') . '[' . strlen($clearBuffer) . ']' . (!$last ? GeneralUtility::fixed_lgd_cs($clearBuffer, -70) : '');
     }
     $this->clearBufferIdx++;
     return $clearBuffer;
 }