From 0381efbd3bb6f38d53250a488b121e2ae36bc290 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 6 Jul 2012 05:18:14 +0200 Subject: Refs #1852. Tinymce detects if site language is installed in its languages path. --- mod/tinymce/start.php | 12 ++++++++++++ mod/tinymce/views/default/js/tinymce.php | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mod/tinymce/start.php b/mod/tinymce/start.php index 48625f456..6aba837e0 100644 --- a/mod/tinymce/start.php +++ b/mod/tinymce/start.php @@ -33,3 +33,15 @@ function tinymce_longtext_menu($hook, $type, $items, $vars) { return $items; } + +function tinymce_get_site_language() { + + if ($site_language = elgg_get_config('language')) { + $path = elgg_get_plugins_path() . "tinymce/vendor/tinymce/jscripts/tiny_mce/langs"; + if (file_exists("$path/$site_language.js")) { + return $site_language; + } + } + + return 'en'; +} diff --git a/mod/tinymce/views/default/js/tinymce.php b/mod/tinymce/views/default/js/tinymce.php index e6e2865a5..51e99c223 100644 --- a/mod/tinymce/views/default/js/tinymce.php +++ b/mod/tinymce/views/default/js/tinymce.php @@ -38,6 +38,7 @@ elgg.tinymce.init = function() { mode : "specific_textareas", editor_selector : "elgg-input-longtext", theme : "advanced", + language : "", plugins : "lists,spellchecker,autosave,fullscreen,paste", relative_urls : false, remove_script_host : false, @@ -86,4 +87,4 @@ elgg.tinymce.init = function() { } } -elgg.register_hook_handler('init', 'system', elgg.tinymce.init); \ No newline at end of file +elgg.register_hook_handler('init', 'system', elgg.tinymce.init); -- cgit v1.2.3