You are here

function quicktabs_list in Quick Tabs 6.2

Same name and namespace in other branches
  1. 5 quicktabs.module \quicktabs_list()
  2. 6.3 includes/admin.inc \quicktabs_list()
  3. 6 quicktabs.module \quicktabs_list()
  4. 7.3 quicktabs.admin.inc \quicktabs_list()
  5. 7.2 includes/admin.inc \quicktabs_list()

Page callback for quicktabs admin landing page.

1 string reference to 'quicktabs_list'
quicktabs_menu in ./quicktabs.module
Implementation of hook_menu().

File

includes/admin.inc, line 6

Code

function quicktabs_list() {
  $result = db_query('SELECT qtid, title FROM {quicktabs} ORDER BY title');
  $header = array(
    array(
      'data' => t('Quicktab'),
    ),
    array(
      'data' => t('Operations'),
      'colspan' => 3,
    ),
  );
  $rows = array();
  while ($row = db_fetch_object($result)) {
    $tablerow = array(
      array(
        'data' => check_plain($row->title),
      ),
      array(
        'data' => l(t('Edit'), 'admin/build/quicktabs/' . $row->qtid . '/edit'),
      ),
      array(
        'data' => l(t('Clone'), 'admin/build/quicktabs/' . $row->qtid . '/clone'),
      ),
      array(
        'data' => l(t('Delete'), 'admin/build/quicktabs/' . $row->qtid . '/delete'),
      ),
    );
    $rows[] = $tablerow;
  }
  if (!empty($rows)) {
    $output = theme('table', $header, $rows, array(
      'id' => 'quicktabs',
    ));
  }
  else {
    $output = '<p>' . t('Click on the "New QT block" tab to get started.') . '</p>';
  }
  return $output;
}