⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 infoviewaddreply.java~1~

📁 云网论坛CWBBS 源码,内容丰富,学习,参考,教学的好资料,具体见内说明,
💻 JAVA~1~
字号:
package com.redmoon.forum.plugin.info;

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 InfoViewAddReply implements IPluginViewAddReply {
    HttpServletRequest request;
    int msgRootId;

    public static final String FORM_ACCEPT_APPLY = "auction_AcceptApply";
    public static final String FORM_DECLINE_APPLY = "auction_DeclineApply";

    public static final String FORM_APPLY_MARRY = "auction_ApplyMarry";
    public static final String FORM_ACCEPT_APPLY_MARRY = "auction_AcceptApplyMarry";
    public static final String FORM_DECLINE_APPLY_MARRY = "auction_DeclineApplyMarry";

    Logger logger = Logger.getLogger(this.getClass().getName());

    public InfoViewAddReply(HttpServletRequest request, String boardCode, int 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() {
        InfoBoardDb 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 += "&nbsp;" + 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 + -