]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed tinymce "remove editor" javascript
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 19 Feb 2011 18:55:47 +0000 (18:55 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 19 Feb 2011 18:55:47 +0000 (18:55 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8341 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/tinymce/views/default/input/longtext.php

index 1d449262fb9f23c28634579ea18341e875231030..9124a89b554f79b69644dbf7811e141580f18202 100644 (file)
@@ -4,10 +4,10 @@
  *
  * @package ElggTinyMCE
  *
- * @uses $vars['value']        The current value, if any
- * @uses $vars['js']           Any Javascript to enter into the input tag
- * @uses $vars['name'] The name of the input field
- * @uses $vars['id']   The id of the input field
+ * @uses $vars['value'] The current value, if any
+ * @uses $vars['js']    Any Javascript to enter into the input tag
+ * @uses $vars['name']  The name of the input field
+ * @uses $vars['id']    The id of the input field
  *
  */
 
@@ -17,12 +17,16 @@ elgg_register_js('mod/tinymce/vendor/tinymce/jscripts/tiny_mce/tiny_mce.js', 'ti
 elgg_unextend_view('footer/analytics', 'tinymce/init');
 elgg_extend_view('footer/analytics', 'tinymce/init');
 
+if (!isset($vars['id'])) {
+       $vars['id'] = 'tinymce-longtext-' . rand();
+}
+
 ?>
 
-<a class="elgg-longtext-control tinymce-toggle-editor small" href="javascript:toggleEditor('<?php echo $vars['name']; ?>');">
+<a class="elgg-longtext-control tinymce-toggle-editor small" href="javascript:toggleEditor('<?php echo $vars['id']; ?>');">
        <?php echo elgg_echo('tinymce:remove'); ?>
 </a>
 
-<textarea class="elgg-input-textarea mceEditor" name="<?php echo $vars['name']; ?>" <?php if (isset($vars['id'])) echo "id=\"{$vars['id']}\""; ?> <?php echo $vars['js']; ?>>
-       <?php echo htmlspecialchars($vars['value'], null, 'UTF-8'); ?>
+<textarea class="elgg-input-textarea mceEditor" name="<?php echo $vars['name']; ?>" id="<?php echo $vars['id']; ?>" <?php echo $vars['js']; ?>>
+<?php echo htmlspecialchars($vars['value'], null, 'UTF-8'); ?>
 </textarea>