You are here

public function ImceFM::validatePredefinedPath in IMCE 8.2

Same name and namespace in other branches
  1. 8 src/ImceFM.php \Drupal\imce\ImceFM::validatePredefinedPath()

Checks the existence of a predefined path.

File

src/ImceFM.php, line 563

Class

ImceFM
Imce File Manager.

Namespace

Drupal\imce

Code

public function validatePredefinedPath(array $items, $silent = FALSE) {
  foreach ($items as $item) {
    if ($item->type === 'folder' && ($folder = $item
      ->hasPredefinedPath())) {
      if (!$silent) {
        $this
          ->setMessage($this
          ->t('%path is a predefined path and can not be modified.', [
          '%path' => $folder
            ->getPath(),
        ]));
      }
      return FALSE;
    }
  }
  return TRUE;
}