get_gitea_all(); set_site_transient('update_plugins', null); set_site_transient('update_themes', null); } if (isset($_POST['gitea_options'])) { update_option('gitea_options', $_POST['gitea_options']); } } function options_page() { $options = (array)get_option('gitea_options'); $repositories = $this->get_repositories(); $types = array( 'plugin' => __('Plugins'), 'theme' => __('Themes'), ); ?>

Gitea Updater

install($_POST['gitea_install']); ?>

$packages) : ?>
$items) : ?> $package) : ?>

http:// or https:// links, It\'s not working with ssh:// links!', 'gitea')?>

plugins: themes:
*/ ?> $plugin) { $plugin['url'] = $plugin['gitea_host'].$plugin['gitea_repo']; $repositories[$plugin['gitea_host']]['plugin'][$slug] = $plugin; } foreach ($themes as $slug => $theme) { $theme['url'] = $theme['gitea_host'].$theme['gitea_repo']; $repositories[$plugin['gitea_host']]['theme'][$slug] = $theme; } return $repositories; } static function get() { return (array)get_option('gitea_options'); } function install($data) { $url = parse_url($data['url']); $host = $url['scheme'].'://'.$url['host'].'/'; $repo = str_replace('.git', '', trim($url['path'], '/')); $updater = Gitea_Updater::getInstance(); $package = $updater->get_gitea_url($host, $repo, '/archive/master.zip', $data['access_token']); if ($data['type'] == 'plugin') { add_filter('install_plugin_complete_actions', array($this, 'install_actions')); $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) ); $upgrader->install($package); remove_filter('install_plugin_complete_actions', array($this, 'install_actions')); } elseif ($data['type'] == 'theme') { add_filter('install_theme_complete_actions', array($this, 'install_actions')); $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'theme', 'api') ) ); $upgrader->install($package); remove_filter('install_theme_complete_actions', array($this, 'install_actions')); } } function install_actions($install_actions) { unset($install_actions['plugins_page'], $install_actions['themes_page']); $install_actions['gitea_page'] = '' . __( 'Return', 'gitea' ) . ''; return $install_actions; } }