Exemplo n.º 1
0
        } else {
            // Import from Github
            $res = GithubInstaller::install($_POST['github']);
            if (!$res) {
                $form->failed = array('github-install');
                $page->installer_error = GithubInstaller::$error;
                return false;
            }
            // App/theme successfully installed
            $page->title = __('Install completed');
            echo $tpl->render('designer/installed', $res);
        }
    } elseif (is_uploaded_file($_FILES['zipfile']['tmp_name'])) {
        ZipInstaller::clean();
        // Import from Zip
        $res = ZipInstaller::install($_FILES['zipfile']);
        if (!$res) {
            ZipInstaller::clean();
            $form->failed = array('zip-install');
            $page->installer_error = ZipInstaller::$error;
            return false;
        }
        // Zip successfully installed
        ZipInstaller::clean();
        $page->title = __('Install completed');
        echo $tpl->render('designer/installed', $res);
    } else {
        $form->failed = array('other');
        return false;
    }
});