diff --git a/CHANGELOG.md b/CHANGELOG.md index da8195a8..3e5d0e01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Version 5.3 +* Update PHP requirement to 8.2 + ## Version 5.2 * Updated PHP requirement to 8.1 * Updated to support PHP 8.2 diff --git a/app/config/anilist.toml.example b/app/config/anilist.toml.example new file mode 100644 index 00000000..9cf0e997 --- /dev/null +++ b/app/config/anilist.toml.example @@ -0,0 +1,6 @@ +################################################################################ +# Anilist API # +################################################################################ +client_id = "your_client_id" +client_secret = "your_client_secret" +username = "user123" \ No newline at end of file diff --git a/app/views/settings/_anilist.php b/app/views/settings/_anilist.php new file mode 100644 index 00000000..c3b86bcd --- /dev/null +++ b/app/views/settings/_anilist.php @@ -0,0 +1,24 @@ + +

See the wiki to learn how to set up Anilist integration.

+ + checkAuth(); ?> + +

Anilist API Client is Not Authorized.

+ a( + $url->generate('anilist-redirect'), + 'Link Anilist Account', + ['class' => 'bracketed user-btn'] + ) ?> + + get(['anilist', 'access_token_expires']); ?> +

+ Linked to Anilist. Your access token will expire around +

+ + a( + $url->generate('anilist-redirect'), + 'Update Access Token', + ['class' => 'bracketed user-btn'] + ) ?> + + \ No newline at end of file diff --git a/app/views/settings/settings.php b/app/views/settings/settings.php index 16fef5f0..0f4a009c 100644 --- a/app/views/settings/settings.php +++ b/app/views/settings/settings.php @@ -28,29 +28,11 @@ $nestedPrefix = 'config'; />
- - checkAuth(); ?> - -

Not Authorized.

- a( - $url->generate('anilist-redirect'), - 'Link Anilist Account' - ) ?> - - get(['anilist', 'access_token_expires']); ?> -

- Linked to Anilist. Your access token will expire around -

- - a( - $url->generate('anilist-redirect'), - 'Update Access Token', - ['class' => 'bracketed user-btn'] - ) ?> - - - - +
@@ -62,7 +44,3 @@ $nestedPrefix = 'config'; - - - - diff --git a/composer.json b/composer.json index 5e16500a..039a947f 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "laminas/laminas-httphandlerrunner": "^2.6.1", "maximebf/consolekit": "^1.0.3", "monolog/monolog": "^3.0.0", - "php": ">= 8.1.0", + "php": ">= 8.2.0", "psr/http-message": "^1.0.1", "symfony/polyfill-mbstring": "^1.0.0", "symfony/polyfill-util": "^1.0.0", diff --git a/src/AnimeClient/Controller/Settings.php b/src/AnimeClient/Controller/Settings.php index e68ecdad..5842bf55 100644 --- a/src/AnimeClient/Controller/Settings.php +++ b/src/AnimeClient/Controller/Settings.php @@ -57,13 +57,15 @@ final class Settings extends BaseController $auth = $this->container->get('auth'); $form = $this->settingsModel->getSettingsForm(); - $hasAnilistLogin = $this->config->has(['anilist', 'access_token']); + $hasRequiredAnilistConfig = $this->config->has(['anilist', 'client_secret']) && + $this->config->has(['anilist', 'client_id']) && + $this->config->has(['anilist', 'username']); $this->outputHTML('settings/settings', [ 'anilistModel' => $this->anilistModel, 'auth' => $auth, 'form' => $form, - 'hasAnilistLogin' => $hasAnilistLogin, + 'hasRequiredAnilistConfig' => $hasRequiredAnilistConfig, 'config' => $this->config, 'title' => $this->config->get('whose_list') . "'s Settings", ]);