Exemplo n.º 1
0
 /**
  * Add JavaScript variable with path to be used by AJAX requests sent by RTE plugin
  */
 public function onRTEAddGlobalVariablesScript(array &$vars)
 {
     wfProfileIn(__METHOD__);
     // check user preferences (enabled by default)
     if ($this->user->getOption('disablespellchecker')) {
         wfDebug(__METHOD__ . ": spell checker disabled in user preferences\n");
         return true;
     }
     // check whether current content lang is supported by spellchecker
     $dict = new SpellCheckerDictionary();
     if ($dict->isLanguageSupported($this->contentLanguage)) {
         $vars['wgSpellCheckerLangIsSupported'] = true;
         $vars['wgSpellCheckerUrl'] = "{$this->script}?action=ajax&rs=SpellCheckerAjax";
     }
     wfProfileOut(__METHOD__);
     return true;
 }