Example #1
0
        protected void cmdDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(WikiPage) || IsFile)
                {
                    return;
                }
                var pageName = PageNameUtil.Decode(WikiPage);

                var page = Wiki.GetPage(pageName);
                CommunitySecurity.DemandPermissions(new WikiObjectsSecurityObject(page), Common.Constants.Action_RemovePage);

                foreach (var cat in Wiki.GetCategoriesRemovedWithPage(pageName))
                {
                    WikiNotifySource.Instance.GetSubscriptionProvider().UnSubscribe(Common.Constants.AddPageToCat, cat.CategoryName);
                }

                Wiki.RemoveCategories(pageName);

                WikiNotifySource.Instance.GetSubscriptionProvider().UnSubscribe(Common.Constants.EditPage, pageName);

                foreach (var comment in Wiki.GetComments(pageName))
                {
                    CommonControlsConfigurer.FCKUploadsRemoveForItem("wiki_comments", comment.Id.ToString());
                }
                Wiki.RemovePage(pageName);

                Response.RedirectLC("Default.aspx", this);
            }
            catch (Exception err)
            {
                WikiMaster.PrintInfoMessage(err.Message, InfoType.Alert);
            }
        }
Example #2
0
        protected void cmdFileUpload_Click(object sender, EventArgs e)
        {
            if (fuFile.HasFile)
            {
                EditFile.DirectFileSave(SecurityContext.CurrentAccount.ID, fuFile, MapPath("~"), WikiSection.Section, ConfigLocation, TenantId, HttpContext.Current);
                //Do a redirect after post stupid bastard!
                Response.Redirect(Request.GetUrlRewriter().ToString(), true);
            }

            WikiMaster.UpdateNavigationItems();
            BindRepeater();
        }
Example #3
0
        protected void cmdDelete_Click(object sender, EventArgs e)
        {
            try
            {
                var pageName = ((LinkButton)sender).CommandName;

                var page = Wiki.GetPage(pageName);
                CommunitySecurity.DemandPermissions(new WikiObjectsSecurityObject(page), Common.Constants.Action_RemovePage);

                foreach (var comment in Wiki.GetComments(pageName))
                {
                    CommonControlsConfigurer.FCKUploadsRemoveForItem("wiki_comments", comment.Id.ToString());
                }
                Wiki.RemovePage(pageName);
                BindRepeater();
            }
            catch (Exception err)
            {
                WikiMaster.PrintInfoMessage(err.Message, InfoType.Warning);
            }
        }
Example #4
0
        protected void cmdFileUpload_Click(object sender, EventArgs e)
        {
            if (fuFile.HasFile)
            {
                var result = EditFile.DirectFileSave(SecurityContext.CurrentAccount.ID, fuFile, MapPath("~"), WikiSection.Section, ConfigLocation, TenantId, HttpContext.Current);

                switch (result)
                {
                case SaveResult.Ok:
                    Response.Redirect(Request.GetUrlRewriter().ToString(), true);
                    return;

                case SaveResult.FileEmpty:
                    WikiMaster.PrintInfoMessage(WikiResource.msgFileEmpty, InfoType.Alert);
                    break;

                case SaveResult.FileSizeExceeded:
                    WikiMaster.PrintInfoMessage(FileSizeComment.GetFileSizeExceptionString(FileUploader.MaxUploadSize), InfoType.Alert);
                    break;
                }
            }

            BindRepeater();
        }
Example #5
0
 private void PrintInfoMessage(string info, InfoType type)
 {
     WikiMaster.PrintInfoMessage(info, type);
 }