Exemple #1
0
            list($ret, $errors) = $importer->importToDb($verifiedFile, 'importProgressCallback');
            if ($ret) {
                $templateData['errors'][] = $ret->getAsHtml();
            } else {
                if ($errors != null) {
                    if (!is_array($errors)) {
                        $templateData['errors'][] = $errors->getAsHtml();
                    } else {
                        foreach ($errors as $status) {
                            $templateData['errors'][] = $status->getAsHtml();
                        }
                    }
                }
            }
            /* The import processing sets Gallery into maintenance mode, undo that now */
            $ret = GalleryCoreApi::setMaintenanceMode(false);
            if ($ret) {
                $templateData['errors'][] = $ret->getAsHtml();
            }
            $templateData['bodyFile'] = 'ImportFinished.html';
            $templateData['hideStatusBlock'] = 1;
            $renderFullPage = false;
        }
    } else {
        getBackupFiles($templateData);
        /* Render the output */
        $templateData['bodyFile'] = 'ImportRequest.html';
    }
}
if (!$ret) {
    $ret = GalleryEmbed::done();