Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
d84aec31
Commit
d84aec31
authored
7 years ago
by
fkiefer
Browse files
Options
Downloads
Patches
Plain Diff
OO-2621 edit rights
parent
cea98c3f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/commons/info/ui/InfoDisplayController.java
+11
-11
11 additions, 11 deletions
.../java/org/olat/commons/info/ui/InfoDisplayController.java
with
11 additions
and
11 deletions
src/main/java/org/olat/commons/info/ui/InfoDisplayController.java
+
11
−
11
View file @
d84aec31
...
...
@@ -124,7 +124,7 @@ public class InfoDisplayController extends FormBasicController {
initForm
(
ureq
);
// now load with configuration
loadMessages
();
loadMessages
(
ureq
);
}
public
InfoDisplayController
(
UserRequest
ureq
,
WindowControl
wControl
,
ModuleConfiguration
config
,
...
...
@@ -166,7 +166,7 @@ public class InfoDisplayController extends FormBasicController {
}
// now load with configuration
loadMessages
();
loadMessages
(
ureq
);
}
private
int
getConfigValue
(
ModuleConfiguration
config
,
String
key
,
int
def
)
{
...
...
@@ -201,7 +201,7 @@ public class InfoDisplayController extends FormBasicController {
* This is the main method which push the messages in the layout container,
* and clean-up old links.
*/
protected
void
loadMessages
()
{
protected
void
loadMessages
(
UserRequest
ureq
)
{
//first clear the current message if any
for
(
Long
key:
previousDisplayKeys
)
{
flc
.
contextRemove
(
"info.date."
+
key
);
...
...
@@ -225,7 +225,7 @@ public class InfoDisplayController extends FormBasicController {
DateElement
dateEl
=
DateComponentFactory
.
createDateElementWithYear
(
dateCmpName
,
info
.
getCreationDate
());
flc
.
add
(
dateCmpName
,
dateEl
);
if
(
secCallback
.
canEdit
())
{
if
(
secCallback
.
canEdit
()
&&
(
ureq
.
getIdentity
().
equals
(
info
.
getAuthor
())
||
secCallback
.
canDelete
())
)
{
String
editName
=
"info.edit."
+
info
.
getKey
();
FormLink
link
=
uifactory
.
addFormLink
(
editName
,
"edit"
,
"edit"
,
flc
,
Link
.
BUTTON_SMALL
);
link
.
setElementCssClass
(
"o_sel_info_edit_msg"
);
...
...
@@ -313,7 +313,7 @@ public class InfoDisplayController extends FormBasicController {
getWindowControl
().
pop
();
}
else
if
(
event
==
Event
.
CHANGED_EVENT
)
{
getWindowControl
().
pop
();
loadMessages
();
loadMessages
(
ureq
);
flc
.
setDirty
(
true
);
//update the view
}
else
if
(
event
==
Event
.
DONE_EVENT
){
showError
(
"failed"
);
...
...
@@ -326,7 +326,7 @@ public class InfoDisplayController extends FormBasicController {
LoggingResourceable
.
wrap
(
msgToDelete
.
getOLATResourceable
(),
OlatResourceableType
.
infoMessage
));
infoMessageManager
.
deleteInfoMessage
(
msgToDelete
);
loadMessages
();
loadMessages
(
ureq
);
}
confirmDelete
.
setUserObject
(
null
);
...
...
@@ -335,7 +335,7 @@ public class InfoDisplayController extends FormBasicController {
lockEntry
=
null
;
}
else
if
(
source
==
editController
)
{
if
(
event
==
Event
.
DONE_EVENT
)
{
loadMessages
();
loadMessages
(
ureq
);
}
editDialogBox
.
deactivate
();
removeAsListenerAndDispose
(
editController
);
...
...
@@ -371,11 +371,11 @@ public class InfoDisplayController extends FormBasicController {
}
else
if
(
source
==
oldMsgsLink
)
{
maxResults
=
-
1
;
after
=
null
;
loadMessages
();
loadMessages
(
ureq
);
}
else
if
(
source
==
newMsgsLink
)
{
maxResults
=
maxResultsConfig
;
after
=
afterConfig
;
loadMessages
();
loadMessages
(
ureq
);
}
else
{
super
.
formInnerEvent
(
ureq
,
source
,
event
);
}
...
...
@@ -391,7 +391,7 @@ public class InfoDisplayController extends FormBasicController {
showWarning
(
"already.deleted"
);
CoordinatorManager
.
getInstance
().
getCoordinator
().
getLocker
().
releaseLock
(
lockEntry
);
lockEntry
=
null
;
loadMessages
();
loadMessages
(
ureq
);
}
else
{
String
title
=
StringHelper
.
escapeHtml
(
msg
.
getTitle
());
String
confirmDeleteText
=
translate
(
"edit.confirm_delete"
,
new
String
[]{
title
});
...
...
@@ -414,7 +414,7 @@ public class InfoDisplayController extends FormBasicController {
showWarning
(
"already.deleted"
);
CoordinatorManager
.
getInstance
().
getCoordinator
().
getLocker
().
releaseLock
(
lockEntry
);
lockEntry
=
null
;
loadMessages
();
loadMessages
(
ureq
);
}
else
{
removeAsListenerAndDispose
(
editController
);
removeAsListenerAndDispose
(
editDialogBox
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment