Projet

Général

Profil

Paste
Télécharger (680 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / media / includes / media.pages.inc @ ba09eb79

1
<?php
2

    
3
/**
4
 * @file
5
 * Common pages for the Media module.
6
 */
7

    
8
/**
9
 * CTools modal callback for editing a file.
10
 */
11
function media_file_edit_modal($form, &$form_state, $file, $js) {
12
  ctools_include('modal');
13
  ctools_include('ajax');
14

    
15
  $form_state['ajax'] = $js;
16
  form_load_include($form_state, 'inc', 'file_entity', 'file_entity.pages');
17

    
18
  $output = ctools_modal_form_wrapper('file_entity_edit', $form_state);
19

    
20
  if ($js) {
21
    $commands = $output;
22

    
23
    if ($form_state['executed']) {
24
      $commands = array(ctools_modal_command_dismiss(t('File saved')));
25
    }
26

    
27
    print ajax_render($commands);
28
    exit();
29
  }
30

    
31
  // Otherwise, just return the output.
32
  return $output;
33
}