Пример #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;
}
Пример #2
0
<?php

// load Claroline kernel
require_once dirname(__FILE__) . '/../../../../../inc/claro_init_global.inc.php';
$acceptedCmdList = array('rqTex');
if (isset($_REQUEST['cmd']) && in_array($_REQUEST['cmd'], $acceptedCmdList)) {
    $cmd = $_REQUEST['cmd'];
} else {
    $cmd = null;
}
if ($cmd == 'rqTex') {
    if (isset($_REQUEST['formula']) && $_REQUEST['formula']) {
        echo renderTex('[tex]' . $_REQUEST['formula'] . '[/tex]');
    }
    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('LaTeX Equation 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 
echo get_path('rootWeb');
?>
web/js/jquery.js"></script>