TAPIr has been released to the public this afternoon and is ready to be put to use. TAPIr, developed initially for use in the Übercart project, is a module that defines a Tables API for use in any Drupal module. Tables defined by TAPIr are dynamic, meaning any field (TAPIr term for a table column) can be turned on or off, repositioned, and renamed. Furthermore, they are extensible, so third party modules can make further fields available to a table. Best of all, the code is lightweight and very easy to use.

TAPIr functions in much the same way as the Forms API. Tables are defined in modules in builder functions. The name of the builder function is passed to the function tapir_get_table as the table's ID. TAPIr will then load the data necessary to construct the table and present it according to the current configuration.

Using the TAPIr hook_table_settings, module developers can further define the settings for their tables. Tables included in the hook have settings pages automatically generated for them, so site owners can configure the look of the table. The TAPIr hook_table_alter allows other module developers to extend other TAPIr defined tables with more fields, integrating the extra fields with the settings page seamlessly. Combine TAPIr with the Forms API to theme forms into configurable TAPIr tables.

To read more about the module, head to the handbook at http://www.ubercart.org/uberlearn/tapir. A full set of example applications with downloadable code has also been prepared at http://www.ubercart.org/uberlearn/tapir_learn_example. Find the latest releases and issue tracker at http://drupal.org/project/tapir.

While we don't expect this to take off immediately, we considered it worthwhile enough to spend a few days preparing the module for our project. I am sure that other module developers can find uses for this functionality, and the community as a whole would benefit from a central way to define and configure dynamic tables. So, put on your thinking caps and figure out a way to make TAPIr work for you.

We are extremely interested in feedback to make this module even better and more useful to module developers. Our current plans are in the "Future of TAPIr" section in the handbook, but please post suggestions, bugs, and ideas there or in the issue tracker here directly.

Comments

jetsetter’s picture

This looks like a great addition. I'd like to see this get picked up by module contributors.

demeester_roel’s picture

I guess this brings us another step closer to Drupal as a Application Framework (more info on that @ http://archivemati.ca/2006/01/21/drupal-as-a-mvc-framework/). I'll definitely spend some time on this module the coming week.

rszrama’s picture

I'll give that article a read... it looks interesting. Thanks for your feedback!