You are here

function theme_disable_breadcrumbs_checked_nodes in Disable breadcrumbs 6

Same name and namespace in other branches
  1. 7 disable_breadcrumbs.admin.inc \theme_disable_breadcrumbs_checked_nodes()

Produce sortable table of currently checked nodes

1 theme call to theme_disable_breadcrumbs_checked_nodes()
disable_breadcrumbs_settings_page in ./disable_breadcrumbs.admin.inc
@file Admin settings page and checked nodes summary table

File

./disable_breadcrumbs.admin.inc, line 107
Admin settings page and checked nodes summary table

Code

function theme_disable_breadcrumbs_checked_nodes() {
  $headers = array(
    array(
      'data' => 'Node (nid)',
      'field' => 'nid',
      'sort' => 'desc',
    ),
    array(
      'data' => 'Type',
      'field' => 'type',
    ),
    array(
      'data' => 'Title',
      'field' => 'title',
    ),
    "",
  );
  $query = "SELECT n.nid, n.type, n.title from {node} n \n  INNER JOIN {disable_breadcrumbs} db ON n.nid = db.nid";
  $query .= tablesort_sql($headers);
  $result = db_query($query);
  $rows = array();
  while ($row = db_fetch_array($result)) {
    $rows[$row['nid']] = $row;

    //Replace title in $row array with below linked version.
    $rows[$row['nid']]['title'] = l($rows[$row['nid']]['title'], 'node/' . $rows[$row['nid']]['nid']);

    //Append edit link to array of table cells.
    $rows[$row['nid']]['edit'] = '<a href="' . base_path() . 'node/' . $row['nid'] . '/edit' . '">Edit</a>';
  }
  $output = '<h2>' . t("Nodes currently checked") . '</h2>';
  $output .= theme('table', $headers, $rows);
  return $output;
}