Create self-only ACL template and helper method
This commit is contained in:
parent
c4267bbca0
commit
5f5b97dad6
2 changed files with 26 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue