<tr>
<td colspan="2">
<div>
- <textarea class="direction_<?php echo $lang_direction; ?>" style="width: 100%" id="nugget<?php echo $elcount; ?>" name="serendipity[plugin][<?php echo $config_item; ?>]" rows="20" cols="80"><?php echo $hvalue; ?></textarea>
+ <textarea class="direction_<?php echo $lang_direction; ?>" style="width: 100%" id="nuggets<?php echo $elcount; ?>" name="serendipity[plugin][<?php echo $config_item; ?>]" rows="20" cols="80"><?php echo $hvalue; ?></textarea>
</div>
</td>
</tr>
<?php
if ($cbag->get('type') == 'html') {
$htmlnugget[] = $elcount;
- serendipity_emit_htmlarea_code('nugget' . $elcount, 'nugget' . $elcount);
+ serendipity_emit_htmlarea_code('nuggets', 'nuggets', true);
}
break;
<script type="text/javascript">
function Spawnnugget() {
<?php foreach($htmlnugget AS $htmlnuggetid) { ?>
- Spawnnugget<?php echo $htmlnuggetid; ?>();
+ Spawnnuggets('<?php echo $htmlnuggetid; ?>');
<?php } ?>
}
</script>
echo ' <script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>';
}
-function serendipity_emit_htmlarea_code($item, $jsname) {
+function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
static $init = false;
global $serendipity;
+ if ($init && $spawnMulti) {
+ return true;
+ }
+
if (isset($serendipity['wysiwyg']) && $serendipity['wysiwyg']) {
$eventData = array(
// HTMLArea.loadPlugin("SpellChecker"); // [SPELLCHECK]
var editor<?php echo $jsname; ?> = null; var config<?php echo $jsname; ?> = null;
- function Spawn<?php echo $jsname; ?>() {
- var editor<?php echo $jsname; ?> = new HTMLArea("<?php echo $item; ?>");
+ function Spawn<?php echo $jsname; ?>(<?php echo $spawnMulti ? 'id' : ''; ?>) {
+ var editor<?php echo $jsname; ?> = new HTMLArea("<?php echo $item; ?>"<?php echo $spawnMulti ? ' + id' : ''; ?>);
var config<?php echo $jsname; ?> = editor<?php echo $jsname; ?>.config;
config<?php echo $jsname; ?>.registerButton('image_selector', '<?PHP echo MANAGE_IMAGES; ?>', 'htmlarea/images/ed_s9yimage.gif', false,
function(editor, id) {