. /** * Library of functions for web output * * Library of all general-purpose Moodle PHP functions and constants * that produce HTML output * * Other main libraries: * - datalib.php - functions that access the database. * - moodlelib.php - general-purpose Moodle functions. * * @package moodlecore * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /// Constants /// Define text formatting types ... eventually we can add Wiki, BBcode etc /** * Does all sorts of transformations and filtering */ define('FORMAT_MOODLE', '0'); // Does all sorts of transformations and filtering /** * Plain HTML (with some tags stripped) */ define('FORMAT_HTML', '1'); // Plain HTML (with some tags stripped) /** * Plain text (even tags are printed in full) */ define('FORMAT_PLAIN', '2'); // Plain text (even tags are printed in full) /** * Wiki-formatted text * Deprecated: left here just to note that '3' is not used (at the moment) * and to catch any latent wiki-like text (which generates an error) */ define('FORMAT_WIKI', '3'); // Wiki-formatted text /** * Markdown-formatted text http://daringfireball.net/projects/markdown/ */ define('FORMAT_MARKDOWN', '4'); // Markdown-formatted text http://daringfireball.net/projects/markdown/ /** * TRUSTTEXT marker - if present in text, text cleaning should be bypassed */ define('TRUSTTEXT', '#####TRUSTTEXT#####'); /** * Allowed tags - string of html tags that can be tested against for safe html tags * @global string $ALLOWED_TAGS * @name $ALLOWED_TAGS */ global $ALLOWED_TAGS; $ALLOWED_TAGS = '