fix connectDefaultShare generated js function, though it isn't obvious if we still use it.
This commit is contained in:
parent
d35678b891
commit
5fb7ea8dbd
@ -388,30 +388,22 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : '');
|
$section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : '');
|
||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
$my_perms = get_channel_default_perms(local_channel());
|
|
||||||
$role = get_pconfig(local_channel(),'system','permissions_role');
|
|
||||||
if($role) {
|
|
||||||
$x = \Zotlabs\Access\PermissionRoles::role_perms($role);
|
|
||||||
if($x['perms_connect'])
|
|
||||||
$my_perms = $x['perms_connect'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$yes_no = array(t('No'),t('Yes'));
|
$yes_no = array(t('No'),t('Yes'));
|
||||||
|
|
||||||
if($my_perms) {
|
$connect_perms = \Zotlabs\Access\Permissions::connect_perms(local_channel());
|
||||||
$o .= "<script>function connectDefaultShare() {
|
|
||||||
\$('.abook-edit-me').each(function() {
|
$o .= "<script>function connectDefaultShare() {
|
||||||
if(! $(this).is(':disabled'))
|
\$('.abook-edit-me').each(function() {
|
||||||
$(this).prop('checked', false);
|
if(! $(this).is(':disabled'))
|
||||||
});\n\n";
|
$(this).prop('checked', false);
|
||||||
$perms = get_perms();
|
});\n\n";
|
||||||
foreach($perms as $p => $v) {
|
foreach($connect_perms['perms'] as $p => $v) {
|
||||||
if($my_perms & $v[1]) {
|
if($v) {
|
||||||
$o .= "\$('#me_id_perms_" . $p . "').prop('checked', true); \n";
|
$o .= "\$('#me_id_perms_" . $p . "').prop('checked', true); \n";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$o .= " }\n</script>\n";
|
|
||||||
}
|
}
|
||||||
|
$o .= " }\n</script>\n";
|
||||||
|
|
||||||
if(argc() == 3) {
|
if(argc() == 3) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user