]> git.mjollnir.org Git - s9y.git/commitdiff
Backport Multi-HTMLTextare-Plugin-Config gotcha.
authorgarvinhicking <garvinhicking>
Fri, 22 Jul 2005 11:54:27 +0000 (11:54 +0000)
committergarvinhicking <garvinhicking>
Fri, 22 Jul 2005 11:54:27 +0000 (11:54 +0000)
docs/NEWS
include/admin/plugins.inc.php

index 6a6de9fa5bfaafcf595d87d0385fc7a161f83afb..c656dd404934f82771f0068f5b43ac70f600d984 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -14,6 +14,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 7e857618f8b904967b571def421c3b82439ea01d..5016c55730be051e076313febe80e69393236835 100644 (file)
@@ -293,7 +293,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);
 
@@ -452,22 +455,17 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
             case 'html':
             case 'text':
 ?>
-        <tr>
-            <td colspan="2"><strong><?php echo $cname; ?></strong>
-                &nbsp;<span style="color: #5E7A94; font-size: 8pt;">&nbsp;<?php echo $cdesc; ?></span>
-            </td>
-        </tr>
-
         <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;
 
@@ -492,6 +490,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
     }
 ?>