public static function ThemeLayoutsImport2()
 {
     $plik = $_FILES;
     if (!isset($plik['importfile'])) {
         GFontsUI::Error(__('Please upload import file. Try again.', self::PLUGIN_SLUG));
         self::ThemeLayoutsImport();
         return;
     } else {
         $error = intval($plik['importfile']['error']);
         if ($error != 0) {
             GFontsUI::Error(__('Error while uploading import file. Try again.', self::PLUGIN_SLUG));
             self::ThemeLayoutsImport();
             return;
         }
         $type = $plik['importfile']['type'];
         if ($type != 'text/xml') {
             GFontsUI::Error(sprintf(__('Expected type text/xml - got %s', self::PLUGIN_SLUG), $type));
             self::ThemeLayoutsImport();
             return;
         }
         $xml = simplexml_load_file($plik['importfile']['tmp_name']);
         if ($xml === false) {
             GFontsUI::Error(__('Error in XML structure.', self::PLUGIN_SLUG));
             self::ThemeLayoutsImport();
             return;
         }
         $sum = 0;
         foreach ($xml->layouts->layout as $layout) {
             if (GFontsDB::ImportThemeLayout($layout)) {
                 $sum++;
             }
         }
         $sum2 = 0;
         foreach ($xml->presets->preset as $preset) {
             if (GFontsDB::ImportPreset($preset)) {
                 $sum2++;
             }
         }
         GFontsUI::Success(sprintf(__("%d theme layouts imported. %d title presets imported.", self::PLUGIN_SLUG), $sum, $sum2));
         self::ThemeLayoutsImport();
     }
 }