You are here

function node_admin_link in Admin 6

Implementation of hook_admin_link() on behalf of the node module.

File

./admin.module, line 300

Code

function node_admin_link($type, $object) {
  $links = array();
  if ($type == 'node') {
    if (node_access('update', $object)) {
      $links['node-edit'] = array(
        'title' => t('Edit'),
        'href' => "node/{$object->nid}/edit",
        'attributes' => array(
          'class' => 'icon-edit',
        ),
        'query' => array(
          'destination' => $_GET['q'],
        ),
      );
    }
    if (node_access('delete', $object)) {
      $links['node-delete'] = array(
        'title' => t('Delete'),
        'href' => "node/{$object->nid}/delete",
        'attributes' => array(
          'class' => 'icon-delete',
        ),
        'query' => array(
          'destination' => $_GET['q'],
        ),
      );
    }
  }
  return $links;
}