ImageStyleWithPipelineListBuilder.php in Image Optimize (or ImageAPI Optimize) 8.2
File
src/ImageStyleWithPipelineListBuilder.php
View source
<?php
namespace Drupal\imageapi_optimize;
use Drupal\Core\Entity\EntityInterface;
use Drupal\image\ImageStyleListBuilder;
class ImageStyleWithPipelineListBuilder extends ImageStyleListBuilder {
public function buildHeader() {
$header = parent::buildHeader();
$header['pipeline'] = $this
->t('Image Optimize Pipeline');
$operations = $header['operations'];
unset($header['operations']);
$header['operations'] = $operations;
return $header;
}
public function buildRow(EntityInterface $entity) {
$pipelineNames = imageapi_optimize_pipeline_options(FALSE);
$row = parent::buildRow($entity);
$row['pipeline'] = isset($pipelineNames[$entity
->getPipeline()]) ? $pipelineNames[$entity
->getPipeline()] : '';
$operations = $row['operations'];
unset($row['operations']);
$row['operations'] = $operations;
return $row;
}
}