]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/ACL.php
Merge pull request #9874 from annando/psid
[friendica.git] / src / Core / ACL.php
index 4df15dc536906a31e6a8c64b245140830c910854..5f69d78b683921cccca5c75a9d3a3340d1bd700e 100644 (file)
@@ -83,6 +83,27 @@ class ACL
                return $o;
        }
 
+       /**
+        * Returns a minimal ACL block for self-only permissions
+        *
+        * @param int    $localUserId
+        * @param string $explanation
+        * @return string
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        */
+       public static function getSelfOnlyHTML(int $localUserId, string $explanation)
+       {
+               $selfPublicContactId = Contact::getPublicIdByUserId($localUserId);
+
+               $tpl = Renderer::getMarkupTemplate('acl/self_only.tpl');
+               $o = Renderer::replaceMacros($tpl, [
+                       '$selfPublicContactId' => $selfPublicContactId,
+                       '$explanation' => $explanation,
+               ]);
+
+               return $o;
+       }
+
        /**
         * Return the default permission of the provided user array
         *