[FEATURE] Add splitChar to noTrimWrap
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / ContentObjectRenderer.php
index 48b4fba..39e3dc3 100644 (file)
@@ -3083,7 +3083,17 @@ class ContentObjectRenderer {
         * @return string The processed input value
         */
        public function stdWrap_noTrimWrap($content = '', $conf = array()) {
-               $content = $this->noTrimWrap($content, $conf['noTrimWrap']);
+               $splitChar = isset($conf['noTrimWrap.']['splitChar.'])
+                       ? $this->stdWrap($conf['noTrimWrap.']['splitChar'], $conf['noTrimWrap.']['splitChar.'])
+                       : $conf['noTrimWrap.']['splitChar'];
+               if ($splitChar === NULL || $splitChar === '') {
+                       $splitChar = '|';
+               }
+               $content = $this->noTrimWrap(
+                       $content,
+                       $conf['noTrimWrap'],
+                       $splitChar
+               );
                return $content;
        }
 
@@ -6341,13 +6351,14 @@ class ContentObjectRenderer {
         *
         * @param string $content The content to wrap, eg. "HELLO WORLD
         * @param string $wrap The wrap value, eg. " | <strong> | </strong>
+        * @param string $char The char used to split the wrapping value, default is "|"
         * @return string Wrapped input string, eg. " <strong> HELLO WORD </strong>
         * @see wrap()
         * @todo Define visibility
         */
-       public function noTrimWrap($content, $wrap) {
+       public function noTrimWrap($content, $wrap, $char = '|') {
                if ($wrap) {
-                       $wrapArr = explode('|', $wrap);
+                       $wrapArr = explode($char, $wrap);
                        return $wrapArr[1] . $content . $wrapArr[2];
                } else {
                        return $content;
@@ -7794,4 +7805,4 @@ class ContentObjectRenderer {
 
 }
 
-?>
+?>
\ No newline at end of file