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
f26a0d87
Commit
f26a0d87
authored
12 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-377: use the standard popup window in after login process
parent
89d7ee67
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/login/AfterLoginInterceptionController.java
+9
-31
9 additions, 31 deletions
...java/org/olat/login/AfterLoginInterceptionController.java
with
9 additions
and
31 deletions
src/main/java/org/olat/login/AfterLoginInterceptionController.java
+
9
−
31
View file @
f26a0d87
...
...
@@ -35,8 +35,7 @@ import org.olat.core.gui.control.WindowControl;
import
org.olat.core.gui.control.controller.BasicController
;
import
org.olat.core.gui.control.creator.AutoCreator
;
import
org.olat.core.gui.control.creator.ControllerCreator
;
import
org.olat.core.gui.control.generic.closablewrapper.CloseableModalWindowController
;
import
org.olat.core.gui.control.generic.closablewrapper.CloseableModalWindowWrapperController
;
import
org.olat.core.gui.control.generic.closablewrapper.CloseableModalController
;
import
org.olat.core.gui.control.generic.wizard.WizardInfoController
;
import
org.olat.properties.Property
;
import
org.olat.properties.PropertyManager
;
...
...
@@ -56,7 +55,7 @@ import org.olat.properties.PropertyManager;
*/
public
class
AfterLoginInterceptionController
extends
BasicController
{
private
CloseableModal
WindowWrapper
Controller
cmc
;
private
CloseableModalController
cmc
;
private
WizardInfoController
wiz
;
private
VelocityContainer
vC
;
private
Panel
actualPanel
;
...
...
@@ -71,8 +70,7 @@ public class AfterLoginInterceptionController extends BasicController {
private
static
final
String
CONTROLLER
=
"controller-instance"
;
private
static
final
String
FORCEUSER_KEY
=
"forceUser"
;
private
static
final
String
REDOTIMEOUT_KEY
=
"redoTimeout"
;
private
static
final
String
I18NINTRO_KEY
=
"i18nIntro"
;
private
static
final
String
SIZE_KEY
=
"size"
;
private
static
final
String
I18NINTRO_KEY
=
"i18nIntro"
;
protected
static
final
String
ORDER_KEY
=
"order"
;
private
static
final
String
PROPERTY_CAT
=
"afterLogin"
;
...
...
@@ -155,11 +153,8 @@ public class AfterLoginInterceptionController extends BasicController {
putControllerToPanel
(
ureq
,
wControl
,
0
);
vC
.
put
(
"actualPanel"
,
actualPanel
);
cmc
=
new
CloseableModalWindowWrapperController
(
ureq
,
getWindowControl
(),
translate
(
"runonce.title"
),
vC
,
"interceptionPopup"
);
cmc
.
setCloseable
(
false
);
cmc
.
setIgnoreCookie
(
true
);
cmc
=
new
CloseableModalController
(
getWindowControl
(),
translate
(
"close"
),
vC
,
true
,
translate
(
"runonce.title"
),
false
);
cmc
.
activate
();
setPopupSizeForCtr
(
0
);
listenTo
(
cmc
);
// if controller could not be created, go to the next one ore close the wizzard
if
(
actCtrl
==
null
)
activateNextOrCloseModal
(
ureq
);
...
...
@@ -179,21 +174,6 @@ public class AfterLoginInterceptionController extends BasicController {
return
false
;
}
/**
*
*/
private
void
setPopupSizeForCtr
(
int
ctrNr
){
if
(
cmc
!=
null
){
Map
<
String
,
Object
>
mapEntry
=
aftctrls
.
get
(
ctrNr
);
if
(
mapEntry
.
containsKey
(
SIZE_KEY
))
{
String
[]
size
=
mapEntry
.
get
(
SIZE_KEY
).
toString
().
split
(
"x"
);
cmc
.
resizeWindow
(
Integer
.
parseInt
(
size
[
0
]),
Integer
.
parseInt
(
size
[
1
]));
}
else
{
cmc
.
setInitialWindowSize
(
300
,
400
);
}
}
}
private
void
saveOrUpdatePropertyForController
(
UserRequest
ureq
,
String
ctrlName
)
{
for
(
Property
prop
:
ctrlPropList
)
{
if
(
prop
.
getName
().
equals
(
ctrlName
))
{
...
...
@@ -236,7 +216,6 @@ public class AfterLoginInterceptionController extends BasicController {
vC
.
contextPut
(
"introPkg"
,
introComb
[
0
]);
vC
.
contextPut
(
"introKey"
,
introComb
[
1
]);
}
setPopupSizeForCtr
(
ctrNr
);
actualPanel
.
setContent
(
actCtrl
.
getInitialComponent
());
}
...
...
@@ -256,7 +235,6 @@ public class AfterLoginInterceptionController extends BasicController {
* org.olat.core.gui.control.Event)
*/
@Override
@SuppressWarnings
(
"unused"
)
protected
void
event
(
UserRequest
ureq
,
Component
source
,
Event
event
)
{
// no such events
}
...
...
@@ -267,7 +245,7 @@ public class AfterLoginInterceptionController extends BasicController {
*/
@Override
protected
void
event
(
UserRequest
ureq
,
Controller
source
,
Event
event
)
{
if
(
source
==
cmc
&&
event
==
CloseableModal
Window
Controller
.
CLOSE_
WINDOW
_EVENT
&&
actualForceUser
)
{
if
(
source
==
cmc
&&
event
==
CloseableModalController
.
CLOSE_
MODAL
_EVENT
&&
actualForceUser
)
{
// show warning if this is a task, where user is forced to do it
showWarning
(
"runonce.forced"
);
cmc
.
activate
();
...
...
@@ -287,8 +265,9 @@ public class AfterLoginInterceptionController extends BasicController {
}
}
// fxdiff: failsafe continueing
/**
* failsafe continuing
*/
private
void
activateNextOrCloseModal
(
UserRequest
ureq
){
if
((
actualCtrNr
+
1
)
<
aftctrls
.
size
())
{
putControllerToPanel
(
ureq
,
getWindowControl
(),
actualCtrNr
+
1
);
...
...
@@ -298,5 +277,4 @@ public class AfterLoginInterceptionController extends BasicController {
fireEvent
(
ureq
,
Event
.
DONE_EVENT
);
}
}
}
}
\ No newline at end of file
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