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
ddad4a63
Commit
ddad4a63
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1413: remove the course node, add code for backwards compatibility
parent
19da8235
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/course/run/calendar/CourseLinkProviderController.java
+18
-12
18 additions, 12 deletions
...lat/course/run/calendar/CourseLinkProviderController.java
with
18 additions
and
12 deletions
src/main/java/org/olat/course/run/calendar/CourseLinkProviderController.java
+
18
−
12
View file @
ddad4a63
...
...
@@ -87,7 +87,7 @@ public class CourseLinkProviderController extends FormBasicController implements
@Override
protected
void
initForm
(
FormItemContainer
formLayout
,
Controller
listener
,
UserRequest
ureq
)
{
multiSelectTree
=
uifactory
.
addTreeMultiselect
(
"seltree"
,
null
,
formLayout
,
courseNodeTreeModel
,
this
);
multiSelectTree
.
setRootVisible
(
false
);
multiSelectTree
.
setRootVisible
(
availableCourses
.
size
()
==
1
);
multiSelectTree
.
setMultiSelect
(
true
);
saveButton
=
uifactory
.
addFormSubmitButton
(
"ok"
,
"cal.links.submit"
,
formLayout
);
...
...
@@ -164,8 +164,17 @@ public class CourseLinkProviderController extends FormBasicController implements
String
nodeId
=
link
.
getId
();
TreeNode
node
=
courseNodeTreeModel
.
getNodeById
(
nodeId
);
if
(
node
==
null
)
{
nodeId
=
availableCourses
.
get
(
0
).
getResourceableId
()
+
"_"
+
nodeId
;
node
=
courseNodeTreeModel
.
getNodeById
(
nodeId
);
String
fallBackNodeId
=
availableCourses
.
get
(
0
).
getResourceableId
()
+
"_"
+
nodeId
;
node
=
courseNodeTreeModel
.
getNodeById
(
fallBackNodeId
);
}
if
(
node
==
null
&&
nodeId
.
indexOf
(
"_"
)
<
0
)
{
//course selected -> map to root node
for
(
ICourse
course:
availableCourses
)
{
if
(
nodeId
.
equals
(
course
.
getResourceableId
().
toString
()))
{
String
fallBackNodeId
=
course
.
getResourceableId
()
+
"_"
+
course
.
getRunStructure
().
getRootNode
().
getIdent
();
node
=
courseNodeTreeModel
.
getNodeById
(
fallBackNodeId
);
}
}
}
if
(
node
!=
null
)
{
node
.
setSelected
(
true
);
...
...
@@ -209,21 +218,18 @@ public class CourseLinkProviderController extends FormBasicController implements
}
private
LinkTreeNode
buildCourseTree
(
ICourse
course
)
{
LinkTreeNode
node
=
new
LinkTreeNode
(
course
.
getCourseTitle
(),
course
,
null
);
node
.
setAltText
(
course
.
getCourseTitle
());
node
.
setIdent
(
course
.
getResourceableId
().
toString
());
node
.
setIconCssClass
(
"o_CourseModule_icon"
);
LinkTreeNode
childNode
=
buildTree
(
course
,
course
.
getRunStructure
().
getRootNode
());
node
.
addChild
(
childNode
);
return
node
;
return
buildTree
(
course
,
course
.
getRunStructure
().
getRootNode
());
}
private
LinkTreeNode
buildTree
(
ICourse
course
,
CourseNode
courseNode
)
{
LinkTreeNode
node
=
new
LinkTreeNode
(
courseNode
.
getShortTitle
(),
course
,
courseNode
);
node
.
setAltText
(
courseNode
.
getLongTitle
());
node
.
setIdent
(
course
.
getResourceableId
()
+
"_"
+
courseNode
.
getIdent
());
node
.
setIconCssClass
((
"o_icon o_"
+
courseNode
.
getType
()
+
"_icon"
).
intern
());
if
(
courseNode
==
course
.
getRunStructure
().
getRootNode
())
{
node
.
setIconCssClass
(
"o_CourseModule_icon"
);
}
else
{
node
.
setIconCssClass
((
"o_icon o_"
+
courseNode
.
getType
()
+
"_icon"
).
intern
());
}
node
.
setUserObject
(
course
);
for
(
int
i
=
0
;
i
<
courseNode
.
getChildCount
();
i
++)
{
CourseNode
childNode
=
(
CourseNode
)
courseNode
.
getChildAt
(
i
);
...
...
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