You are here

public function ImceFM::validatePredefinedPath in IMCE 8

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

Checks the existence of a predefined path.

File

src/ImceFM.php, line 562

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;
}