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
c5a6523b
Commit
c5a6523b
authored
8 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-2606: set the current course node at the start of a course
parent
ef33302c
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/course/run/RunMainController.java
+9
-9
9 additions, 9 deletions
src/main/java/org/olat/course/run/RunMainController.java
with
9 additions
and
9 deletions
src/main/java/org/olat/course/run/RunMainController.java
+
9
−
9
View file @
c5a6523b
...
@@ -204,7 +204,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
...
@@ -204,7 +204,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
}
}
navHandler
=
new
NavigationHandler
(
uce
,
treeFilter
,
false
);
navHandler
=
new
NavigationHandler
(
uce
,
treeFilter
,
false
);
updateTreeAndContent
(
ureq
,
currentCourseNode
,
null
);
currentCourseNode
=
updateTreeAndContent
(
ureq
,
currentCourseNode
,
null
);
if
(
courseRepositoryEntry
!=
null
&&
repositoryManager
.
createRepositoryEntryStatus
(
courseRepositoryEntry
.
getStatusCode
()).
isClosed
())
{
if
(
courseRepositoryEntry
!=
null
&&
repositoryManager
.
createRepositoryEntryStatus
(
courseRepositoryEntry
.
getStatusCode
()).
isClosed
())
{
wControl
.
setWarning
(
translate
(
"course.closed"
));
wControl
.
setWarning
(
translate
(
"course.closed"
));
...
@@ -396,7 +396,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
...
@@ -396,7 +396,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
nextLink
.
setEnabled
(
hasNext
);
nextLink
.
setEnabled
(
hasNext
);
}
}
protected
boolean
updateCurrentCourseNode
(
UserRequest
ureq
)
{
protected
CourseNode
updateCurrentCourseNode
(
UserRequest
ureq
)
{
return
updateTreeAndContent
(
ureq
,
getCurrentCourseNode
(),
""
,
null
,
null
);
return
updateTreeAndContent
(
ureq
,
getCurrentCourseNode
(),
""
,
null
,
null
);
}
}
...
@@ -408,11 +408,11 @@ public class RunMainController extends MainLayoutBasicController implements Gene
...
@@ -408,11 +408,11 @@ public class RunMainController extends MainLayoutBasicController implements Gene
* @param nodecmd An optional command used to activate the run view or NULL if not available
* @param nodecmd An optional command used to activate the run view or NULL if not available
* @return true if the node jumped to is visible
* @return true if the node jumped to is visible
*/
*/
private
boolean
updateTreeAndContent
(
UserRequest
ureq
,
CourseNode
calledCourseNode
,
String
nodecmd
)
{
private
CourseNode
updateTreeAndContent
(
UserRequest
ureq
,
CourseNode
calledCourseNode
,
String
nodecmd
)
{
return
updateTreeAndContent
(
ureq
,
calledCourseNode
,
nodecmd
,
null
,
null
);
return
updateTreeAndContent
(
ureq
,
calledCourseNode
,
nodecmd
,
null
,
null
);
}
}
private
boolean
updateTreeAndContent
(
UserRequest
ureq
,
CourseNode
calledCourseNode
,
String
nodecmd
,
List
<
ContextEntry
>
entries
,
StateEntry
state
)
{
private
CourseNode
updateTreeAndContent
(
UserRequest
ureq
,
CourseNode
calledCourseNode
,
String
nodecmd
,
List
<
ContextEntry
>
entries
,
StateEntry
state
)
{
// build menu (treemodel)
// build menu (treemodel)
// dispose old node controller before creating the NodeClickedRef which creates
// dispose old node controller before creating the NodeClickedRef which creates
// the new node controller. It is important that the old node controller is
// the new node controller. It is important that the old node controller is
...
@@ -431,7 +431,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
...
@@ -431,7 +431,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
MessageController
msgController
=
MessageUIFactory
.
createInfoMessage
(
ureq
,
getWindowControl
(),
translate
(
"course.noaccess.title"
),
translate
(
"course.noaccess.text"
));
MessageController
msgController
=
MessageUIFactory
.
createInfoMessage
(
ureq
,
getWindowControl
(),
translate
(
"course.noaccess.title"
),
translate
(
"course.noaccess.text"
));
contentP
.
setContent
(
msgController
.
getInitialComponent
());
contentP
.
setContent
(
msgController
.
getInitialComponent
());
luTree
.
setTreeModel
(
new
GenericTreeModel
());
luTree
.
setTreeModel
(
new
GenericTreeModel
());
return
false
;
return
null
;
}
}
}
}
...
@@ -466,7 +466,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
...
@@ -466,7 +466,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene
updateNextPrevious
();
updateNextPrevious
();
updateCourseDataAttributes
(
nclr
.
getCalledCourseNode
());
updateCourseDataAttributes
(
nclr
.
getCalledCourseNode
());
updateLastUsage
(
nclr
.
getCalledCourseNode
());
updateLastUsage
(
nclr
.
getCalledCourseNode
());
return
true
;
return
nclr
.
getCalledCourseNode
()
;
}
}
private
void
updateLastUsage
(
CourseNode
calledCourseNode
)
{
private
void
updateLastUsage
(
CourseNode
calledCourseNode
)
{
...
@@ -524,9 +524,9 @@ public class RunMainController extends MainLayoutBasicController implements Gene
...
@@ -524,9 +524,9 @@ public class RunMainController extends MainLayoutBasicController implements Gene
String
nodeid
=
ureq
.
getParameter
(
"nodeid"
);
String
nodeid
=
ureq
.
getParameter
(
"nodeid"
);
if
(
nodeid
!=
null
)
{
if
(
nodeid
!=
null
)
{
CourseNode
identNode
=
course
.
getRunStructure
().
getNode
(
nodeid
);
CourseNode
identNode
=
course
.
getRunStructure
().
getNode
(
nodeid
);
boolean
success
=
updateTreeAndContent
(
ureq
,
identNode
,
null
);
CourseNode
node
=
updateTreeAndContent
(
ureq
,
identNode
,
null
);
if
(
success
)
{
if
(
node
!=
null
)
{
currentCourseNode
=
identN
ode
;
currentCourseNode
=
n
ode
;
}
else
{
}
else
{
getWindowControl
().
setWarning
(
translate
(
"msg.nodenotavailableanymore"
));
getWindowControl
().
setWarning
(
translate
(
"msg.nodenotavailableanymore"
));
}
}
...
...
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