📄 rewardviewaddreply.java~3~
字号:
package com.redmoon.forum.plugin.reward;
import javax.servlet.http.HttpServletRequest;
import cn.js.fan.db.PrimaryKey;
import com.redmoon.forum.Privilege;
import com.redmoon.forum.plugin.base.IPluginViewAddReply;
import com.redmoon.forum.plugin.base.UIAddReply;
import org.apache.log4j.Logger;
import cn.js.fan.util.ParamUtil;
public class RewardViewAddReply implements IPluginViewAddReply {
HttpServletRequest request;
long msgRootId;
Logger logger = Logger.getLogger(this.getClass().getName());
public RewardViewAddReply(HttpServletRequest request, String boardCode, long msgRootId) {
this.request = request;
this.boardCode = boardCode;
this.msgRootId = msgRootId;
init();
}
public String render(int position) {
String str = "";
switch (position) {
case UIAddReply.POS_FORM_NOTE:
str = getFormNote();
break;
case UIAddReply.POS_FORM_ELEMENT:
str = getFormElement();
break;
default:
}
return str;
}
public void setBoardCode(String boardCode) {
this.boardCode = boardCode;
}
public void setFormNote(String formNote) {
this.formNote = formNote;
}
public void setFormElement(String formElement) {
this.formElement = formElement;
}
public String getBoardCode() {
return boardCode;
}
public boolean IsPluginBoard() {
RewardBoardDb sb = new InfoBoardDb();
return sb.isPluginBoard(boardCode);
}
public String getFormElement() {
return formElement;
}
public void init() {
formElement = "";
/*
// logger.info("name=" + name + "InfoDb.name=" + sd.getName());
if (name.equals(sd.getName())) {
formNote = InfoSkin.LoadString(request, "addReplyNoteOwner");
}
else {
String str = "";
// 如果在auction用户表中已记录
if (su.isLoaded()) {
switch (su.getType()) {
case InfoUserDb.TYPE_APPLIER: // 如果正在申请中,则可继续发申请贴
str = InfoSkin.LoadString(request, "noteApplier");
formElement = "<input type=hidden name=auctionAction value='apply'><input type=checkbox name=tempInfoAction value='apply' disabled checked>" + InfoSkin.LoadString(request, "addReplyLableApply");
break;
case InfoUserDb.TYPE_PERSUATER:
str = InfoSkin.LoadString(request, "addReplyLableUserPersuate");
break;
case InfoUserDb.TYPE_SPOUSE:
str = InfoSkin.LoadString(request, "addReplyLableUserSpouse");
break;
default:
}
} else { // 如果在用户表中未记录,则说明为申请贴
str = InfoSkin.LoadString(request, "addReplyNoteApply");
formElement = "<input type=hidden name=auctionAction value='" + InfoMsgAction.ACTION_APPLY + "'><input type=checkbox name=tempInfoAction value='apply' disabled checked>" + InfoSkin.LoadString(request, "addReplyLableApply");
}
formNote = str;
}
*/
// 根据pluginForm置入相应的表单元素
String pluginForm = ParamUtil.get(request, "pluginForm");
// logger.info("pluginForm" + pluginForm);
if (pluginForm.equals(this.FORM_ACCEPT_APPLY)) { // 接受申请,成为追求者
//formElement +=
// "<input type=hidden name='auctionAction' value='" + InfoMsgAction.ACTION_ACCEPT_APPLY + "'>" +
// "<input type=checkbox name=tempInfoAction disabled checked>" +
// InfoSkin.LoadString(request, "BUTTON_ACCEPT");
// formElement += getFormSecretLevel(request, InfoMsgDb.SECRET_LEVEL_MSG_USER_REPLIED);
}
else if (pluginForm.equals(this.FORM_DECLINE_APPLY)) { // 拒绝申请成为追求者
//formElement += "<input type=hidden name='auctionAction' value='" + InfoMsgAction.ACTION_DECLINE_APPLY + "'><input type=checkbox name=tempInfoAction disabled checked>" +
// InfoSkin.LoadString(request, "BUTTON_DECLINE");
// formElement += getFormSecretLevel(request, InfoMsgDb.SECRET_LEVEL_MSG_USER_REPLIED);
}
else if (pluginForm.equals(this.FORM_APPLY_MARRY)) { // 申请结婚表单
/*
// 如果回复者不是楼主
if (!sd.getName().equals(name)) {
// 如果在auction用户表中已记录
if (su.getType()==su.TYPE_SPOUSE)
formElement += InfoSkin.LoadString(request, "addReplyLableAlreadyMarry");
else if (su.getType() == su.TYPE_PERSUATER) {
formElement +=
"<input type=hidden name='auctionAction' value='" +
InfoMsgAction.ACTION_APPLY_MARRY +
"'><input type=checkbox name=tempInfoAction disabled checked>" +
InfoSkin.LoadString(request,
"addReplyLableApplyMarry");
}
else
formElement += " " + InfoSkin.LoadString(request, "addReplyLableShouldApplyPersuate"); // 警告,您必须先成为追求者
}
// 仅楼主可见
formElement += getFormSecretLevel(request, InfoMsgDb.SECRET_LEVEL_MSG_OWNER);
*/
}
else if (pluginForm.equals(this.FORM_ACCEPT_APPLY_MARRY)) { // 接受求婚
//formElement +=
// "<input type=hidden name='auctionAction' value='" + InfoMsgAction.ACTION_ACCEPT_MARRY + "'>" +
// "<input type=checkbox name=tempInfoAction disabled checked>" +
// InfoSkin.LoadString(request, "BUTTON_ACCEPT");
//formElement += getFormSecretLevel(request, InfoMsgDb.SECRET_LEVEL_MSG_USER_REPLIED);
}
else if (pluginForm.equals(this.FORM_DECLINE_APPLY_MARRY)) { // 拒绝申请成为追求者
//formElement += "<input type=hidden name='auctionAction' value='" + InfoMsgAction.ACTION_DECLINE_MARRY + "'><input type=checkbox name=tempInfoAction disabled checked>" +
// InfoSkin.LoadString(request, "BUTTON_DECLINE");
//formElement += getFormSecretLevel(request, InfoMsgDb.SECRET_LEVEL_MSG_USER_REPLIED);
}
else
;//formElement += getFormSecretLevel(request, InfoMsgDb.SECRET_LEVEL_FORUM_PUBLIC);
}
public String getFormNote() {
return formNote;
}
private String boardCode;
private String formNote = "";
private String formElement = "";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -