Index: modules/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter.module,v
retrieving revision 1.48
diff -u -F^f: -r1.48 filter.module
--- modules/filter.module	15 Dec 2004 21:19:42 -0000	1.48
+++ modules/filter.module	23 Dec 2004 09:16:58 -0000
@@ -60,7 +60,228 @@
 
         case FILTER_HTML_STRIP:
           if ($allowed_html = variable_get("allowed_html_$format", '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>')) {
-            return t('Allowed HTML tags') .': '. htmlspecialchars($allowed_html);
+            switch ($long) {
+              case 0:
+                return t('Allowed HTML tags') .': '. htmlspecialchars($allowed_html);
+              case 1:
+                $s = t('Allowed HTML tags') .': '. htmlspecialchars($allowed_html) . t('
+<p>This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML &quot;tags&quot; is very easy. This page provides examples for each tag that is enabled on this site.</p>
+<p>For more information see W3C\'s <a href="http://www.w3.org/TR/html/">HTML Specifications</a> or use your favorite search engine.</p>
+<table>
+<tr> <th> Tag Description </th><th> You Type </th><th> You Get</th> </tr>');
+                $row = 'dark';
+                foreach (explode("> <", $allowed_html) as $tag) {
+                  $tag = preg_replace('/^</', '', $tag);
+                  $tag = preg_replace('/>$/', '', $tag);
+                  if ($tag == 'a') {
+                    $s = $s . t('
+<tr class="'.$row.'"> <td valign="top"> Anchors are used to make all HTML links to other pages and for named anchors on the same page.  </td>
+<td valign="top"> <code> &lt;a href=&quot;http://drupal.org&quot;&gt;Drupal&lt;/a&gt; </code> </td>
+<td valign="top"> <a href="http://drupal.org">Drupal</a></td> </tr>');
+                  }
+                  elseif ($tag == 'br') {
+                    $s = $s . t('
+<tr class="'.$row.'"> <td valign="top">Drupal comes configured to add line break tags automatically so you can use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others.  Use the extra &quot /&quot; to maintain XHTML 1.0 compatibility</td>
+<td valign="top"><code>text with &lt;br /&gt; line break</code></td>
+<td valign="top">text with <br /> line break</td> </tr>');
+                  }
+                  elseif ($tag == 'p') {
+                    $s = $s . t('
+<tr class="'.$row.'"> <td valign="top">Drupal comes configured to add paragraph tags automatically so you can use this tag to add additional ones.
+<td valign="top"><code>&lt;p&gt;Paragraph one.&lt;/p&gt;&lt;p&gt;Paragraph two.&lt;/p&gt;</code></td>
+<td valign="top"><p>Paragraph one.</p><p>Paragraph two.</p></td> </tr>');
+                  }
+                  elseif ($tag == 'em') {
+                    $s = $s . t('
+<tr class="'.$row.'"> <td valign="top">Emphasized text </td>
+<td valign="top"> <code> &lt;em&gt;Emphasized&lt;/em&gt; </code></td>
+<td valign="top"> <em>Emphasized</em></td> </tr>');
+                  }
+                  elseif ($tag == 'strong') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Strong text</td>
+<td valign="top"> <code> &lt;strong&gt;Strong&lt;/strong&gt; </code></td>
+<td valign="top"> <strong>Strong</strong></td> </tr>');
+                  }
+                  elseif ($tag == 'cite') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Cited text</td>
+<td valign="top"> <code> &lt;cite&gt;Cited&lt;/cite&gt;</code></td>
+<td valign="top"> <cite>Cited</cite></td> </tr> ');
+                  }
+                  elseif ($tag == 'code') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Coded text used as programming source code.</td>
+<td valign="top"> <code> &lt;code&gt;Coded&lt;/code&gt;</code></td>
+<td valign="top"> <code>Coded</code></td> </tr> ');
+                  }
+                  elseif ($tag == 'b') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Bolded text</td>
+<td valign="top"> <code> &lt;b&gt;Bolded&lt;/b&gt; </code></td>
+<td valign="top"> <b>Bolded</b></td> </tr>');
+                  }
+                  elseif ($tag == 'bold') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Bolded text</td>
+<td valign="top"> <code> &lt;bold&gt;Bolded&lt;/bold&gt; </code></td>
+<td valign="top"> <bold>Bolded</bold></td> </tr>');
+                  }
+                  elseif ($tag == 'u') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Underlined text</td>
+<td valign="top"> <code> &lt;u&gt;Underlined&lt;/u&gt; </code></td>
+<td valign="top"> <u>Underlined</u></td> </tr>');
+                  }
+                  elseif ($tag == 'i') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Italicized text</td>
+<td valign="top"> <code> &lt;i&gt;Italicized&lt;/i&gt; </code></td>
+<td valign="top"> <i>Italicized</i></td> </tr>');
+                  }
+                  elseif ($tag == 'sup') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Superscripted text</td>
+<td valign="top"> <code> &lt;sup&gt;Superscrited&lt;/sup&gt; </code></td>
+<td valign="top"> <sup>Superscripted</sup></td> </tr>');
+                  }
+                  elseif ($tag == 'sub') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Subscripted text</td>
+<td valign="top"> <code> &lt;sub&gt;Subscripted&lt;/sub&gt; </code></td>
+<td valign="top"> <sub>Subscripted</sub></td> </tr>');
+                  }
+                  elseif ($tag == 'pre') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Preformatted text</td>
+<td valign="top"> <code> &lt;pre&gt;Preformatted&lt;/pre&gt; </code></td>
+<td valign="top"> <pre>Preformatted</pre></td> </tr>');
+                  }
+                  elseif ($tag == 'blockquote') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Block quoted text</td>
+<td valign="top"> <code> &lt;blockquote&gt;Block quoted&lt;/blockquote&gt; </code></td>
+<td valign="top"> <blockquote>Block quoted</blockquote></td> </tr>');
+                  }
+                  elseif ($tag == 'q') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Quoted inline text</td>
+<td valign="top"> <code> &lt;q&gt;Quoted inline&lt;/q&gt; </code></td>
+<td valign="top"> <q>Quoted inline</q></td> </tr>');
+                  }
+                  elseif ($tag == 'th') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Table Header</td>
+<td valign="top"> <code> &lt;th&gt;Table header&lt;/th&gt; </code></td>
+<td valign="top"> <table><tr><th>Table header</th></tr></table></td> </tr>');
+                  }
+                  elseif ($tag == 'del') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Deleted text</td>
+<td valign="top"> <code> &lt;del&gt;Deleted&lt;/del&gt; </code></td>
+<td valign="top"> <del>Deleted</del></td> </tr>');
+                  }
+                  elseif ($tag == 'ins') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top">Inserted</td>
+<td valign="top"> <code> &lt;ins&gt;Inserted&lt;/ins&gt; </code></td>
+<td valign="top"> <ins>Inserted</ins></td> </tr>');
+                  }
+                  elseif ($tag == 'ol') { // assumes and describes li
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Begins an ordered list. Use the &lt;li&gt; to begin each list item and &lt;/li&gt; to end them.</td>
+<td valign="top"> <code> &lt;ol&gt;&lt;li&gt;First item.&lt;/li&gt;&lt;li&gt;Second item.&lt;/li&gt;&lt;/ol&gt; </code></td>
+<td valign="top"> <ol><li>First item.</li><li>Second item.</li></ol></td> </tr>');
+                  }
+                  elseif ($tag == 'li') {
+                  }
+                  elseif ($tag == 'ul') { // assumes and describes li
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Begins an unordered list. Use the &lt;li&gt; to begin each list item and &lt;/li&gt; to end them.</td>
+<td valign="top"> <code> &lt;ul&gt;&lt;li&gt;First item.&lt;/li&gt;&lt;li&gt;Second item.&lt;/li&gt;&lt;/ul&gt; </code></td>
+<td valign="top"> <ul><li>First item.</li><li>Second item.</li></ul></td> </tr>');
+                  }
+                  elseif ($tag == 'dl') { // assumes and describes dt and dd
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Definition lists are similar to other HTML lists. &lt;dl&gt; begins the definition list, &lt;dt&gt; begins the definition term and &lt;dd&gt; begins the definition description.</td>
+<td valign="top"> <code> &lt;dl&gt; &lt;dt&gt;First term&lt;/dt&gt;&lt;dd&gt;First definition.&lt;/dd&gt; &lt;dt&gt;Second term&lt;/dt&gt;&lt;dd&gt;Second definition.&lt;/dd&gt;&lt;/dl&gt; </code></td>
+<td valign="top"> <dl> <dt>First term</dt><dd>First definition.</dd> <dt>Second term</dt><dd>Second definition.</dd></dl></td> </tr>');
+                  }
+                  elseif ($tag == 'dt') {
+                  }
+                  elseif ($tag == 'dd') {
+                  }
+                  elseif ($tag == 'h1') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Header text</td>
+<td valign="top"> <code> &lt;h1&gt;Header one&lt;/h1&gt; </code></td>
+<td valign="top"> <h1>Header one</h1></td> </tr>');
+                  }
+                  elseif ($tag == 'h2') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Header text</td>
+<td valign="top"> <code> &lt;h2&gt;Header two&lt;/h2&gt; </code></td>
+<td valign="top"> <h2>Header two</h2></td> </tr>');
+                  }
+                  elseif ($tag == 'h3') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Header text</td>
+<td valign="top"> <code> &lt;h3&gt;Header three&lt;/h3&gt; </code></td>
+<td valign="top"> <h3>Header three</h3></td> </tr>');
+                  }
+                  elseif ($tag == 'h4') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Header text</td>
+<td valign="top"> <code> &lt;h4&gt;Header four&lt;/h4&gt; </code></td>
+<td valign="top"> <h4>Header four</h4></td> </tr>');
+                  }
+                  elseif ($tag == 'h5') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Header text</td>
+<td valign="top"> <code> &lt;h5&gt;Header five&lt;/h5&gt; </code></td>
+<td valign="top"> <h5>Header five</h5></td> </tr>');
+                  }
+                  elseif ($tag == 'h6') {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> Header text</td>
+<td valign="top"> <code> &lt;h6&gt;Header six&lt;/h6&gt; </code></td>
+<td valign="top"> <h6>Header six</h6></td> </tr>');
+                  }
+                  else {
+                    $s = $s . t('
+<tr class="'.$row.'"><td valign="top"> No help provided for tag ' . htmlspecialchars($tag) . '</td>
+<td valign="top"> </td>
+<td valign="top"> </td> </tr>');
+                  }
+                  if ($row == 'dark') {
+                    $row = 'light';
+                  }
+                  else {
+                    $row = 'dark';
+                  }
+                }
+                // included for all sites
+                $s = $s . t('
+</table>
+<p>Since Drupal sites use UTF-8 character encoding by default, most extended characters can be directly entered without any problem.  This method is preferred to using character entities.</p>
+<p><a href="http://www.w3.org/TR/html4/sgml/entities.html">Character entities</a> allow representation of symbols and other special characters using hexadecimal codes and names. A common example looks like &amp;amp; for an &amp; ampersand character. Some characters available include:</p>
+<table>
+<tr> <th> Entity Description </th><th> You Type </th><th> You Get</th> </tr>
+<tr class="dark"><td valign="top">Ampersand</td> <td>&amp;amp;</td> <td>&amp;</td> </tr>
+<tr class="light"><td valign="top">Cent</td> <td>&amp;cent;</td> <td>&cent;</td> </tr>
+<tr class="dark"><td valign="top">Copyright</td> <td>&amp;copy;</td> <td>&copy;</td> </tr>
+<tr class="light"><td valign="top">Euro</td> <td>&amp;euro;</td> <td>&euro;</td> </tr>
+<tr class="dark"><td valign="top">Greater than</td> <td>&amp;gt;</td> <td>&gt;</td> </tr>
+<tr class="light"><td valign="top">Less than</td> <td>&amp;lt;</td> <td>&lt;</td> </tr>
+<tr class="dark"><td valign="top">Non-breaking space</td> <td>&amp;nbsp;</td> <td>&nbsp;</td> </tr>
+<tr class="light"><td valign="top">Pound</td> <td>&amp;pound;</td> <td>&pound;</td> </tr>
+<tr class="dark"><td valign="top">Quotation mark</td> <td>&amp;quot;</td> <td>&quot;</td> </tr>
+<tr class="light"><td valign="top">Registered</td> <td>&amp;reg;</td> <td>&reg;</td> </tr>
+<tr class="dark"><td valign="top">Trademark</td> <td>&amp;trade;</td> <td>&trade;</td> </tr>
+<tr class="light"><td valign="top">Yen</td> <td>&amp;yen;</td> <td>&yen;</td> </tr>
+</table>');
+                return $s;
+            }
           }
           else {
             return t('No HTML tags allowed');
@@ -100,8 +321,13 @@
       }
 
     case 2:
-      return t('Lines and paragraphs break automatically.');
+      switch ($long) {
+        case 0:
+          return t('Lines and paragraphs break automatically.');
+        case 1:
+          return t('Lines and paragraphs are automatically recognized. The &lt;br /&gt; line break, &lt;p&gt; paragraph and &lt;/p&gt; close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.');
       break;
+      }
   }
 }
 
@@ -867,4 +1093,4 @@
  * @} End of "Standard filters".
  */
 
-?>
\ No newline at end of file
+?>
