* @return
*/
@RequestMapping(value = "/member/contribute_edit.jspx")
public String edit(Integer id, HttpServletRequest request,
HttpServletResponse response, ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
CmsUser user = CmsUtils.getUser(request);
FrontUtils.frontData(request, model, site);
MemberConfig mcfg = site.getConfig().getMemberConfig();
// 没有开启会员功能
if (!mcfg.isMemberOn()) {
return FrontUtils.showMessage(request, model, "member.memberClose");
}
if (user == null) {
return FrontUtils.showLogin(request, model, site);
}
WebErrors errors = validateEdit(id, site, user, request);
if (errors.hasErrors()) {
return FrontUtils.showError(request, response, model, errors);
}
Content content = contentMng.findById(id);
// 获得本站栏目列表
Set<Channel> rights = user.getGroup().getContriChannels();
List<Channel> topList = channelMng.getTopList(site.getId(), true);
List<Channel> channelList = Channel.getListForSelect(topList, rights,
true);
model.addAttribute("content", content);
model.addAttribute("channelList", channelList);
return FrontUtils.getTplPath(request, site.getSolutionPath(),
TPLDIR_MEMBER, CONTRIBUTE_EDIT);
}