Ejemplo n.º 1
0
 /**
  * {@inhericDoc}
  * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList()
  */
 public function getCertificatesList($selCity)
 {
     $selCity = Functions::encodeUtf8ToFileSystem($selCity);
     $certdir = $this->getRealCertificatesDirectory();
     $tabCertif = array();
     if (is_dir($certdir . $selCity)) {
         $dir = opendir($certdir . $selCity);
         while ($entry = readdir($dir)) {
             if ($entry != '.' && $entry != '..' && !is_dir($certdir . $entry . '/')) {
                 $path = Functions::encodeFileSystemToUtf8($selCity . '/' . $entry);
                 $certificate = new Certificate($path, $this->tree, $this);
                 if (Functions::isImageTypeSupported($certificate->extension())) {
                     $tabCertif[] = $certificate;
                 }
             }
         }
     }
     return $tabCertif;
 }