From 002a3396dab95a08fc08b3f433eb79563c56de89 Mon Sep 17 00:00:00 2001 From: Ɓukasz Wilenski Date: Sat, 19 Feb 2011 20:25:32 +0000 Subject: fix bug when template is not pasted into ckeditor window --- modules/html/module.php | 104 +++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 62 deletions(-) (limited to 'modules') diff --git a/modules/html/module.php b/modules/html/module.php index 8ba823545a..7b2ac05343 100644 --- a/modules/html/module.php +++ b/modules/html/module.php @@ -96,7 +96,7 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { */ $id=$this->getName().$block_id; $title=''; - if ($ctype=="gedcom" && WT_USER_GEDCOM_ADMIN || $ctype=="user" && WT_USER_ID) { + if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && WT_USER_ID) { $title .= "" ."\"".WT_I18N::translate('Configure').'"'; $title .= help_link('index_htmlplus'); @@ -272,77 +272,60 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { $title=get_block_setting($block_id, 'title'); $html=get_block_setting($block_id, 'html'); // title - echo "" - .translate_fact('TITL') - .help_link('index_htmlplus_title') - ."" - ; + echo '', + translate_fact('TITL'), + help_link('index_htmlplus_title'), + ''; // templates - echo "" - .WT_I18N::translate('Templates') - .help_link('index_htmlplus_template') - ."" + echo '', + WT_I18N::translate('Templates'), + help_link('index_htmlplus_template'), + '' ; - if (array_key_exists('ckeditor', WT_Module::getActiveModules())) - { - echo "\n" - .""; + if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { + echo WT_JS_START, + 'function loadTemplate(html) {', + ' var oEditor = CKEDITOR.instances["html"];', + ' oEditor.setData(html);', + '}', + WT_JS_END, + ''; } - echo ""; - foreach ($templates as $title=>$template) - { - echo ""; + echo ''; + foreach ($templates as $title=>$template) { + echo ''; } - echo "" - ."" - ; + echo ''; // gedcom $gedcoms = get_all_gedcoms(); $gedcom=get_block_setting($block_id, 'gedcom'); - if (count($gedcoms) > 1) - { + if (count($gedcoms) > 1) { if ($gedcom == '__current__') {$sel_current = ' selected="selected"';} else {$sel_current = '';} if ($gedcom == '__default__') {$sel_default = ' selected="selected"';} else {$sel_default = '';} - echo "" - .WT_I18N::translate('Family tree') - .help_link('index_htmlplus_gedcom') - ."" - ."', + '', + ''; + foreach ($gedcoms as $ged_id=>$ged_name) { if ($ged_name == $gedcom) {$sel = ' selected="selected"';} else {$sel = '';} - echo ""; + echo ''; } - echo "" - ."" - ; + echo ''; } // html - echo "" - .WT_I18N::translate('Content') - .help_link('index_htmlplus_content') - ."

" - ."" - ; + echo '', + WT_I18N::translate('Content'), + help_link('index_htmlplus_content'), + '

', + ''; if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { // use CKeditor module require_once WT_ROOT.WT_MODULES_DIR.'ckeditor/ckeditor.php'; @@ -353,14 +336,11 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { $oCKeditor->config['AutoDetectLanguage'] = false ; $oCKeditor->config['DefaultLanguage'] = 'en'; $oCKeditor->editor('html', $html); - } - else - { + } else { //use standard textarea - echo ""; + echo ''; } - - echo ""; + echo ''; $show_timestamp=get_block_setting($block_id, 'show_timestamp', false); echo ''; -- cgit v1.3