]> git.mxchange.org Git - friendica.git/blobdiff - mod/editpost.php
Remove mod/wall_upload.php file
[friendica.git] / mod / editpost.php
index 3fb8c80ec0510bff5c09260ea8115c684f4ff7f1..bec5d3449ef311b14928e616e97f2c919f955cf8 100644 (file)
@@ -34,29 +34,29 @@ function editpost_content(App $a)
 {
        $o = '';
 
-       if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+       if (!DI::userSession()->getLocalUserId()) {
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return;
        }
 
        $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
 
        if (!$post_id) {
-               notice(DI::l10n()->t('Item not found'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
                return;
        }
 
        $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
                'body', 'title', 'uri-id', 'wall', 'post-type', 'guid'];
 
-       $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
+       $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['id' => $post_id, 'uid' => DI::userSession()->getLocalUserId()]);
 
        if (!DBA::isResult($item)) {
-               notice(DI::l10n()->t('Item not found'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
                return;
        }
 
-       $user = User::getById(local_user());
+       $user = User::getById(DI::userSession()->getLocalUserId());
 
        $geotag = '';
 
@@ -118,8 +118,8 @@ function editpost_content(App $a)
                '$jotnets' => $jotnets,
                '$title' => $item['title'],
                '$placeholdertitle' => DI::l10n()->t('Set title'),
-               '$category' => Post\Category::getCSVByURIId($item['uri-id'], local_user(), Post\Category::CATEGORY),
-               '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
+               '$category' => Post\Category::getCSVByURIId($item['uri-id'], DI::userSession()->getLocalUserId(), Post\Category::CATEGORY),
+               '$placeholdercategory' => (Feature::isEnabled(DI::userSession()->getLocalUserId(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
                '$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
                '$lockstate' => $lockstate,
                '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),