summaryrefslogtreecommitdiff
path: root/modules_v3/html/module.php
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2012-09-28 07:46:44 +0000
committerfisharebest <fisharebest@gmail.com>2012-09-28 07:46:44 +0000
commit0b95d5e293dee8401cfba69586579519f8dc4c96 (patch)
treecdbc6a2605549beaf877690e1dd100a3102ecda2 /modules_v3/html/module.php
parentb1361368a00ca7833fb4d73679cfe3cba975336e (diff)
downloadwebtrees-0b95d5e293dee8401cfba69586579519f8dc4c96.tar.gz
webtrees-0b95d5e293dee8401cfba69586579519f8dc4c96.tar.bz2
webtrees-0b95d5e293dee8401cfba69586579519f8dc4c96.zip
#1057171 - CKEditor fails to save HTML block data in most browsers
Diffstat (limited to 'modules_v3/html/module.php')
-rw-r--r--modules_v3/html/module.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules_v3/html/module.php b/modules_v3/html/module.php
index cca56476be..6b11da52b3 100644
--- a/modules_v3/html/module.php
+++ b/modules_v3/html/module.php
@@ -274,7 +274,13 @@ class html_WT_Module extends WT_Module implements WT_Module_Block {
WT_I18N::translate('Templates'),
help_link('block_html_template', $this->getName()),
'</td><td class="optionbox">';
- echo '<select name="template" onchange="document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;">';
+ // The CK editor needs lots of help to load/save data :-(
+ if (array_key_exists('ckeditor', WT_Module::getActiveModules())) {
+ $ckeditor_onchange='CKEDITOR.instances.html.setData(document.block.html.value);';
+ } else {
+ $ckeditor_onchange='';
+ }
+ echo '<select name="template" onchange="document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;', $ckeditor_onchange, '">';
echo '<option value="', htmlspecialchars($html), '">', WT_I18N::translate('Custom'), '</option>';
foreach ($templates as $title=>$template) {
echo '<option value="', htmlspecialchars($template), '">', $title, '</option>';