Advertisement
Guest User

Untitled

a guest
May 28th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. function modalreg_edit_request_callback($nid, $js = NULL){
  2.     if (!$js) {
  3.         drupal_goto('/');
  4.     }
  5.     ctools_include('modal');
  6.     ctools_include('ajax');
  7.     ctools_include('node.pages', 'node', '');
  8.     $node = node_load($nid);
  9.     $form_state = array(
  10.         'title' => 'Редактирование заявки',
  11.         'ajax' => TRUE,
  12.         'build_info' => array(
  13.             'args' => $node->nid,
  14.         ),
  15.     );
  16.     form_load_include($form, $form_state, 'inc', 'node', 'node.pages');
  17.     $commands = ctools_modal_form_wrapper($node->type . '_node_form',$form_state);
  18.  
  19.     if (!empty($form_state['executed'])) {
  20.         $commands = array();
  21.         $commands[] = ctools_modal_command_dismiss();
  22.         $commands[] = ajax_command_html('.request-' . $nid, views_embed_view('calls_entitys_view', 'default', $nid));
  23.     }
  24.     return array('#type' => 'ajax', '#commands' => $commands);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement