19declare(strict_types=1);
34 return hash(
"sha256", self::class);
39 return "Check configuration of Services/MathJax";
50 new \ilSettingsFactoryExistsObjective()
57 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
58 $interaction = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
62 $repo->updateConfig($new_config);
84 $recommended =
'https://cdn.jsdelivr.net/npm/mathjax@2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe';
86 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML',
87 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe',
88 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML',
89 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe',
90 'https://cdn.jsdelivr.net/npm/mathjax@2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML',
91 'https://cdn.jsdelivr.net/npm/mathjax@2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
94 if (in_array(
$config->getClientScriptUrl(), $outdated)) {
95 if (
$config->isClientEnabled()) {
96 $change = $interaction->confirmOrDeny(
"Replace outdated or unsave MathJax URL with $recommended ?");
98 $interaction->inform(
"Replaced inactive outdated MathJax URL with $recommended");
103 && $this->setup_config !==
null
104 && in_array($this->setup_config->getConfig()->getClientScriptUrl(), $outdated)
106 $interaction->inform(
"Please change the URL in the setup.json to avoid this message in the next update.");
110 return $config->withClientScriptUrl($recommended);
checkClientScriptUrl(ilMathJaxConfig $config, Setup\AdminInteraction $interaction)
Check if an outdated script URL is used and try to correct it.
ilMathJaxSetupConfig $setup_config
isApplicable(Setup\Environment $environment)
getPreconditions(Setup\Environment $environment)
__construct(?\ilMathJaxSetupConfig $setup_config=null)
Repository for storing and loading the MathJax configuration.
Global Mathjax configuration.
This defines ways in which objectives may interact with admins during the setup.
An environment holds resources to be used in the setup process.
An objective is a desired state of the system that is supposed to be created by the setup.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...