Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function modalreg_edit_request_callback($nid, $js = NULL){
- if (!$js) {
- drupal_goto('/');
- }
- ctools_include('modal');
- ctools_include('ajax');
- ctools_include('node.pages', 'node', '');
- $node = node_load($nid);
- $form_state = array(
- 'title' => 'Редактирование заявки',
- 'ajax' => TRUE,
- 'build_info' => array(
- 'args' => $node->nid,
- ),
- );
- form_load_include($form, $form_state, 'inc', 'node', 'node.pages');
- $commands = ctools_modal_form_wrapper($node->type . '_node_form',$form_state);
- if (!empty($form_state['executed'])) {
- $commands = array();
- $commands[] = ctools_modal_command_dismiss();
- $commands[] = ajax_command_html('.request-' . $nid, views_embed_view('calls_entitys_view', 'default', $nid));
- }
- return array('#type' => 'ajax', '#commands' => $commands);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement