From 978fa2979b69d75c3502aea847d899ab8931c6e5 Mon Sep 17 00:00:00 2001 From: Charles Hedrick Date: Thu, 22 Dec 2016 14:59:28 -0500 Subject: [PATCH] LSNBLDR-739; in edit page, show actual current CSS, even if it's a default (#3714) --- .../tool/producers/ShowPageProducer.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/producers/ShowPageProducer.java b/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/producers/ShowPageProducer.java index 4cb6c7760aa6..0a047452b485 100644 --- a/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/producers/ShowPageProducer.java +++ b/lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/producers/ShowPageProducer.java @@ -3220,7 +3220,7 @@ else if(questionStatus == Status.FAILED) createSubpageDialog(tofill, currentPage); } - createDialogs(tofill, currentPage, pageItem); + createDialogs(tofill, currentPage, pageItem, cssLink); } public void makeCsrf(UIContainer tofill, String rsfid) { @@ -3229,11 +3229,11 @@ public void makeCsrf(UIContainer tofill, String rsfid) { UIInput.make(tofill, rsfid, "simplePageBean.csrfToken", sessionToken.toString()); } - public void createDialogs(UIContainer tofill, SimplePage currentPage, SimplePageItem pageItem) { + public void createDialogs(UIContainer tofill, SimplePage currentPage, SimplePageItem pageItem, ContentResource cssLink) { createEditItemDialog(tofill, currentPage, pageItem); createAddMultimediaDialog(tofill, currentPage); createEditMultimediaDialog(tofill, currentPage); - createEditTitleDialog(tofill, currentPage, pageItem); + createEditTitleDialog(tofill, currentPage, pageItem, cssLink); createNewPageDialog(tofill, currentPage, pageItem); createRemovePageDialog(tofill, currentPage, pageItem); createImportCcDialog(tofill); @@ -4393,7 +4393,7 @@ private void createMovieDialog(UIContainer tofill, SimplePage currentPage) { UICommand.make(form, "movie-cancel", messageLocator.getMessage("simplepage.cancel"), null); } - private void createEditTitleDialog(UIContainer tofill, SimplePage page, SimplePageItem pageItem) { + private void createEditTitleDialog(UIContainer tofill, SimplePage page, SimplePageItem pageItem, ContentResource cssLink) { if (pageItem.getType() == SimplePageItem.STUDENT_CONTENT) UIOutput.make(tofill, "edit-title-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.editTitle"))); else @@ -4469,8 +4469,11 @@ private void createEditTitleDialog(UIContainer tofill, SimplePage page, SimplePa } } + // cssLink is set above to the actual CSS resource that's active for the page + String currentCss = (cssLink == null ? null : cssLink.getId()); + UIOutput.make(form, "cssDropdownLabel", messageLocator.getMessage("simplepage.css-dropdown-label")); - UISelect.make(form, "cssDropdown", options, labels, "#{simplePageBean.dropDown}", page.getCssSheet()); + UISelect.make(form, "cssDropdown", options, labels, "#{simplePageBean.dropDown}", currentCss); UIOutput.make(form, "cssDefaultInstructions", messageLocator.getMessage("simplepage.css-default-instructions")); UIOutput.make(form, "cssUploadLabel", messageLocator.getMessage("simplepage.css-upload-label"));