You are here

public function FileStyles::render in Styles 7.2

Override the render function to always display a thumbnail in the wysiwyg.

Overrides StylesDefault::render

File

contrib/file_styles/includes/styles/FileStyles.inc, line 244
styles/contrib/file_styles/includes/styles/FileStyles.inc Styles definitions for file styles.

Class

FileStyles
@file styles/contrib/file_styles/includes/styles/FileStyles.inc Styles definitions for file styles.

Code

public function render($reset = FALSE) {
  $object = $this
    ->getObject();
  if (isset($object->override) && is_array($object->override) && isset($object->override['wysiwyg']) && $object->override['wysiwyg']) {

    // Disregard any links pushed ahead.
    $this
      ->pushEffect(array(
      'name' => 'linkToPath',
      'settings' => array(
        'path' => NULL,
      ),
    ));

    // We ensure that the thumbnail will be applied at the end.
    $this
      ->pushEffect(array(
      'name' => 'thumbnail',
      'settings' => array(),
    ));
  }
  return parent::render($reset);
}