Exemplo n.º 1
0
/**
 * Parse the user text (e.g. stored in database)
 * before displaying it to the screen
 * For example it change new line charater to <br> tag etc.
 *
 * @param string $userText original user text
 * @return string : parsed user text
 * @author Hugues Peeters <*****@*****.**>
 */
function claro_parse_user_text($userText)
{
    $userText = cleanup_mso2007_text($userText);
    $userText = cleanUpLaTeX($userText);
    $userText = renderTex($userText);
    $userText = make_clickable($userText);
    $userText = make_spoiler($userText);
    if (!claro_is_html($userText)) {
        // only if the content isn't HTML change new line to <br>
        // Note the '<!-- content: html -->' is introduced by HTML Area
        $userText = nl2br($userText);
    }
    return $userText;
}
Exemplo n.º 2
0
<?php

// load Claroline kernel
require_once dirname(__FILE__) . '/../../../../../inc/claro_init_global.inc.php';
if (!claro_is_allowed_to_edit()) {
    claro_die(get_lang('Not allowed'));
}
$acceptedCmdList = array('rqSpoiler');
if (isset($_REQUEST['cmd']) && in_array($_REQUEST['cmd'], $acceptedCmdList)) {
    $cmd = $_REQUEST['cmd'];
} else {
    $cmd = null;
}
if ($cmd == 'rqSpoiler') {
    if (isset($_REQUEST['title']) && $_REQUEST['title'] && isset($_REQUEST['content']) && $_REQUEST['content']) {
        echo make_spoiler('<p>[spoiler /' . $_REQUEST['title'] . '/]</p>' . $_REQUEST['content'] . '<p>[/spoiler]</p>');
    }
    exit;
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?php 
echo get_lang('Spoiler Editor');
?>
</title>
	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
	<script type="text/javascript" src="js/dialog.js"></script>
	<script type="text/javascript" src="<?php