You are here

function party_data_set_admin in Party 7

Same name and namespace in other branches
  1. 8.2 party.admin.inc \party_data_set_admin()

Page callback for managing data sets.

@todo: Get links on this page to always redirect back to this page.

1 string reference to 'party_data_set_admin'
party_menu in ./party.module
Implements hook_menu().

File

./party.admin.inc, line 13
Admin page callback file for the party module.

Code

function party_data_set_admin() {
  $data_sets = party_get_data_set_info();
  $header = array(
    0 => t('Data set name'),
    1 => array(
      'data' => t('Operations'),
      'colspan' => '6',
    ),
  );
  $rows = array();
  foreach ($data_sets as $key => $data_set) {
    $name = check_plain($data_set['label']);
    $name .= ' <small>' . t('(Machine name: @set-name)', array(
      '@set-name' => $key,
    )) . '</small>';
    $ops = array(
      'edit',
      'manage fields',
      'manage display',
      'clone',
      'export',
      'delete',
    );
    $row = array(
      $name,
    );
    foreach ($ops as $op) {
      $row[] = array(
        'data' => isset($data_set['admin'][$op]) ? l($op, $data_set['admin'][$op], array(
          'query' => array(
            'destination' => 'admin/community/datasets',
          ),
        )) : '',
      );
    }
    $rows[] = $row;
  }
  $build['dataset_table'] = array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#empty' => t('No data sets available'),
  );
  return $build;
}