mirror of
https://github.com/friendica/friendica
synced 2024-11-10 03:42:53 +00:00
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
|
||||
*
|
||||
|
|
5
view/templates/acl/self_only.tpl
Normal file
5
view/templates/acl/self_only.tpl
Normal file
|
@ -0,0 +1,5 @@
|
|||
<input type="hidden" name="contact_allow" value="{{$selfPublicContactId}}">
|
||||
<input type="hidden" name="group_allow" value="">
|
||||
<input type="hidden" name="contact_deny" value="">
|
||||
<input type="hidden" name="group_deny" value="">
|
||||
<div class="alert alert-info" role="alert"><p>{{$explanation}}</p></div>
|
Loading…
Reference in a new issue