You are here

function xbbcode_help in Extensible BBCode 6

Same name and namespace in other branches
  1. 8 xbbcode.module \xbbcode_help()
  2. 5 xbbcode.module \xbbcode_help()
  3. 7 xbbcode.module \xbbcode_help()

File

./xbbcode.module, line 129

Code

function xbbcode_help($section) {
  if ($section != 'admin/help#modulename' && $section != 'admin/settings/xbbcode/tags') {
    return;
  }
  return <<<EOF
<p>How to write the replacement value for a new custom XBBCode tag:</p>

<h3>Static text:</h3>

<p>Simply enter the HTML code that should replace [tag=option]content[/tag]. The following variables are available to you:</p>

<ul>
  <li>{option} will be replaced with the value of 'option' in the above example</li>
  <li>{content} will be replaced with the text between the text.</li>
</ul>

<h3>Multiple arguments:</h3>
<p>Your tag can take advantage of multiple arguments that can be provided in the form of [tag arg1=value1 arg2='value 2']content[/tag].
In this example, you will have access to these variables:</p>

<ul>
  <li>{arg1} will be replaced with val1,</li>
  <li>{arg2} will be replaced with val2,</li>
  <li>{content} remains the same.</li>
</ul>

<h3>PHP Code</h3>
<p>Enter the PHP code (including &lt;?php ?&gt;) that should be executed. Variables are 'filtered' into the code as literal strings prior to execution, so they should be wrapped in quotes and assigned to variables. Code outside code tags will be printed literally.</p>
<p>As an example, [php=Label for this Code]Some PHP Code[/php] might be replaced by this code:</p>
<code>
  &lt;label&gt;{option}&lt;/label&gt;
  &lt;code&gt;
  &lt;?=highlight_string("{content}")?&gt;
  &lt;/code&gt;
</code>
<p>You may return your replacement code by printing it or using return.</p>
EOF;
}