Same name and namespace in other branches
  1. 4.7.x modules/path.module \path_overview()
  2. 5.x modules/path/path.module \path_overview()

Return a listing of all defined URL aliases.

1 call to path_overview()
path_admin in modules/path.module
Menu callback; presents an overview of all URL aliases.

File

modules/path.module, line 256
Enables users to rename URLs.

Code

function path_overview() {
  $sql = 'SELECT * FROM {url_alias}';
  $header = array(
    array(
      'data' => t('Alias'),
      'field' => 'dst',
      'sort' => 'asc',
    ),
    array(
      'data' => t('System'),
      'field' => 'src',
    ),
    array(
      'data' => t('Operations'),
      'colspan' => '2',
    ),
  );
  $sql .= tablesort_sql($header);
  $result = pager_query($sql, 50);
  $destination = drupal_get_destination();
  while ($data = db_fetch_object($result)) {
    $rows[] = array(
      check_plain($data->dst),
      check_plain($data->src),
      l(t('edit'), "admin/path/edit/{$data->pid}", array(), $destination),
      l(t('delete'), "admin/path/delete/{$data->pid}", array(), $destination),
    );
  }
  if ($pager = theme('pager', NULL, 50, 0, tablesort_pager())) {
    $rows[] = array(
      array(
        'data' => $pager,
        'colspan' => '4',
      ),
    );
  }
  if (!$rows) {
    $rows[] = array(
      array(
        'data' => t('No URL aliases available.'),
        'colspan' => '4',
      ),
    );
  }
  return theme('table', $header, $rows);
}