function tripal_custom_tables_list

1.x custom_tables.inc tripal_custom_tables_list()

A template function to render a listing of all Custom tables

Related topics

1 string reference to 'tripal_custom_tables_list'
tripal_core_menu in tripal_core/tripal_core.module
Implements hook_menu(). Defines all menu items needed by Tripal Core

File

tripal_core/includes/custom_tables.inc, line 64
Contains functions for creating, editing and deleting custom tables on the Tripal website.

Code

function tripal_custom_tables_list() {
  $header = array('', 'Table Name', 'Description');
  $rows = array();
  $custom_tables = db_query("SELECT * FROM {tripal_custom_tables} ORDER BY table_name");

  while ($custom_table = db_fetch_object($custom_tables)) {

    $rows[] = array(
      l(t('View'), "admin/tripal/custom_tables/view/$custom_table->table_id") . " | " .
        l(t('Edit'), "admin/tripal/custom_tables/edit/$custom_table->table_id") . " | " .
        $custom_table->table_name,
      $custom_table->comment,
      l(t('Delete'), "admin/tripal/custom_tables/action/delete/$custom_table->table_id"),
    );
  }

  $rows[] = array(
    'data' => array(
      array('data' => l(t('Create a new custom table.'), "admin/tripal/custom_tables/new"),
        'colspan' => 6),
    )
  );

  $page = theme('table', $header, $rows);
  return $page;
}