Accessing settings.php from javascript.

Accessing settings.php from javascript.

by Joey Andres -
Number of replies: 2
Moodle 2.8.5

Hello all,

I'm very new to Moodle dev. I have read the basics of the API, and now started getting my hands dirty by making tinymce plugin. While doing so, I have encountered the following problem: How do I access settings.php from javascript.

I know how to access lan/en strings from javascript, I also know that in php,
$layout_string = $this->get_config('statlayout');
will exract the setting 'statlayout'. What I want is to access $layout_string from JavaScript.
Average of ratings: -
In reply to Joey Andres

Re: Accessing settings.php from javascript.

by Joey Andres -
After exploring other tinymce plugins and stumbling upon spellchecker plugin, in lib.php the following code is found:
$params['spellchecker_languages'] = $spelllanguagelist;

This is accessed in javascript, editor_plugin.js, via ed.getParam('spellchecker_languages');