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
e82d14aa
Commit
e82d14aa
authored
12 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-348: add CSS classes for the catalog
parent
7b23c2ca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/catalog/ui/CatalogController.java
+11
-24
11 additions, 24 deletions
src/main/java/org/olat/catalog/ui/CatalogController.java
src/main/java/org/olat/catalog/ui/EntryForm.java
+5
-2
5 additions, 2 deletions
src/main/java/org/olat/catalog/ui/EntryForm.java
with
16 additions
and
26 deletions
src/main/java/org/olat/catalog/ui/CatalogController.java
+
11
−
24
View file @
e82d14aa
...
@@ -34,7 +34,7 @@ import java.util.Iterator;
...
@@ -34,7 +34,7 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.List
;
import
java.util.Stack
;
import
java.util.Stack
;
import
org.olat.ControllerFactory
;
import
org.olat.
New
ControllerFactory
;
import
org.olat.admin.securitygroup.gui.GroupController
;
import
org.olat.admin.securitygroup.gui.GroupController
;
import
org.olat.admin.securitygroup.gui.IdentitiesAddEvent
;
import
org.olat.admin.securitygroup.gui.IdentitiesAddEvent
;
import
org.olat.admin.securitygroup.gui.IdentitiesRemoveEvent
;
import
org.olat.admin.securitygroup.gui.IdentitiesRemoveEvent
;
...
@@ -49,7 +49,6 @@ import org.olat.core.CoreSpringFactory;
...
@@ -49,7 +49,6 @@ import org.olat.core.CoreSpringFactory;
import
org.olat.core.commons.persistence.DBFactory
;
import
org.olat.core.commons.persistence.DBFactory
;
import
org.olat.core.dispatcher.DispatcherAction
;
import
org.olat.core.dispatcher.DispatcherAction
;
import
org.olat.core.gui.UserRequest
;
import
org.olat.core.gui.UserRequest
;
import
org.olat.core.gui.Windows
;
import
org.olat.core.gui.components.Component
;
import
org.olat.core.gui.components.Component
;
import
org.olat.core.gui.components.image.ImageComponent
;
import
org.olat.core.gui.components.image.ImageComponent
;
import
org.olat.core.gui.components.link.Link
;
import
org.olat.core.gui.components.link.Link
;
...
@@ -61,8 +60,6 @@ import org.olat.core.gui.control.WindowControl;
...
@@ -61,8 +60,6 @@ import org.olat.core.gui.control.WindowControl;
import
org.olat.core.gui.control.controller.BasicController
;
import
org.olat.core.gui.control.controller.BasicController
;
import
org.olat.core.gui.control.generic.closablewrapper.CloseableModalController
;
import
org.olat.core.gui.control.generic.closablewrapper.CloseableModalController
;
import
org.olat.core.gui.control.generic.dtabs.Activateable2
;
import
org.olat.core.gui.control.generic.dtabs.Activateable2
;
import
org.olat.core.gui.control.generic.dtabs.DTab
;
import
org.olat.core.gui.control.generic.dtabs.DTabs
;
import
org.olat.core.gui.control.generic.modal.DialogBoxController
;
import
org.olat.core.gui.control.generic.modal.DialogBoxController
;
import
org.olat.core.gui.control.generic.modal.DialogBoxUIFactory
;
import
org.olat.core.gui.control.generic.modal.DialogBoxUIFactory
;
import
org.olat.core.gui.control.generic.tool.ToolController
;
import
org.olat.core.gui.control.generic.tool.ToolController
;
...
@@ -326,30 +323,17 @@ public class CatalogController extends BasicController implements Activateable2
...
@@ -326,30 +323,17 @@ public class CatalogController extends BasicController implements Activateable2
+
", title "
+
cur
.
getName
());
+
", title "
+
cur
.
getName
());
// launch entry if launchable, otherwise offer it as download / launch
// launch entry if launchable, otherwise offer it as download / launch
// it as non-html in browser
// it as non-html in browser
String
displayName
=
cur
.
getName
();
RepositoryHandler
handler
=
RepositoryHandlerFactory
.
getInstance
().
getRepositoryHandler
(
repoEntry
);
OLATResource
ores
=
repoEntry
.
getOlatResource
();
if
(
ores
==
null
)
throw
new
AssertException
(
"repoEntry had no olatresource, repoKey = "
+
repoEntry
.
getKey
());
if
(
repoEntry
.
getCanLaunch
())
{
if
(
repoEntry
.
getCanLaunch
())
{
// we can create a controller and launch
String
businessPath
=
"[RepositoryEntry:"
+
repoEntry
.
getKey
()
+
"]"
;
// it in OLAT, e.g. if it is a
NewControllerFactory
.
getInstance
().
launch
(
businessPath
,
ureq
,
getWindowControl
());
// content-packacking or a course
//was brasato:: DTabs dts = getWindowControl().getDTabs();
DTabs
dts
=
(
DTabs
)
Windows
.
getWindows
(
ureq
).
getWindow
(
ureq
).
getAttribute
(
"DTabs"
);
DTab
dt
=
dts
.
getDTab
(
ores
);
if
(
dt
==
null
)
{
// does not yet exist -> create and add
dt
=
dts
.
createDTab
(
ores
,
repoEntry
,
displayName
);
if
(
dt
==
null
)
return
;
Controller
launchController
=
ControllerFactory
.
createLaunchController
(
ores
,
ureq
,
dt
.
getWindowControl
(),
true
);
dt
.
setController
(
launchController
);
dts
.
addDTab
(
ureq
,
dt
);
}
dts
.
activate
(
ureq
,
dt
,
null
);
// null: start with main entry point of controller
}
else
if
(
repoEntry
.
getCanDownload
())
{
}
else
if
(
repoEntry
.
getCanDownload
())
{
OLATResource
ores
=
repoEntry
.
getOlatResource
();
if
(
ores
==
null
)
{
throw
new
AssertException
(
"repoEntry had no olatresource, repoKey = "
+
repoEntry
.
getKey
());
}
// else not launchable in olat, but downloadable -> send the document
// else not launchable in olat, but downloadable -> send the document
// directly to browser but "downloadable" (pdf, word, excel)
// directly to browser but "downloadable" (pdf, word, excel)
RepositoryHandler
handler
=
RepositoryHandlerFactory
.
getInstance
().
getRepositoryHandler
(
repoEntry
);
MediaResource
mr
=
handler
.
getAsMediaResource
(
ores
,
false
);
MediaResource
mr
=
handler
.
getAsMediaResource
(
ores
,
false
);
RepositoryManager
.
getInstance
().
incrementDownloadCounter
(
repoEntry
);
RepositoryManager
.
getInstance
().
incrementDownloadCounter
(
repoEntry
);
ureq
.
getDispatchResult
().
setResultingMediaResource
(
mr
);
ureq
.
getDispatchResult
().
setResultingMediaResource
(
mr
);
...
@@ -454,6 +438,7 @@ public class CatalogController extends BasicController implements Activateable2
...
@@ -454,6 +438,7 @@ public class CatalogController extends BasicController implements Activateable2
}
}
removeAsListenerAndDispose
(
addEntryForm
);
removeAsListenerAndDispose
(
addEntryForm
);
addEntryForm
=
new
EntryForm
(
ureq
,
getWindowControl
(),
false
);
addEntryForm
=
new
EntryForm
(
ureq
,
getWindowControl
(),
false
);
addEntryForm
.
setElementCssClass
(
"o_sel_catalog_add_category_popup"
);
listenTo
(
addEntryForm
);
listenTo
(
addEntryForm
);
// open form in dialog
// open form in dialog
...
@@ -495,6 +480,7 @@ public class CatalogController extends BasicController implements Activateable2
...
@@ -495,6 +480,7 @@ public class CatalogController extends BasicController implements Activateable2
}
}
removeAsListenerAndDispose
(
editEntryForm
);
removeAsListenerAndDispose
(
editEntryForm
);
editEntryForm
=
new
EntryForm
(
ureq
,
getWindowControl
(),
false
);
editEntryForm
=
new
EntryForm
(
ureq
,
getWindowControl
(),
false
);
editEntryForm
.
setElementCssClass
(
"o_sel_catalog_edit_category_popup"
);
listenTo
(
editEntryForm
);
listenTo
(
editEntryForm
);
editEntryForm
.
setFormFields
(
currentCatalogEntry
);
// fill the
editEntryForm
.
setFormFields
(
currentCatalogEntry
);
// fill the
...
@@ -593,6 +579,7 @@ public class CatalogController extends BasicController implements Activateable2
...
@@ -593,6 +579,7 @@ public class CatalogController extends BasicController implements Activateable2
else
if
(
event
.
getCommand
().
equals
(
ACTION_ADD_STRUCTURE
))
{
else
if
(
event
.
getCommand
().
equals
(
ACTION_ADD_STRUCTURE
))
{
removeAsListenerAndDispose
(
addStructureForm
);
removeAsListenerAndDispose
(
addStructureForm
);
addStructureForm
=
new
EntryForm
(
ureq
,
getWindowControl
(),
false
);
addStructureForm
=
new
EntryForm
(
ureq
,
getWindowControl
(),
false
);
addStructureForm
.
setElementCssClass
(
"o_sel_catalog_add_root_category_popup"
);
listenTo
(
addStructureForm
);
listenTo
(
addStructureForm
);
removeAsListenerAndDispose
(
cmc
);
removeAsListenerAndDispose
(
cmc
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/olat/catalog/ui/EntryForm.java
+
5
−
2
View file @
e82d14aa
...
@@ -51,12 +51,10 @@ import org.olat.core.gui.control.WindowControl;
...
@@ -51,12 +51,10 @@ import org.olat.core.gui.control.WindowControl;
class
EntryForm
extends
FormBasicController
{
class
EntryForm
extends
FormBasicController
{
// NLS support
// NLS support
private
static
final
String
NLS_ENTRY_LEAF
=
"entry.leaf"
;
private
static
final
String
NLS_ENTRY_LEAF
=
"entry.leaf"
;
private
static
final
String
NLS_ENTRY_CATEGORY
=
"entry.category"
;
private
static
final
String
NLS_ENTRY_CATEGORY
=
"entry.category"
;
private
static
final
String
NLS_ENTRY_DESCRIPTION
=
"entry.description"
;
private
static
final
String
NLS_ENTRY_DESCRIPTION
=
"entry.description"
;
private
static
final
String
NLS_FORM_LEGENDE_MANDATORY
=
"form.legende.mandatory"
;
private
static
final
String
NLS_FORM_LEGENDE_MANDATORY
=
"form.legende.mandatory"
;
private
static
final
String
NLS_INPUT_TOOLONG
=
"input.toolong"
;
// private stuff
// private stuff
...
@@ -94,6 +92,10 @@ class EntryForm extends FormBasicController {
...
@@ -94,6 +92,10 @@ class EntryForm extends FormBasicController {
tName
.
setValue
(
ce
.
getName
());
tName
.
setValue
(
ce
.
getName
());
taDescription
.
setValue
(
ce
.
getDescription
());
taDescription
.
setValue
(
ce
.
getDescription
());
}
}
public
void
setElementCssClass
(
String
cssClass
)
{
flc
.
setElementCssClass
(
cssClass
);
}
@Override
@Override
protected
void
formOK
(
UserRequest
ureq
)
{
protected
void
formOK
(
UserRequest
ureq
)
{
...
@@ -113,6 +115,7 @@ class EntryForm extends FormBasicController {
...
@@ -113,6 +115,7 @@ class EntryForm extends FormBasicController {
taDescription
=
uifactory
.
addTextAreaElement
(
"description"
,
NLS_ENTRY_DESCRIPTION
,
255
,
5
,
60
,
true
,
""
,
formLayout
);
taDescription
=
uifactory
.
addTextAreaElement
(
"description"
,
NLS_ENTRY_DESCRIPTION
,
255
,
5
,
60
,
true
,
""
,
formLayout
);
FormLayoutContainer
buttonLayout
=
FormLayoutContainer
.
createButtonLayout
(
"button_layout"
,
getTranslator
());
FormLayoutContainer
buttonLayout
=
FormLayoutContainer
.
createButtonLayout
(
"button_layout"
,
getTranslator
());
buttonLayout
.
setElementCssClass
(
"o_sel_catalog_entry_form_buttons"
);
formLayout
.
add
(
buttonLayout
);
formLayout
.
add
(
buttonLayout
);
uifactory
.
addFormSubmitButton
(
"submit"
,
buttonLayout
);
uifactory
.
addFormSubmitButton
(
"submit"
,
buttonLayout
);
uifactory
.
addFormCancelButton
(
"cancel"
,
buttonLayout
,
ureq
,
getWindowControl
());
uifactory
.
addFormCancelButton
(
"cancel"
,
buttonLayout
,
ureq
,
getWindowControl
());
...
...
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