Ejemplo n.º 1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId", "channelId", "ContentID", "ReturnUrl");
            var channelId = AuthRequest.GetQueryInt("channelId");

            _contentId = AuthRequest.GetQueryInt("ContentID");
            _returnUrl = StringUtils.ValueFromUrl(AuthRequest.GetQueryString("ReturnUrl"));

            _channelInfo = ChannelManager.GetChannelInfo(SiteId, channelId);

            if (IsPostBack)
            {
                return;
            }

            RblOperation.Items.Add(new ListItem("继续添加内容", EContentAddAfter.ContinueAdd.ToString()));
            RblOperation.Items.Add(new ListItem("返回管理界面", EContentAddAfter.ManageContents.ToString()));

            var isCrossSiteTrans = CrossSiteTransUtility.IsCrossSiteTrans(SiteInfo, _channelInfo);
            var isAutomatic      = CrossSiteTransUtility.IsAutomatic(_channelInfo);

            var isTranslated = ContentUtility.AfterContentAdded(SiteInfo, _channelInfo, _contentId, isCrossSiteTrans, isAutomatic);

            if (isCrossSiteTrans && !isAutomatic)
            {
                RblOperation.Items.Add(new ListItem("转发到其他站点", EContentAddAfter.Contribute.ToString()));
            }

            SuccessMessage(isTranslated ? "内容添加成功并已转发到指定站点,请选择后续操作。" : "内容添加成功,请选择后续操作。");

            PhSiteId.Visible = PhSubmit.Visible = false;
        }