mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-16637 removing obsoleted spellchecker support
This commit is contained in:
parent
5d0b1e40c1
commit
53b20fe35a
19 changed files with 18 additions and 1522 deletions
|
@ -3862,72 +3862,6 @@ class admin_setting_emoticons extends admin_setting {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting for spellchecker language selection.
|
||||
*/
|
||||
class admin_setting_special_editordictionary extends admin_setting_configselect {
|
||||
|
||||
function admin_setting_special_editordictionary() {
|
||||
$name = 'editordictionary';
|
||||
$visiblename = get_string('editordictionary','admin');
|
||||
$description = get_string('configeditordictionary', 'admin');
|
||||
parent::admin_setting_configselect($name, $visiblename, $description, '', NULL);
|
||||
}
|
||||
|
||||
function load_choices() {
|
||||
// function borrowed from the old moodle/admin/editor.php, slightly modified
|
||||
// Get all installed dictionaries in the system
|
||||
if (is_array($this->choices)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->choices = array();
|
||||
|
||||
global $CFG;
|
||||
|
||||
clearstatcache();
|
||||
|
||||
// If aspellpath isn't set don't even bother ;-)
|
||||
if (empty($CFG->aspellpath)) {
|
||||
$this->choices['error'] = 'Empty aspell path!';
|
||||
return true;
|
||||
}
|
||||
|
||||
// Do we have access to popen function?
|
||||
if (!function_exists('popen')) {
|
||||
$this->choices['error'] = 'Popen function disabled!';
|
||||
return true;
|
||||
}
|
||||
|
||||
$cmd = $CFG->aspellpath;
|
||||
$output = '';
|
||||
$dictionaries = array();
|
||||
|
||||
if(!($handle = @popen(escapeshellarg($cmd).' dump dicts', 'r'))) {
|
||||
$this->choices['error'] = 'Couldn\'t create handle!';
|
||||
}
|
||||
|
||||
while(!feof($handle)) {
|
||||
$output .= fread($handle, 1024);
|
||||
}
|
||||
@pclose($handle);
|
||||
|
||||
$dictionaries = explode(chr(10), $output);
|
||||
foreach ($dictionaries as $dict) {
|
||||
if (empty($dict)) {
|
||||
continue;
|
||||
}
|
||||
$this->choices[$dict] = $dict;
|
||||
}
|
||||
|
||||
if (empty($this->choices)) {
|
||||
$this->choices['error'] = 'Error! Check your aspell installation!';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class admin_setting_special_editorhidebuttons extends admin_setting {
|
||||
var $items;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue