Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PXDBContext        context = new PXDBContext(new PXWikiSettings(this).Absolute);
        SendKBArticleMaint graph   = ds.DataGraph as SendKBArticleMaint;

        if (graph != null)
        {
            graph.WikiSettings = context.Settings;
            context.WikiID     = graph.Message.Current.WikiID;
        }

        PXWikiEdit wikiEdit = form.FindControl("wikiEdit") as PXWikiEdit;

        if (wikiEdit != null)
        {
            wikiEdit.PreviewSettings = context;
            form.DataBound          += new EventHandler(delegate(object o, EventArgs args)
            {
                PXDBContext settings = context;
                //settings.StyleID = SitePolicy.DefaultMailStyle;
                wikiEdit.PreviewSettings = settings;
            });
        }

        PXKBShow edContent = frmInsertArticle.FindControl("edContent") as PXKBShow;
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        T graph = (T)ds.DataGraph;

        this.gridSub         = this.tab.FindControl("gridSub") as PXGrid;
        this.gridAttachments = this.tab.FindControl("gridAttachments") as PXGrid;

        WikiPage curr = (WikiPage)graph.Caches[typeof(WikiPage)].Current;

        if (!this.hasQueryParams && curr != null && !this.Page.IsPostBack && !this.Page.IsCallback)
        {
            this.ds.DataGraph.Clear();
            this.Response.Redirect(this.Request.RawUrl + "?wiki=" + curr.WikiID.GetValueOrDefault().ToString() + "&parent=" + curr.ParentUID.GetValueOrDefault().ToString() + "&name=" + curr.Name);
            return;
        }

        WikiReader reader = PXGraph.CreateInstance <WikiReader>();

        this.edtWikiText = (PXWikiEdit)this.tab.DataControls["edtWikiText"];
        this.edtWikiText.PreviewSettings = new PXWikiSettings(this.Page, reader).Relative;
        this.edtWikiText.FileNamePrefix  = curr == null ? null : curr.Name;
        this.edtWikiText.FileUploaded   += new PXFileUploadEventHandler(editor_FileUploaded);

        graph.GetFileUrl            = Request.GetWebsiteAuthority().GetLeftPart(UriPartial.Authority) + ResolveUrl("~/Frames/GetFile.ashx");
        graph.CurrentAttachmentGuid = PX.Common.GUID.CreateGuid((string)gridAttachments.DataValues["FileID"]).GetValueOrDefault();

        PXEntryStatus recStatus = ds.DataGraph.Caches[typeof(WikiPage)].GetStatus(curr);

        if (recStatus == PXEntryStatus.Deleted || recStatus == PXEntryStatus.Inserted || recStatus == PXEntryStatus.InsertedDeleted)
        {
            edtWikiText.AttachFileEnabled = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Master.PopupWidth  = 900;
        this.Master.PopupHeight = 600;
        PXWikiEdit edit = this.FindControl("edBody") as PXWikiEdit;

        if (edit != null)
        {
            edit.PreviewSettings = new PXWikiSettings(this).Relative;
        }
    }