Skip to content

Commit

Permalink
RSF-13 - Clean up RSF code to honor correct skinning values
Browse files Browse the repository at this point in the history
  • Loading branch information
jonespm committed Mar 4, 2016
1 parent f5cdc06 commit 7009dcc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
4 changes: 4 additions & 0 deletions rsf/sakai-rsf-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
<groupId>org.sakaiproject.entitybroker</groupId>
<artifactId>entitybroker-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.portal</groupId>
<artifactId>sakai-portal-util</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,16 @@
package org.sakaiproject.rsf.copies;

import org.sakaiproject.component.cover.ServerConfigurationService;
import javax.servlet.http.HttpServletRequest;

import org.sakaiproject.portal.util.CSSUtils;
import org.sakaiproject.portal.util.ToolUtils;

import org.sakaiproject.site.api.Site;

public class DefaultPortalMatter {
public static String getDefaultPortalMatter() {
// This code copied from CharonPortal.java/ToolPortal.java setupForward
// It should really be available in a standard Sakai API.
String skin = ServerConfigurationService.getString("skin.default");
String skinRepo = ServerConfigurationService.getString("skin.repo");
String headCssToolBase = "<link href=\"" + skinRepo
+ "/tool_base.css\" type=\"text/css\" rel=\"stylesheet\" media=\"all\" />\n";
String headCssToolSkin = "<link href=\"" + skinRepo + "/" + skin
+ "/tool.css\" type=\"text/css\" rel=\"stylesheet\" media=\"all\" />\n";
String headCss = headCssToolBase + headCssToolSkin;
// String headJs = "<script type=\"text/javascript\"
// language=\"JavaScript\"
// src=\"/library/js/headscripts.js\"></script>\n";
// String head = headCss + headJs;
public static String getDefaultPortalMatter(Site site, HttpServletRequest req) {
String headCss = CSSUtils.getCssHead(CSSUtils.getSkinFromSite(site),ToolUtils.isInlineRequest(req));
return headCss;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ public void init() {
Tool tool = (Tool) request.getAttribute("sakai.tool");
placement = (Placement) request.getAttribute("sakai.tool.placement");

SakaiPortalMatterSCR matterscr = new SakaiPortalMatterSCR();
String headMatter = (String) request.getAttribute("sakai.html.head");
if (headMatter == null) {
headMatter = DefaultPortalMatter.getDefaultPortalMatter();
}
matterscr.setHeadMatter(headMatter);

if (tool != null && placement != null) {
String toolid = tool.getId();
String toolinstancepid = placement.getId();
Expand Down Expand Up @@ -159,6 +152,12 @@ public void init() {
src.addSCR(bodyscr2);
}

SakaiPortalMatterSCR matterscr = new SakaiPortalMatterSCR();
String headMatter = (String) request.getAttribute("sakai.html.head");
if (headMatter == null) {
headMatter = DefaultPortalMatter.getDefaultPortalMatter(site,request);
}
matterscr.setHeadMatter(headMatter);
src.addSCR(matterscr);

consumerinfo = new ConsumerInfo();
Expand Down

0 comments on commit 7009dcc

Please sign in to comment.