TIP_Devhelp2

Introduction

A content module managing devhelp2 hierarchies

Source file
/Type/module/content/devhelp2.php
Extends
TIP_Content

This is a stripped down rewrite of TIP_Hierarchy that sets a default data engine capable to directly manage .devhelp2 files, the common format generated by gtk-doc.

To be able to use this module, it suffices to configure a devhelp2 module and feed it with the .devhelp2 file:

 $cfg = array(
     ...
     'api'      => array(
         'type' => array('module', 'content', 'devhelp2'),
         'data' => 'api/adg.devhelp2'
     ),
     ...
 );

After that, the template system can use the hierarcy generated by the "show" tag in the same way the TIP_Hierarchy module is used, for instance (using the TIP_RcbtNG engine):

 <ul class="article">{API.show(view,-id-)}
 </ul>

The actionView() method is overriden so that, on a view request, the corresponding html file (searched in the data directory of the current module) is output "as is" in the page content. This means a previous stripping step is required in order to directly use the file generated by gtk-doc: a simple xslt transformation that removes everything unneeded will be enough.

For more customizations, the "view_template" is still available, although disabled if not explicitely set in the configuration. In this case, the 'id' and 'content' keys are generated with the proper content and the "title_field", "creation_field" and "edited_field" are honored. This means if the magic fields are left to their default values, the following (virtual) fields are available to the template engine:

yet includes html tags so, in order to get the proper styled content, {raw(content)} tag should be used instead of the more usual

{content}

returned by the filectime() function

as returned by the filemtime() function

Methods

checkOptions (&$options)

&$options
lines
83 - 108
static
yes
access
protected

__construct ($options)

Constructor

$options
array
Properties values
lines
117 - 123
access
protected

Initializes a TIP_Devhelp2 instance.

tagShow ($params) : string|null

Echo the hierarchy

$params
string
Parameters of the tag
lines
181 - 193
access
protected

Overrides the default tagShow() to disable the page indexing if the current selected row is a container. In $params you can specify the custom action to use: if left empty, the default action (configured for this module) will be used.

actionView ($id) : bool

Perform a view action

$id
mixed
The identifier of the row to view
lines
209 - 250
access
protected

Runs the file identified by the 'view_template' property for the specified row. The rendered result is appended to the page.

TIP_Devhelp2 was last modified by TiP on Mon 25 May 2009 06:22:25 PM CEST
Hosted by BerliOS Developer Logo