private void Page_Load(System.Object sender, System.EventArgs e) { StyleHelper objStyle; Ektron.Cms.Common.EkMessageHelper m_refMsg; try { Utilities.ValidateUserLogin(); if ((m_refAPI.RequestInformationRef.IsMembershipUser >0) || (m_refAPI.RequestInformationRef.UserId == 0)) { Response.Redirect("blank.htm", false); return; } m_refMsg = m_refAPI.EkMsgRef; objStyle = new StyleHelper(); m_strStyleSheetJS = objStyle.GetClientScript(); jsAppImgPath.Text = m_refAPI.AppImgPath; Button0.InnerHtml = "<img style=\"MARGIN-LEFT: 3px;\" id=\"iconImage0\" title=\"" + m_refMsg.GetMessage("alt select contenttree button text") + "\" src=\"images/application/navbar/icon_content.gif\" align=\"absmiddle\"> " + m_refMsg.GetMessage("content button text"); if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.SocialNetworking)) { Button4.InnerHtml = "<img style=\"MARGIN-LEFT: 3px;\" id=\"Img5\" title=\"" + m_refMsg.GetMessage("alt select workspacetree button text") + "\" src=\"images/application/user.gif\" align=\"absmiddle\" width=\"16\" height=\"16\"> " + m_refMsg.GetMessage("lbl my stuff"); } Button1.InnerHtml = "<img style=\"MARGIN-LEFT: 3px;\" id=\"Img2\" title=\"" + m_refMsg.GetMessage("alt select librarytree button text") + "\" src=\"images/application/navbar/icon_library.gif\" align=\"absmiddle\"> " + m_refMsg.GetMessage("library button text"); Button2.InnerHtml = "<img style=\"MARGIN-LEFT: 3px;\" id=\"Img3\" title=\"" + m_refMsg.GetMessage("alt select moduletree button text") + "\" src=\"images/application/navbar/icon_modules.gif\" align=\"absmiddle\"> " + m_refMsg.GetMessage("modules button text"); Button3.InnerHtml = "<img style=\"MARGIN-LEFT: 3px;\" id=\"Img4\" title=\"" + m_refMsg.GetMessage("alt select admintree button text") + "\" src=\"images/application/navbar/icon_admin.gif\" align=\"absmiddle\"> " + m_refMsg.GetMessage("administrate button text"); } catch (Exception) { } finally { objStyle = null; } }
private void Page_Load(System.Object sender, System.EventArgs e) { StyleHelper objStyle; try { RegisterResources(); Utilities.ValidateUserLogin(); if ((m_refAPI.RequestInformationRef.IsMembershipUser > 0) || (m_refAPI.RequestInformationRef.UserId == 0)) { Response.Redirect("blank.htm", false); return; } objStyle = new StyleHelper(); StyleSheetJS.Text = objStyle.GetClientScript(); jsAppImgPath.Text = m_refAPI.AppImgPath; HelpButton.Text = objStyle.GetHelpButton("navtoolbar_aspx", ""); m_msgHelper = m_refAPI.EkMsgRef; } catch (Exception) { } finally { objStyle = null; } }
protected void Page_Init(object sender, EventArgs e) { ltrincremental.Text = this.Sites.EkMsgRef.GetMessage("js incremental crawl"); ltrincrementalRequest.Text = this.Sites.EkMsgRef.GetMessage("js incremental crawl request"); ltrFullC.Text = this.Sites.EkMsgRef.GetMessage("js full crawl"); ltrFullRequest.Text = this.Sites.EkMsgRef.GetMessage("js full crawl request"); if (HasPermission()) { _style = new StyleHelper(); _crawler = new SearchServerCrawler(); JS.RegisterJS(this, JS.ManagedScript.EktronStyleHelperJS); JS.RegisterJS(this, JS.ManagedScript.EktronJFunctJS); JS.RegisterJS(this, JS.ManagedScript.EktronJS); JS.RegisterJS(this, JS.ManagedScript.EktronWorkareaJS); JS.RegisterJS(this, JS.ManagedScript.EktronWorkareaHelperJS); JS.RegisterJS(this, JS.ManagedScript.EktronWorkareaContextMenusJS); Css.RegisterCss(this, Css.ManagedStyleSheet.EktronWorkareaCss); Css.RegisterCss(this, Css.ManagedStyleSheet.EktronWorkareaIeCss, Css.BrowserTarget.LessThanEqualToIE8); styleHelper.Text = _style.GetClientScript(); RenderToolbar(); RenderTitleBar(); if (!string.IsNullOrEmpty(Request.QueryString[ActionParameter])) { switch (Request.QueryString[ActionParameter].ToLower()) { case IncrementalCrawlAction: _crawler.StartIncrementalCrawl(false); Response.Redirect("Status.aspx"); break; case FullCrawlAction: _crawler.StartFullCrawl(); Response.Redirect("Status.aspx"); break; } } try { RenderState(); RenderSettings(); } catch (NullReferenceException) { Utilities.ShowError(Sites.EkMsgRef.GetMessage("msg search status connection error")); } } else { Response.Redirect(ContentAPI.Current.ApplicationPath + "Login.aspx", true); } }
private void Page_Load(System.Object sender, System.EventArgs e) { StyleHelper objStyle; try { m_MsgHelper = m_refAPI.EkMsgRef; objStyle = new StyleHelper(); StyleSheetJS = objStyle.GetClientScript(); jsAppImgPath.Text = m_refAPI.AppImgPath; Utilities.ValidateUserLogin(); } catch (Exception) { } finally { objStyle = null; } }
private void Page_Load(System.Object sender, System.EventArgs e) { StyleHelper shelper = new StyleHelper(); litStyleSheetJS.Text = shelper.GetClientScript(); Utilities.ValidateUserLogin(); if (!(Request.QueryString["action"] == null)) { if (Request.QueryString["action"] != "") { _PageAction = (string) (Ektron.Cms.Common.EkFunctions.HtmlEncode(Request.QueryString["action"].ToLower())); } } if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { _ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); _CommonApi.SetCookieValue("LastValidLanguageID", _ContentLanguage.ToString()); } else { if (_CommonApi.GetCookieValue("LastValidLanguageID") != "") { _ContentLanguage = Convert.ToInt32(_CommonApi.GetCookieValue("LastValidLanguageID")); } } } else { if (_CommonApi.GetCookieValue("LastValidLanguageID") != "") { _ContentLanguage = Convert.ToInt32(_CommonApi.GetCookieValue("LastValidLanguageID")); } } if (_ContentLanguage.ToString() == "CONTENT_LANGUAGES_UNDEFINED") { _CommonApi.ContentLanguage = Convert.ToInt32("ALL_CONTENT_LANGUAGES"); } else { _CommonApi.ContentLanguage = _ContentLanguage; } _EnableMultilingual = System.Convert.ToInt32(_CommonApi.EnableMultilingual); EmailHelper ehelp = new EmailHelper(); EmailArea.Text = ehelp.MakeEmailArea(); }
private void Page_Load(System.Object sender, System.EventArgs e) { //Put user code to initialize the page here string strResult = ""; string sZoom = ""; string sAppPath = ""; sAppPath = m_refContentApi.AppPath; string sSitePath = ""; sSitePath = m_refContentApi.SitePath; StyleHelper aSytleHelper = new StyleHelper(); StyleSheetJS.Text = "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + sSitePath + "default.css\" />" + "\r\n"; StyleSheetJS.Text = StyleSheetJS.Text + aSytleHelper.GetClientScript(); if (!(Request.QueryString["zoom"] == null)) { if (Request.QueryString["zoom"] != "1") { sZoom = (string) (Request.QueryString["zoom"].ToString()); } } if (Request.QueryString["display_type"] == null) { //display form block or report in IFRAME ReportForm.Visible = false; PollForm.Visible = true; if (sZoom != "") { PollForm.Style["zoom"] = sZoom; } } else { //post back from "inline" DisplayType "new window", originally in formresponse.aspx PollForm.Visible = false; ReportForm.Visible = true; if (sZoom != "") { ReportForm.Style["zoom"] = sZoom; } Collection cForm; string XmlData = ""; string DisplayType = ""; ArrayList arrResult = new ArrayList(); Hashtable hshQuestions = null; int llResponses; System.Xml.Xsl.XsltArgumentList objXsltArgs = new System.Xml.Xsl.XsltArgumentList(); Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; //Put user code to initialize the page here var ContentLanguage = m_refContentApi.ContentLanguage; var AppImgPath = m_refContentApi.AppImgPath; var FormId = Request.QueryString["id"]; DisplayType = Request.QueryString["display_type"]; if (Request.QueryString["LangType"] != "") { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID")); } } var EnableMultilingual = m_refContentApi.EnableMultilingual; m_refContentApi.ContentLanguage = ContentLanguage; var Security_info = m_refContentApi.LoadPermissions(Convert.ToInt64(FormId), "content", 0); var objMod = m_refContentApi.EkModuleRef; llResponses = Convert.ToInt32(m_refContentApi.EkModuleRef.GetFormSubmissionsByFormId(Convert.ToInt64(FormId))); cForm = objMod.GetFormById(Convert.ToInt64(FormId)); if ((Convert.ToString(FormId) != "") && (Convert.ToInt32(FormId) > 0)) { if ((((DisplayType) == Ektron.Cms.Common.EkEnumeration.CMSFormReportType.DataTable.ToString()) || ((DisplayType) == Ektron.Cms.Common.EkEnumeration.CMSFormReportType.Bar.ToString())) || ((DisplayType) == Ektron.Cms.Common.EkEnumeration.CMSFormReportType.Combined.ToString())) { arrResult = m_refContentApi.GetFormDataHistogramById(Convert.ToInt64(FormId)); hshQuestions = m_refContentApi.GetFormFieldQuestionsById(Convert.ToInt64(FormId)); XmlData = m_refContentApi.EkModuleRef.CreateHistogramFormDataXml(cForm, llResponses, arrResult, hshQuestions, ""); } else if ((DisplayType) == Ektron.Cms.Common.EkEnumeration.CMSFormReportType.Pie.ToString()) { bool showAxis = false; string ImageUrl; //ImageUrl = sAppPath & "chart.aspx?form_page=form_page&grpdisplay=" & DisplayType & "&responses=" & llResponses & "&showAxis=" & showAxis & "&fieldOptionNames=" & strFieldOptionNames & "&FieldNames=" & strFieldNames & "&FormValues=" & strFieldOptionValues ImageUrl = sAppPath + "chart.aspx?form_page=form_page&grpdisplay=" + DisplayType + "&responses=" + llResponses + "&showAxis=" + showAxis + "&formid=" + FormId; XmlData = m_refContentApi.EkModuleRef.CreateHistogramFormDataXml(cForm, llResponses, arrResult, hshQuestions, ImageUrl); } else { } } lblReport.Text = ""; objXsltArgs = new System.Xml.Xsl.XsltArgumentList(); objXsltArgs.AddParam("displayType", string.Empty, DisplayType); objXsltArgs.AddParam("appPath", string.Empty, sAppPath); try { strResult = m_refContentApi.EkModuleRef.InsertRefreshReportJS(""); strResult = strResult + Ektron.Cms.Common.EkFunctions.XSLTransform(null, null, true, false, objXsltArgs, true, null); } catch (Exception ex) { strResult = ex.Message; } lblReport.Text = strResult; } }
private void Page_Init(System.Object sender, System.EventArgs e) { m_refMsg = m_refContentApi.EkMsgRef; if (m_refContentApi.RequestInformationRef.IsMembershipUser == 1 || m_refContentApi.RequestInformationRef.UserId == 0) { Response.Redirect(m_refContentApi.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(m_refMsg.GetMessage("msg login cms user")), false); return; } this.ShowAjaxTreeJsValues(); this.SetEktronContentTemplateJsValues(); this.RegisterJs(); this.RegisterCss(); Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; if (m_refContentApi.GetCookieValue("user_id") == "0") { if (!(Request.QueryString["callerpage"] == null)) { Session["RedirectLnk"] = "Content.aspx?" + AntiXss.UrlEncode(Request.QueryString.ToString()); } Response.Redirect("login.aspx?fromLnkPg=1", false); return; } if (!string.IsNullOrEmpty(Request.QueryString["action"])) { PageAction = Convert.ToString(Request.QueryString["action"]).ToLower().Trim(); } if (!string.IsNullOrEmpty(Request.QueryString["membership"])) { m_strMembership = Convert.ToString(Request.QueryString["membership"]).ToLower().Trim(); } if (m_refContentApi.TreeModel == 1) { m_bAjaxTree = true; } Int32 lastValidLanguageID; string LastValidLanguage = m_refContentApi.GetCookieValue("LastValidLanguageID"); if (LastValidLanguage == null || !Int32.TryParse(LastValidLanguage, out lastValidLanguageID)) lastValidLanguageID = Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED; if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { if (Request.QueryString["LangType"] != null) Int32.TryParse(Request.QueryString["LangType"], out ContentLanguage); if (ContentLanguage != lastValidLanguageID) { m_bLangChange = true; } m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (lastValidLanguageID != Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { ContentLanguage = lastValidLanguageID; } } } else { if (lastValidLanguageID != Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { ContentLanguage = lastValidLanguageID; } } if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES; } else { m_refContentApi.ContentLanguage = ContentLanguage; } StyleHelper styleHelper = new StyleHelper(); ltrStyleSheetJs.Text = styleHelper.GetClientScript(); txtContentLanguage.Text = m_refContentApi.ContentLanguage.ToString(); txtDefaultContentLanguage.Text = m_refContentApi.DefaultContentLanguage.ToString(); txtEnableMultilingual.Text = m_refContentApi.EnableMultilingual.ToString(); switch (PageAction) { case "viewarchivecontentbycategory": case "viewcontentbycategory": UniqueLiteral.Text = "viewfolder"; m_viewfolder = (viewfolder)(LoadControl("controls/folder/viewfolder.ascx")); m_viewfolder.ID = "viewfolder"; if (m_bLangChange == true) { m_viewfolder.ResetPostData(); } DataHolder.Controls.Add(m_viewfolder); break; case "deletecontentbycategory": UniqueLiteral.Text = "deletecontentbycategory"; removefolderitem m_removefolderitem; m_removefolderitem = (removefolderitem)(LoadControl("controls/folder/removefolderitem.ascx")); m_removefolderitem.ID = "deletecontentbycategory"; DataHolder.Controls.Add(m_removefolderitem); break; case "movecontentbycategory": UniqueLiteral.Text = "movefolderitem"; movefolderitem m_movefolderitem; m_movefolderitem = (movefolderitem)(LoadControl("controls/folder/movefolderitem.ascx")); m_movefolderitem.ID = "movefolderitem"; DataHolder.Controls.Add(m_movefolderitem); break; case "selectpermissions": UniqueLiteral.Text = "permission"; selectpermissions m_selectpermissions; m_selectpermissions = (selectpermissions)(LoadControl("controls/permission/selectpermissions.ascx")); m_selectpermissions.ID = "permission"; DataHolder.Controls.Add(m_selectpermissions); break; } EmailHelper m_mail = new EmailHelper(); string strEmailArea; strEmailArea = m_mail.EmailJS(); strEmailArea += m_mail.MakeEmailArea(); ltrEmailAreaJs.Text = strEmailArea; if (PageAction.ToLower().ToString() != "viewcontentbycategory") { ShowDropUploader(false); } // resource text string tokens string closeDialogText = m_refMsg.GetMessage("close this dialog"); string cancelText = m_refMsg.GetMessage("btn cancel"); // assign resource text string values btnConfirmOk.Text = m_refMsg.GetMessage("lbl ok"); btnConfirmOk.NavigateUrl = "#" + m_refMsg.GetMessage("lbl ok"); btnConfirmCancel.Text = cancelText; btnConfirmCancel.NavigateUrl = "#" + cancelText; btnCloseSyncStatus.Text = m_refMsg.GetMessage("close title"); btnCloseSyncStatus.NavigateUrl = "#" + m_refMsg.GetMessage("close title"); btnStartSync.Text = m_refMsg.GetMessage("btn sync now"); btnCloseConfigDialog.Text = m_refMsg.GetMessage("close title"); closeDialogLink.Text = "<span class=\"ui-icon ui-icon-closethick\">" + m_refMsg.GetMessage("close title") + "</span>"; closeDialogLink.NavigateUrl = "#" + System.Text.RegularExpressions.Regex.Replace(m_refMsg.GetMessage("close title"), "\\s+", ""); closeDialogLink.ToolTip = closeDialogText; closeDialogLink2.Text = closeDialogLink.Text; closeDialogLink2.NavigateUrl = closeDialogLink.NavigateUrl; closeDialogLink2.ToolTip = closeDialogText; closeDialogLink3.Text = closeDialogLink.Text; closeDialogLink3.NavigateUrl = closeDialogLink.NavigateUrl; closeDialogLink3.ToolTip = closeDialogText; lblSyncStatus.Text = string.Format(m_refMsg.GetMessage("lbl sync status"), " <span class=\"statusHeaderProfileId\"></span>"); m_jsResources = (SyncResources)(LoadControl("sync/SyncResources.ascx")); m_jsResources.ID = "jsResources"; sync_jsResourcesPlaceholder.Controls.Add(m_jsResources); }
protected void BuildToolBar() { string helpScreenAlias = "salestrend"; System.Text.StringBuilder result = new System.Text.StringBuilder(); StyleHelper m_refStyle = new StyleHelper(); Ektron.Cms.ContentAPI m_refContentAPI = new ContentAPI(); Ektron.Cms.Common.EkMessageHelper m_refMsg = new EkMessageHelper(m_refContentAPI.RequestInformationRef); Utilities.ValidateUserLogin(); divTitleBar.InnerHtml = m_refStyle.GetTitleBar(m_refMsg.GetMessage("lbl sales trend")); //result.Append("<table cellspacing=\"0\"><tbody><tr><td>"); result.Append("<div style=\"height:22px\">"); result.Append(m_refStyle.GetHelpButton(helpScreenAlias, "center")); result.Append("</div>"); //result.Append("</td></tr></tbody></table>"); divToolBar.InnerHtml = result.ToString(); StyleSheetJS.Text = m_refStyle.GetClientScript(); }
private void Page_Load(System.Object sender, System.EventArgs e) { objStyle = new StyleHelper(); _SearchHelper = new SearchHelper(); gtMess = m_refContentApi.EkMsgRef; AppPath = siteRef.AppPath; AppImgPath = siteRef.AppImgPath; CurrentUserId = siteRef.UserId; EnableMultilingual = siteRef.EnableMultilingual; ltrStyleSheet.Text = objStyle.GetClientScript(); if (!String.IsNullOrEmpty(Request.QueryString["LangType"])) { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); siteRef.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else if (!String.IsNullOrEmpty(siteRef.GetCookieValue("LastValidLanguageID"))) { ContentLanguage = Convert.ToInt32(siteRef.GetCookieValue("LastValidLanguageID")); } RegisterResources(); SetServerJSVariables(); if (m_refContentApi.RequestInformationRef.IsMembershipUser == 1 || m_refContentApi.RequestInformationRef.UserId == 0 || ! m_refContentApi.EkUserRef.IsAllowed(m_refContentApi.UserId, 0, "users", "IsAdmin", 0)) { Response.Redirect(m_refContentApi.ApplicationPath + "Login.aspx", true); return; } StringBuilder sb = new StringBuilder(); action = Request.QueryString["action"]; if ("SubmitIntegratedFolder" == action || "UpdateIntegratedFolder" == action || action == "DeleteIntegratedFolder") { try { if (("SubmitIntegratedFolder" == action) || ("UpdateIntegratedFolder" == action)) { cIntegratedFolder = new IntegratedFolderData(); cIntegratedFolder.TypeId = System.Convert.ToInt32(Request.Form["integrated_id"]); cIntegratedFolder.DirectoryName = Request.Form["frm_directoryname"]; cIntegratedFolder.ExcludeFiles = Request.Form["frm_excludefiles"]; cIntegratedFolder.IncludeFiles = Request.Form["frm_includefiles"]; cIntegratedFolder.ExcludeDirs = Request.Form["frm_excludedirs"]; if (Strings.LCase(Request.Form["frm_recursive"]) == "on") { cIntegratedFolder.Recursive = true; } else { cIntegratedFolder.Recursive = false; } cIntegratedFolder.UserName = Request.Form["DomainUserName"]; cIntegratedFolder.Password = Request.Form["Password"]; if (Path.IsPathRooted(cIntegratedFolder.DirectoryName)) { cIntegratedFolder.AbsolutePath = cIntegratedFolder.DirectoryName; } else { cIntegratedFolder.AbsolutePath = (string) (EnsureTrailingSlash(HttpContext.Current.Request.MapPath((string) ("/" + cIntegratedFolder.DirectoryName))).Replace("/", "\\\\")); if (! Directory.Exists(cIntegratedFolder.AbsolutePath)) { cIntegratedFolder.AbsolutePath = (string) (EnsureTrailingSlash(HttpContext.Current.Request.MapPath((string) ("~/" + cIntegratedFolder.DirectoryName))).Replace("/", "\\\\")); } } if ("AddIntegratedFolder" == action) { m_refContentApi.EkContentRef.AddIntegratedFolder(cIntegratedFolder); } else { m_refContentApi.EkContentRef.UpdateIntegratedFolderByID(cIntegratedFolder); } if ("AddIntegratedFolder" == action) { Response.Redirect("integratedsearch.aspx?action=ViewAllIntegratedFolders"); } else { Response.Redirect((string) ("integratedsearch.aspx?action=ViewIntegratedFolder&id=" + Request.Form["integrated_id"])); } } else if (action == "DeleteIntegratedFolder") { m_refContentApi.EkContentRef.DeleteIntegratedFolder(System.Convert.ToInt64(Request.QueryString["id"])); Response.Redirect("integratedsearch.aspx?action=ViewAllIntegratedFolders"); } } catch (Exception ex) { DebugErrLit.Text = ex.Message; } } else { if (action == "ViewAllIntegratedFolders") { pnlViewAllIntegratedFolders.Visible = true; pnlAddEditViewIntegratedFolder.Visible = false; ContentObj = siteRef.EkContentRef; cIntegratedFolderArray = ContentObj.GetIntegratedFolders(); foreach (IntegratedFolderData cTempIntFolder in cIntegratedFolderArray) { sb.Append("<tr>").Append(Environment.NewLine); sb.Append(" <td>").Append(Environment.NewLine); sb.Append(" <a href=\"integratedsearch.aspx?action=ViewIntegratedFolder&id=").Append(cTempIntFolder.TypeId).Append("\" title=\"Click here to view Integrated Search Folder\">").Append(Environment.NewLine); sb.Append(cTempIntFolder.DirectoryName).Append(Environment.NewLine); sb.Append(" </a>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append(" <td>").Append(cTempIntFolder.TypeId).Append("</td>").Append(Environment.NewLine); sb.Append(" <td>").Append((cTempIntFolder.ExcludeFiles).Replace(",", ", ")).Append("</td>").Append(Environment.NewLine); sb.Append(" <td>").Append((cTempIntFolder.IncludeFiles).Replace(",", ", ")).Append("</td>").Append(Environment.NewLine); sb.Append(" <td>").Append((cTempIntFolder.ExcludeDirs).Replace(",", ", ")).Append("</td>").Append(Environment.NewLine); sb.Append(" <td>").Append(cTempIntFolder.UserName).Append("</td>").Append(Environment.NewLine); sb.Append("</tr>").Append(Environment.NewLine); } ltrFolderList.Text = sb.ToString(); } else if ("AddIntegratedFolder" == action || "EditIntegratedFolder" == action || "ViewIntegratedFolder" == action) { pnlViewAllIntegratedFolders.Visible = false; pnlAddEditViewIntegratedFolder.Visible = true; bool bNew = false; bool bEdit = false; ContentObj = siteRef.EkContentRef; bNew = ("AddIntegratedFolder" == action); bEdit = ("EditIntegratedFolder" == action); bView = ("ViewIntegratedFolder" == action); if (bNew) { id = 0; strTitleMsg = gtMess.GetMessage("alt Click here to add Integrated Search Folder"); cIntegratedFolder = new IntegratedFolderData(); } else { id = Convert.ToInt64(Request.QueryString["id"]); if (bEdit) { strTitleMsg = gtMess.GetMessage("alt Edit Integrated Search Folder"); } else if (bView) { strTitleMsg = gtMess.GetMessage("alt View Integrated Search Folder"); } cIntegratedFolder = ContentObj.GetIntegratedFolderByID(id); } if (bNew) { strAction = "SubmitIntegratedFolder"; } else { strAction = "UpdateIntegratedFolder"; strTitleMsg = strTitleMsg + " \"" + cIntegratedFolder.DirectoryName + "\""; } if (!bView) Ektron.Cms.API.JS.RegisterJS(this, m_refContentApi.ApplicationPath + "java/optiontransfer.js", "EktronOptionTransferJS"); //Toolbar sb = new StringBuilder(); if (bNew) { sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", "integratedsearch.aspx?action=ViewAllIntegratedFolders", gtMess.GetMessage("alt back button text"), gtMess.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/save.png", "#", gtMess.GetMessage("alt Click here to add this integrated search folder"), gtMess.GetMessage("btn save"), "Onclick=\"javascript:return SubmitForm('integratedform', 'VerifyIntegratedSearchForm()');\"", StyleHelper.SaveButtonCssClass, true)); } else if (bEdit) { sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", "integratedsearch.aspx?action=ViewIntegratedFolder&id=" + id + "", gtMess.GetMessage("alt back button text"), gtMess.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/save.png", "#", gtMess.GetMessage("alt Click here to updated this integrated search folder"), gtMess.GetMessage("btn update"), "Onclick=\"javascript:return SubmitForm('integratedform', 'VerifyIntegratedSearchForm()');\"", StyleHelper.SaveButtonCssClass, true)); } else if (bView) { sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", "integratedsearch.aspx?action=ViewAllIntegratedFolders", gtMess.GetMessage("alt back button text"), gtMess.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/contentEdit.png", "integratedsearch.aspx?action=EditIntegratedFolder&id=" + id + "", gtMess.GetMessage("alt Edit this integrated search folder"), gtMess.GetMessage("btn edit"), "", StyleHelper.EditButtonCssClass, true)); sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/delete.png", "integratedsearch.aspx?action=DeleteIntegratedFolder&id=" + id + "", gtMess.GetMessage("alt Delete this integrated search folder"), gtMess.GetMessage("btn delete"), "OnClick=\"return ConfirmDelete();\"", StyleHelper.DeleteButtonCssClass)); } sb.Append(StyleHelper.ActionBarDivider); sb.Append("<td>").Append(objStyle.GetHelpButton(action, "")).Append("</td>").Append(Environment.NewLine); ltrToolBar.Text = sb.ToString(); //PageHolder sb = new StringBuilder(); sb.Append("<table class=\"ektronForm\"> ").Append(Environment.NewLine); //tr sb.Append(" <tr>").Append(Environment.NewLine); sb.Append(" <td class=\"label\"><label for=\"DirectoryName\" title=\"Site Directory\">").Append(gtMess.GetMessage("lbl Site Directory")).Append("</label></td>").Append(Environment.NewLine); if (bView) { sb.Append(" <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.DirectoryName).Append("\" >").Append(cIntegratedFolder.DirectoryName).Append("</td>").Append(Environment.NewLine); } else { sb.Append(" <td class=\"value\">").Append(Environment.NewLine); sb.Append(" <input type=\"text\" title=\"Enter Directory Name here\" id=\"DirectoryName\" name=\"frm_directoryname\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode(cIntegratedFolder.DirectoryName)).Append("\" />").Append(Environment.NewLine); sb.Append(" <div class=\"ektronCaption\" title=\"Directory or virtual directory relative to site root\">").Append(gtMess.GetMessage("alt Directory or virtual directory relative to site root")).Append("</div>").Append(Environment.NewLine); if (bNew || bEdit) sb.Append(" <span class=\"ektronCaption\" style=\"color:Red\" title=\"Please make sure you create virtual directory first before adding the virtual directory name\">").Append(gtMess.GetMessage("alt the virtual directory name")).Append("</span>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); } sb.Append(" </tr>").Append(Environment.NewLine); if (!bNew) { sb.Append(" <tr>").Append(Environment.NewLine); sb.Append(" <td class=\"label\" title=\"ID\">").Append(gtMess.GetMessage("id label")).Append("</td>").Append(Environment.NewLine); sb.Append(" <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.TypeId).Append("\" >").Append(cIntegratedFolder.TypeId).Append("</td>").Append(Environment.NewLine); sb.Append(" </tr>").Append(Environment.NewLine); } //tr sb.Append(" <tr>").Append(Environment.NewLine); sb.Append(" <td class=\"label\"><label for=\"Recursive\" title=\"Recursive\">").Append(gtMess.GetMessage("lbl Recursive")).Append(":</label></td>").Append(Environment.NewLine); if (bView) sb.Append(" <td class=\"readOnlyValue\" title=\"").Append(_SearchHelper.BoolToYesNo(cIntegratedFolder.Recursive)).Append("\" >").Append(_SearchHelper.BoolToYesNo(cIntegratedFolder.Recursive)).Append("</td>").Append(Environment.NewLine); else sb.Append(" <td class=\"value\"><input type=\"checkbox\" title=\"Recursive Option\" id=\"Recursive\" name=\"frm_recursive\" ").Append(_SearchHelper.CheckedAttr(cIntegratedFolder.Recursive)).Append(" /></td>").Append(Environment.NewLine); sb.Append(" </tr>").Append(Environment.NewLine); //tr sb.Append(" <tr>").Append(Environment.NewLine); sb.Append(" <td class=\"label\"><label for=\"IncludeFiles\" title=\"Exclude Directories\">").Append(gtMess.GetMessage("lbl exclude directories")).Append("</label></td>").Append(Environment.NewLine); if (bView) { sb.Append(" <td class=\"readOnlyValue\" title=\"").Append((cIntegratedFolder.ExcludeDirs).Replace(",", ", ")).Append("\" >").Append((cIntegratedFolder.ExcludeDirs).Replace(",", ", ")).Append(":</td>").Append(Environment.NewLine); } else { sb.Append(" <td class=\"value\">").Append(Environment.NewLine); sb.Append(" <input type=\"text\" title=\"Enter Exclude Directories here\" id=\"ExcludeDirs\" name=\"frm_excludedirs\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode((cIntegratedFolder.ExcludeDirs).Replace(",", ", "))).Append("\"/>").Append(Environment.NewLine); sb.Append(" <div class=\"ektronCaption\" title=\"Sub directories not to include in search\" >").Append(gtMess.GetMessage("alt Sub directories not to include in search")).Append("</div>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); } sb.Append(" </tr>").Append(Environment.NewLine); //tr sb.Append(" <tr>").Append(Environment.NewLine); sb.Append(" <td class=\"label\"><label for=\"ExcludeFiles\" title=\"Exclude Extensions\">").Append(gtMess.GetMessage("lbl exclude extension")).Append(":</label></td>").Append(Environment.NewLine); if (bView) { sb.Append(" <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.ExcludeFiles).Append("\" >").Append(cIntegratedFolder.ExcludeFiles).Append("</td>").Append(Environment.NewLine); } else { sb.Append(" <td class=\"value\">").Append(Environment.NewLine); sb.Append(" <input type=\"text\" title=\"Enter Excluded File Extensions here\" id=\"ExcludeFiles\" name=\"frm_excludefiles\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode((cIntegratedFolder.ExcludeFiles).Replace(",", ", "))).Append("\" />").Append(Environment.NewLine); sb.Append(" <div class=\"ektronCaption\" title=\"Extensions not to include *.aspx,*.ascx\">").Append(gtMess.GetMessage("alt Extensions not to include *.aspx,*.ascx")).Append("</div>").Append(Environment.NewLine); sb.Append(" <td>").Append(Environment.NewLine); } sb.Append(" </tr>").Append(Environment.NewLine); //tr sb.Append(" <tr>").Append(Environment.NewLine); sb.Append(" <td class=\"label\"><label for=\"IncludeFiles\" title=\"Include Extensions\">").Append(gtMess.GetMessage("lbl include extensions")).Append(":</label></td>").Append(Environment.NewLine); if (bView) { sb.Append(" <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.IncludeFiles).Append("\">").Append(cIntegratedFolder.IncludeFiles).Append("</td>").Append(Environment.NewLine); } else { sb.Append(" <td class=\"value\">").Append(Environment.NewLine); sb.Append(" <input type=\"text\" title=\"Enter Included File Extensions here\" id=\"IncludeFiles\" name=\"frm_includefiles\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode((cIntegratedFolder.IncludeFiles).Replace(",", ", "))).Append("\"/>").Append(Environment.NewLine); sb.Append(" <div class=\"ektronCaption\" title=\"*.html,*.doc exclude extensions is ignored if include is specified\">").Append(gtMess.GetMessage("alt extensions is ignored if include is specified")).Append("</div>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); } sb.Append(" </tr>").Append(Environment.NewLine); //tr sb.Append(" <tr>").Append(Environment.NewLine); sb.Append(" <td class=\"label\"><label title=\"Domain/User Name\" for=\"DomainUserName\">").Append(gtMess.GetMessage("lbl domain username")).Append(":</label></td>").Append(Environment.NewLine); if (bView) { sb.Append(" <td class=\"readOnlyValue\">").Append(cIntegratedFolder.UserName).Append(Environment.NewLine); } else { sb.Append(" <td class=\"value\"><input type=\"text\" title=\"Enter Domain or User Name here\" id=\"DomainUserName\" name=\"DomainUserName\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode(cIntegratedFolder.UserName)).Append("\"/>").Append(Environment.NewLine); } sb.Append(" <div class=\"ektronCaption\" title=\"Specify domain or username\">").Append(gtMess.GetMessage("alt domain username")).Append("</div>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append(" </tr>").Append(Environment.NewLine); if (bNew) { string integratedFolderNames = ""; cIntegratedFolderArray = ContentObj.GetIntegratedFolders(); foreach (IntegratedFolderData cTempIntFolder in cIntegratedFolderArray) { if (cTempIntFolder.DirectoryName != null && cTempIntFolder.DirectoryName.Length > 0) { if (integratedFolderNames.Length > 0) { integratedFolderNames += ","; } integratedFolderNames += cTempIntFolder.DirectoryName; } } sb.Append("<input type=\"hidden\" id=\"integrated_fol_names\" value=\"").Append(integratedFolderNames).Append("\" />").Append(Environment.NewLine); } ektronPageHolder.InnerHtml = sb.ToString(); } } }
private void Page_Load(System.Object sender, System.EventArgs e) { RegisterResources(); //StyleSheetJS.Text = (new StyleHelper()()).GetClientScript; StyleHelper sh = new StyleHelper(); StyleSheetJS.Text = sh.GetClientScript(); m_refMsg = (new CommonApi()).EkMsgRef; if (!(Request.QueryString["action"] == null)) { if (Request.QueryString["action"] != "") { m_strPageAction = Request.QueryString["action"].ToLower(); } } if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); m_refApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (m_refApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID")); } } } else { if (m_refApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID")); } } try { Ektron.Cms.ContentAPI m_refContentApi = new Ektron.Cms.ContentAPI(); if (! Utilities.ValidateUserLogin()) { return; } if (! m_refContentApi.IsAdmin()) { Response.Redirect((string) ("reterror.aspx?info=" + m_refContentApi.EkMsgRef.GetMessage("msg login cms administrator")), false); return; } switch (m_strPageAction) { case "managecustompermissions": m_customroles = (customroles) (LoadControl("controls/roles/customroles.ascx")); DataHolder.Controls.Add(m_customroles); break; default: m_rolemembermgr = (rolemembermgr) (LoadControl("controls/roles/rolemembermgr.ascx")); m_rolemembermgr.ID = "role"; DataHolder.Controls.Add(m_rolemembermgr); break; } } catch (Exception ex) { Utilities.ShowError(ex.Message); } }
/// <summary> /// Registers scripts and styles with the page. /// </summary> private void PrepareResources() { _style = new StyleHelper(); JS.RegisterJS(this, JS.ManagedScript.EktronStyleHelperJS); JS.RegisterJS(this, JS.ManagedScript.EktronJFunctJS); JS.RegisterJS(this, JS.ManagedScript.EktronJS); JS.RegisterJS(this, JS.ManagedScript.EktronWorkareaJS); JS.RegisterJS(this, JS.ManagedScript.EktronWorkareaHelperJS); JS.RegisterJS(this, JS.ManagedScript.EktronWorkareaContextMenusJS); Css.RegisterCss(this, Css.ManagedStyleSheet.EktronWorkareaCss); Css.RegisterCss(this, Css.ManagedStyleSheet.EktronWorkareaIeCss, Css.BrowserTarget.LessThanEqualToIE8); styleHelper.Text = _style.GetClientScript(); }