textprocessors()->register($name, new LegacyTextprocessor($fx, $visible_in_backend)); } /** * Apply a textprocessor on a text. * * @param string $text The input text. * @param string $name The name of the textprocessor. * * @return string HTML * @throws Exception If the textprocessor is unknown * @deprecated Use {@see TextprocessorRepository::mustApply()} of the global {@see TextprocessorRepository} as returned by {@see Env::textprocessors()}. */ function textprocessor_apply($text, $name) { return Env::getGlobal()->textprocessors()->mustApply((string)$text, (string)$name); } /** * Applies a textprocessor automatically on a {@see Translation} object. * * The used textprocessor is determined by the {@see Translation::$texttype} property. * * @param Translation $translationobj * @return string HTML * @deprecated Use {@see Translation::applyTextprocessor()} instead */ function textprocessor_apply_translation(Translation $translationobj) { return $translationobj->applyTextprocessor(Env::getGlobal()->textprocessors()); }