returnt('Allowed HTML tags').': '.htmlspecialchars($allowed_html);
switch($long){
case0:
returnt('Allowed HTML tags').': '.drupal_specialchars($allowed_html);
case1:
$output='<p>'.t('Allowed HTML tags').': '.drupal_specialchars($allowed_html).'</p>';
if(!variable_get("filter_html_help_$format",1)){
return$output;
}
$output.=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 "tags" is very easy. This table 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 to find other sites that explain HTML.</p>');
$tips=array(
'a'=>array(t('Anchors are used to make links to other pages.'),'<a href="'.$base_url.'">'.variable_get('site_name','drupal').'</a>'),
'br'=>array(t('By default line break tags are automatically added, so 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 " /" inside the tag to maintain XHTML 1.0 compatibility'),t('Text with <br />line break')),
'p'=>array(t('By default paragraph tags are automatically added, so use this tag to add additional ones.'),'<p>'.t('Paragraph one.').'</p> <p>'.t('Paragraph two.').'</p>'),
'ol'=>array(t('Ordered list - use the <li> to begin each list item'),'<ol> <li>'.t('First item').'</li> <li>'.t('Second item').'</li> </ol>'),
'ul'=>array(t('Unordered list - use the <li> to begin each list item'),'<ul> <li>'.t('First item').'</li> <li>'.t('Second item').'</li> </ul>'),
'li'=>NULL,
// Assumes and describes dt and dd.
'dl'=>array(t('Definition lists are similar to other HTML lists. <dl> begins the definition list, <dt> begins the definition term and <dd> begins the definition description.'),'<dl> <dt>'.t('First term').'</dt> <dd>'.t('First definition').'</dd> <dt>'.t('Second term').'</dt> <dd>'.t('Second definition').'</dd> </dl>'),
array('data'=>t('No help provided for tag %tag.',array('%tag'=>drupal_specialchars($tag))),'class'=>'description','colspan'=>3),
);
}
}
$output.=theme('table',$header,$rows);
$output.=t('<p>Most unusual characters can be directly entered without any problems.</p>
<p>If you do encounter problems, try using HTML character entities. A common example looks like &amp; for an ampersand & character. For a full list of entities see HTML\'s <a href="http://www.w3.org/TR/html4/sgml/entities.html">entities</a> page. Some of the available characters include:</p>');
returnt('Lines and paragraphs break automatically.');
switch($long){
case0:
returnt('Lines and paragraphs break automatically.');
case1:
returnt('Lines and paragraphs are automatically recognized. The <br /> line break, <p> paragraph and </p> close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.');
$group=form_radios(t('Filter HTML tags'),"filter_html_$format",variable_get("filter_html_$format",FILTER_HTML_STRIP),array(FILTER_HTML_STRIP=>t('Strip tags'),FILTER_HTML_ESCAPE=>t('Escape tags')),t('How to deal with HTML tags in user-contributed content. If set to "Strip tags", dangerous tags are removed (see below). If set to "Escape tags", all HTML is escaped and presented as it was typed.'));
$group.=form_textfield(t('Allowed HTML tags'),"allowed_html_$format",variable_get("allowed_html_$format",'<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>'),64,255,t('If "Strip tags" is selected, optionally specify tags which should not be stripped. Javascript event attributes are always stripped.'));
$group.=form_checkbox(t('Display HTML help'),"filter_html_help_$format",1,variable_get("filter_html_help_$format",1),t('If enabled, Drupal will display some basic HTML help in the long filter tips.'));
$group.=form_radios(t('HTML style attributes'),"filter_style_$format",variable_get("filter_style_$format",FILTER_STYLE_STRIP),array(FILTER_STYLE_ALLOW=>t('Allowed'),FILTER_STYLE_STRIP=>t('Removed')),t('If "Strip tags" is selected, you can choose whether "STYLE" attributes are allowed or removed from input.'));
$output.=form_group(t('HTML filter'),$group);
...
...
@@ -832,7 +924,7 @@ function _filter_html($text, $format) {
returnt('Allowed HTML tags').': '.htmlspecialchars($allowed_html);
switch($long){
case0:
returnt('Allowed HTML tags').': '.drupal_specialchars($allowed_html);
case1:
$output='<p>'.t('Allowed HTML tags').': '.drupal_specialchars($allowed_html).'</p>';
if(!variable_get("filter_html_help_$format",1)){
return$output;
}
$output.=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 "tags" is very easy. This table 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 to find other sites that explain HTML.</p>');
$tips=array(
'a'=>array(t('Anchors are used to make links to other pages.'),'<a href="'.$base_url.'">'.variable_get('site_name','drupal').'</a>'),
'br'=>array(t('By default line break tags are automatically added, so 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 " /" inside the tag to maintain XHTML 1.0 compatibility'),t('Text with <br />line break')),
'p'=>array(t('By default paragraph tags are automatically added, so use this tag to add additional ones.'),'<p>'.t('Paragraph one.').'</p> <p>'.t('Paragraph two.').'</p>'),
'ol'=>array(t('Ordered list - use the <li> to begin each list item'),'<ol> <li>'.t('First item').'</li> <li>'.t('Second item').'</li> </ol>'),
'ul'=>array(t('Unordered list - use the <li> to begin each list item'),'<ul> <li>'.t('First item').'</li> <li>'.t('Second item').'</li> </ul>'),
'li'=>NULL,
// Assumes and describes dt and dd.
'dl'=>array(t('Definition lists are similar to other HTML lists. <dl> begins the definition list, <dt> begins the definition term and <dd> begins the definition description.'),'<dl> <dt>'.t('First term').'</dt> <dd>'.t('First definition').'</dd> <dt>'.t('Second term').'</dt> <dd>'.t('Second definition').'</dd> </dl>'),
array('data'=>t('No help provided for tag %tag.',array('%tag'=>drupal_specialchars($tag))),'class'=>'description','colspan'=>3),
);
}
}
$output.=theme('table',$header,$rows);
$output.=t('<p>Most unusual characters can be directly entered without any problems.</p>
<p>If you do encounter problems, try using HTML character entities. A common example looks like &amp; for an ampersand & character. For a full list of entities see HTML\'s <a href="http://www.w3.org/TR/html4/sgml/entities.html">entities</a> page. Some of the available characters include:</p>');
returnt('Lines and paragraphs break automatically.');
switch($long){
case0:
returnt('Lines and paragraphs break automatically.');
case1:
returnt('Lines and paragraphs are automatically recognized. The <br /> line break, <p> paragraph and </p> close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.');
$group=form_radios(t('Filter HTML tags'),"filter_html_$format",variable_get("filter_html_$format",FILTER_HTML_STRIP),array(FILTER_HTML_STRIP=>t('Strip tags'),FILTER_HTML_ESCAPE=>t('Escape tags')),t('How to deal with HTML tags in user-contributed content. If set to "Strip tags", dangerous tags are removed (see below). If set to "Escape tags", all HTML is escaped and presented as it was typed.'));
$group.=form_textfield(t('Allowed HTML tags'),"allowed_html_$format",variable_get("allowed_html_$format",'<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>'),64,255,t('If "Strip tags" is selected, optionally specify tags which should not be stripped. Javascript event attributes are always stripped.'));
$group.=form_checkbox(t('Display HTML help'),"filter_html_help_$format",1,variable_get("filter_html_help_$format",1),t('If enabled, Drupal will display some basic HTML help in the long filter tips.'));
$group.=form_radios(t('HTML style attributes'),"filter_style_$format",variable_get("filter_style_$format",FILTER_STYLE_STRIP),array(FILTER_STYLE_ALLOW=>t('Allowed'),FILTER_STYLE_STRIP=>t('Removed')),t('If "Strip tags" is selected, you can choose whether "STYLE" attributes are allowed or removed from input.'));
$output.=form_group(t('HTML filter'),$group);
...
...
@@ -832,7 +924,7 @@ function _filter_html($text, $format) {