Backup/Discuz.Web/space/modules/builtin/customizepanel/customizepanel.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using Discuz.Space.Entities;
using Discuz.Entity;
using Discuz.Common;
using Discuz.Config;
using Discuz.Space.Provider;
using Discuz.Space.Utilities;

namespace Discuz.Space.Modules
{
    /// <summary>
    /// 自定义面板
    /// </summary>
    public class CustomizePanel : ModuleBase
    {
        private string filename = Utils.GetMapPath(BaseConfigs.GetForumPath + "/space/Modules/builtin/customizepanel/customizepanel.config");
        
        public CustomizePanel()
        { }

        public override string GetModulePost(System.Web.HttpContext httpContext)
        {
            return base.GetModulePost(httpContext);
        }

        /// <summary>
        /// 自定义编辑框行为
        /// </summary>
        /// <param name="editbox"></param>
        /// <returns></returns>
        public override string OnEditBoxLoad(string editbox)
        {
            this.Editable = true;

            UserPrefsSaved userprefs = new UserPrefsSaved(this.Module.UserPref);
            string value = userprefs.GetValueByName("showborder");
            value = value == string.Empty ? "0" : value;
            string checkvalue = string.Empty;
            if (value == "1")
                checkvalue = "checked";
            editbox = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\">";
            editbox += string.Format("<tr><td colspan=\"1\" align=\"right\" width=\"35%\"><nobr>{0}{4}</nobr></td><td colspan=\"2\" align=\"left\" nowrap=\"nowrap\" width=\"65%\">&nbsp;<input id=\"m___MODULE_ID___0\" name=\"m___MODULE_ID___up_{3}\" value=\"{1}\" type=\"hidden\" /><input type=\"checkbox\" {2} onclick=\"_gel('m___MODULE_ID___0').value = this.checked ? '1' : '0';\" /></td></tr>", "显示边框: ", value, checkvalue, "showborder", "");
            value = userprefs.GetValueByName("moduletitle");

            if (value != string.Empty)
            {
                this.ModulePref.Title = value;
            }

            editbox += string.Format("<tr><td colspan=\"1\" align=\"right\" width=\"35%\"><nobr>{0}{3}</nobr></td><td colspan=\"2\" align=\"left\" nowrap=\"nowrap\" width=\"65%\">&nbsp;<input type=\"text\" size=\"20\" maxlen=\"200\" id=\"m___MODULE_ID___1\" name=\"m___MODULE_ID___up_{2}\" value=\"{1}\" /></td></tr>", "设置标题: ", value, "moduletitle", "");
            editbox += string.Format("<tr><td colspan=\"1\" align=\"right\" width=\"35%\">&nbsp;</td><td colspan=\"1\" align=\"right\" width=\"65%\"><nobr><a id=\"DD_tg___cp___MODULE_ID__\" href=\"###\" onclick=\"_DS_popup(event,'__cp___MODULE_ID__');editpanel___MODULE_ID__();_gel('DD___cp___MODULE_ID__').style.zIndex = 2;\">点此编辑面板内容</a></nobr></td></tr>");
            editbox += "</table>";
            return base.OnEditBoxLoad(editbox);
        }

        /// <summary>
        /// 自定义模块加载时的行为
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
后面还有 33 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。