Guest User

Untitled

a guest
Jan 18th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $node->processed['add_collection_form'] = drupal_get_form('add_to_collection_form', $node->nid);
  2.  
  3. print drupal_render($node->processed['add_collection_form']);
  4.  
  5. function hook_forms($form_id, $args)
  6. {
  7. $forms = array();
  8.  
  9. // Check if the form id is of the pattern add_to_collection_form-[NUMBER]
  10. if(preg_match('/^add_to_collection_form-d+$/', $form_id)
  11. {
  12. $forms[$form_id]['callback'] = 'add_to_collection_form';
  13. }
  14.  
  15. return $forms;
  16. }
  17.  
  18. drupal_get_form('add_to_collection_form-1', $node->nid);
  19. drupal_get_form('add_to_collection_form-2', $node->nid);
  20. drupal_get_form('add_to_collection_form-3', $node->nid);
Add Comment
Please, Sign In to add comment