protected PageViewMode GetUserViewMode() { PageViewMode viewMode = PageViewMode.WorkInProgress; // we let the query string value trump because we pass it in an url from the Admin workflow pages if (!string.IsNullOrEmpty(Request.QueryString["vm"])) { try { viewMode = (PageViewMode)Enum.Parse(typeof(PageViewMode), Request.QueryString["vm"]); } catch (ArgumentException) { } } else { // if query string is not passed use the cookie string viewCookieValue = CookieHelper.GetCookieValue(GetViewModeCookieName()); if (!string.IsNullOrEmpty(viewCookieValue)) { try { viewMode = (PageViewMode)Enum.Parse(typeof(PageViewMode), viewCookieValue); } catch (ArgumentException) { } } } return(viewMode); }
protected override void Construct() { base.Construct(); this.pages = this.CreatePagesInstance(); this.viewMode = PageViewMode.Strip; this.UpdateUI(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); userIsAdmin = WebUser.IsAdmin; userIsContentAdmin = WebUser.IsContentAdmin; userIsSiteEditor = SiteUtils.UserIsSiteEditor(); viewMode = GetUserViewMode(); }
protected void SetupWorkflowControls() { if ( (WebConfigSettings.EnableContentWorkflow && siteSettings.EnableContentWorkflow) && ( (WebUser.IsInRoles(CurrentPage.DraftEditOnlyRoles)) || (WebUser.IsInRoles(CurrentPage.EditRoles)) ) ) { viewMode = GetUserViewMode(); if ((WebConfigSettings.EnableContentWorkflow) && (siteSettings.EnableContentWorkflow)) { ddlContentView.EnableTheming = false; ddlContentView.CssClass = "ddworkflow"; ddlContentView.Items.Add(new ListItem(Resource.ViewWorkInProgress, PageViewMode.WorkInProgress.ToString())); ddlContentView.Items.Add(new ListItem(Resource.ViewLive, PageViewMode.Live.ToString())); ListItem item = ddlContentView.Items.FindByValue(viewMode.ToString()); if (item != null) { ddlContentView.ClearSelection(); item.Selected = true; } ddlContentView.SelectedIndexChanged += new EventHandler(ddlContentView_SelectedIndexChanged); ddlContentView.AutoPostBack = true; if (UseIconsForAdminLinks) { this.MPPageEdit.Controls.Add(new LiteralControl(" ")); } this.MPPageEdit.Controls.Add(ddlContentView); } } }
public RadPageViewModeEventArgs(PageViewMode mode) { this.viewMode = mode; }
protected PageViewMode GetUserViewMode() { PageViewMode viewMode = PageViewMode.WorkInProgress; // we let the query string value trump because we pass it in an url from the Admin workflow pages if (!string.IsNullOrEmpty(Request.QueryString["vm"])) { try { viewMode = (PageViewMode)Enum.Parse(typeof(PageViewMode), Request.QueryString["vm"]); } catch (ArgumentException) { } } else { // if query string is not passed use the cookie string viewCookieValue = CookieHelper.GetCookieValue(GetViewModeCookieName()); if (!string.IsNullOrEmpty(viewCookieValue)) { try { viewMode = (PageViewMode)Enum.Parse(typeof(PageViewMode), viewCookieValue); } catch (ArgumentException) { } } } return viewMode; }
protected void SetupWorkflowControls(bool forceShowWorkflow) { if ( (WebConfigSettings.EnableContentWorkflow && siteSettings.EnableContentWorkflow) && ( forceShowWorkflow //||(WebUser.IsInRoles(CurrentPage.DraftEditOnlyRoles)) //|| WebUser.IsContentAdmin //|| (WebUser.IsInRoles(CurrentPage.EditRoles) //|| SiteUtils.UserIsSiteEditor()) || UserCanSeeWorkflowControls() ) ) { viewMode = GetUserViewMode(); ddlContentView.SkinID = "workflow"; ddlContentView.CssClass = "ddworkflow"; ddlContentView.Items.Add(new ListItem(Resource.ViewWorkInProgress, PageViewMode.WorkInProgress.ToString())); ddlContentView.Items.Add(new ListItem(Resource.ViewLive, PageViewMode.Live.ToString())); ListItem item = ddlContentView.Items.FindByValue(viewMode.ToString()); if (item != null) { ddlContentView.ClearSelection(); item.Selected = true; } ddlContentView.SelectedIndexChanged += new EventHandler(ddlContentView_SelectedIndexChanged); ddlContentView.AutoPostBack = true; if (UseIconsForAdminLinks) { this.MPPageEdit.Controls.Add(new LiteralControl(" ")); } this.MPPageEdit.Controls.Add(ddlContentView); } else { viewMode = PageViewMode.Live; } }
public void ReadFrom(DomDocument document) { _Options = document.Options.Clone(); _PageViewMode = document.PageViewMode; }
public RadPageViewModeChangingEventArgs(PageViewMode mode) : base(mode) { }