From 629c4af3c82e4455aacd660b4460130d6fce50d2 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 10 Nov 2024 23:53:03 +0000 Subject: [PATCH] Replace typehint App with AppHelper in view folder --- view/theme/duepuntozero/config.php | 18 +++++++++--------- view/theme/duepuntozero/theme.php | 7 ++++--- view/theme/frio/config.php | 4 ++-- view/theme/quattro/config.php | 16 ++++++++-------- view/theme/quattro/theme.php | 4 ++-- view/theme/smoothly/theme.php | 4 ++-- view/theme/vier/config.php | 18 +++++++++--------- 7 files changed, 36 insertions(+), 35 deletions(-) diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index 59acb109d2..1c70b4414c 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -7,11 +7,11 @@ * */ -use Friendica\App; +use Friendica\AppHelper; use Friendica\Core\Renderer; use Friendica\DI; -function theme_content(App $a) +function theme_content(AppHelper $appHelper) { if (!DI::userSession()->getLocalUserId()) { return; @@ -20,10 +20,10 @@ function theme_content(App $a) $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset'); $user = true; - return clean_form($a, $colorset, $user); + return clean_form($appHelper, $colorset, $user); } -function theme_post(App $a) +function theme_post(AppHelper $appHelper) { if (!DI::userSession()->getLocalUserId()) { return; @@ -34,23 +34,23 @@ function theme_post(App $a) } } -function theme_admin(App $a) +function theme_admin(AppHelper $appHelper) { $colorset = DI::config()->get('duepuntozero', 'colorset'); $user = false; - return clean_form($a, $colorset, $user); + return clean_form($appHelper, $colorset, $user); } -function theme_admin_post(App $a) +function theme_admin_post(AppHelper $appHelper) { if (isset($_POST['duepuntozero-settings-submit'])) { DI::config()->set('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); } } -/// @TODO $a is no longer used -function clean_form(App $a, &$colorset, $user) +/// @TODO $appHelper is no longer used +function clean_form(AppHelper $appHelper, &$colorset, $user) { $colorset = [ 'default' => DI::l10n()->t('default'), diff --git a/view/theme/duepuntozero/theme.php b/view/theme/duepuntozero/theme.php index a9466b2350..9ab5dd4ce3 100644 --- a/view/theme/duepuntozero/theme.php +++ b/view/theme/duepuntozero/theme.php @@ -7,7 +7,8 @@ * */ -use Friendica\App; +use Friendica\App\Mode; +use Friendica\AppHelper; use Friendica\Core\Renderer; use Friendica\DI; @@ -15,13 +16,13 @@ use Friendica\DI; * This script can be included even when the app is in maintenance mode which requires us to avoid any config call */ -function duepuntozero_init(App $a) { +function duepuntozero_init(AppHelper $appHelper) { Renderer::setActiveTemplateEngine('smarty3'); $colorset = null; - if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { + if (DI::mode()->has(Mode::MAINTENANCEDISABLED)) { $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset'); if (!$colorset) $colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 75074da2f9..21df4d2c15 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -7,14 +7,14 @@ * */ -use Friendica\App; +use Friendica\AppHelper; use Friendica\Core\Renderer; use Friendica\DI; require_once 'view/theme/frio/php/Image.php'; require_once 'view/theme/frio/php/scheme.php'; -function theme_post(App $a) +function theme_post(AppHelper $appHelper) { if (!DI::userSession()->getLocalUserId()) { return; diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 77384d9b65..97f68c0579 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -7,11 +7,11 @@ * */ -use Friendica\App; +use Friendica\AppHelper; use Friendica\Core\Renderer; use Friendica\DI; -function theme_content(App $a) { +function theme_content(AppHelper $appHelper) { if (!DI::userSession()->getLocalUserId()) { return; } @@ -21,10 +21,10 @@ function theme_content(App $a) { $tfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","tfs"); $pfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","pfs"); - return quattro_form($a,$align, $color, $tfs, $pfs); + return quattro_form($appHelper,$align, $color, $tfs, $pfs); } -function theme_post(App $a) { +function theme_post(AppHelper $appHelper) { if (!DI::userSession()->getLocalUserId()) { return; } @@ -37,16 +37,16 @@ function theme_post(App $a) { } } -function theme_admin(App $a) { +function theme_admin(AppHelper $appHelper) { $align = DI::config()->get('quattro', 'align' ); $color = DI::config()->get('quattro', 'color' ); $tfs = DI::config()->get("quattro","tfs"); $pfs = DI::config()->get("quattro","pfs"); - return quattro_form($a,$align, $color, $tfs, $pfs); + return quattro_form($appHelper,$align, $color, $tfs, $pfs); } -function theme_admin_post(App $a) { +function theme_admin_post(AppHelper $appHelper) { if (isset($_POST['quattro-settings-submit'])){ DI::config()->set('quattro', 'align', $_POST['quattro_align']); DI::config()->set('quattro', 'color', $_POST['quattro_color']); @@ -56,7 +56,7 @@ function theme_admin_post(App $a) { } /// @TODO $a is no longer used here -function quattro_form(App $a, $align, $color, $tfs, $pfs) { +function quattro_form(AppHelper $appHelper, $align, $color, $tfs, $pfs) { $colors = [ "dark" => "Quattro", "lilac" => "Lilac", diff --git a/view/theme/quattro/theme.php b/view/theme/quattro/theme.php index 7e72e2930a..7c2595dc2b 100644 --- a/view/theme/quattro/theme.php +++ b/view/theme/quattro/theme.php @@ -12,14 +12,14 @@ * Maintainer: Tobias */ -use Friendica\App; +use Friendica\AppHelper; use Friendica\DI; /* * This script can be included even when the app is in maintenance mode which requires us to avoid any config call */ -function quattro_init(App $a) { +function quattro_init(AppHelper $appHelper) { DI::page()['htmlhead'] .= ''; DI::page()['htmlhead'] .= '';; } diff --git a/view/theme/smoothly/theme.php b/view/theme/smoothly/theme.php index 2b81898aea..e42ed94364 100644 --- a/view/theme/smoothly/theme.php +++ b/view/theme/smoothly/theme.php @@ -20,7 +20,7 @@ * Screenshot: Screenshot */ -use Friendica\App; +use Friendica\AppHelper; use Friendica\Core\Renderer; use Friendica\DI; @@ -28,7 +28,7 @@ use Friendica\DI; * This script can be included even when the app is in maintenance mode which requires us to avoid any config call */ -function smoothly_init(App $a) { +function smoothly_init(AppHelper $appHelper) { Renderer::setActiveTemplateEngine('smarty3'); $cssFile = null; diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php index 3f61122dd3..f30bf1be7e 100644 --- a/view/theme/vier/config.php +++ b/view/theme/vier/config.php @@ -7,13 +7,13 @@ * */ -use Friendica\App; +use Friendica\AppHelper; use Friendica\Core\Renderer; use Friendica\DI; require_once __DIR__ . '/theme.php'; -function theme_content(App $a) +function theme_content(AppHelper $appHelper) { if (!DI::userSession()->getLocalUserId()) { return; @@ -40,11 +40,11 @@ function theme_content(App $a) $show_friends = get_vier_config('show_friends', true); $show_lastusers = get_vier_config('show_lastusers', true); - return vier_form($a,$style, $show_pages, $show_profiles, $show_helpers, + return vier_form($appHelper,$style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers); } -function theme_post(App $a) +function theme_post(AppHelper $appHelper) { if (!DI::userSession()->getLocalUserId()) { return; @@ -62,7 +62,7 @@ function theme_post(App $a) } -function theme_admin(App $a) { +function theme_admin(AppHelper $appHelper) { if (!function_exists('get_vier_config')) return; @@ -85,13 +85,13 @@ function theme_admin(App $a) { $show_services = get_vier_config('show_services', true, true); $show_friends = get_vier_config('show_friends', true, true); $show_lastusers = get_vier_config('show_lastusers', true, true); - $o .= vier_form($a,$style, $show_pages, $show_profiles, $show_helpers, $show_services, + $o .= vier_form($appHelper,$style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers); return $o; } -function theme_admin_post(App $a) { +function theme_admin_post(AppHelper $appHelper) { if (isset($_POST['vier-settings-submit'])){ DI::config()->set('vier', 'style', $_POST['vier_style']); DI::config()->set('vier', 'show_pages', $_POST['vier_show_pages']); @@ -104,8 +104,8 @@ function theme_admin_post(App $a) { } } -/// @TODO $a is no longer used -function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers) { +/// @TODO $appHelper is no longer used +function vier_form(AppHelper $appHelper, $style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers) { $styles = [ "breathe"=>"Breathe", "netcolour"=>"Coloured Networks",