2007-09-15 03:05:16 +02:00
|
|
|
/**
|
|
|
|
* UI behaviour for the "Access" tab
|
|
|
|
*
|
|
|
|
* Adapted from the forum module "ForumAccess.js" file.
|
|
|
|
*
|
|
|
|
* @author Markus Lanthaler <markus@silverstripe.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
ViewersGroupHide = function() {
|
2008-11-03 15:54:57 +01:00
|
|
|
$('ViewerGroups').style.display = "none";
|
2007-09-15 03:05:16 +02:00
|
|
|
}
|
|
|
|
EditorsGroupHide = function() {
|
2008-11-03 15:54:57 +01:00
|
|
|
$('EditorGroups').style.display = "none";
|
2007-09-15 03:05:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Behaviour.register({
|
2008-11-03 15:54:57 +01:00
|
|
|
'#Form_EditForm_CanViewType_OnlyTheseUsers': {
|
2007-09-15 03:05:16 +02:00
|
|
|
|
|
|
|
onclick: function() {
|
2008-11-03 15:54:57 +01:00
|
|
|
$('ViewerGroups').style.display = "block";
|
2007-09-15 03:05:16 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function() {
|
2008-11-03 15:54:57 +01:00
|
|
|
if($('Form_EditForm_CanViewType_OnlyTheseUsers')) {
|
|
|
|
if($('Form_EditForm_CanViewType_OnlyTheseUsers').checked)
|
|
|
|
$('ViewerGroups').style.display = "block";
|
2007-09-15 03:05:16 +02:00
|
|
|
else
|
2008-11-03 15:54:57 +01:00
|
|
|
$('ViewerGroups').style.display = "none";
|
2007-09-15 03:05:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2008-11-03 15:54:57 +01:00
|
|
|
'#Form_EditForm_CanViewType_Anyone': {
|
2007-09-15 03:05:16 +02:00
|
|
|
onclick: ViewersGroupHide
|
|
|
|
},
|
2008-11-03 15:54:57 +01:00
|
|
|
'#Form_EditForm_CanViewType_LoggedInUsers': {
|
2007-09-15 03:05:16 +02:00
|
|
|
onclick: ViewersGroupHide
|
|
|
|
},
|
2009-06-17 00:23:29 +02:00
|
|
|
'#Form_EditForm_CanViewType_Inherit': {
|
|
|
|
onclick: ViewersGroupHide
|
|
|
|
},
|
|
|
|
|
2008-11-03 15:54:57 +01:00
|
|
|
'#Form_EditForm_CanEditType_OnlyTheseUsers': {
|
2009-06-17 00:23:29 +02:00
|
|
|
|
2007-09-15 03:05:16 +02:00
|
|
|
onclick: function() {
|
2008-11-03 15:54:57 +01:00
|
|
|
$('EditorGroups').style.display = "block";
|
2007-09-15 03:05:16 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function() {
|
2008-11-03 15:54:57 +01:00
|
|
|
if($('Form_EditForm_CanEditType_OnlyTheseUsers')) {
|
|
|
|
if($('Form_EditForm_CanEditType_OnlyTheseUsers').checked)
|
|
|
|
$('EditorGroups').style.display = "block";
|
2007-09-15 03:05:16 +02:00
|
|
|
else
|
2008-11-03 15:54:57 +01:00
|
|
|
$('EditorGroups').style.display = "none";
|
2007-09-15 03:05:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2008-11-03 15:54:57 +01:00
|
|
|
'#Form_EditForm_CanEditType_LoggedInUsers': {
|
2007-09-15 03:05:16 +02:00
|
|
|
onclick: EditorsGroupHide
|
2009-06-17 00:23:29 +02:00
|
|
|
},
|
|
|
|
'#Form_EditForm_CanEditType_Inherit': {
|
|
|
|
onclick: EditorsGroupHide
|
2007-09-15 03:05:16 +02:00
|
|
|
}
|
|
|
|
});
|