ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMathJaxConfigSettingsRepository.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
26  protected ilSetting $settings;
27 
32  public function __construct(ilSetting $settings)
33  {
34  $this->settings = $settings;
35  }
36 
40  public function getConfig(): ilMathJaxConfig
41  {
42  return new ilMathJaxConfig(
43  (bool) $this->settings->get('enable'),
44  (string) $this->settings->get('path_to_polyfill'),
45  (string) $this->settings->get('path_to_mathjax'),
46  (int) $this->settings->get('limiter'),
47  (bool) $this->settings->get('enable_server'),
48  (string) $this->settings->get('server_address'),
49  (int) $this->settings->get('server_timeout'),
50  (bool) $this->settings->get('server_for_browser'),
51  (bool) $this->settings->get('server_for_export'),
52  (bool) $this->settings->get('server_for_pdf')
53  );
54  }
55 
59  public function updateConfig(ilMathJaxConfig $config): void
60  {
61  $this->settings->set('enable', (string) $config->isClientEnabled());
62  $this->settings->set('path_to_polyfill', $config->getClintPolyfillUrl());
63  $this->settings->set('path_to_mathjax', $config->getClientScriptUrl());
64  $this->settings->set('limiter', (string) $config->getClientLimiter());
65  $this->settings->set('enable_server', (string) $config->isServerEnabled());
66  $this->settings->set('server_address', $config->getServerAddress());
67  $this->settings->set('server_timeout', (string) $config->getServerTimeout());
68  $this->settings->set('server_for_browser', (string) $config->isServerForBrowser());
69  $this->settings->set('server_for_export', (string) $config->isServerForExport());
70  $this->settings->set('server_for_pdf', (string) $config->isServerForPdf());
71  }
72 }
isServerForPdf()
Should the server-side rendingeing be used for PDF generation.
getClintPolyfillUrl()
Url of a javascript polyfill (needed by MathJax 3)
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
isServerForExport()
Should the server-side rendingeing be used for HTML exports.
Global Mathjax configuration.
isServerEnabled()
Is a server side rendering engine configured and enabled.
getServerAddress()
Url of Mathjax server.
getClientLimiter()
Type of enclosing limiters for wich the embedded client-side Mathjax is configured.
getClientScriptUrl()
Url of Mathjax script to be embedded with script tag on the page.
isClientEnabled()
Should latex code be rendered in the browser.
getServerTimeout()
timeout (s) to wait for the result of the rendering server
updateConfig(ilMathJaxConfig $config)
Update the MathNax Configuration.
isServerForBrowser()
Should the server-side rendingeing be used for browser output.
Repository for storing and loading the MathJax configuration.