function context_admin_node_form_wrapper in Contextual Administration 7
Custom wrapper for node_form() so that we do not have to load node.pages.inc from a menu item. Being forced into loading it in the menu prevents any other module from being able to abstractly utilize node_add() since all field ajax will fail.
5 string references to 'context_admin_node_form_wrapper'
- context_admin_entityref_create_node_form_alter in plugins/
context_admin/ entityref_create_node.inc - context_admin_form_alter in ./
context_admin.module - Implementation of hook_form_alter
- context_admin_noderef_create_node_form_alter in plugins/
context_admin/ noderef_create_node.inc - context_admin_node_add_wrapper in ./
context_admin.module - Build our own node_add style function so that we can do things core does not support. Also, we need to call a completely different form so that we can load the node.pages.inc file from drupal_get_form so that ajax fields continue to work.
- context_admin_termref_create_node_form_alter in plugins/
context_admin/ termref_create_node.inc
File
- ./
context_admin.module, line 258
Code
function context_admin_node_form_wrapper($form, &$form_state, $node, $page) {
module_load_include('inc', 'node', 'node.pages');
if (!page_manager_get_current_page()) {
page_manager_get_current_page($page);
}
$form = node_form($form, $form_state, $node);
return $form;
}