Skip to content

Commit

Permalink
SAK-29934: Add sakai.property to disable Forums Ranks feature - Phase…
Browse files Browse the repository at this point in the history
… 1: disabling the Ranks page
  • Loading branch information
bbailla2 committed Sep 29, 2015
1 parent e08d4bb commit 868144b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9327,6 +9327,11 @@ public void setRankBeanList(List ranklist) {
this.rankBeanList.addAll(alist);
}

public boolean isRanksEnabled()
{
return ServerConfigurationService.getBoolean("msgcntr.forums.ranks.enable", true);
}

private static final String INSUFFICIENT_PRIVILEGES_TO_EDIT_RANKS = "cdfm_insufficient_privileges_ranks";
private static final String VIEW_RANK = "dfViewAllRanks";
private static final String ADD_RANK = "dfAddRank";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ public void setAuthorRank(Rank aRank) {
}

public void setAuthorPostCount(String userEid) {
int authorCount = messageManager.findAuthoredMessageCountForStudent(userEid);
authorPostCount = authorCount;
// This is invoked a lot, but it's only relevant when a student has a rank.
if (authorRank != null)
{
int authorCount = messageManager.findAuthoredMessageCountForStudent(userEid);
authorPostCount = authorCount;
}
}

public int getAuthorPostCount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ org.sakaiproject.tool.cover.SessionManager.getCurrentToolSession().
<sakai:tool_bar_item value="#{msgs.cdfm_template_setting}" action="#{ForumTool.processActionTemplateSettings}" rendered="#{ForumTool.instructor}" />
<sakai:tool_bar_item value="#{msgs.stat_list}" action="#{ForumTool.processActionStatistics}" rendered="#{ForumTool.instructor}" />
<sakai:tool_bar_item value="#{msgs.cdfm_msg_pending_queue} #{msgs.cdfm_openb}#{ForumTool.numPendingMessages}#{msgs.cdfm_closeb}" action="#{ForumTool.processPendingMsgQueue}" rendered="#{ForumTool.displayPendingMsgQueue}" />
<sakai:tool_bar_item value="#{msgs.ranks}" action="#{ForumTool.processActionViewRanks}" rendered="#{ForumTool.instructor}" />
<sakai:tool_bar_item value="#{msgs.ranks}" action="#{ForumTool.processActionViewRanks}" rendered="#{ForumTool.instructor && ForumTool.ranksEnabled}" />
<sakai:tool_bar_item value="#{msgs.watch}" action="#{ForumTool.processActionWatch}" />

</sakai:tool_bar>
Expand Down

0 comments on commit 868144b

Please sign in to comment.