ratatoeskr/sys/textprocessors.php

Manage text processors (functions that transform text to HTML) and implement some default ones.

License

This file is part of Ratatöskr.  Ratatöskr is licensed unter the MIT / X11 License.  See “ratatoeskr/licenses/ratatoeskr” for more information.

Summary
ratatoeskr/sys/textprocessors.phpManage text processors (functions that transform text to HTML) and implement some default ones.
Functions
textprocessor_registerRegister a textprocessor.
textprocessor_applyApply a textprocessor on a text.
textprocessor_apply_translationApplys a textprocessor automatically on a Translation object.

Functions

textprocessor_register

function textprocessor_register($name,  
$fx,  
$visible_in_backend = True)

Register a textprocessor.

Parameters

$nameThe name of the textprocessor
$fxThe textprocessor function (function($input), returns HTML)
$visible_in_backendShould this textprocessor be visible in the backend?  Defaults to True.

textprocessor_apply

function textprocessor_apply($text,
$textprocessor)

Apply a textprocessor on a text.

Parameters

$textThe input text.
$textprocessorThe name of the textprocessor.

Returns

HTML

textprocessor_apply_translation

function textprocessor_apply_translation($translationobj)

Applys a textprocessor automatically on a Translation object.  The used textprocessor is determined by the $texttype property.

Parameters

$translationobjThe Translation object.

Returns

HTML

function textprocessor_register($name,  
$fx,  
$visible_in_backend = True)
Register a textprocessor.
function textprocessor_apply($text,
$textprocessor)
Apply a textprocessor on a text.
function textprocessor_apply_translation($translationobj)
Applys a textprocessor automatically on a Translation object.
A translation.
Close