Projet

Général

Profil

Révision a8cee257

Ajouté par Assos Assos il y a plus de 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/file_entity/file_entity.field.inc
59 59
        'remote_playback' => 'remote_playback',
60 60
      ),
61 61
      'autoplay' => FALSE,
62
      'playsinline' => FALSE,
62 63
      'loop' => FALSE,
63 64
      'muted' => FALSE,
64 65
      'width' => NULL,
......
194 195
      '#type' => 'checkbox',
195 196
      '#default_value' => $settings['autoplay'],
196 197
    );
198
    $element['playsinline'] = array(
199
      '#title' => t('Plays inline'),
200
      '#type' => 'checkbox',
201
      '#default_value' => $settings['playsinline'],
202
    );
197 203
    $element['loop'] = array(
198 204
      '#title' => t('Loop'),
199 205
      '#type' => 'checkbox',
......
304 310
    if (isset($settings['autoplay'])) {
305 311
      $summary[] = t('Autoplay: %autoplay', array('%autoplay' => $settings['autoplay'] ? t('yes') : t('no')));
306 312
    }
313
    if (isset($settings['playsinline'])) {
314
      $summary[] = t('Plays inline: %playsinline', array('%playsinline' => $settings['playsinline'] ? t('yes') : t('no')));
315
    }
307 316
    if (isset($settings['loop'])) {
308 317
      $summary[] = t('Loop: %loop', array('%loop' => $settings['loop'] ? t('yes') : t('no')));
309 318
    }
......
351 360
          if (variable_get('file_entity_protect_repeated_render', TRUE)) {
352 361
            // Protect ourselves from repeated rendering.
353 362
            static $repeated_render_depth = array();
354
            $repeated_render_id = $entity_type . $field['field_name'] . $item['fid'];
363
            list($entity_id) = entity_extract_ids($entity_type, $entity);
364
            $repeated_render_id = $entity_type . $entity_id . $field['field_name'] . $item['fid'];
355 365
            if (isset($repeated_render_depth[$repeated_render_id])) {
356 366
              $repeated_render_depth[$repeated_render_id]++;
357 367
            }
......
388 398
          $file->referencing_entity_type = $entity_type;
389 399
          $file->referencing_field = $field['field_name'];
390 400

  
401
          // Prevent recursion by checking if the referencing entity is itself
402
          // do not display it again (return an empty array).
403
          // This senario is created a few lines below when file_view is called
404
          // it returns an array containing a referncing entity that is itself.
405
          // This is likely treating the symptom and not the root cause which is
406
          // probably buried in some hook_file_view() setting the referencing
407
          // entity.
408
          if (!empty($entity->fid) && $entity->fid === $item['fid']) {
409
            return $element;
410
          }
391 411
          // Untranslatable fields are rendered with no language code, fall back
392 412
          // to the content language in that case.
393 413
          $element[$delta] = file_view($file, $settings['file_view_mode'], $langcode !== LANGUAGE_NONE ? $langcode : NULL);
......
488 508
          '#controls' => $settings['controls'],
489 509
          '#controls_list' => $settings['controls_list'],
490 510
          '#autoplay' => $settings['autoplay'],
511
          '#playsinline' => $settings['playsinline'],
491 512
          '#loop' => $settings['loop'],
492 513
          '#muted' => $settings['muted'],
493 514
          '#width' => $settings['width'],

Formats disponibles : Unified diff