Projet

Général

Profil

Révision 29771811

Ajouté par Assos Assos il y a presque 5 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.test
22 22
    parent::setUp($modules);
23 23
  }
24 24

  
25
  /**
26
    * Generates markup to be inserted for a file.
27
    *
28
    * This is a PHP version of InsertMedia.insert() from js/wysiwyg-media.js.
29
    *
30
    * @param int $fid
31
    *   Drupal file id
32
    * @param int $count
33
    *   Quantity of markup to insert
34
    * @param array $attributes
35
    *   Extra attributes to insert.
36
    * @param array $fields
37
    *   Extra field values to insert.
38
    *
39
    * @return string
40
    *   Filter markup.
41
    */
25
 /**
26
   * Generates markup to be inserted for a file.
27
   *
28
   * This is a PHP version of InsertMedia.insert() from js/wysiwyg-media.js.
29
   *
30
   * @param int $fid
31
   *   Drupal file id.
32
   * @param int $count
33
   *   Quantity of markup to insert.
34
   * @param array $attributes
35
   *   Extra attributes to insert.
36
   * @param array $fields
37
   *   Extra field values to insert.
38
   *
39
   * @return string
40
   *   Filter markup.
41
   */
42 42
  protected function generateJsonTokenMarkup($fid, $count = 1, array $attributes = array(), array $fields = array()) {
43 43
    $markup = '';
44 44
    // Merge default atttributes.
......
72 72
   *
73 73
   * @param int $fid
74 74
   *   Create the node with media markup in the body field
75
    * @param array $attributes
76
    *   Extra attributes to insert to the file.
77
    * @param array $fields
78
    *   Extra field values to insert.
75
   * @param array $attributes
76
   *   Extra attributes to insert to the file.
77
   * @param array $fields
78
   *   Extra field values to insert.
79 79
   *
80 80
   * @return int
81 81
   *   Returns the node id
82 82
   */
83 83
  protected function createNode($fid = FALSE, array $attributes = array(), array $fields = array()) {
84 84
    $markup = '';
85
    if (! empty($fid)) {
85
    if (!empty($fid)) {
86 86
      $markup = $this->generateJsonTokenMarkup($fid, 1, $attributes, $fields);
87 87
    }
88 88

  
......
112 112
    $web_user = $this->drupalCreateUser(array('access administration pages', 'administer file types', 'view files', 'use media wysiwyg'));
113 113
    $this->drupalLogin($web_user);
114 114
  }
115

  
115 116
}
116 117

  
117 118
/**

Formats disponibles : Unified diff