Same name and namespace in other branches
  1. 4.6.x modules/node.module \node_admin_nodes()
  2. 4.7.x modules/node.module \node_admin_nodes()
  3. 6.x modules/node/node.admin.inc \node_admin_nodes()
  4. 7.x modules/node/node.admin.inc \node_admin_nodes()
1 string reference to 'node_admin_nodes'
node_admin_content in modules/node/node.module
Menu callback: content administration.

File

modules/node/node.module, line 1621
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_admin_nodes() {
  $filter = node_build_filter_query();
  $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n ' . $filter['join'] . ' INNER JOIN {users} u ON n.uid = u.uid ' . $filter['where'] . ' ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);
  $form['options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Update options'),
    '#prefix' => '<div class="container-inline">',
    '#suffix' => '</div>',
  );
  $options = array();
  foreach (module_invoke_all('node_operations') as $operation => $array) {
    $options[$operation] = $array['label'];
  }
  $form['options']['operation'] = array(
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => 'approve',
  );
  $form['options']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Update'),
  );
  $destination = drupal_get_destination();
  while ($node = db_fetch_object($result)) {
    $nodes[$node->nid] = '';
    $form['title'][$node->nid] = array(
      '#value' => l($node->title, 'node/' . $node->nid) . ' ' . theme('mark', node_mark($node->nid, $node->changed)),
    );
    $form['name'][$node->nid] = array(
      '#value' => check_plain(node_get_types('name', $node)),
    );
    $form['username'][$node->nid] = array(
      '#value' => theme('username', $node),
    );
    $form['status'][$node->nid] = array(
      '#value' => $node->status ? t('published') : t('not published'),
    );
    $form['operations'][$node->nid] = array(
      '#value' => l(t('edit'), 'node/' . $node->nid . '/edit', array(), $destination),
    );
  }
  $form['nodes'] = array(
    '#type' => 'checkboxes',
    '#options' => $nodes,
  );
  $form['pager'] = array(
    '#value' => theme('pager', NULL, 50, 0),
  );
  return $form;
}