adding a delete tab on some content types

View: New views
5 Messages — Rating Filter:   Alert me  

adding a delete tab on some content types

by Lluís Forns Puigmartí-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I need to add a "delete" tab for some content types, but I can't
figure out what 'file' should be; if I use "drupal_get_path('module',
'node').'/node.pages.inc'" I get
'sites/all/modules/my_module/node/node.pages.inc'

  $items['node/%/delete_tab'] = array(
    'title' => t('delete'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('node_delete_confirm', 1),
    'access callback' => TRUE, // 'node_access',
    'access arguments' => array('delete', 1),
    'file' => drupal_get_path('module', 'node').'/node.pages.inc',
    'weight' => 1,
    'type' => MENU_LOCAL_TASK,
  );


--
*La vida és com una taronja, què esperes a exprimir-la?
*Si creus que l'educació és cara, prova la ignorància.
*La vida és com una moneda, la pots gastar en el que vulguis però
només una vegada.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.

Re: adding a delete tab on some content types

by Damien Tournoud :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You will need to use 'file path', like this:

 $items['node/%/delete_tab'] = array(
   'title' => t('delete'),
   'page callback' => 'drupal_get_form',
   'page arguments' => array('node_delete_confirm', 1),
   'access callback' => TRUE, // 'node_access',
   'access arguments' => array('delete', 1),
   'file path' => drupal_get_path('module', 'node'),
   'file' => 'node.pages.inc',
   'weight' => 1,
   'type' => MENU_LOCAL_TASK,
 );

Damien Tournoud

On Thu, Jun 11, 2009 at 11:07 AM, Lluís <enboig@...> wrote:
I need to add a "delete" tab for some content types, but I can't
figure out what 'file' should be; if I use "drupal_get_path('module',
'node').'/node.pages.inc'" I get
'sites/all/modules/my_module/node/node.pages.inc'

 $items['node/%/delete_tab'] = array(
   'title' => t('delete'),
   'page callback' => 'drupal_get_form',
   'page arguments' => array('node_delete_confirm', 1),
   'access callback' => TRUE, // 'node_access',
   'access arguments' => array('delete', 1),
   'file' => drupal_get_path('module', 'node').'/node.pages.inc',
   'weight' => 1,
   'type' => MENU_LOCAL_TASK,
 );


--
*La vida és com una taronja, què esperes a exprimir-la?
*Si creus que l'educació és cara, prova la ignorància.
*La vida és com una moneda, la pots gastar en el que vulguis però
només una vegada.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.


Re: adding a delete tab on some content types

by Lluís Forns Puigmartí-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok, it works now

thanks

On Thu, Jun 11, 2009 at 11:13 AM, Damien Tournoud<damz@...> wrote:

> You will need to use 'file path', like this:
>
>  $items['node/%/delete_tab'] = array(
>    'title' => t('delete'),
>    'page callback' => 'drupal_get_form',
>    'page arguments' => array('node_delete_confirm', 1),
>    'access callback' => TRUE, // 'node_access',
>    'access arguments' => array('delete', 1),
>    'file path' => drupal_get_path('module', 'node'),
>    'file' => 'node.pages.inc',
>    'weight' => 1,
>    'type' => MENU_LOCAL_TASK,
>  );
>
> Damien Tournoud
>
> On Thu, Jun 11, 2009 at 11:07 AM, Lluís <enboig@...> wrote:
>>
>> I need to add a "delete" tab for some content types, but I can't
>> figure out what 'file' should be; if I use "drupal_get_path('module',
>> 'node').'/node.pages.inc'" I get
>> 'sites/all/modules/my_module/node/node.pages.inc'
>>
>>  $items['node/%/delete_tab'] = array(
>>    'title' => t('delete'),
>>    'page callback' => 'drupal_get_form',
>>    'page arguments' => array('node_delete_confirm', 1),
>>    'access callback' => TRUE, // 'node_access',
>>    'access arguments' => array('delete', 1),
>>    'file' => drupal_get_path('module', 'node').'/node.pages.inc',
>>    'weight' => 1,
>>    'type' => MENU_LOCAL_TASK,
>>  );
>>
>>
>> --
>> *La vida és com una taronja, què esperes a exprimir-la?
>> *Si creus que l'educació és cara, prova la ignorància.
>> *La vida és com una moneda, la pots gastar en el que vulguis però
>> només una vegada.
>> *Abans d'imprimir aquest missatge, pensa en el medi ambient.
>
>



--
*La vida és com una taronja, què esperes a exprimir-la?
*Si creus que l'educació és cara, prova la ignorància.
*La vida és com una moneda, la pots gastar en el que vulguis però
només una vegada.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.

Re: adding a delete tab on some content types

by Michael Favia-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lluís wrote:
> I need to add a "delete" tab for some content types, but I can't
> figure out what 'file' should be; if I use "drupal_get_path('module',
> 'node').'/node.pages.inc'" I get
> 'sites/all/modules/my_module/node/node.pages.inc'
>  
Wrote this functioning patch to promote delete to a MENU_LOCAL_TASK for
D7 but was eventually shot down by webchick over concerns that the
usability work of Mark and Leisa might eventually take us in another
direction. I disagree with holding up real world patches that fix
existing bugs (sufficiently privileged users cant delete their content
if the don't also have edit permission) and make incremental
improvements because someones ideas (not code) for the future MIGHT
disagree with it. My next step was to introduce modal popups for
confirmations and ditch the page reloads for "Are you sure?" If you
think this would be useful or an improvement your voice would be
appreciated on the issue. http://drupal.org/node/196758 -mf

Re: adding a delete tab on some content types

by Vladimir Radulovski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

there is a contrib module admin_links that does this - is this helpful in some way?

On Thu, Jun 11, 2009 at 4:52 PM, Michael Favia <michael@...> wrote:
Lluís wrote:
I need to add a "delete" tab for some content types, but I can't
figure out what 'file' should be; if I use "drupal_get_path('module',
'node').'/node.pages.inc'" I get
'sites/all/modules/my_module/node/node.pages.inc'
 
Wrote this functioning patch to promote delete to a MENU_LOCAL_TASK for D7 but was eventually shot down by webchick over concerns that the usability work of Mark and Leisa might eventually take us in another direction. I disagree with holding up real world patches that fix existing bugs (sufficiently privileged users cant delete their content if the don't also have edit permission) and make incremental improvements because someones ideas (not code) for the future MIGHT disagree with it. My next step was to introduce modal popups for confirmations and ditch the page reloads for "Are you sure?" If you think this would be useful or an improvement your voice would be appreciated on the issue. http://drupal.org/node/196758 -mf



--
"Есть что-то более важное, чем власть или сила. Есть ещё на свете Любовь..." - Светлана де Роган-Левашова - http://levashov.info