Many deprecated function calls are replaced
[friendica.git/.git] / mod / photos.php
index 32031e2..e7b24b9 100644 (file)
  *
  */
 
-use Friendica\App;
 use Friendica\Content\Nav;
 use Friendica\Content\Pager;
 use Friendica\Content\Text\BBCode;
-use Friendica\Content\Widget;
 use Friendica\Core\ACL;
 use Friendica\Core\Addon;
 use Friendica\Core\Hook;
@@ -53,7 +51,7 @@ use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
 use Friendica\Util\XML;
 
-function photos_init(App $a)
+function photos_init()
 {
        if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
                return;
@@ -67,8 +65,6 @@ function photos_init(App $a)
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
 
-               $is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner['uid']));
-
                $albums = Photo::getAlbums($owner['uid']);
 
                $albums_visible = ((intval($owner['hidewall']) && !DI::userSession()->isAuthenticated()) ? false : true);
@@ -125,7 +121,7 @@ function photos_init(App $a)
        return;
 }
 
-function photos_post(App $a)
+function photos_post()
 {
        $user = User::getByNickname(DI::args()->getArgv()[1]);
        if (!DBA::isResult($user)) {
@@ -200,7 +196,7 @@ function photos_post(App $a)
                        // Update the photo albums cache
                        Photo::clearAlbumCache($page_owner_uid);
 
-                       DI::baseUrl()->redirect('photos/' . $a->getLoggedInUserNickname() . '/album/' . bin2hex($newalbum));
+                       DI::baseUrl()->redirect('photos/' . DI::userSession()->getLocalUserNickname() . '/album/' . bin2hex($newalbum));
                        return; // NOTREACHED
                }
 
@@ -559,7 +555,7 @@ function photos_post(App $a)
        }
 }
 
-function photos_content(App $a)
+function photos_content()
 {
        // URLs:
        // photos/name/upload
@@ -714,7 +710,7 @@ function photos_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('photos_upload.tpl');
 
-               $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId()));
+               $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML(DI::page(), DI::userSession()->getLocalUserId()));
 
                $o .= Renderer::replaceMacros($tpl, [
                        '$pagename' => DI::l10n()->t('Upload Photos'),
@@ -728,7 +724,7 @@ function photos_content(App $a)
                        '$selname' => $selname,
                        '$permissions' => DI::l10n()->t('Permissions'),
                        '$aclselect' => $aclselect_e,
-                       '$lockstate' => ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',
+                       '$lockstate' => ACL::getLockstateForUserId(DI::userSession()->getLocalUserId()) ? 'lock' : 'unlock',
                        '$alt_uploader' => $ret['addon_text'],
                        '$default_upload_box' => ($ret['default_upload'] ? $default_upload_box : ''),
                        '$default_upload_submit' => ($ret['default_upload'] ? $default_upload_submit : ''),
@@ -1074,7 +1070,7 @@ function photos_content(App $a)
 
                        $album_e = $ph[0]['album'];
                        $caption_e = $ph[0]['desc'];
-                       $aclselect_e = ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), false, ACL::getDefaultUserPermissions($ph[0]));
+                       $aclselect_e = ACL::getFullSelectorHTML(DI::page(), DI::userSession()->getLocalUserId(), false, ACL::getDefaultUserPermissions($ph[0]));
 
                        $edit = Renderer::replaceMacros($edit_tpl, [
                                '$id' => $ph[0]['id'],