Backport Multi-HTMLTextare-Plugin-Config gotcha.
authorgarvinhicking <garvinhicking>
Fri, 22 Jul 2005 11:55:23 +0000 (11:55 +0000)
committergarvinhicking <garvinhicking>
Fri, 22 Jul 2005 11:55:23 +0000 (11:55 +0000)
docs/NEWS
include/admin/plugins.inc.php

index 48ae142d82af041c7200d85d0b6d529b9fa10871..841c6025197e6b6ec5b53ec223e27211ab6b416e 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -169,6 +169,9 @@ Version 0.8.3 ()
        XML_RPC         to 1.3.3
      Fixing several bugs and vulnerabilities. (nohn)
 
+   * Allow plugins to contain more than one HTML nuggets which can be
+     WYSIWYGized. (garvinhicking)
+     
    * Fix editing a draft article to be properly displayed as draft
      in PostgreSQL setups. Thanks to Penny Leach! (garvinhicking)
 
index 9d0b981243374c73331ad4e92bef200431ad512c..663968ec1f5305494d6f7c18962bef1c00335887 100644 (file)
@@ -301,7 +301,10 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
 <br />
     <table border="0" cellspacing="0" cellpadding="3" width="100%">
 <?php
+    $elcount = 0;
+    $htmlnugget = array();
     foreach ($config_names as $config_item) {
+        $elcount++;
         $cbag = new serendipity_property_bag;
         $plugin->introspect_config_item($config_item, $cbag);
 
@@ -469,13 +472,14 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
         <tr>
             <td colspan="2">
                 <div>
-                    <textarea class="direction_<?php echo $lang_direction; ?>" style="width: 100%" id="nugget" 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="nugget<?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') {
-                    serendipity_emit_htmlarea_code('nugget', 'nugget');
+                    $htmlnugget[] = $elcount;
+                    serendipity_emit_htmlarea_code('nugget' . $elcount, 'nugget' . $elcount);
                 }
                 break;
 
@@ -500,6 +504,18 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
     <div>
         <?php echo $plugin->example() ?>
     </div>
+<?php
+    }
+
+    if (isset($serendipity['wysiwyg']) && $serendipity['wysiwyg'] && count($htmlnugget) > 0) {
+?>
+    <script type="text/javascript">
+    function Spawnnugget() {
+        <?php foreach($htmlnugget AS $htmlnuggetid) { ?>
+        Spawnnugget<?php echo $htmlnuggetid; ?>();
+        <?php } ?>
+    }
+    </script>
 <?php
     }
 ?>