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  
   3  defined('MOODLE_INTERNAL') || die;
   4  
   5  if ($ADMIN->fulltree) {
   6      require_once($CFG->dirroot.'/mod/glossary/lib.php');
   7  
   8      $settings->add(new admin_setting_heading('glossary_normal_header', get_string('glossaryleveldefaultsettings', 'glossary'), ''));
   9  
  10      $settings->add(new admin_setting_configtext('glossary_entbypage', get_string('entbypage', 'glossary'),
  11                         get_string('entbypage', 'glossary'), 10, PARAM_INT));
  12  
  13  
  14      $settings->add(new admin_setting_configcheckbox('glossary_dupentries', get_string('allowduplicatedentries', 'glossary'),
  15                         get_string('cnfallowdupentries', 'glossary'), 0));
  16  
  17      $settings->add(new admin_setting_configcheckbox('glossary_allowcomments', get_string('allowcomments', 'glossary'),
  18                         get_string('cnfallowcomments', 'glossary'), 0));
  19  
  20      $settings->add(new admin_setting_configcheckbox('glossary_linkbydefault', get_string('usedynalink', 'glossary'),
  21                         get_string('cnflinkglossaries', 'glossary'), 1));
  22  
  23      $settings->add(new admin_setting_configcheckbox('glossary_defaultapproval', get_string('defaultapproval', 'glossary'),
  24                         get_string('cnfapprovalstatus', 'glossary'), 1));
  25  
  26  
  27      if (empty($CFG->enablerssfeeds)) {
  28          $options = array(0 => get_string('rssglobaldisabled', 'admin'));
  29          $str = get_string('configenablerssfeeds', 'glossary').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
  30  
  31      } else {
  32          $options = array(0=>get_string('no'), 1=>get_string('yes'));
  33          $str = get_string('configenablerssfeeds', 'glossary');
  34      }
  35      $settings->add(new admin_setting_configselect('glossary_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
  36                         $str, 0, $options));
  37  
  38  
  39      $settings->add(new admin_setting_heading('glossary_levdev_header', get_string('entryleveldefaultsettings', 'glossary'), ''));
  40  
  41      $settings->add(new admin_setting_configcheckbox('glossary_linkentries', get_string('usedynalink', 'glossary'),
  42                         get_string('cnflinkentry', 'glossary'), 0));
  43  
  44      $settings->add(new admin_setting_configcheckbox('glossary_casesensitive', get_string('casesensitive', 'glossary'),
  45                         get_string('cnfcasesensitive', 'glossary'), 0));
  46  
  47      $settings->add(new admin_setting_configcheckbox('glossary_fullmatch', get_string('fullmatch', 'glossary'),
  48                         get_string('cnffullmatch', 'glossary'), 0));
  49  
  50  
  51      //Update and get available formats
  52      $recformats = glossary_get_available_formats();
  53      $formats = array();
  54      //Take names
  55      foreach ($recformats as $format) {
  56          $formats[$format->id] = get_string("displayformat$format->name", "glossary");
  57      }
  58      asort($formats);
  59  
  60      $str = '<table>';
  61      foreach ($formats as $formatid=>$formatname) {
  62          $recformat = $DB->get_record('glossary_formats', array('id'=>$formatid));
  63          $str .= '<tr>';
  64          $str .= '<td>' . $formatname . '</td>';
  65          $eicon = "<a title=\"".get_string("edit")."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=edit\">";
  66          $eicon .= $OUTPUT->pix_icon('t/edit', get_string('edit')). "</a>";
  67          if ( $recformat->visible ) {
  68              $vtitle = get_string("hide");
  69              $vicon  = "t/hide";
  70          } else {
  71              $vtitle = get_string("show");
  72              $vicon  = "t/show";
  73          }
  74          $url = "$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=visible&amp;sesskey=".sesskey();
  75          $viconlink = "<a title=\"$vtitle\" href=\"$url\">";
  76          $viconlink .= $OUTPUT->pix_icon($vicon, $vtitle) . "</a>";
  77  
  78          $str .= '<td align="center">' . $eicon . '&nbsp;&nbsp;' . $viconlink . '</td>';
  79          $str .= '</tr>';
  80      }
  81      $str .= '</table>';
  82  
  83      $settings->add(new admin_setting_heading('glossary_formats_header', get_string('displayformatssetup', 'glossary'), $str));
  84  }