The Tables API defined by TAPIr can be used by module developers to include simple, dynamically configurable tables in their modules. The tables generated by TAPIr feature dynamic loading of data but also dynamic positioning and disabling of fields (columns) based on settings configured in the table's settings page. Settings pages are auto-generated and include helpful links to preview tables and view a master tabel list. Tables defined by TAPIr are also extensible, so your tables will be available for other module developers to hook into in a method similar to the Forms API.
Interested users and developers should:
Check out the documentation
Use TAPIr and give site owners maximum control over the look and feel of their sites!
This project will be used extensively to support the doDUbercart Project.
The Tables API mimics the Forms API by building tables based on a Table ID. For now, the Table ID refers to the function used to build the table, though it's not impossible for TAPIr to define a hook like Drupal's hook_forms. The builder function operates on an $op variable to first build the fieldset and then grab the data for the rows for each field. In TAPIr terminology, fields refers to a column in the table. Fields will be configurable from a settings page for each table so the user can adjust the title of a column, its order in the table, and whether or not it should be shown when the table is rendered. TAPIr automatically generates these settings pages with corresponding menu items and gives developers control over the path, menu settings, access control, and which options are enabled for each table.
Tables created by TAPIr are also extensible. Developers can hook into tables by Table ID using a hook_table_alter that works much like Drupal's hook_form_alter. Fields may be added to tables defined by other modules, and these fields are available for configuration in the same way as the default fields.
Forms have been dynamic for a while now, let this be the first step toward bringing table displays up to par. While not applicable to all tables, there are many places where modules will benefit from being able to extend other tables. The doDUbercart project will rely heavily on this so site administrators have maximum control over the content and display of their site.
TAPIr's documentation is full of explanation and actual code examples of TAPIr in use.
Please post any questions, issues, and your own examples of TAPIr in action!