protected override void OnLoad(EventArgs e) { base.OnLoad(e); basePage = Page as CBasePage; Visible = ShouldRender(); if (!Visible) { return; } if (basePage == null) { return; } if (CssClass.Length > 0) { CssClass = "ModuleEditLink adminlink filemanlink " + CssClass; } else { CssClass = "ModuleEditLink adminlink filemanlink"; } Text = Resource.AdminMenuFileManagerLink; ToolTip = Resource.AdminMenuFileManagerLink; NavigateUrl = basePage.SiteRoot + "/Dialog/FileManagerDialog.aspx"; if (basePage.UseIconsForAdminLinks) { ImageUrl = Page.ResolveUrl("~/Data/SiteImages/folder_explore.png"); } ClientClick = "GB_showFullScreen(this.title, this.href); return false;"; DialogCloseText = Resource.CloseDialogButton; }
override protected void OnInit(EventArgs e) { this.Load += new EventHandler(this.Page_Load); base.OnInit(e); basePage = Page as CBasePage; SiteRoot = basePage.SiteRoot; ImageSiteRoot = basePage.ImageSiteRoot; }
private void SetupColorPicker() { if (Page is CBasePage) { CBasePage p = Page as CBasePage; p.IncludeColorPickerCss = true; p.ScriptConfig.IncludeColorPicker = true; } pnlPicker.Attributes.Add("style", "position: relative; height:205px;"); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!(Page is CBasePage)) { return; } CBasePage CPage = Page as CBasePage; CPage.ScriptConfig.IncludeClueTip = true; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (disableYui) { return; } if (Page is CBasePage) { CBasePage p = Page as CBasePage; p.ScriptConfig.IncludeYuiDataTable = true; } }
protected virtual void PopulateLabels() { Title1.EditUrl = SiteRoot + "/Blog/EditPost.aspx"; Title1.EditText = BlogResources.BlogAddPostLabel; if ((IsEditable) && (countOfDrafts > 0)) { //BlogEditCategoriesLabel Title1.LiteralExtraMarkup = " <a href='" + SiteRoot + "/Blog/EditCategory.aspx?pageid=" + PageId.ToInvariantString() + "&mid=" + ModuleId.ToInvariantString() + "' class='ModuleEditLink' title='" + BlogResources.BlogEditCategoriesLabel + "'>" + BlogResources.BlogEditCategoriesLabel + "</a>" + " <a href='" + SiteRoot + "/Blog/Drafts.aspx?pageid=" + PageId.ToInvariantString() + "&mid=" + ModuleId.ToInvariantString() + "' class='ModuleEditLink' title='" + BlogResources.BlogDraftsLink + "'>" + BlogResources.BlogDraftsLink + "</a>"; } else if (IsEditable) { Title1.LiteralExtraMarkup = " <a href='" + SiteRoot + "/Blog/EditCategory.aspx?pageid=" + PageId.ToInvariantString() + "&mid=" + ModuleId.ToInvariantString() + "' class='ModuleEditLink' title='" + BlogResources.BlogEditCategoriesLabel + "'>" + BlogResources.BlogEditCategoriesLabel + "</a>"; } calBlogNav.UseAccessibleHeader = true; EditBlogAltText = BlogResources.EditImageAltText; CBasePage basePage = Page as CBasePage; if (basePage != null) { if (!basePage.UseTextLinksForFeatureSettings) { EditLinkImageUrl = String.Format("{0}/Data/SiteImages/{1}", ImageSiteRoot, EditContentImage); } } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); basePage = Page as CBasePage; Visible = ShouldRender(); if (!Visible) { return; } if (basePage == null) { return; } if (CssClass.Length > 0) { CssClass = "ModuleEditLink adminlink newpagelink " + CssClass; } else { CssClass = "ModuleEditLink adminlink newpagelink"; } ToolTip = Resource.AddPageTooltip; if ( basePage.CurrentPage != null) { NavigateUrl = basePage.SiteRoot + "/Admin/PageSettings.aspx?start=" + basePage.CurrentPage.PageId.ToInvariantString(); } else { NavigateUrl = basePage.SiteRoot + "/Admin/PageSettings.aspx"; } if (basePage.UseIconsForAdminLinks) { ImageUrl = Page.ResolveUrl("~/Data/SiteImages/" + ConfigurationManager.AppSettings["NewPageImage"]); Text = Resource.PagesAddButton; } else { Text = Resource.AddPageLink; } }
private void PopulateLabels() { btnSend.Text = ContactFormResources.ContactFormSendButtonLabel; SiteUtils.SetButtonAccessKey (btnSend, ContactFormResources.ContactFormSendButtonAccessKey); this.reqEmail.ErrorMessage = ContactFormResources.ContactFormValidAddressLabel; this.regexEmail.ErrorMessage = ContactFormResources.ContactFormValidAddressLabel; Title1.Visible = !this.RenderInWebPartMode; if (this.ModuleConfiguration != null) { this.Title = this.ModuleConfiguration.ModuleTitle; this.Description = this.ModuleConfiguration.FeatureName; } Title1.EditUrl = string.Empty; Title1.EditText = string.Empty; Title1.ToolTip = string.Empty; if (IsEditable) { CBasePage basePage = Page as CBasePage; if (basePage != null) { basePage.ScriptConfig.IncludeGreyBox = true; if (keepMessages) { Title1.LiteralExtraMarkup = " <a href='" + SiteRoot + "/ContactForm/MessageListDialog.aspx?pageid=" + PageId.ToInvariantString() + "&mid=" + ModuleId.ToInvariantString() + "' class='ModuleEditLink' title='" + ContactFormResources.ContactFormViewMessagesLink + "' " + "onclick='GB_showFullScreen(this.title, this.href); return false;'" + ">" + ContactFormResources.ContactFormViewMessagesLink + "</a>"; } } } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); basePage = Page as CBasePage; Visible = ShouldRender(); if (!Visible) { return; } if (basePage == null) { return; } if (CssClass.Length > 0) { CssClass = "ModuleEditLink adminlink adminmenulink " + CssClass; } else { CssClass = "ModuleEditLink adminlink adminmenulink"; } //ToolTip = Resource.AdminMenuLink; NavigateUrl = basePage.SiteRoot + relativeUrl; //if (basePage.UseIconsForAdminLinks) //{ // ImageUrl = Page.ResolveUrl("~/Data/SiteImages/admin.png"); // Text = Resource.AdminMenuLink; //} //else //{ // Text = Resource.AdminLink; //} }
private void LoadSettings() { Title1.EditUrl = SiteRoot + "/HtmlEdit.aspx"; Title1.EditText = Resource.EditImageAltText; Title1.ToolTip = Resource.EditImageAltText; Title1.Visible = !this.RenderInWebPartMode; if ((WebUser.IsAdminOrContentAdmin) || (SiteUtils.UserIsSiteEditor())) { isAdmin = true; Title1.IsAdminEditor = isAdmin; } if (IsEditable) { TitleUrl = String.Format("{0}/HtmlEdit.aspx?mid={1}&pageid={2}", SiteRoot, ModuleId, CurPageSettings.PageId); } TimeOffset = SiteUtils.GetUserTimeOffset(); EnableContentRatingSetting = WebUtils.ParseBoolFromHashtable( Settings, "EnableContentRatingSetting", EnableContentRatingSetting); EnableRatingCommentsSetting = WebUtils.ParseBoolFromHashtable( Settings, "EnableRatingCommentsSetting", EnableRatingCommentsSetting); IncludeSwfObject = WebUtils.ParseBoolFromHashtable( Settings, "IncludeSwfObjectSetting", IncludeSwfObject); enableSlideShow = WebUtils.ParseBoolFromHashtable( Settings, "HtmlEnableSlideShow", enableSlideShow); slideContainerHeight = WebUtils.ParseInt32FromHashtable( Settings, "HtmlSlideContainerHeight", slideContainerHeight); pauseSlideOnHover = WebUtils.ParseBoolFromHashtable( Settings, "HtmlSlideShowPauseOnHover", pauseSlideOnHover); slideDuration = WebUtils.ParseInt32FromHashtable( Settings, "HtmlSlideDuration", slideDuration); transitionSpeed = WebUtils.ParseInt32FromHashtable( Settings, "HtmlTransitionSpeed", transitionSpeed); randomizeSlides = WebUtils.ParseBoolFromHashtable( Settings, "HtmlSlideShowRandomizeSlides", randomizeSlides); useSlideClearTypeCorrections = WebUtils.ParseBoolFromHashtable( Settings, "HtmlSlideShowUseExtraClearTypeCorrections", useSlideClearTypeCorrections); // if (Settings.Contains("HtmlSlideTransitions")) { slideTransitions = Settings["HtmlSlideTransitions"].ToString(); } if (Settings.Contains("HtmlSlideContainerClass")) { slideContainerClass = Settings["HtmlSlideContainerClass"].ToString().Trim(); } if ((IncludeSwfObject) && (Page is CBasePage)) { CBasePage p = Page as CBasePage; if (p != null) { p.ScriptConfig.IncludeSwfObject = true; } } if (this.ModuleConfiguration != null) { this.Title = this.ModuleConfiguration.ModuleTitle; this.Description = this.ModuleConfiguration.FeatureName; } Rating.Enabled = EnableContentRatingSetting; Rating.AllowFeedback = EnableRatingCommentsSetting; Rating.ContentGuid = ModuleGuid; pnlContainer.ModuleId = this.ModuleId; if (enableSlideShow) { divContent.EnableSlideShow = true; divContent.Random = randomizeSlides; divContent.CleartypeNoBg = !useSlideClearTypeCorrections; divContent.SlideContainerClass = slideContainerClass; divContent.PauseOnHover = pauseSlideOnHover; divContent.TransitionEffect = slideTransitions; divContent.TransitionInterval = slideDuration; divContent.Speed = transitionSpeed; if (slideContainerHeight > 0) { divContent.ContainerHeight = slideContainerHeight.ToInvariantString() + "px"; } } }
private void Initialize() { if (HttpContext.Current == null) { return; } siteModule = GetParentAsSiteModelControl(this); bool useTextLinksForFeatureSettings = true; CBasePage basePage = Page as CBasePage; if (basePage != null) { useTextLinksForFeatureSettings = basePage.UseTextLinksForFeatureSettings; } if (siteModule != null) { module = siteModule.ModuleConfiguration; CanEdit = siteModule.IsEditable; enableWorkflow = siteModule.EnableWorkflow; forbidModuleSettings = siteModule.ForbidModuleSettings; } if (module != null) { if (module.ShowTitle) { litModuleTitle.Text = Page.Server.HtmlEncode(module.ModuleTitle); } else { useHeading = false; } if (CanEdit) { if (!disabledModuleSettingsLink) { lnkModuleSettings.Visible = true; lnkModuleSettings.Text = Resource.SettingsLink; lnkModuleSettings.ToolTip = Resource.ModuleEditSettings; if (!useTextLinksForFeatureSettings) { lnkModuleSettings.ImageUrl = Page.ResolveUrl(String.Format("~/Data/SiteImages/{0}", WebConfigSettings.EditPropertiesImage)); } else { // if its a text link make it small like the edit link lnkModuleSettings.CssClass = "ModuleEditLink"; } siteRoot = SiteUtils.GetNavigationSiteRoot(); lnkModuleSettings.NavigateUrl = String.Format("{0}/Admin/ModuleSettings.aspx?mid={1}&pageid={2}", siteRoot, module.ModuleId.ToInvariantString(), module.PageId.ToInvariantString()); if ((enableWorkflow) && (siteModule != null) && (siteModule is IWorkflow)) { SetupWorkflowControls(); } } } if ( ((CanEdit) || (ShowEditLinkOverride)) && ((EditText != null) && (EditUrl != null))) { lnkModuleEdit.Text = EditText; if (this.ToolTip.Length > 0) { lnkModuleEdit.ToolTip = this.ToolTip; } else { lnkModuleEdit.ToolTip = EditText; } lnkModuleEdit.NavigateUrl = String.Format("{0}?mid={1}&pageid={2}", EditUrl, module.ModuleId.ToInvariantString(), module.PageId.ToInvariantString()); if (!useTextLinksForFeatureSettings) { lnkModuleEdit.ImageUrl = Page.ResolveUrl(String.Format("~/Data/SiteImages/{0}", WebConfigSettings.EditContentImage)); } } else { lnkModuleEdit.Visible = false; } } }
protected override void Render(HtmlTextWriter writer) { if (this.Site != null && this.Site.DesignMode) { // TODO: show a bmp or some other design time thing? //writer.Write("[" + this.ID + "]"); } else { bool allowPageOverride = true; if (Page is CBasePage) { CBasePage basePage = (CBasePage)Page; allowPageOverride = basePage.AllowSkinOverride; } string skinBaseUrl = SiteUtils.GetSkinBaseUrl(true, Page); string scriptBaseUrl = WebUtils.GetSiteRoot() + "/ClientScript/"; if (includeHtml5Script) { writer.Write("\n<!--[if IE]>\n"); writer.Write("<script defer=\"defer\" src=\"" + scriptBaseUrl + "html5.js\" type=\"text/javascript\"></script>\n"); // the above script does what the below script used to do //writer.Write("<script type=\"text/javascript\">"); //writer.Write("\n document.createElement(\"header\");"); //writer.Write("\n document.createElement(\"footer\");"); //writer.Write("\n document.createElement(\"nav\");"); //writer.Write("\n document.createElement(\"article\");"); //writer.Write("\n document.createElement(\"section\");"); //writer.Write("\n</script>"); writer.Write("\n<![endif]-->"); } writer.Write("\n<!--[if lt IE 7]>\n"); if (includeIE7Script) { writer.Write("<script defer=\"defer\" src=\"" + scriptBaseUrl + "IE7.js\" type=\"text/javascript\"></script>\n"); } writer.Write("<link rel=\"stylesheet\" href=\"" + skinBaseUrl + ie6CssFile + "\" type=\"text/css\" id=\"IEMenuCSS\" />\n"); writer.Write("<![endif]-->\n"); writer.Write("<!--[if IE 7]>\n"); if (includeIE8Script) { writer.Write("<script defer=\"defer\" src=\"" + scriptBaseUrl + "IE8.js\" type=\"text/javascript\"></script>\n"); } writer.Write("<link rel=\"stylesheet\" href=\"" + skinBaseUrl + ie7CssFile + "\" type=\"text/css\" id=\"IE7MenuCSS\" />\n"); writer.Write("<![endif]-->\n"); if (includeIE8) { writer.Write("<!--[if gt IE 7]>\n"); writer.Write("<link rel=\"stylesheet\" href=\"" + skinBaseUrl + "IE8Specific.css\" type=\"text/css\" id=\"IE8MenuCSS\" />\n"); writer.Write("<![endif]-->\n"); } } }