/**
  * 
  * get galleries array from galleris folder with settings from config.xml from each gallery
  */
 private function initArrGalleryTypes()
 {
     $arrOrder = $this->getArrOrder();
     $strErrorPrefix = __("Load galleries error", UNITEGALLERY_TEXTDOMAIN);
     $arrDirs = UniteFunctionsUG::getDirList(GlobalsUG::$pathGalleries);
     $arrGalleries = array();
     //reorder arrdirs:
     $arrDirsNew = array();
     $arrDirs = UniteFunctionsUG::arrayToAssoc($arrDirs);
     foreach ($arrOrder as $dir) {
         if (array_key_exists($dir, $arrDirs)) {
             $arrDirsNew[] = $dir;
             unset($arrDirs[$dir]);
         }
     }
     $arrDirsNew = array_merge($arrDirsNew, $arrDirs);
     foreach ($arrDirsNew as $dir) {
         $pathGallery = GlobalsUG::$pathGalleries . $dir . "/";
         if (is_dir($pathGallery) == false) {
             continue;
         }
         $objGallery = new UniteGalleryGalleryType();
         $objGallery->initByFolder($dir);
         $galleryName = $objGallery->getName();
         $arrGalleries[$galleryName] = $objGallery;
     }
     self::$arrGalleryTypes = $arrGalleries;
 }