You can create your own menu callback using hook_menu
(you need to do this from your custom module). Then from your custom callback you you can call whatever callback function is assigned to the different panel pages you have. In your custom callback, you will need to specify the path to whatever function panels is using in it's callback. Here's how your custom callback could look like:
<?php
/**
* The 1st %node argument represents the node you are editing.
* The 2nd %node argument would represent the referencing node ID.
*/
$items['node/%node/%node/edit'] = array(
'page callback' => 'mymodule_edit_node',
'page arguments' => array(1,2),
// Other arguments ...
// This includes the node_edit.inc file, needed for calling the page_manager_node_edit() function.
'file' => 'node_edit.inc',
'file path' => drupal_get_path('module', 'page_manager'). '/plugins/tasks', );
/**
* The callback above automatically converts $node_edit and $node_ref to node objects.
*/
function mymodule_edit_node($node_edit, $node_ref) {
// Do something with $node_ref, like building a Form or storing it
// statically in a function for later use.
&drupal_static(__FUNCTION__, $node_ref);
// page_manager_node_edit() is what Panels uses for rendering it's custom edit node page.
return page_manager_node_edit($node_edit);
}
It's a little hard to figure out how your form is looking in that panel page, based on your description above, so I cannot give a concrete example of how to insert the node reference directly into the form. However most likely it would involve using one the hook_form_alter() or hook_form_FORM_ID_alter() functions. Using these you can retrieve the referenced node using the drupal_static() function or directly using arg():
<?php
// Retrieve from static cache:
$foo = &drupal_static(__FUNCTION__);
// Retrieve from URL:
$foo = arg(2)