]> git.mjollnir.org Git - s9y.git/commitdiff
Support other WYSIWYG editors (tinyMCE plugin available)
authorgarvinhicking <garvinhicking>
Thu, 7 Jul 2005 16:50:16 +0000 (16:50 +0000)
committergarvinhicking <garvinhicking>
Thu, 7 Jul 2005 16:50:16 +0000 (16:50 +0000)
include/functions_entries.inc.php

index 9723245e0b333b7d2d7070bc5905b58549d0141c..ec7920d8447c5399aee57ede07ace82573269cb1 100644 (file)
@@ -1584,8 +1584,15 @@ if (!$serendipity['wysiwyg']) {
 <?php } ?>
 <?php
     if ($serendipity['wysiwyg']) {
-        serendipity_emit_htmlarea_code('serendipity[body]', 'body');
-        serendipity_emit_htmlarea_code('serendipity[extended]', 'extended');
+        $fields = array(
+            'body'      => 'serendipity[body]', 
+            'extended'  => 'serendipty[extended]'
+        );
+        
+        foreach($fields AS $f_jsname => $f_item) {
+            serendipity_emit_htmlarea_code($f_item, $f_jsname);
+        }
+        serendipity_plugin_api::hook_event('backend_wysiwyg_finish', $fields);
     }
 
     echo '    <script type="text/javascript" language="JavaScript" src="serendipity_define.js.php"></script>';
@@ -1596,7 +1603,19 @@ function serendipity_emit_htmlarea_code($item, $jsname) {
     static $init = false;
     global $serendipity;
 
-    if (isset ($serendipity['wysiwyg']) && $serendipity['wysiwyg']) {
+    if (isset($serendipity['wysiwyg']) && $serendipity['wysiwyg']) {
+
+        $eventData = array(
+            'init'   => &$init,
+            'item'   => &$item,
+            'jsname' => &$jsname,
+            'skip'   => false
+        );
+        serendipity_plugin_api::hook_event('backend_wysiwyg', $eventData);
+
+        if ($eventData['skip']) {
+            return true;
+        }
 
         if (!$init) {
 ?>
@@ -1612,7 +1631,7 @@ function serendipity_emit_htmlarea_code($item, $jsname) {
 <?php
         }
 
-    $csscode = str_replace(
+        $csscode = str_replace(
                  array(
                    "\n",
                    "'",
@@ -1626,7 +1645,7 @@ function serendipity_emit_htmlarea_code($item, $jsname) {
                  ),
 
                  file_get_contents(serendipity_getTemplateFile('htmlarea.css', 'serendipityPath'))
-    );
+        );
 ?>
     <script type="text/javascript">
     // IF you want to enable HTMLArea's spellchecker, download the SpellChecker plugin from the HTMLArea homepage