You are here

public function Delete::buildPage in IMCE 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/ImcePlugin/Delete.php \Drupal\imce\Plugin\ImcePlugin\Delete::buildPage()

Builds imce page by adding required libraries and elements.

Overrides ImcePluginBase::buildPage

File

src/Plugin/ImcePlugin/Delete.php, line 36

Class

Delete
Defines Imce Delete plugin.

Namespace

Drupal\imce\Plugin\ImcePlugin

Code

public function buildPage(array &$page, ImceFM $fm) {

  // Check if delete permission exists.
  if ($fm
    ->hasPermission('delete_files') || $fm
    ->hasPermission('delete_subfolders')) {
    $page['#attached']['library'][] = 'imce/drupal.imce.delete';
  }
}