Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. function vacancy_render_apply_form(stdClass $vacancy = null)
  2. {
  3. ctools_include('ajax');
  4. ctools_include('modal');
  5. ctools_modal_add_js();
  6. $form_state = array(
  7. 'ajax' => TRUE,
  8. 'title' => t('Vacancy'),
  9. 'vacancy_id' => $vacancy->id
  10. );
  11. if(!empty($form_state['ajax_commands'])){
  12. $command = $form_state['ajax_commands'];
  13. }else {
  14. $command = ctools_modal_form_wrapper('vacancy_apply_form', $form_state);
  15. }
  16. print ajax_render($command);
  17. drupal_exit();
  18. }
  19.  
  20. $items['vacancy/loadForm/%vacancy_id'] = array(
  21. 'page callback' => 'vacancy_render_apply_form',
  22. 'page arguments' => array(2),
  23. 'access callback' => TRUE,
  24. 'type' => MENU_CALLBACK
  25. );
  26.  
  27. <a href="/vacancy/loadForm/<?php echo $v->id; ?>" class="ctools-use-modal">
  28. <div id="apply-button">APPLY</div>
  29. </a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement