use of org.olat.modules.webFeed.portfolio.BlogEntryMedia in project OpenOLAT by OpenOLAT.
the class ItemsController method createButtonsForItem.
private void createButtonsForItem(UserRequest ureq, Feed feed, Item item) {
boolean author = getIdentity().getKey().equals(item.getAuthorKey());
boolean edit = callback.mayEditItems() || (author && callback.mayEditOwnItems());
boolean delete = callback.mayDeleteItems() || (author && callback.mayDeleteOwnItems());
String guid = item.getGuid();
String editId = "feed.edit.item.".concat(guid);
Link editButton = LinkFactory.createCustomLink(editId, editId, "feed.edit.item", Link.BUTTON_SMALL, vcItems, this);
editButton.setElementCssClass("o_sel_feed_item_edit");
editButton.setEnabled(edit);
editButton.setVisible(edit);
String deleteId = "delete.".concat(guid);
Link deleteButton = LinkFactory.createCustomLink(deleteId, deleteId, "delete", Link.BUTTON_SMALL, vcItems, this);
deleteButton.setElementCssClass("o_sel_feed_item_delete");
deleteButton.setEnabled(delete);
deleteButton.setVisible(delete);
if (feedResource.isInternal() && getIdentity().getKey() != null && getIdentity().getKey().equals(item.getAuthorKey())) {
String businessPath = BusinessControlFactory.getInstance().getAsString(getWindowControl().getBusinessControl());
businessPath += "[item=" + item.getKey() + ":0]";
if (portfolioModule.isEnabled()) {
String name = "feed.artefact.item.".concat(guid);
BlogEntryMedia media = new BlogEntryMedia(feed, item);
MediaCollectorComponent collectorCmp = new MediaCollectorComponent(name, getWindowControl(), media, blogMediaHandler, businessPath);
vcItems.put(name, collectorCmp);
} else {
Controller artefactCtrl = EPUIFactory.createArtefactCollectWizzardController(ureq, getWindowControl(), feedResource, businessPath);
if (artefactCtrl != null) {
artefactLinks.put(item, artefactCtrl);
vcItems.put("feed.artefact.item.".concat(guid), artefactCtrl.getInitialComponent());
}
}
}
editButton.setUserObject(item);
deleteButton.setUserObject(item);
editButtons.add(editButton);
deleteButtons.add(deleteButton);
}
use of org.olat.modules.webFeed.portfolio.BlogEntryMedia in project openolat by klemens.
the class ItemsController method createButtonsForItem.
private void createButtonsForItem(UserRequest ureq, Feed feed, Item item) {
boolean author = getIdentity().getKey().equals(item.getAuthorKey());
boolean edit = callback.mayEditItems() || (author && callback.mayEditOwnItems());
boolean delete = callback.mayDeleteItems() || (author && callback.mayDeleteOwnItems());
String guid = item.getGuid();
String editId = "feed.edit.item.".concat(guid);
Link editButton = LinkFactory.createCustomLink(editId, editId, "feed.edit.item", Link.BUTTON_SMALL, vcItems, this);
editButton.setElementCssClass("o_sel_feed_item_edit");
editButton.setEnabled(edit);
editButton.setVisible(edit);
String deleteId = "delete.".concat(guid);
Link deleteButton = LinkFactory.createCustomLink(deleteId, deleteId, "delete", Link.BUTTON_SMALL, vcItems, this);
deleteButton.setElementCssClass("o_sel_feed_item_delete");
deleteButton.setEnabled(delete);
deleteButton.setVisible(delete);
if (feedResource.isInternal() && getIdentity().getKey() != null && getIdentity().getKey().equals(item.getAuthorKey())) {
String businessPath = BusinessControlFactory.getInstance().getAsString(getWindowControl().getBusinessControl());
businessPath += "[item=" + item.getKey() + ":0]";
if (portfolioModule.isEnabled()) {
String name = "feed.artefact.item.".concat(guid);
BlogEntryMedia media = new BlogEntryMedia(feed, item);
MediaCollectorComponent collectorCmp = new MediaCollectorComponent(name, getWindowControl(), media, blogMediaHandler, businessPath);
vcItems.put(name, collectorCmp);
} else {
Controller artefactCtrl = EPUIFactory.createArtefactCollectWizzardController(ureq, getWindowControl(), feedResource, businessPath);
if (artefactCtrl != null) {
artefactLinks.put(item, artefactCtrl);
vcItems.put("feed.artefact.item.".concat(guid), artefactCtrl.getInitialComponent());
}
}
}
editButton.setUserObject(item);
deleteButton.setUserObject(item);
editButtons.add(editButton);
deleteButtons.add(deleteButton);
}
Aggregations