]> git.mxchange.org Git - friendica.git/commitdiff
Remove requirement for App class in legacy mods
authorArt4 <art4@wlabs.de>
Sat, 23 Nov 2024 08:26:59 +0000 (08:26 +0000)
committerArt4 <art4@wlabs.de>
Sat, 23 Nov 2024 08:26:59 +0000 (08:26 +0000)
mod/item.php
mod/lostpass.php
mod/notes.php
mod/photos.php
mod/update_contact.php
mod/update_notes.php

index decb957bcc5eb8f07623d204eef69759f0268c4b..c47dbac44d730d455072aeb5ae68e02ce07c4cf6 100644 (file)
@@ -16,7 +16,6 @@
  * information.
  */
 
-use Friendica\AppHelper;
 use Friendica\Content\Conversation;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Hook;
@@ -330,7 +329,7 @@ function item_post_return($baseurl, $return_path)
        System::jsonExit($json);
 }
 
-function item_content(AppHelper $appHelper)
+function item_content()
 {
        if (!DI::userSession()->isAuthenticated()) {
                throw new HTTPException\UnauthorizedException();
index 940546d951b3a46b875739989ab19d7b588bf530..d62fd5f5aa65722876d8494980d8bafc9c2fdce1 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-use Friendica\AppHelper;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -15,7 +14,7 @@ use Friendica\Model\User;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Strings;
 
-function lostpass_post(AppHelper $a)
+function lostpass_post()
 {
        $loginame = trim($_POST['login-name']);
        if (!$loginame) {
@@ -78,7 +77,7 @@ function lostpass_post(AppHelper $a)
        DI::baseUrl()->redirect();
 }
 
-function lostpass_content(AppHelper $appHelper)
+function lostpass_content()
 {
        if (DI::args()->getArgc() > 1) {
                $pwdreset_token = DI::args()->getArgv()[1];
index b61cb97850ffa7e9e0d3aefb320404a304c43736..478e4c4acab86ade50e716e48aeb8b214e7ebfc8 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-use Friendica\AppHelper;
 use Friendica\Content\Conversation;
 use Friendica\Content\Nav;
 use Friendica\Content\Pager;
@@ -17,7 +16,7 @@ use Friendica\Model\Item;
 use Friendica\Model\Post;
 use Friendica\Module\BaseProfile;
 
-function notes_init(AppHelper $appHelper)
+function notes_init()
 {
        if (! DI::userSession()->getLocalUserId()) {
                return;
@@ -27,8 +26,10 @@ function notes_init(AppHelper $appHelper)
 }
 
 
-function notes_content(AppHelper $appHelper, bool $update = false)
+function notes_content(bool $update = false)
 {
+       $contactId = DI::appHelper()->getContactId();
+
        if (!DI::userSession()->getLocalUserId()) {
                DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return;
@@ -46,11 +47,11 @@ function notes_content(AppHelper $appHelper, bool $update = false)
                        'acl_data' => '',
                ];
 
-               $o .= DI::conversation()->statusEditor($x, $appHelper->getContactId());
+               $o .= DI::conversation()->statusEditor($x, $contactId);
        }
 
        $condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
-               'contact-id'=> $appHelper->getContactId()];
+               'contact-id'=> $contactId];
 
        if (DI::mode()->isMobile()) {
                $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
index 3afca2db2a7d0abf4bb4f39035bb514a602c6470..c9fa60bca03caf8087076d79e3bdabe03f821ce5 100644 (file)
@@ -28,9 +28,7 @@ use Friendica\Model\Tag;
 use Friendica\Model\User;
 use Friendica\Module\BaseProfile;
 use Friendica\Network\HTTPException;
-use Friendica\Network\Probe;
 use Friendica\Protocol\Activity;
-use Friendica\Protocol\ActivityNamespace;
 use Friendica\Security\Security;
 use Friendica\Util\Crypto;
 use Friendica\Util\DateTimeFormat;
index 30212e5589359cbec81471cab9996a8f9a00fc8f..adfbc513d73b7cd0b8cdb57e53c0af7858b54d76 100644 (file)
@@ -9,14 +9,13 @@
  *
  */
 
-use Friendica\AppHelper;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Post;
 use Friendica\Model\Contact;
 
-function update_contact_content(AppHelper $appHelper)
+function update_contact_content()
 {
        if (!empty(DI::args()->get(1)) && !empty($_GET['force'])) {
                $contact = DBA::selectFirst('account-user-view', ['pid', 'deleted'], ['id' => DI::args()->get(1)]);
index 93b5e95207b77bf31fd3f0ab095a53e3c4bd8776..06bbac693092444a67968215bd19d41668afc8b5 100644 (file)
@@ -8,12 +8,11 @@
  * AJAX synchronisation of notes page
  */
 
-use Friendica\AppHelper;
 use Friendica\Core\System;
 
 require_once 'mod/notes.php';
 
-function update_notes_content(AppHelper $appHelper)
+function update_notes_content()
 {
        $profile_uid = intval($_GET['p']);
 
@@ -27,7 +26,7 @@ function update_notes_content(AppHelper $appHelper)
         *
         */
 
-       $text = notes_content($appHelper, $profile_uid);
+       $text = notes_content($profile_uid);
 
        System::htmlUpdateExit($text);
 }