<subtitle>Available hooks for adding reporting extensions</subtitle>
<abstract>Custom hooks are implemented to allow the report engine to be extended in many ways. Using OOP methodologies, any of the available classes may be extended, or new ones can be written from scratch.</abstract>
<link>hooks</link>
</chapter>
<chapter>
<title>Field Formatters</title>
<subtitle>Implement custom formatters either in control objects or in data plugin objects</subtitle>
<abstract>Implementing a formatter requires the implementation of Formatter Methods and a Formats Registration Function.</abstract>
In the above example, you would be able to reference <strong>:security.admin</strong> in any data block or <strong>{security_admin}</strong>
to reference a value of 'Y' whenever the user had access to Drupal's access administration pages right.
</p>
<h2id="formats">Custom Formatters</h2>
<p>Custom formatters may be implemented either in control objects or in data plugin objects. Formatters that are implemented in plugin objects are only available within data blocks that reference data block repositories that use that plugin type. For example, formatters defined by the FrxOracle plugin will only be available fore repositories that are Oracle repositories. Formatters defined in FrxControls, however, will be available in all reports.</p>
<p>To implement a formatter in control or plugin class requires the implementation of two methods.</p>
<h3>Formatter Methods</h3>
<p>Formatter methods should take a value and a format string parameter, and should return the formatted value. The
following function can be used as a reference implementation of a formatter function.</p>
<p>Each class that implements formatters should also implement a formats registration function that returns an associative array that lists the function names and their appropriate user label. Forena uses its own registration mechanisms for advertising its controls. The following can be used as a reference implementation for this method.</p>