Merge pull request #6931 from MrPetovan/task/6903-collapse-connector-list
Collapse connector list
This commit is contained in:
commit
15e9d8dcdb
|
@ -10,9 +10,10 @@ Version 2019.06 (UNRELEASED) (2019-06-?)
|
||||||
General Code cleaning and restructuring [nupplaphil]
|
General Code cleaning and restructuring [nupplaphil]
|
||||||
Added frio color scheme sharing [JeroenED]
|
Added frio color scheme sharing [JeroenED]
|
||||||
Added syslog and stream Logger [nupplaphil]
|
Added syslog and stream Logger [nupplaphil]
|
||||||
|
Added collapsible panel for connector permission fields [MrPetovan]
|
||||||
|
|
||||||
Closed Issues:
|
Closed Issues:
|
||||||
6303, 6478, 6319, 6921
|
6303, 6478, 6319, 6921, 6903
|
||||||
|
|
||||||
Version 2019.03 (2019-03-22)
|
Version 2019.03 (2019-03-22)
|
||||||
Friendica Core:
|
Friendica Core:
|
||||||
|
|
|
@ -411,6 +411,30 @@ Hook data:
|
||||||
visitor => array with the contact record of the visitor
|
visitor => array with the contact record of the visitor
|
||||||
url => the query string
|
url => the query string
|
||||||
|
|
||||||
|
### jot_networks
|
||||||
|
Called when displaying the post permission screen.
|
||||||
|
Hook data is a list of form fields that need to be displayed along the ACL.
|
||||||
|
Form field array structure is:
|
||||||
|
|
||||||
|
- **type**: `checkbox` or `select`.
|
||||||
|
- **field**: Standard field data structure to be used by `field_checkbox.tpl` and `field_select.tpl`.
|
||||||
|
|
||||||
|
For `checkbox`, **field** is:
|
||||||
|
- [0] (String): Form field name; Mandatory.
|
||||||
|
- [1]: (String): Form field label; Optional, default is none.
|
||||||
|
- [2]: (Boolean): Whether the checkbox should be checked by default; Optional, default is false.
|
||||||
|
- [3]: (String): Additional help text; Optional, default is none.
|
||||||
|
- [4]: (String): Additional HTML attributes; Optional, default is none.
|
||||||
|
|
||||||
|
For `select`, **field** is:
|
||||||
|
- [0] (String): Form field name; Mandatory.
|
||||||
|
- [1] (String): Form field label; Optional, default is none.
|
||||||
|
- [2] (Boolean): Default value to be selected by default; Optional, default is none.
|
||||||
|
- [3] (String): Additional help text; Optional, default is none.
|
||||||
|
- [4] (Array): Associative array of options. Item key is option value, item value is option label; Mandatory.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Complete list of hook callbacks
|
## Complete list of hook callbacks
|
||||||
|
|
||||||
Here is a complete list of all hook callbacks with file locations (as of 24-Sep-2018). Please see the source for details of any hooks not documented above.
|
Here is a complete list of all hook callbacks with file locations (as of 24-Sep-2018). Please see the source for details of any hooks not documented above.
|
||||||
|
|
|
@ -266,14 +266,12 @@ class ACL extends BaseObject
|
||||||
$default_permissions = self::getDefaultUserPermissions($user);
|
$default_permissions = self::getDefaultUserPermissions($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
$jotnets = '';
|
$jotnets_fields = [];
|
||||||
if ($show_jotnets) {
|
if ($show_jotnets) {
|
||||||
$imap_disabled = !function_exists('imap_open') || Config::get('system', 'imap_disabled');
|
|
||||||
|
|
||||||
$mail_enabled = false;
|
$mail_enabled = false;
|
||||||
$pubmail_enabled = false;
|
$pubmail_enabled = false;
|
||||||
|
|
||||||
if (!$imap_disabled) {
|
if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) {
|
||||||
$mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', local_user()]);
|
$mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', local_user()]);
|
||||||
if (DBA::isResult($mailacct)) {
|
if (DBA::isResult($mailacct)) {
|
||||||
$mail_enabled = true;
|
$mail_enabled = true;
|
||||||
|
@ -283,14 +281,17 @@ class ACL extends BaseObject
|
||||||
|
|
||||||
if (empty($default_permissions['hidewall'])) {
|
if (empty($default_permissions['hidewall'])) {
|
||||||
if ($mail_enabled) {
|
if ($mail_enabled) {
|
||||||
$selected = $pubmail_enabled ? ' checked="checked"' : '';
|
$jotnets_fields[] = [
|
||||||
$jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> ' . L10n::t("Post to Email") . '</div>';
|
'type' => 'checkbox',
|
||||||
|
'field' => [
|
||||||
|
'pubmail_enable',
|
||||||
|
L10n::t('Post to Email'),
|
||||||
|
$pubmail_enabled
|
||||||
|
]
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Hook::callAll('jot_networks', $jotnets);
|
Hook::callAll('jot_networks', $jotnets_fields);
|
||||||
} else {
|
|
||||||
$jotnets .= L10n::t('Connectors disabled, since "%s" is enabled.',
|
|
||||||
L10n::t('Hide your profile details from unknown viewers?'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,7 +307,10 @@ class ACL extends BaseObject
|
||||||
'$networks' => $show_jotnets,
|
'$networks' => $show_jotnets,
|
||||||
'$emailcc' => L10n::t('CC: email addresses'),
|
'$emailcc' => L10n::t('CC: email addresses'),
|
||||||
'$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
|
'$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
|
||||||
'$jotnets' => $jotnets,
|
'$jotnets_enabled' => empty($default_permissions['hidewall']),
|
||||||
|
'$jotnets_summary' => L10n::t('Connectors'),
|
||||||
|
'$jotnets_fields' => $jotnets_fields,
|
||||||
|
'$jotnets_disabled_label' => L10n::t('Connectors disabled, since "%s" is enabled.', L10n::t('Hide your profile details from unknown viewers?')),
|
||||||
'$aclModalTitle' => L10n::t('Permissions'),
|
'$aclModalTitle' => L10n::t('Permissions'),
|
||||||
'$aclModalDismiss' => L10n::t('Close'),
|
'$aclModalDismiss' => L10n::t('Close'),
|
||||||
'$features' => [
|
'$features' => [
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
/* General style rules .*/
|
/* General style rules .*/
|
||||||
.pull-right { float: right }
|
.pull-right { float: right }
|
||||||
|
|
||||||
|
details > summary {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
/* General designing elements */
|
/* General designing elements */
|
||||||
.btn {
|
.btn {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
|
@ -225,30 +225,41 @@ ACL.prototype.is_show_all = function() {
|
||||||
this.deny_gid.length==0 && this.deny_cid.length==0);
|
this.deny_gid.length==0 && this.deny_cid.length==0);
|
||||||
};
|
};
|
||||||
|
|
||||||
ACL.prototype.update_view = function(){
|
ACL.prototype.update_view = function () {
|
||||||
if (this.is_show_all()){
|
if (this.is_show_all()) {
|
||||||
this.showall.addClass("selected");
|
this.showall.addClass("selected");
|
||||||
/* jot acl */
|
/* jot acl */
|
||||||
$('#jot-perms-icon').removeClass('lock').addClass('unlock');
|
$('#jot-perms-icon').removeClass('lock').addClass('unlock');
|
||||||
$('#jot-public').show();
|
$('#jot-public').show();
|
||||||
|
$('.profile-jot-net input[type=checkbox]').each(function() {
|
||||||
|
// Restores checkbox state if it had been saved
|
||||||
|
if ($(this).attr('data-checked') !== undefined) {
|
||||||
|
$(this).prop('checked', $(this).attr('data-checked') === 'true');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('.profile-jot-net input').attr('disabled', false);
|
$('.profile-jot-net input').attr('disabled', false);
|
||||||
if(typeof editor != 'undefined' && editor != false) {
|
if (typeof editor != 'undefined' && editor != false) {
|
||||||
$('#profile-jot-desc').html(ispublic);
|
$('#profile-jot-desc').html(ispublic);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.showall.removeClass("selected");
|
this.showall.removeClass("selected");
|
||||||
/* jot acl */
|
/* jot acl */
|
||||||
$('#jot-perms-icon').removeClass('unlock').addClass('lock');
|
$('#jot-perms-icon').removeClass('unlock').addClass('lock');
|
||||||
$('#jot-public').hide();
|
$('#jot-public').hide();
|
||||||
|
$('.profile-jot-net input[type=checkbox]').each(function() {
|
||||||
|
// Saves current checkbox state
|
||||||
|
$(this)
|
||||||
|
.attr('data-checked', $(this).prop('checked'))
|
||||||
|
.prop('checked', false);
|
||||||
|
});
|
||||||
$('.profile-jot-net input').attr('disabled', 'disabled');
|
$('.profile-jot-net input').attr('disabled', 'disabled');
|
||||||
$('#profile-jot-desc').html(' ');
|
$('#profile-jot-desc').html(' ');
|
||||||
}
|
}
|
||||||
$("#acl-list-content .acl-list-item").each(function(){
|
|
||||||
$(this).removeClass("groupshow grouphide");
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#acl-list-content .acl-list-item").each(function(index, element){
|
$("#acl-list-content .acl-list-item").each(function (index, element) {
|
||||||
|
$(this).removeClass("groupshow grouphide");
|
||||||
|
|
||||||
itemid = $(element).attr('id');
|
itemid = $(element).attr('id');
|
||||||
type = itemid[0];
|
type = itemid[0];
|
||||||
id = parseInt(itemid.substr(1));
|
id = parseInt(itemid.substr(1));
|
||||||
|
@ -256,40 +267,40 @@ ACL.prototype.update_view = function(){
|
||||||
btshow = $(element).children(".acl-button-show").removeClass("selected");
|
btshow = $(element).children(".acl-button-show").removeClass("selected");
|
||||||
bthide = $(element).children(".acl-button-hide").removeClass("selected");
|
bthide = $(element).children(".acl-button-hide").removeClass("selected");
|
||||||
|
|
||||||
switch(type){
|
switch (type) {
|
||||||
case "g":
|
case "g":
|
||||||
var uclass = "";
|
var uclass = "";
|
||||||
if (this.allow_gid.indexOf(id)>=0){
|
if (this.allow_gid.indexOf(id) >= 0) {
|
||||||
btshow.addClass("selected");
|
btshow.addClass("selected");
|
||||||
bthide.removeClass("selected");
|
bthide.removeClass("selected");
|
||||||
uclass="groupshow";
|
uclass = "groupshow";
|
||||||
}
|
}
|
||||||
if (this.deny_gid.indexOf(id)>=0){
|
if (this.deny_gid.indexOf(id) >= 0) {
|
||||||
btshow.removeClass("selected");
|
btshow.removeClass("selected");
|
||||||
bthide.addClass("selected");
|
bthide.addClass("selected");
|
||||||
uclass="grouphide";
|
uclass = "grouphide";
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this.group_uids[id]).each(function(i,v) {
|
$(this.group_uids[id]).each(function (i, v) {
|
||||||
if(uclass == "grouphide")
|
if (uclass == "grouphide")
|
||||||
$("#c"+v).removeClass("groupshow");
|
$("#c" + v).removeClass("groupshow");
|
||||||
if(uclass != "") {
|
if (uclass != "") {
|
||||||
var cls = $("#c"+v).attr('class');
|
var cls = $("#c" + v).attr('class');
|
||||||
if( cls == undefined)
|
if (cls == undefined)
|
||||||
return true;
|
return true;
|
||||||
var hiding = cls.indexOf('grouphide');
|
var hiding = cls.indexOf('grouphide');
|
||||||
if(hiding == -1)
|
if (hiding == -1)
|
||||||
$("#c"+v).addClass(uclass);
|
$("#c" + v).addClass(uclass);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "c":
|
case "c":
|
||||||
if (this.allow_cid.indexOf(id)>=0){
|
if (this.allow_cid.indexOf(id) >= 0) {
|
||||||
btshow.addClass("selected");
|
btshow.addClass("selected");
|
||||||
bthide.removeClass("selected");
|
bthide.removeClass("selected");
|
||||||
}
|
}
|
||||||
if (this.deny_cid.indexOf(id)>=0){
|
if (this.deny_cid.indexOf(id) >= 0) {
|
||||||
btshow.removeClass("selected");
|
btshow.removeClass("selected");
|
||||||
bthide.addClass("selected");
|
bthide.addClass("selected");
|
||||||
}
|
}
|
||||||
|
@ -297,7 +308,7 @@ ACL.prototype.update_view = function(){
|
||||||
|
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
ACL.prototype.get = function(start,count, search){
|
ACL.prototype.get = function(start,count, search){
|
||||||
var postdata = {
|
var postdata = {
|
||||||
|
|
|
@ -19,9 +19,30 @@
|
||||||
<hr style="clear:both"/>
|
<hr style="clear:both"/>
|
||||||
<div id="profile-jot-email-label">{{$emailcc}}</div><input type="text" name="emailcc" id="profile-jot-email" title="{{$emtitle}}" />
|
<div id="profile-jot-email-label">{{$emailcc}}</div><input type="text" name="emailcc" id="profile-jot-email" title="{{$emtitle}}" />
|
||||||
<div id="profile-jot-email-end"></div>
|
<div id="profile-jot-email-end"></div>
|
||||||
{{if $jotnets}}
|
|
||||||
{{$jotnets nofilter}}
|
{{if $jotnets_fields}}
|
||||||
{{/if}}{{/if}}
|
{{if $jotnets_fields|count < 3}}
|
||||||
|
<div class="profile-jot-net">
|
||||||
|
{{else}}
|
||||||
|
<details class="profile-jot-net">
|
||||||
|
<summary>{{$jotnets_summary}}</summary>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{foreach $jotnets_fields as $jotnets_field}}
|
||||||
|
{{if $jotnets_field.type == 'checkbox'}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$jotnets_field.field}}
|
||||||
|
{{elseif $jotnets_field.type == 'select'}}
|
||||||
|
{{include file="field_select.tpl" field=$jotnets_field.field}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
|
{{if $jotnets_fields|count >= 3}}
|
||||||
|
</details>
|
||||||
|
{{else}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
|
@ -26,9 +26,29 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="profile-jot-email-end"></div>
|
<div id="profile-jot-email-end"></div>
|
||||||
|
|
||||||
{{if $jotnets}}
|
{{if $jotnets_fields}}
|
||||||
{{$jotnets nofilter}}
|
{{if $jotnets_fields|count < 3}}
|
||||||
{{/if}}{{/if}}
|
<div class="profile-jot-net">
|
||||||
|
{{else}}
|
||||||
|
<details class="profile-jot-net">
|
||||||
|
<summary>{{$jotnets_summary}}</summary>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{foreach $jotnets_fields as $jotnets_field}}
|
||||||
|
{{if $jotnets_field.type == 'checkbox'}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$jotnets_field.field}}
|
||||||
|
{{elseif $jotnets_field.type == 'select'}}
|
||||||
|
{{include file="field_select.tpl" field=$jotnets_field.field}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
|
{{if $jotnets_fields|count >= 3}}
|
||||||
|
</details>
|
||||||
|
{{else}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
Loading…
Reference in a new issue