ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
latex.php
Go to the documentation of this file.
1 <?php
2 
3 $steps = 0;
4 while(!file_exists('ilias.ini.php'))
5 {
6  chdir('..');
7  ++$steps;
8 }
9 
10 require_once 'Services/Init/classes/class.ilInitialisation.php';
12 
18 
19 $tpl = new ilTemplate(dirname(__FILE__) . '/tpl.latex.html', true, true);
20 
21 $tpl->resetJavascript();
22 
23 require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
25 if(strpos($jquery_path, './') === 0)
26 {
27  $jquery_path = substr($jquery_path, 2);
28 }
29 else if(strpos($jquery_path, '.') === 0)
30 {
31  $jquery_path = substr($jquery_path, 1);
32 }
33 
34 $mathJaxSetting = new ilSetting('MathJax');
35 if($mathJaxSetting->get('enable'))
36 {
37  $tpl->addJavaScript($mathJaxSetting->get('path_to_mathjax'));
38 
39  $tpl->setCurrentBlock('js_on_change_math_jax');
40  $tpl->touchBlock('js_on_change_math_jax');
41  $tpl->parseCurrentBlock();
42 
43  $tpl->setCurrentBlock('delimiter_latex');
44  $tpl->setVariable('DELIMITER', (int) $mathJaxSetting->get('limiter'));
45  $tpl->parseCurrentBlock();
46 }
47 else if(strlen($ilIliasIniFile->readVariable('tools', 'latex')))
48 {
49  $tpl->setCurrentBlock('js_on_change_latex');
50  $tpl->setVariable('LATEX_URL', $ilIliasIniFile->readVariable('tools', 'latex'));
51  $tpl->parseCurrentBlock();
52 }
53 
54 $tpl->addJavaScript(str_repeat('../', $steps) . $jquery_path, true, 1);
55 $tpl->fillJavaScriptFiles(true);
56 $tpl->show('DEFAULT', false, true);
$jquery_path
Definition: latex.php:24
ILIAS Setting Class.
global $ilIliasIniFile
Definition: latex.php:17
static initILIAS()
ilias initialisation
getLocaljQueryPath()
Get local path of jQuery file.
global $ilUser
Definition: latex.php:17
special template class to simplify handling of ITX/PEAR
$steps
Definition: latex.php:3
$tpl
Definition: latex.php:34
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:34