I have a content type called 'Checklist' which I bring forward using Views, in it's node-edit form.
I wrote PHP code within the header in order to do this, here it is:
<?php
$view = views_get_current_view();
$arg0 = $view->args[0];
$nodeToLoad = $view->result[0]->nid; //I get the node to load from Fields within my view
module_load_include('inc', 'node', 'node.pages');
$node = node_load($nodeToLoad);
dsm($nodeToLoad);
$edit_page = drupal_get_form('page_node_form', $node);
$edit_page['additional_settings']['#access'] = FALSE;
$edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';
print drupal_render($edit_page );
function redirect_submit($form, &$form_state){
$form_state['redirect'] = 'www.google.com';
}
?>
I'd like to remove the 'Delete' button of this form(which normally deletes the content). I have read that this is easily done with hook_form_alter() but my code resides within the header of a View and I'd like to keep it that way.
Is there a way to do this?