Erzeugt HTML-Code eines Acronyms.
@access		public
@static
@param		string		$text			Text des Acronyms
@param		string		$description		Beschreibung des Acronyms
@param		string		$class			CSS-Klasse des Acronyms
@return		string
511215
public static function Acronym( $text, $description, $class = "" )
	{
		$ins_title		= " title=\"".$description."\"";
		$ins_class	= $class ? " class=\"".$class."\"" : "";
		$code		= "<acronym".$ins_title.$ins_class.">".$text."</acronym>";
		return $code;
	}
751942
public static function translateFromEditMode($text)
    {
        $app = Application::getFacadeApplication();
        $entityManager = $app->make(EntityManagerInterface::class);
        $resolver = $app->make(ResolverManagerInterface::class);
        $appUrl = Application::getApplicationURL();

        $text = preg_replace(
            [
                '/{CCM:BASE_URL}/i',
            ],
            [
                $appUrl,
            ],
            $text
        );

        //page links...
        $text = preg_replace(
            '/{CCM:CID_([0-9]+)}/i',
            $appUrl . '/' . DISPATCHER_FILENAME . '?cID=\\1',
            $text
        );

        //images...
        $dom = new HtmlDomParser();
        $r = $dom->str_get_html($text, true, true, DEFAULT_TARGET_CHARSET, false);
        if (is_object($r)) {
            foreach ($r->find('concrete-picture') as $picture) {
                $fID = $picture->fid;

                $attrString = "";
                foreach ($picture->attr as $attr => $val) {
                    if (!in_array($attr, self::$blackListImgAttributes)) {
                        $attrString .= "$attr=\"$val\" ";
                    }
                }

                $picture->outertext = '<img src="' . $resolver->resolve([
                        '/download_file',
                        'view_inline',
                        $fID
                    ]) . '" ' . $attrString . '/>';
            }

            $text = (string) $r->restore_noise($r);
        }

        // now we add in support for the links
        $text = static::replacePlaceholder(
            $text,
            '{CCM:FID_([0-9]+)}',
            function ($fID) use ($resolver) {
                if ($fID > 0) {
                    return $resolver->resolve(['/download_file', 'view_inline', $fID]);
                }
            }
        );

        //file downloads...
        $text = static::replacePlaceholder(
            $text,
            '{CCM:FID_DL_([0-9]+)}',
            function ($fID) use ($resolver) {
                if ($fID > 0) {
                    return $resolver->resolve(['/download_file', 'view', $fID]);
                }
            }
        );

        return $text;
    }
569298
public static function getRealNamespace($class)
    {
        if (($lastNsPos = strrpos($realClass = self::getRealClass($class), '\\')) !== false) {
            return substr($realClass, 0, $lastNsPos);
        }
    }
728157
static public function htmlClassTr($html, $css_tr) {
    $html = preg_replace_callback('@<(?<tag>[a-z]+)(?<other>\s+[^>]*)class="(?<class>[^"]+)"@s', function ($attrs) use ($css_tr) {
      $class = ' '
        . strtr($attrs['class'], array(
          "\n" => ' ',
          "\r" => ' ',
          "\t" => ' ',
        )) . ' ';
      $class = strtr($class, $css_tr['*']);
      if (isset($css_tr[$attrs['tag']])) {
        $class = strtr($class, $css_tr[$attrs['tag']]);
      }
      $class = trim($class);
      if ($class !== '') {
        $class = 'class="' . $class . '"';
      }
      return '<' . $attrs['tag'] . $attrs['other'] . $class;
    }, $html);
    return $html;
  }
634424
public static function getNamespace($class)
    {
        if (is_object($class) === true) {
            $class = get_class($class);
        }
        foreach (['\\', '_'] as $separator) {
            $pos = strrpos($class, $separator);
            if ($pos !== false) {
                return ltrim(substr($class, 0, $pos), $separator);
            }
        }
        return '';
    }
955189
public function autoLink($text)
    {
        $rexProtocol = '(https?://)?';
        $rexDomain = '((?:[-a-zA-Z0-9]{1,63}\.)+[-a-zA-Z0-9]{2,63}|(?:[0-9]{1,3}\.){3}[0-9]{1,3})';
        $rexPort = '(:[0-9]{1,5})?';
        $rexPath = '(/[!$-/0-9:;=@_\':;!a-zA-Z\x7f-\xff]*?)?';
        $rexQuery = '(\?[!$-/0-9:;=@_\':;!a-zA-Z\x7f-\xff]+?)?';
        $rexFragment = '(#[!$-/0-9:;=@_\':;!a-zA-Z\x7f-\xff]+?)?';

        $text = preg_replace_callback(
            "&\\b$rexProtocol$rexDomain$rexPort$rexPath$rexQuery$rexFragment(?=[?.!,;:\"]?(\s|$))&",
            function ($match) {
                // Prepend http:// if no protocol specified
                $completeUrl = $match[1] ? $match[0] : "http://{$match[0]}";

                return '<a href="'.$completeUrl.'" target="_blank">'
                    .$match[2].$match[3].$match[4].'</a>';
            },
            htmlspecialchars($text)
        );

        return $text;
    }
255689
static function TextToHtml($txt) 
	{
		//Kills double spaces and spaces inside tags.
		while( !( strpos($txt,'  ') === FALSE ) ) $txt = str_replace('  ',' ',$txt);
		$txt = str_replace(' >','>',$txt);
		$txt = str_replace('< ','<',$txt);
	
		//Transforms accents in html entities.
		$txt = htmlentities($txt);
	
		//We need some HTML entities back!
		$txt = str_replace('&quot;','"',$txt);
		$txt = str_replace('&lt;','<',$txt);
		$txt = str_replace('&gt;','>',$txt);
		$txt = str_replace('&amp;','&',$txt);
	
		//Ajdusts links - anything starting with HTTP opens in a new window
		//$txt = str_ireplace("<a href=\"http://","<a target=\"_blank\" href=\"http://",$txt);
		//$txt = str_ireplace("<a href=http://","<a target=\"_blank\" href=http://",$txt);

		
		//Basic formatting
		$eol = ( strpos($txt,"\r") === FALSE ) ? "\n" : "\r\n";
		$html = '<p>'.str_replace("$eol$eol","</p><p>",$txt).'</p>';
		$html = str_replace("$eol","<br />\n",$html);
		$html = str_replace("</p>","</p>\n\n",$html);
		$html = str_replace("<p></p>","<p>&nbsp;</p>",$html);
	
		//Wipes <br> after block tags (for when the user includes some html in the text).
		$wipebr = Array("table","tr","td","blockquote","ul","ol","li");
	
		for($x = 0; $x < count($wipebr); $x++) 
		{
			$tag = $wipebr[$x];
			$html = str_ireplace("<$tag><br />","<$tag>",$html);
			$html = str_ireplace("</$tag><br />","</$tag>",$html);
		}
	
		return $html;
	}
1064254
public function getParsedText(string $text): string
    {
        $parser = new Node_Container_Document(true, false);

        if ($this->configData['emoticons']['active']) {
            $parser->add_emoticons($this->configData['emoticons']['path']);
        }

        $result = $parser->parse($text)
            ->detect_links()
            ->detect_emails();

        if ($this->configData['emoticons']['active']) {
            $result->detect_emoticons();
        }

        return $result->get_html();
    }
164625
protected function parseDescription($descriptionLine)
    {
        if (strpos($descriptionLine, '*') <= 2) {
            $descriptionLine = substr($descriptionLine, (strpos($descriptionLine, '*') + 1));
        }

        //geen lege comment regel indien al in grote omschrijving
        if (trim(str_replace(array("\n", "\r"), array('', ''), $descriptionLine)) == '') {
            if ($this->obj->fullDescription == '') {
                $descriptionLine = '';
            }
            $this->smallDescriptionDone = true;
        }

        if (!$this->smallDescriptionDone) {
            //add to small description
            $this->obj->smallDescription .= $descriptionLine;
        } else {
            //add to full description
            $this->obj->fullDescription .= $descriptionLine;
        }
    }
716241
public function paintText($text, Definition $definition, TestResult $result)
    {
        $regex = $this->patternTransformer->transformPatternToRegex($definition->getPattern());
        $style = $this->resultConverter->convertResultToString($result);
        $paramStyle = $style . '_param';

        // If it's just a string - skip
        if ('/' !== substr($regex, 0, 1)) {
            return $text;
        }

        // Find arguments with offsets
        $matches = array();
        preg_match($regex, $text, $matches, PREG_OFFSET_CAPTURE);
        array_shift($matches);

        // Replace arguments with colorized ones
        $shift = 0;
        $lastReplacementPosition = 0;
        foreach ($matches as $key => $match) {
            if (!is_numeric($key) || -1 === $match[1] || false !== strpos($match[0], '<')) {
                continue;
            }

            $offset = $match[1] + $shift;
            $value = $match[0];

            // Skip inner matches
            if ($lastReplacementPosition > $offset) {
                continue;
            }
            $lastReplacementPosition = $offset + strlen($value);

            $begin = substr($text, 0, $offset);
            $end = substr($text, $lastReplacementPosition);
            $format = "{-$style}{+$paramStyle}%s{-$paramStyle}{+$style}";
            $text = sprintf("%s{$format}%s", $begin, $value, $end);

            // Keep track of how many extra characters are added
            $shift += strlen($format) - 2;
            $lastReplacementPosition += strlen($format) - 2;
        }

        // Replace "<", ">" with colorized ones
        $text = preg_replace(
            '/(<[^>]+>)/',
            "{-$style}{+$paramStyle}\$1{-$paramStyle}{+$style}",
            $text
        );

        return $text;
    }
1099682
public static function translate($text)
    {
        foreach (Config::get('smiley.db_smileys') as $key => $value) {
            $div = "<div class='fst_sml $value'></div>";
            $text = str_replace($key, $div, $text);
        }

        foreach (Config::get('smiley.smileys') as $key => $value) {
            $div = "<div class='fst_sml $value'></div>";
            $text = str_replace($key, $div, $text);
        }
        //
        return $text;
    }
334894
private function getFormattedName($class)
    {
        $class_name = (substr(strrchr(get_class($class), "\\"), 1));
        $underscored = preg_replace('/([a-z])([A-Z])/', '$1_$2', $class_name);

        return strtolower($underscored);
    }
323108
public function label($text, $contextual = '', array $options = [])
    {
        $class = $prefix = 'label';

        if (isset($options['icon'])) {
            $content = $this->_icon($text, $options);
            unset($options['icon']);
        } else {
            $content = $text;
        }
        if (!empty($contextual)) {
            $class .= " $prefix-$contextual";
        }
        $classes = $class;
        if (isset($options['class']) && !empty($options['class'])) {
            $classes .= " " . $options['class'];
        }
        $options['class'] = $classes;
        return parent::tag('span', $content, $options);
    }
224715
public static function Parse( $text, $class = NULL )
	{
		$text = trim( $text );

		$pattern = "^(?<plus>\+)?(?<sign>-)?(?<all>P((?<year>\d+)Y)?((?<month>\d+)M)?((?<day>\d+)D)?T?((?<hour>\d+)H)?((?<minute>\d+)M)?(((?<second>\d+)(\.(?<micro>\d*))?)S)?)?$";
		if ( empty( $text ) || ! preg_match( "/$pattern/", $text, $matches ) )
		{
			throw XPath2Exception::withErrorCodeAndParams( "FORG0001", Resources::FORG0001, array( $text, "Duration" ) );
		}

		$sign = empty( $matches['sign'] ) ? false : $matches['sign'] == "-" ;
		$plus = empty( $matches['plus'] ) ? false : $matches['plus'] == "+" ;

		if (
			in_array( $matches["all"][ strlen( $matches["all"] ) -1 ], array( "P", "T" ) ) ||
			( in_array( $matches["all"][ strlen( $matches["all"] ) -1 ], array( "H", "S" ) ) && strpos( $matches["all"], "T" ) === false ) ||
			$plus
		)
		{
			throw XPath2Exception::withErrorCodeAndParams( "FORG0001", Resources::FORG0001, array( $text, "Duration" ) );
		}

		if ($sign || $plus )
		{
			$text = substr( $text, 1 );
		}

		if ( ! empty( $matches['day'] ) ||
			 ! empty( $matches['hour'] ) ||
			 ! empty( $matches['hour'] ) ||
			 ! empty( $matches['minute'] ) ||
			 ! empty( $matches['microseconds'] ))
		{
			throw XPath2Exception::withErrorCodeAndParams( "FORG0001", Resources::FORG0001, array( $text, "yearMonthDuration" ) );
		}

		$di = new \DateInterval( $text );
		$di->invert = $sign;

		// Normalize the interval.  It might be rational like 01Y02M  but it might be 01Y46M200D.
		// In this case the 46 will be converted into 03Y10M and the days will be dropped.
		$years = $di->y;
		$months = $di->m;

		if ( $months > 11 )
		{
			$years += intval( $months / 12 );
			$months = $months % 12;
		}

		$di = new \DateInterval( sprintf( "P%02sY%02sM", $years, $months ) );
		$di->hasValue = $di->m || $di->y;
		if ( $di->hasValue ) $di->invert = $sign;

		return new YearMonthDurationValue( $di );
	}
306191
public function highlight($text, array $options = []) {
		$string = highlight_string($text, true);

		$options += $this->_config;

		$attr = ['class' => $options['prefix'] . $options['lang']];

		$options['attr'] = $this->templater()->formatAttributes($attr);
		$options['content'] = str_replace(["\r\n", "\n", "\r"], '', $string);

		return $this->templater()->format('code', $options);
	}
151642
public static function strtolower($text, $charset='utf-8') {
        $charset = self::parse_charset($charset);

        if ($charset === 'utf-8' and function_exists('mb_strtolower')) {
            return mb_strtolower($text, 'UTF-8');
        }

        $oldlevel = error_reporting(E_PARSE);
        $result = self::typo3()->conv_case($charset, (string)$text, 'toLower');
        error_reporting($oldlevel);

        return $result;
    }
594561
protected function createListItem($class, $text)
    {
        $li = new NodeElement();
        $li->openTag('li')
           ->addAttribute('class', $class)
           ->finalize(false);

        if ($text !== null) {
            $li->setText($text);
        }

        return $li->closeTag();
    }