Skip to content

Commit

Permalink
LSNBLDR-789: Reorder function does not display the new widgets correc…
Browse files Browse the repository at this point in the history
…tly (sakaiproject#4040)

LSNBLDR-789: Added constants
  • Loading branch information
nicholaswilson100 authored and buckett committed Mar 13, 2017
1 parent 155ce01 commit a1cb71e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public interface SimplePageItem {
public static final int CHECKLIST = 15;
public static final int FORUM_SUMMARY = 16;
public static final int ANNOUNCEMENTS = 17;
public static final int TWITTER = 18;
public static final int CALENDAR = 19;

// sakaiId used for an item copied from another site with no real content
public static final String DUMMY = "/dummy";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,23 @@ public void fillComponents(UIContainer tofill, ViewParameters params, ComponentC
String.valueOf(i.getSequence()));

if (i.getType() == 5) {
String text = FormattedText.convertFormattedTextToPlaintext(i.getHtml());
if (text.length() > 100)
text = text.substring(0,100);
UIOutput.make(row, "text-snippet", text);
if (i.getAttribute("isFolder")!=null && i.getAttribute("isFolder").equals("true")){
UIOutput.make(row, "text-snippet", messageLocator.getMessage("simplepage.resources-snippet"));
}
else {
String text = FormattedText.convertFormattedTextToPlaintext(i.getHtml());
if (text.length() > 100)
text = text.substring(0, 100);
UIOutput.make(row, "text-snippet", text);
}
} else if (SimplePageItem.ANNOUNCEMENTS == i.getType()) {
UIOutput.make(row, "text-snippet", messageLocator.getMessage("simplepage.announcements-snippet"));
} else if (SimplePageItem.FORUM_SUMMARY == i.getType()) {
UIOutput.make(row, "text-snippet", messageLocator.getMessage("simplepage.forums-snippet"));
} else if (SimplePageItem.TWITTER == i.getType()) {
UIOutput.make(row, "text-snippet", messageLocator.getMessage("simplepage.twitter-snippet"));
} else if (SimplePageItem.CALENDAR == i.getType()) {
UIOutput.make(row, "text-snippet", messageLocator.getMessage("simplepage.calendar-snippet"));
} else if ("1".equals(subtype)) {
// embed code, nothing useful to show
UIOutput.make(row, "text-snippet", messageLocator.getMessage("simplepage.embedded-video"));
Expand Down
3 changes: 3 additions & 0 deletions lessonbuilder/tool/src/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -740,3 +740,6 @@ simplepage.announcements-error-message=Error in adding announcements:
simplepage.announcements-header-title=Announcements
simplepage.announcements-snippet=latest announcements
simplepage.forums-snippet=latest forum conversations
simplepage.twitter-snippet=twitter timeline
simplepage.resources-snippet=resources folder
simplepage.calendar-snippet=calendar

0 comments on commit a1cb71e

Please sign in to comment.