mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
mlanthaler: Added javascript helper file for the UI of the new access tab for pages.
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41871 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3d5deccd43
commit
a3d8e8c9e2
60
javascript/SitetreeAccess.js
Normal file
60
javascript/SitetreeAccess.js
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/**
|
||||||
|
* UI behaviour for the "Access" tab
|
||||||
|
*
|
||||||
|
* Adapted from the forum module "ForumAccess.js" file.
|
||||||
|
*
|
||||||
|
* @author Markus Lanthaler <markus@silverstripe.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
ViewersGroupHide = function() {
|
||||||
|
$('ViewersGroup').style.display = "none";
|
||||||
|
}
|
||||||
|
EditorsGroupHide = function() {
|
||||||
|
$('EditorsGroup').style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
Behaviour.register({
|
||||||
|
'#Form_EditForm_Viewers_OnlyTheseUsers': {
|
||||||
|
|
||||||
|
onclick: function() {
|
||||||
|
$('ViewersGroup').style.display = "block";
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize: function() {
|
||||||
|
if($('Form_EditForm_Viewers_OnlyTheseUsers')) {
|
||||||
|
if($('Form_EditForm_Viewers_OnlyTheseUsers').checked)
|
||||||
|
$('ViewersGroup').style.display = "block";
|
||||||
|
else
|
||||||
|
$('ViewersGroup').style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'#Form_EditForm_Viewers_Anyone': {
|
||||||
|
onclick: ViewersGroupHide
|
||||||
|
},
|
||||||
|
|
||||||
|
'#Form_EditForm_Viewers_LoggedInUsers': {
|
||||||
|
onclick: ViewersGroupHide
|
||||||
|
},
|
||||||
|
|
||||||
|
'#Form_EditForm_Editors_OnlyTheseUsers': {
|
||||||
|
|
||||||
|
onclick: function() {
|
||||||
|
$('EditorsGroup').style.display = "block";
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize: function() {
|
||||||
|
if($('Form_EditForm_Editors_OnlyTheseUsers')) {
|
||||||
|
if($('Form_EditForm_Editors_OnlyTheseUsers').checked)
|
||||||
|
$('EditorsGroup').style.display = "block";
|
||||||
|
else
|
||||||
|
$('EditorsGroup').style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'#Form_EditForm_Editors_LoggedInUsers': {
|
||||||
|
onclick: EditorsGroupHide
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user