mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:35:12 +00:00
multi acl: port /rpost
This commit is contained in:
parent
53a2262fef
commit
bed0a5773f
8 changed files with 18 additions and 20 deletions
|
@ -218,14 +218,13 @@ class Chat extends \Zotlabs\Web\Controller {
|
|||
notice( t('Feature disabled.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$acl = new \Zotlabs\Access\AccessList($channel);
|
||||
$channel_acl = $acl->get();
|
||||
|
||||
|
||||
$lockstate = (($channel_acl['allow_cid'] || $channel_acl['allow_gid'] || $channel_acl['deny_cid'] || $channel_acl['deny_gid']) ? 'lock' : 'unlock');
|
||||
require_once('include/acl_selectors.php');
|
||||
|
||||
|
||||
$chatroom_new = '';
|
||||
if(local_channel()) {
|
||||
$chatroom_new = replace_macros(get_markup_template('chatroom_new.tpl'),array(
|
||||
|
@ -243,7 +242,7 @@ class Chat extends \Zotlabs\Web\Controller {
|
|||
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$rooms = Zlib\Chatroom::roomlist(\App::$profile['profile_uid']);
|
||||
|
||||
$o .= replace_macros(get_markup_template('chatrooms.tpl'), array(
|
||||
|
|
|
@ -116,6 +116,7 @@ class Rpost extends \Zotlabs\Web\Controller {
|
|||
'nickname' => $channel['channel_address'],
|
||||
'lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'),
|
||||
'acl' => populate_acl($channel_acl, true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
|
||||
'permissions' => $channel_acl,
|
||||
'bang' => '',
|
||||
'visitor' => true,
|
||||
'profile_uid' => local_channel(),
|
||||
|
|
|
@ -53,8 +53,6 @@ function ACL(backend_url) {
|
|||
$(document).on('click','.acl-button-show',that.on_button_show);
|
||||
$(document).on('click','.acl-button-hide',that.on_button_hide);
|
||||
|
||||
$(document).on('click','.acl-button-hide',that.on_button_hide);
|
||||
|
||||
$("#acl-search").keypress(that.on_search);
|
||||
|
||||
/* startup! */
|
||||
|
@ -64,7 +62,7 @@ function ACL(backend_url) {
|
|||
}
|
||||
|
||||
|
||||
ACL.prototype.get_form_data = function(event) {
|
||||
ACL.prototype.get_form_data = function(event, form_id) {
|
||||
|
||||
form_id = $(this).data('form_id');
|
||||
|
||||
|
@ -401,5 +399,5 @@ ACL.prototype.populate = function(data) {
|
|||
$(el).attr('src', $(el).data("src"));
|
||||
$(el).removeAttr("data-src");
|
||||
});
|
||||
that.update_view();
|
||||
//that.update_view();
|
||||
};
|
||||
|
|
|
@ -100,13 +100,13 @@ function prepareHtml(f, i) {
|
|||
}
|
||||
|
||||
function formatSizeUnits(bytes){
|
||||
if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';}
|
||||
else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';}
|
||||
else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';}
|
||||
else if (bytes>1) {bytes=bytes+' bytes';}
|
||||
else if (bytes==1) {bytes=bytes+' byte';}
|
||||
else {bytes='0 byte';}
|
||||
return bytes;
|
||||
if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';}
|
||||
else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';}
|
||||
else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';}
|
||||
else if (bytes>1) {bytes=bytes+' bytes';}
|
||||
else if (bytes==1) {bytes=bytes+' byte';}
|
||||
else {bytes='0 byte';}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
// this is basically a js port of include/text.php getIconFromType() function
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="generic-content-wrapper">
|
||||
<div class="section-title-wrapper">
|
||||
{{if $is_owner}}
|
||||
<button type="button" class="btn btn-success btn-xs pull-right" onclick="openClose('chatroom-new');"><i class="fa fa-plus-circle"></i> {{$newroom}}</button>
|
||||
<button type="button" class="btn btn-success btn-xs pull-right acl-form-trigger" onclick="openClose('chatroom-new');" data-form_id="chatroom-new-form"><i class="fa fa-plus-circle"></i> {{$newroom}}</button>
|
||||
{{/if}}
|
||||
<h2>{{$header}}</h2>
|
||||
</div>
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
</button>
|
||||
{{/if}}
|
||||
{{if $showacl}}
|
||||
<button id="dbtn-acl" class="acl-select btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" title="{{$permset}}" type="button">
|
||||
<button id="dbtn-acl" class="acl-select btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" title="{{$permset}}" type="button" data-form_id="profile-jot-form">
|
||||
<i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons"></i>{{if $bang}} <i class="fa fa-exclamation jot-icons"></i>{{/if}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="section-title-wrapper">
|
||||
{{if $editor}}
|
||||
<div class="pull-right">
|
||||
<button id="webpage-create-btn" class="btn btn-xs btn-success" onclick="openClose('webpage-editor');"><i class="fa fa-pencil-square-o"></i> {{$create}}</button>
|
||||
<button id="webpage-create-btn" class="btn btn-xs btn-success acl-form-trigger" onclick="openClose('webpage-editor');" data-form_id="profile-jot-form"><i class="fa fa-pencil-square-o"></i> {{$create}}</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
<h2>{{$listtitle}}</h2>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="section-title-wrapper">
|
||||
<div class="pull-right">
|
||||
{{if $showNewWikiButton}}
|
||||
<button class="btn btn-primary btn-xs" onclick="$('#new-page-form-wrapper').hide(); openClose('new-wiki-form-wrapper');">New Wiki</button>
|
||||
<button class="btn btn-primary btn-xs acl-form-trigger" onclick="$('#new-page-form-wrapper').hide(); openClose('new-wiki-form-wrapper');" data-form_id="new-wiki-form">New Wiki</button>
|
||||
{{/if}}
|
||||
{{if $showNewPageButton}}
|
||||
<button class="btn btn-success btn-xs" onclick="$('#new-wiki-form-wrapper').hide(); openClose('new-page-form-wrapper');">New Page</button>
|
||||
|
|
Loading…
Reference in a new issue