Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * Settings that allow configuration of the list of tex examples in the equation editor.
  19   *
  20   * @package    atto_equation
  21   * @copyright  2013 Damyon Wiese
  22   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  
  25  defined('MOODLE_INTERNAL') || die();
  26  
  27  $ADMIN->add('editoratto', new admin_category('atto_equation', new lang_string('pluginname', 'atto_equation')));
  28  
  29  $settings = new admin_settingpage('atto_equation_settings', new lang_string('settings', 'atto_equation'));
  30  if ($ADMIN->fulltree) {
  31      // Group 1
  32      $name = new lang_string('librarygroup1', 'atto_equation');
  33      $desc = new lang_string('librarygroup1_desc', 'atto_equation');
  34      $default = '
  35  \cdot
  36  \times
  37  \ast
  38  \div
  39  \diamond
  40  \pm
  41  \mp
  42  \oplus
  43  \ominus
  44  \otimes
  45  \oslash
  46  \odot
  47  \circ
  48  \bullet
  49  \asymp
  50  \equiv
  51  \subseteq
  52  \supseteq
  53  \leq
  54  \geq
  55  \preceq
  56  \succeq
  57  \sim
  58  \simeq
  59  \approx
  60  \subset
  61  \supset
  62  \ll
  63  \gg
  64  \prec
  65  \succ
  66  \infty
  67  \in
  68  \ni
  69  \forall
  70  \exists
  71  \neq
  72  ';
  73      $setting = new admin_setting_configtextarea('atto_equation/librarygroup1',
  74                                                  $name,
  75                                                  $desc,
  76                                                  $default);
  77      $settings->add($setting);
  78  
  79      // Group 2
  80      $name = new lang_string('librarygroup2', 'atto_equation');
  81      $desc = new lang_string('librarygroup2_desc', 'atto_equation');
  82      $default = '
  83  \leftarrow
  84  \rightarrow
  85  \uparrow
  86  \downarrow
  87  \leftrightarrow
  88  \nearrow
  89  \searrow
  90  \swarrow
  91  \nwarrow
  92  \Leftarrow
  93  \Rightarrow
  94  \Uparrow
  95  \Downarrow
  96  \Leftrightarrow
  97  ';
  98      $setting = new admin_setting_configtextarea('atto_equation/librarygroup2',
  99                                                  $name,
 100                                                  $desc,
 101                                                  $default);
 102      $settings->add($setting);
 103  
 104      // Group 3
 105      $name = new lang_string('librarygroup3', 'atto_equation');
 106      $desc = new lang_string('librarygroup3_desc', 'atto_equation');
 107      $default = '
 108  \alpha
 109  \beta
 110  \gamma
 111  \delta
 112  \epsilon
 113  \zeta
 114  \eta
 115  \theta
 116  \iota
 117  \kappa
 118  \lambda
 119  \mu
 120  \nu
 121  \xi
 122  \pi
 123  \rho
 124  \sigma
 125  \tau
 126  \upsilon
 127  \phi
 128  \chi
 129  \psi
 130  \omega
 131  \Gamma
 132  \Delta
 133  \Theta
 134  \Lambda
 135  \Xi
 136  \Pi
 137  \Sigma
 138  \Upsilon
 139  \Phi
 140  \Psi
 141  \Omega
 142  ';
 143      $setting = new admin_setting_configtextarea('atto_equation/librarygroup3',
 144                                                  $name,
 145                                                  $desc,
 146                                                  $default);
 147      $settings->add($setting);
 148  
 149      // Group 4
 150      $name = new lang_string('librarygroup4', 'atto_equation');
 151      $desc = new lang_string('librarygroup4_desc', 'atto_equation');
 152      $default = '
 153  \sum{a,b}
 154  \sqrt[a]{b+c}
 155  \int_{a}^{b}{c}
 156  \iint_{a}^{b}{c}
 157  \iiint_{a}^{b}{c}
 158  \oint{a}
 159  (a)
 160  [a]
 161  \lbrace{a}\rbrace
 162  \left| \begin{matrix} a_1 & a_2 \\ a_3 & a_4 \end{matrix} \right|
 163  \frac{a}{b+c}
 164  \vec{a}
 165  \binom {a} {b}
 166  {a \brack b}
 167  {a \brace b}
 168  ';
 169      $setting = new admin_setting_configtextarea('atto_equation/librarygroup4',
 170                                                  $name,
 171                                                  $desc,
 172                                                  $default);
 173      $settings->add($setting);
 174  
 175  }