You are here

function xbbcode_help in Extensible BBCode 5

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

File

./xbbcode.module, line 122

Code

function xbbcode_help($section) {
  if ($section != 'admin/help#modulename') {
    return;
  }
  ob_start();
  ?>

<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 (without &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.</p>
<p>As an example, [php=label]link text[/php] might be replaced by this code:</p>
<code>
<?php

  echo check_plain('
  echo "<label>{option}</label><code>";
  echo highlight_string("{content}");
  echo "</code>"
');
  ?>
</code>
<p>You may return your replacement code by printing it or using return.</p>
<?php

  return ob_get_clean();
}