use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.
the class BinderListController method getComponents.
@Override
public Iterable<Component> getComponents(int row, Object rowObject) {
BinderRow elRow = model.getObject(row);
List<Component> components = new ArrayList<>(2);
if (elRow.getOpenLink() != null) {
components.add(elRow.getOpenLink().getComponent());
}
return components;
}
use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.
the class BinderListController method forgePortfolioRow.
protected BinderRow forgePortfolioRow(BinderStatistics binderRow) {
String openLinkId = "open_" + (++counter);
FormLink openLink = uifactory.addFormLink(openLinkId, "open", "open", null, flc, Link.LINK);
openLink.setIconRightCSS("o_icon o_icon_start");
VFSLeaf image = portfolioService.getPosterImageLeaf(binderRow);
BinderRow row = new BinderRow(binderRow, image, openLink);
openLink.setUserObject(row);
return row;
}
use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.
the class PortfolioHomeController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (myBindersLink == source) {
BinderListController bindersCtrl = doOpenMyBinders(ureq);
if (!portfolioModule.isLearnerCanCreateBinders() && bindersCtrl.getNumOfBinders() == 1) {
BinderRow row = bindersCtrl.getFirstBinder();
OLATResourceable resource = OresHelper.createOLATResourceableInstance(Binder.class, row.getKey());
List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromString(resource);
bindersCtrl.activate(ureq, entries, null);
}
} else if (myEntriesLink == source) {
doOpenMyPages(ureq);
} else if (mySharedItemsLink == source) {
doOpenMySharedItems(ureq);
} else if (sharedItemsLink == source) {
doOpenSharedWithMe(ureq).activate(ureq, null, null);
} else if (mediaCenterLink == source) {
doOpenMediaCenter(ureq);
} else if (editLastEntryLink == source) {
doOpenLastEntry(ureq);
} else if (createNewEntryLink == source) {
doNewEntry(ureq);
} else if (showHelpLink == source) {
} else if (goToTrashLink == source) {
doDeletedPages(ureq);
}
}
use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.
the class DeletedBinderController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof FlexiTableRenderEvent) {
FlexiTableRenderEvent se = (FlexiTableRenderEvent) event;
deleteButton.setVisible(se.getRendererType() == FlexiTableRendererType.classic && model.getRowCount() > 0);
tableEl.setSelectAllEnable(tableEl.getRendererType() == FlexiTableRendererType.classic);
} else if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
if ("restore".equals(cmd)) {
BinderRow row = model.getObject(se.getIndex());
doConfirmRestoreBinder(ureq, row);
}
}
} else if (deleteButton == source) {
doConfirmDelete(ureq);
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.ui.model.BinderRow in project openolat by klemens.
the class DeletedBinderController method doConfirmDelete.
private void doConfirmDelete(UserRequest ureq) {
if (deleteBinderCtrl != null)
return;
List<BinderRow> rows = getSelectedRows();
if (rows.isEmpty()) {
showWarning("binder.atleastone");
} else {
List<BinderStatistics> stats = new ArrayList<>(rows.size());
for (BinderRow row : rows) {
stats.add(row.getStatistics());
}
deleteBinderCtrl = new ConfirmDeleteBinderController(ureq, getWindowControl(), stats);
listenTo(deleteBinderCtrl);
String title = translate("delete.binder");
cmc = new CloseableModalController(getWindowControl(), null, deleteBinderCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
}
Aggregations