'default'); $options['links'] = array('default' => TRUE); return $options; } function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $form['view_mode'] = array( '#type' => 'select', '#options' => file_entity_view_mode_labels(), '#title' => t('View mode'), '#default_value' => $this->options['view_mode'], ); $form['links'] = array( '#type' => 'checkbox', '#title' => t('Display links'), '#default_value' => $this->options['links'], ); } function summary_title() { $view_mode_label = file_entity_view_mode_label($this->options['view_mode'], t('Unknown')); return check_plain($view_mode_label); } function pre_render($values) { $fids = array(); foreach ($values as $row) { $fids[] = $row->{$this->field_alias}; } $this->files = file_load_multiple($fids); } function render($row) { $file = $this->files[$row->{$this->field_alias}]; $file->view = $this->view; $build = file_view($file, $this->options['view_mode']); return drupal_render($build); } }