public void DeletePostIcon()
        {
            int[] postIconIds = StringUtil.Split <int>(_Request.Get("deleteposticonids", Method.Post));

            PostIconSettings.DeleteIcons(postIconIds);
            SettingManager.SaveSettings(PostIconSettings);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (_Request.IsClick("savesetting"))
            {
                SaveSettings();
            }

            else if (_Request.IsClick("delete"))
            {
                DeletePostIcon();
            }
            else if (_Request.Get("enable", Method.Get) != null)
            {
                bool enable = _Request.Get("enable", Method.Get).ToLower() == "true";
                if (AllSettings.Current.PostIconSettings.EnablePostIcon != enable)
                {
                    PostIconSettings setting = SettingManager.CloneSetttings <PostIconSettings>(AllSettings.Current.PostIconSettings);
                    setting.EnablePostIcon = enable;
                    SettingManager.SaveSettings(setting);
                }
            }
        }
        public bool SaveSettings()
        {
            MessageDisplay msgDisplay = CreateMessageDisplay("iconurl");

            int[] posticonids = StringUtil.Split <int>(_Request.Get("posticonids", Method.Post));

            PostIconCollection posticons = new PostIconCollection();
            PostIcon           temp;
            int rowindex = 0;

            foreach (int id in posticonids)
            {
                temp            = new PostIcon();
                temp.IconID     = id;
                temp.IconUrlSrc = _Request.Get("iconurl." + id, Method.Post);
                temp.SortOrder  = _Request.Get <int>("sortorder." + id, Method.Post, 0);
                temp.IsNew      = _Request.Get <bool>("isnew." + id, Method.Post, false);
                if (string.IsNullOrEmpty(temp.IconUrl))
                {
                    msgDisplay.AddError("iconurl", rowindex, "");
                }
                posticons.Add(temp);
                rowindex++;
            }

            //无脚本
            if (_Request.Get("newposticons", Method.Post) != null &&
                _Request.Get("newposticons", Method.Post).Contains("{0}")
                )
            {
                temp            = PostIconSettings.CreatePostIcon();
                temp.IconUrlSrc = _Request.Get("iconurl.new.{0}", Method.Post);
                temp.SortOrder  = _Request.Get("sortorder.new.{0}", Method.Post, 0);
                if (!string.IsNullOrEmpty(temp.IconUrl))
                {
                    posticons.Add(temp);
                }
            }
            else
            {
                int[] newiconids = StringUtil.Split <int>(_Request.Get("newposticons", Method.Post));
                foreach (int newid in newiconids)
                {
                    temp            = PostIconSettings.CreatePostIcon();
                    temp.IconUrlSrc = _Request.Get("iconurl.new." + newid, Method.Post);
                    temp.SortOrder  = _Request.Get("sortorder.new." + newid, Method.Post, 0);
                    if (string.IsNullOrEmpty(temp.IconUrl))
                    {
                        msgDisplay.AddError("iconurl", rowindex, "");
                    }
                    posticons.Add(temp);
                    rowindex++;
                }
            }

            if (!msgDisplay.HasAnyError())
            {
                PostIconSettings.PostIcons = posticons;
                foreach (PostIcon pi in posticons)
                {
                    pi.IsNew = false;
                }
                SettingManager.SaveSettings(PostIconSettings);
            }
            else
            {
                msgDisplay.AddError(new DataNoSaveError());
                m_postIconList = new PostIcon[posticons.Count];
                posticons.CopyTo(m_postIconList, 0);
            }

            return(true);
        }