ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilMathJaxConfigCheckedObjective Class Reference
+ Inheritance diagram for ilMathJaxConfigCheckedObjective:
+ Collaboration diagram for ilMathJaxConfigCheckedObjective:

Public Member Functions

 __construct (?\ilMathJaxSetupConfig $setup_config=null)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Protected Member Functions

 checkClientScriptUrl (ilMathJaxConfig $config, Setup\AdminInteraction $interaction)
 Check if an outdated script URL is used. More...
 

Protected Attributes

ilMathJaxSetupConfig $setup_config = null
 

Detailed Description

Definition at line 23 of file class.ilMathJaxConfigCheckedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilMathJaxConfigCheckedObjective::__construct ( ?\ilMathJaxSetupConfig  $setup_config = null)

Definition at line 27 of file class.ilMathJaxConfigCheckedObjective.php.

References $setup_config.

28  {
29  $this->setup_config = $setup_config;
30  }

Member Function Documentation

◆ checkClientScriptUrl()

ilMathJaxConfigCheckedObjective::checkClientScriptUrl ( ilMathJaxConfig  $config,
Setup\AdminInteraction  $interaction 
)
protected

Check if an outdated script URL is used.

Definition at line 74 of file class.ilMathJaxConfigCheckedObjective.php.

References ilMathJaxConfig\getClientScriptUrl().

Referenced by getPreconditions().

74  : void
75  {
76  $recommended = 'https://YOUR_ILIAS_URL/assets/js/cdn-mathjax2-tex-mml-chtml-safe.js';
77 
78  if (str_contains($config->getClientScriptUrl(), '?')) {
79  $interaction->inform("ILIAS 10 cuts query params of javascript URLs that are added to the page."
80  . " Please replace your MathJax URL with $recommended or a similar script that sets the save mode of MathJax!");
81 
82  if ($this->setup_config !== null && str_contains($this->setup_config->getConfig()->getClientScriptUrl(), '?')) {
83  $interaction->inform("Change the URL in the setup.json to avoid this message in the next update.");
84  }
85  }
86  }
getClientScriptUrl()
Url of Mathjax script to be embedded with script tag on the page.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHash()

ilMathJaxConfigCheckedObjective::getHash ( )

Definition at line 32 of file class.ilMathJaxConfigCheckedObjective.php.

32  : string
33  {
34  return hash("sha256", self::class);
35  }

◆ getLabel()

ilMathJaxConfigCheckedObjective::getLabel ( )

Definition at line 37 of file class.ilMathJaxConfigCheckedObjective.php.

37  : string
38  {
39  return "Check configuration of Services/MathJax";
40  }

◆ getPreconditions()

ilMathJaxConfigCheckedObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 47 of file class.ilMathJaxConfigCheckedObjective.php.

References checkClientScriptUrl().

47  : array
48  {
49  return [
50  new \ilSettingsFactoryExistsObjective()
51  ];
52  }
+ Here is the call graph for this function:

◆ isApplicable()

ilMathJaxConfigCheckedObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 66 of file class.ilMathJaxConfigCheckedObjective.php.

66  : bool
67  {
68  return true;
69  }

◆ isNotable()

ilMathJaxConfigCheckedObjective::isNotable ( )

Definition at line 42 of file class.ilMathJaxConfigCheckedObjective.php.

42  : bool
43  {
44  return false;
45  }

Field Documentation

◆ $setup_config

ilMathJaxSetupConfig ilMathJaxConfigCheckedObjective::$setup_config = null
protected

Definition at line 25 of file class.ilMathJaxConfigCheckedObjective.php.

Referenced by __construct().


The documentation for this class was generated from the following file: