]> git.mxchange.org Git - friendica.git/commitdiff
Replace typehint App with AppHelper in view folder
authorArt4 <art4@wlabs.de>
Sun, 10 Nov 2024 23:53:03 +0000 (23:53 +0000)
committerArt4 <art4@wlabs.de>
Sun, 10 Nov 2024 23:53:03 +0000 (23:53 +0000)
view/theme/duepuntozero/config.php
view/theme/duepuntozero/theme.php
view/theme/frio/config.php
view/theme/quattro/config.php
view/theme/quattro/theme.php
view/theme/smoothly/theme.php
view/theme/vier/config.php

index 59acb109d23e086954cf3ee78f389b8330ee30c1..1c70b4414c1c30a4e871f9d60ac391b9d0212c64 100644 (file)
@@ -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'),
index a9466b2350d20615ebaa9d5a1472f40b7c62e145..9ab5dd4ce3b6966cf264ca7435974884234b3b4e 100644 (file)
@@ -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
index 75074da2f9f58836ffa710ff222cba5a85b2ae53..21df4d2c15b6f19456ef237200cf8b7d34580f52 100644 (file)
@@ -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;
index 77384d9b657bb1e03c4c5fb322b3032bd23ad761..97f68c0579964056280bbd52b5347c568cc2d171 100644 (file)
@@ -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",
index 7e72e2930a138058c4707f52b2552ddc0be4f1bb..7c2595dc2bbf5a3afb3aaa920bc172b26a5e628e 100644 (file)
  * Maintainer: Tobias <https://diekershoff.homeunix.net/friendica/profile/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'] .= '<script src="'.DI::baseUrl().'/view/theme/quattro/tinycon.min.js"></script>';
        DI::page()['htmlhead'] .= '<script src="'.DI::baseUrl().'/view/theme/quattro/js/quattro.js"></script>';;
 }
index 2b81898aea9ef142946b53849ceeae734da3283d..e42ed94364e5929b6851a07f7bef90f8958c07ae 100644 (file)
@@ -20,7 +20,7 @@
  * Screenshot: <a href="screenshot.png">Screenshot</a>
  */
 
-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;
index 3f61122dd343d19b8d3a8840a558ca5396654ce6..f30bf1be7e77e11a61a9c8a020be775ddc47f04a 100644 (file)
@@ -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",