You are here

class FileRouteProvider in Panopoly 8.2

Provides routes for files.

Hierarchy

Expanded class hierarchy of FileRouteProvider

1 file declares its use of FileRouteProvider
panopoly_media.module in modules/panopoly/panopoly_media/panopoly_media.module
Hook implementations for Panopoly Media.

File

modules/panopoly/panopoly_media/src/Routing/FileRouteProvider.php, line 13

Namespace

Drupal\panopoly_media\Routing
View source
class FileRouteProvider implements EntityRouteProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function getRoutes(EntityTypeInterface $entity_type) {
    $route_collection = new RouteCollection();

    // Individual file delete form.
    $route = (new Route('/file/{file}/delete'))
      ->addDefaults([
      '_entity_form' => 'file.delete',
      '_title' => 'Delete',
    ])
      ->setRequirement('file', '\\d+')
      ->setRequirement('_entity_access', 'file.delete');
    $route_collection
      ->add('entity.file.delete_form', $route);

    // Bulk operation confirmation form.
    $route = (new Route('/admin/content/files/delete'))
      ->addDefaults([
      '_form' => '\\Drupal\\panopoly_media\\Form\\FileDeleteMultiple',
    ])
      ->setRequirement('_permission', 'access files overview');
    $route_collection
      ->add('file.multiple_delete_confirm', $route);
    return $route_collection;
  }

}

Members