Howto? Add "delete" button besides "View" and "Edit"

Lenn-art - October 19, 2009 - 14:14

A logged in user sees above the node a VIEW and EDIT button. These buttons are stored in $tabs. Sometimes there are extra buttons, like BROADCAST (when using messaging module).

I want to add a delete-button to this (just node/$number/delete), but i can't figure out where the $tabs is filled with VIEW and EDIT. Does somebody knows this?

Found something .. not fully

Lenn-art - October 19, 2009 - 14:31

Found something .. not fully tested yet, so use it careful!

change in /modules/node/node.module

  $items['node/%node/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('node_delete_confirm', 1),
    'access callback' => 'node_access',
    'access arguments' => array('delete', 1),
    'file' => 'node.pages.inc',
    'weight' => 1,
    'type' => MENU_CALLBACK);

the line that says 'type' to:
    'type' => MENU_LOCAL_TASK);

======
There are 10 people who can count binary
They who can and they who don't

It is best to not modify

nevets - October 19, 2009 - 14:42

It is best to not modify Drupal core files, you can write a small module that does that. I also believe there is a module in the downloads section that provides that functionality.

Yes i know that hacking core

Lenn-art - October 19, 2009 - 14:57

Yes i know that hacking core modules isn't the best option.

Didn't know that the module exists. I'll try to find him. - edit: you mean this one: http://drupal.org/project/admin_links?

======
There are 10 people who can count binary
They who can and they who don't

 
 

Drupal is a registered trademark of Dries Buytaert.