private void button1_Click(object sender, EventArgs e) { Process[] p = Process.GetProcessesByName("AccessSecurity"); if (ListTool.HasElements(p)) { ApplicationAPI.Raise(p[0], true); } }
static void Main() { //如果程序已启动 if (!AppUnique.IsUnique("appppppppppp")) { //唤起已启动的程序窗口 ApplicationAPI.Raise(Process.GetCurrentProcess()); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
protected void Page_Load(object sender, EventArgs e) { ApplicationAPI AppUI = new ApplicationAPI(); MsgHelper = new EkMessageHelper(AppUI.RequestInformationRef); if (!string.IsNullOrEmpty(Request.QueryString["folderid"])) { long folderId = Convert.ToInt64(Request.QueryString["folderid"]); Hashtable cPerms = AppUI.EkSiteRef.GetPermissions(folderId, 0, "folder"); trPer.Visible = (m_refApi.IsAdmin() || IsCollectionMenuAdmin() || IsCollectionApprover() || (IsFolderAdmin(folderId))); if ((!IsCollectionMenuRoleMember()) && (!((cPerms.Contains("Collections") && Convert.ToBoolean(cPerms["Collections"]))))) { ErrorString = MsgHelper.GetMessage("com: user does not have permission"); divErrors.Visible = true; divMain.Visible = false; } cPerms = null; jsFolderId.Text = folderId.ToString(); divErrors.InnerHtml = ErrorString; if (!string.IsNullOrEmpty(Request.QueryString["back"])) { litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewCollectionReport", MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } else { litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewCollectionReport&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt: save collection text"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'nav\', \'VerifyCollectionForm()\');\"", StyleHelper.SaveButtonCssClass, true); } litAddCollectionTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("add collection title")); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("Add", "").ToString() + "</td>"; litGeneric.Text = MsgHelper.GetMessage("generic title label"); litTemplate.Text = MsgHelper.GetMessage("generic template label"); litLeave.Text = MsgHelper.GetMessage("collections: leave template empty"); litDesc.Text = MsgHelper.GetMessage("description label"); litInclude.Text = MsgHelper.GetMessage("generic include subfolders msg"); litApprove.Text = MsgHelper.GetMessage("lbl approval required"); AddCollection.Text = MsgHelper.GetMessage("add collection title"); litSitePath.Text = AppUI.SitePath; }
public string getContentTypeIconAspx(int ContentTypeID, Collection colContent) { ApplicationAPI AppUI = new ApplicationAPI(); string contentIcon = "<img src=\"" + AppUI.AppPath + "images/UI/Icons/contentHtml.png\" alt=\"Content\">"; string pageIcon = "<img src=\"" + AppUI.AppPath + "images/UI/Icons/layout.png\" alt=\"Content\">"; string formsIcon = "<img src=\"" + AppUI.AppPath + "images/UI/Icons/contentForm.png\" alt=\"Content\">"; string menuIcon = "<img src=\"" + AppUI.AppPath + "images/UI/Icons/menu.png\" alt=\"Content\">"; string libraryIcon = "<img src=\"" + AppUI.AppPath + "images/UI/Icons/book.png\" alt=\"Content\">"; string linkIcon = "<img src=\"" + AppUI.AppPath + "images/UI/Icons/link.png\" alt=\"Content\">"; string returnValue; if (ContentTypeID == 2) { returnValue = formsIcon + " "; } else if (ContentTypeID == 1) { if (Ektron.Cms.Common.EkFunctions.DoesKeyExist(colContent, "ContentSubType") && Convert.ToInt32(colContent["ContentSubType"]) == 1) { returnValue = pageIcon + " "; } else { returnValue = contentIcon + " "; } } else if (Ektron.Cms.Common.EkConstants.IsAssetContentType(ContentTypeID, false)) { if (colContent["ImageUrl"].ToString() != "") { returnValue = "<img src=\"" + colContent["ImageUrl"] + "\" alt=\"Content\"> "; } else { returnValue = libraryIcon + " "; } } else { returnValue = contentIcon + " "; } return returnValue; }
protected void btnCheck_Click(object sender, System.Web.UI.ImageClickEventArgs e) { if (txtURL.Text != "") { if (txtURL.Text.IndexOf("://") < 0) { txtURL.Text = "http://" + txtURL.Text; } EkThreads.URLCheckerClass.CheckURL = (string) txtURL.Text; EkThreads.URLCheckerClass.Debug = true; } ApplicationAPI m_AppRef = new ApplicationAPI(); EkThreads.URLCheckerClass.getInstance().Start(m_AppRef.RequestInformationRef, Request.Url.Authority); int i; for (i = 1; i <= 20; i++) { Thread.Sleep(100); // give thread some time to spin up if (EkThreads.URLCheckerClass.ThreadRunning) { break; } } Response.Redirect("BadLinkCheck.aspx", false); }
public Application(string windowTitle, int width, int height, bool fullscreen = false) { Instance = this; Graphics = new GraphicsDeviceManager(this); Graphics.GraphicsProfile = GraphicsProfile.HiDef; Input = new Input(); Content.RootDirectory = "Content"; LuaEnvManagement.RegisterTypes(); Window.Title = windowTitle; IsMouseVisible = true; API = new ApplicationAPI(this); if (fullscreen) { SetFullScreen(); } else { SetWindowed(width, height); } Scene.LaunchScene("default-scene"); }
protected void Page_Load(object sender, EventArgs e) { EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); Collection gtNavs = null; Collection gtNav = null; string ErrorString = ""; string FolderName = ""; ApplicationAPI AppUI = new ApplicationAPI(); long folderId = 0; string action = ""; if (!string.IsNullOrEmpty(Request.QueryString["folderId"])) { folderId = Convert.ToInt64(Request.QueryString["folderId"]); } if (!string.IsNullOrEmpty(Request.QueryString["action"])) { action = Request.QueryString["action"].ToString(); } string OrderBy = Request.QueryString["OrderBy"]; if (OrderBy == "") OrderBy = "title"; gtNavs = AppUI.EkContentRef.GetAllCollectionsInfo(folderId, "title"); if (ErrorString.Length == 0) { gtNav = AppUI.EkContentRef.GetFolderInfov2_0(folderId); if (ErrorString.Length == 0) FolderName = gtNav["FolderName"].ToString(); } if (ErrorString != "") { divError.Visible = true; } titlebarerror.InnerHtml = ErrorString; litErrorButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx", MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); litErrorHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton(action, "") + "<td>"; litCollectionTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("view collections title")) + " " + FolderName; litErrorViewCollectionTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("view collections title")); litGenericError.Text = MsgHelper.GetMessage("generic page error message"); litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "content.aspx?Action=ViewContentByCategory&id=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/add.png", "collections.aspx?action=Add&folderid=" + folderId, MsgHelper.GetMessage("alt: add new collection text"), MsgHelper.GetMessage("btn add"), "", StyleHelper.AddButtonCssClass, true); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("view_collections_in_folder", "") + "<td>"; if (gtNavs.Count > 0) { DataTable dtItems = new DataTable(); dtItems.Columns.Add("CollectionID"); dtItems.Columns.Add("DisplayLastEditDate"); dtItems.Columns.Add("CollectionTemplate"); dtItems.Columns.Add("CollectionTitle"); dtItems.Columns.Add("CollectionLink"); foreach (Collection gtNa in gtNavs) { string colAction = ""; if (Convert.ToBoolean(gtNa["ApprovalRequired"]) && gtNa["Status"].ToString().ToUpper() != "A") colAction = "&action=ViewStage"; else colAction = "&action=View"; DataRow dRow = dtItems.NewRow(); dRow["CollectionID"] = gtNa["CollectionID"].ToString(); dRow["DisplayLastEditDate"] = gtNa["DisplayLastEditDate"].ToString(); dRow["CollectionTemplate"] = gtNa["CollectionTemplate"].ToString(); dRow["CollectionTitle"] = gtNa["CollectionTitle"].ToString(); dRow["CollectionLink"] = "collections.aspx?folderid=" + folderId + colAction + "&nid=" + gtNa["CollectionID"].ToString(); dtItems.Rows.Add(dRow); } rptInfo.DataSource = dtItems; rptInfo.DataBind(); } gtNavs = null; aGenericTitle.HRef = "collections.aspx?folderid=" + folderId + "&OrderBy=navname"; aGenericTitle.InnerHtml = MsgHelper.GetMessage("generic Title"); aGenericId.HRef = "collections.aspx?folderid=" + folderId + "&OrderBy=CollectionID"; aGenericId.InnerHtml = MsgHelper.GetMessage("generic ID"); aGenericLast.HRef = "collections.aspx?folderid=" + folderId + "&OrderBy=date"; aGenericLast.InnerHtml = MsgHelper.GetMessage("generic Date Modified"); aGenericURL.HRef = "collections.aspx?folderid=" + folderId + "&OrderBy=CollectionTemplate"; aGenericURL.InnerHtml = MsgHelper.GetMessage("generic URL Link"); }
protected void Page_Load(object sender, EventArgs e) { EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); ApplicationAPI AppUI = new ApplicationAPI(); String MenuTitle = String.Empty; long nId = Convert.ToInt64(Request.QueryString["nid"]); Collection gtLinks = AppUI.EkContentRef.GetMenuByID(nId, 0, false); if (gtLinks.Count > 0) { MenuTitle = gtLinks["MenuTitle"].ToString(); gtLinks = (Collection)gtLinks["Items"]; } string action = string.Empty; long folderId = 0; if (string.IsNullOrEmpty(Request.QueryString["action"])) action = Request.QueryString["action"].ToString(); if (string.IsNullOrEmpty(Request.QueryString["folderId"])) folderId = Convert.ToInt64(Request.QueryString["folderId"]); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton(action, "") + "</td>"; litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("delete menu items title") + " \"" + MenuTitle + "\""); if (m_refApi.TreeModel == 1) litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + nId + "&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?Action=ViewMenu&nid=" + nId + "&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/delete.png", "#", MsgHelper.GetMessage("alt: delete menu items text"), MsgHelper.GetMessage("btn delete"), "onclick=\"return SubmitForm(\'selections\', \'GetIDs()\');\"", StyleHelper.DeleteButtonCssClass, true); Int32 lLoop = 0; string cLanguagesArray=""; DataTable dtItems = new DataTable(); dtItems.Columns.Add("ItemTitle"); dtItems.Columns.Add("ItemID"); dtItems.Columns.Add("ItemLink"); dtItems.Columns.Add("ItemType"); dtItems.Columns.Add("ID"); dtItems.Columns.Add("ContentLanguage"); dtItems.Columns.Add("lLoop"); foreach (Collection gtLink in gtLinks) { DataRow dRow = dtItems.NewRow(); dRow["ItemTitle"] = gtLink["ItemTitle"].ToString(); dRow["ItemID"] = gtLink["ItemID"].ToString(); dRow["ItemLink"] = gtLink["ItemLink"].ToString(); dRow["ItemType"] = gtLink["ItemType"].ToString(); dRow["ID"] = gtLink["ID"].ToString(); dRow["ContentLanguage"] = gtLink["ContentLanguage"].ToString(); dRow["lLoop"] = lLoop.ToString(); dtItems.Rows.Add(dRow); cLinkArray = cLinkArray + "," + gtLink["ID"] + "_" + gtLink["ItemType"]; cLanguagesArray=cLanguagesArray + "," + gtLink["ContentLanguage"] + "_" + gtLink["ItemType"]; fLinkArray = fLinkArray + "," + folderId; lLoop++; } rptItems.DataSource = dtItems; rptItems.DataBind(); if (cLinkArray.Length > 0) { cLinkArray = cLinkArray.Remove(0, 1); fLinkArray = fLinkArray.Remove(0, 1); cLanguagesArray = cLanguagesArray.Remove(0, 1); } CollectionID.Value = nId.ToString(); form1.Action = "collections.aspx?Action=doDeleteMenuItem&folderid=" + folderId + "&nid=" + nId; litURL.Text = MsgHelper.GetMessage("generic URL Link"); litID.Text = MsgHelper.GetMessage("generic ID"); litGenericTitle.Text = MsgHelper.GetMessage("generic Title"); aSelect.InnerHtml = MsgHelper.GetMessage("generic select all msg"); aClear.InnerHtml = MsgHelper.GetMessage("generic clear all msg"); }
protected void Page_Load(object sender, EventArgs e) { EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); ApplicationAPI AppUI = new ApplicationAPI(); nId = Convert.ToInt64(Request.QueryString["nid"]); CollectionID.Value = nId.ToString(); Collection gtLinks = new Collection(); string ErrorString = ""; string CollectionTitle = ""; if (!string.IsNullOrEmpty(Request.QueryString["LangType"])) { Int32 ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); if (ContentLanguage == ALL_CONTENT_LANGUAGES) { ContentLanguage = AppUI.DefaultContentLanguage; } AppUI.FilterByLanguage=ContentLanguage; } string checkout = ""; if (!string.IsNullOrEmpty(Request.QueryString["checkout"])) checkout = Request.QueryString["checkout"].ToString(); if (checkout == "true" || Request.QueryString["status"] == "o") gtLinks = AppUI.EkContentRef.GetEcmStageCollectionByID( nId, false, false, ref ErrorString, true, false, true); else gtLinks = AppUI.EkContentRef.GetEcmCollectionByID( nId, false, false, ref ErrorString, true, false, true); if (ErrorString == "") { if (gtLinks.Count > 0) { CollectionTitle = gtLinks["CollectionTitle"].ToString(); gtLinks = (Collection)gtLinks["Contents"]; } } if (ErrorString != "") { divError.Visible = true; } if (string.IsNullOrEmpty(Request.QueryString["folderId"])) { folderId = Convert.ToInt64(Request.QueryString["folderId"]); } divTitle.InnerHtml = ErrorString; DeleteCollectionError.InnerHtml = m_refStyle.GetTitleBar(MsgHelper.GetMessage("delete collection items title")); DeleteCollection.InnerHtml = m_refStyle.GetTitleBar(MsgHelper.GetMessage("delete collection items title")) + " " + CollectionTitle; litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("deletecollectionitems", "") + "</td>"; litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?Action=View&nid=" + nId + "&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/delete.png", "#", MsgHelper.GetMessage("alt: delete collection items text"), MsgHelper.GetMessage("btn delete"), "onclick=\"return SubmitForm(\'selections\', \'GetIDs()\');\"", StyleHelper.DeleteButtonCssClass, true); litGenericTitle.Text = MsgHelper.GetMessage("generic Title"); litGenericID.Text = MsgHelper.GetMessage("generic ID"); litGenericURL.Text = MsgHelper.GetMessage("generic URL Link"); Int32 lLoop = 0; string cLanguagesArray = ""; DataTable dtItems = new DataTable(); dtItems.Columns.Add("lLoop"); dtItems.Columns.Add("ContentLanguage"); dtItems.Columns.Add("ContentID"); dtItems.Columns.Add("ContentLinks"); dtItems.Columns.Add("ContentIcon"); foreach (Collection gtLink in gtLinks) { DataRow dRow = dtItems.NewRow(); dRow["lLoop"] = lLoop; dRow["ContentLanguage"] = gtLink["ContentLanguage"].ToString(); dRow["ContentID"] = gtLink["ContentID"].ToString(); dRow["ContentLinks"] = gtLink["ContentLinks"].ToString(); dRow["ContentIcon"] = getContentTypeIconAspx(Convert.ToInt32(gtLink["ContentType"]), gtLink) + gtLink["ContentTitle"].ToString(); dtItems.Rows.Add(dRow); cLinkArray = cLinkArray + "," + gtLink["ContentID"]; cLanguagesArray=cLanguagesArray + "," + gtLink["ContentLanguage"]; fLinkArray = fLinkArray + "," + folderId; lLoop = lLoop + 1; } rptItems.DataSource = dtItems; rptItems.DataBind(); if (cLinkArray.Length > 0) { cLinkArray = cLinkArray.Remove(0, 1); fLinkArray = fLinkArray.Remove(0, 1); cLanguagesArray = cLanguagesArray.Remove(0, 1); } }
protected void Page_Load(object sender, EventArgs e) { ContentAPI m_refContentApi = new ContentAPI(); EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); ApplicationAPI AppUI = new ApplicationAPI(); string action = ""; if (!string.IsNullOrEmpty(Request.QueryString["action"])) { action = Request.QueryString["action"].ToString(); } if (!string.IsNullOrEmpty(Request.QueryString["folderid"])) { folderId = Convert.ToInt64(Request.QueryString["folderid"]); Hashtable cPerms = AppUI.EkSiteRef.GetPermissions(folderId, 0, "folder"); nId = Convert.ToInt64(Request.QueryString["nid"]); EkContent gtObj = AppUI.EkContentRef; if (!string.IsNullOrEmpty(Request.QueryString["checkout"])) checkout = "&checkout=" + Request.QueryString["checkout"].ToString(); if (!string.IsNullOrEmpty(Request.QueryString["status"])) { if (Request.QueryString["status"].ToString().ToLower() == "o") checkout = checkout + "&status=o"; } string ErrorString = ""; if (ErrorString == "") { if (gtNavs.Count > 0) { string CollectionTitle = gtNavs["CollectionTitle"].ToString(); } } if (checkout != "") gtNavs = gtObj.GetEcmStageCollectionByID(nId, false, false, ref ErrorString, true, false, true); else gtNavs = gtObj.GetEcmCollectionByID(nId, false, false, ref ErrorString, true, false, true); divErrorString.InnerHtml = ErrorString; litEditColl.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("edit collection title")); litEditCollectionTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("edit collection title")); litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?Action=View&nid=" + nId + "&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt: update collection text"), MsgHelper.GetMessage("btn update"), "onclick=\"return SubmitForm(\'nav\', \'VerifyCollectionForm()\');\"", StyleHelper.SaveButtonCssClass, true); litSearch.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton(action, "") + "</td>"; litTitle.Text = MsgHelper.GetMessage("generic title label"); litIDLabel.Text = MsgHelper.GetMessage("id label"); litPath.Text = MsgHelper.GetMessage("lbl path") + ":"; litTemplate.Text = MsgHelper.GetMessage("generic template label"); litDesc.Text = MsgHelper.GetMessage("description label"); litSitePath.Text = AppUI.SitePath; litLeaveTemplate.Text = MsgHelper.GetMessage("collections: leave template empty"); litInclueSub.Text = MsgHelper.GetMessage("generic include subfolders msg"); litApproval.Text = MsgHelper.GetMessage("lbl approval required"); //// NEED SOME LOGIC HERE frm_nav_template.Value = gtNavs["CollectionTemplate"].ToString(); trID.InnerHtml = gtNavs["CollectionID"].ToString(); if (gtNavs.Contains("FolderPath") && null != gtNavs["FolderPath"] && !string.IsNullOrEmpty(gtNavs["FolderPath"].ToString())) { lblFolderPath.Text = gtNavs["FolderPath"].ToString(); trFolderPath.Visible = true; litFolderSelect.Text = (m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/folderopen.png", "#", MsgHelper.GetMessage("alt select folder"), MsgHelper.GetMessage("btn select folder"), "onclick=\"LoadFolderChildPage(\'\',\'" + AppUI.ContentLanguage.ToString() + "\');\"")).Replace("<td ", "<span ").Replace("</td>", "</span>"); } trApproval.Visible = (m_refApi.IsAdmin() || IsCollectionMenuAdmin() || IsCollectionApprover() || (IsFolderAdmin(Convert.ToInt64(gtNavs["FolderID"])))); } }
protected void Page_Load(object sender, EventArgs e) { EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); Collection gtNavs = new Collection(); ApplicationAPI AppUI = new ApplicationAPI(); FolderId = Convert.ToInt64(Request.QueryString["folderid"]); MenuId = Convert.ToInt64(Request.QueryString["nId"]); mpID = Convert.ToInt64(Request.QueryString["parentid"]); maID = Convert.ToInt64(Request.QueryString["ancestorid"]); if (!string.IsNullOrEmpty(Request.QueryString["LangType"])) { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); if (ContentLanguage == ALL_CONTENT_LANGUAGES) { ContentLanguage = AppUI.DefaultContentLanguage; } AppUI.FilterByLanguage = ContentLanguage; } else ContentLanguage = AppUI.ContentLanguage; if (!string.IsNullOrEmpty(Request.QueryString["noworkarea"]) && Request.QueryString["noworkarea"] == "1") { noWorkAreaString = "&noworkarea=1"; } if (MenuId != 0) { gtNavs = AppUI.EkContentRef.GetMenuByID(MenuId, false, false); } litAddMenuTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("Add Menu Item Title")); bool addHelpDivider = true; if (!(string.IsNullOrEmpty(Request.QueryString["back"]))) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["iframe"] == "true") litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true); else { if (Request.QueryString["noworkarea"] != "1") { if (m_refApi.TreeModel == 1) litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenu&nId=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } else { addHelpDivider = false; } } if (addHelpDivider) { litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("AddMenuItem", "") + "</td>"; } else { litHelp.Text = m_refStyle.GetHelpButton("AddMenuItem", ""); } if (!string.IsNullOrEmpty(Request.QueryString["noworkarea"]) && Request.QueryString["noworkarea"].ToString() == "1") { //ItemType.Visible = true; ContentBlock.Visible = true; } subMenu.Text = MsgHelper.GetMessage("Sub Menu Label"); Hyperlink.Text = MsgHelper.GetMessage("External Hyperlink label"); ContentBlock.Text = MsgHelper.GetMessage("lbl new content block"); Library.Text = MsgHelper.GetMessage("Library Asset label"); content.Text = MsgHelper.GetMessage("lbl content item"); if (!string.IsNullOrEmpty(Request.QueryString["back"])) frm_back.Value = Request.QueryString["back"].ToString(); }
private void Login(string username, string password, string domain) { //Hashtable user; ApplicationAPI appAPI = new ApplicationAPI(); // if the username and password are both blank, then return // whether or not the user is currently logged in, and if he // is, return the userid and uniqueid if (username == "" && password == "") { Response.Clear(); Response.Write("loginCallback(" + (appAPI.IsLoggedIn ? "'userid=" + appAPI.UserId + "&uniqueid=" + appAPI.UniqueId + "'" : "'0'") + ");"); //Response.End(); return; } // similarly, if the user is logged in, don't login again! if (appAPI.IsLoggedIn) { Response.Clear(); Response.Write("loginCallback('userid=" + appAPI.UserId + "&uniqueid=" + appAPI.UniqueId + "');"); //Response.End(); return; } // login and create the cookies... Ektron.Cms.CommonApi appUI = new Ektron.Cms.CommonApi(); System.Collections.Hashtable cUser = new Hashtable(); string serverName = Request.ServerVariables.Get("SERVER_NAME"); cUser = appUI.EkUserRef.logInUser(username, password, serverName, "", appUI.AuthProtocol, false, EkEnumeration.AutoAddUserTypes.Author); if (cUser.Count > 0) { //Response.Clear(); HttpCookie cookEcm; /*if (!(Request.Cookies.Get("ecm") == null)) { cookEcm = Request.Cookies.Get("ecm"); cookEcm.Expires = DateTime.Now; Response.Cookies.Add(cookEcm); }*/ cookEcm = new HttpCookie("ecm"); cookEcm.Values.Add("user_id", cUser["UserID"].ToString()); cookEcm.Values.Add("site_id", appUI.SitePath + "," + cUser["LoginNumber"].ToString()); cookEcm.Values.Add("userfullname", cUser["UserName"].ToString()); cookEcm.Values.Add("username", username); cookEcm.Values.Add("new_site", appUI.SitePath.ToString()); cookEcm.Values.Add("unique_id", cUser["LoginNumber"].ToString()); cookEcm.Values.Add("site_preview", "0"); cookEcm.Values.Add("langvalue", ""); System.Configuration.AppSettingsReader objConfigSettings = new System.Configuration.AppSettingsReader(); string i_mLangId = objConfigSettings.GetValue("ek_DefaultContentLanguage", typeof(string)).ToString(); cookEcm.Values.Add("DefaultLangauge", i_mLangId); cookEcm.Values.Add("NavLanguage", i_mLangId); cookEcm.Values.Add("SiteLanguage", i_mLangId); cookEcm.Values.Add("LastValidLanguageID", i_mLangId); cookEcm.Values.Add("UserCulture", i_mLangId); cookEcm.Expires = DateTime.Now.AddYears(1); bool encryptCookie = false; try { encryptCookie = Convert.ToBoolean(objConfigSettings.GetValue("ek_EnableCookieEncryption", typeof(bool))); } catch { } if (encryptCookie) Response.Cookies.Add(SecureCookie.Encode(cookEcm)); else Response.Cookies.Add(cookEcm); System.Web.HttpCookie cookieEktGUID; if (Request.Cookies.Get("EktGUID") == null) { //create GUID if it doesn't exist string strGUID = System.Guid.NewGuid().ToString(); cookieEktGUID = new HttpCookie("EktGUID", strGUID); cookieEktGUID.Path = "/"; cookieEktGUID.Expires = DateTime.Now.AddYears(1); Response.Cookies.Add(cookieEktGUID); Ektron.Cms.UserAPI m_refUserApi = new Ektron.Cms.UserAPI(); m_refUserApi.RequestInformationRef.ClientEktGUID = strGUID; } Response.Write("loginCallback('userid=" + cUser["UserID"].ToString() + "&uniqueid=" + cUser["LoginNumber"].ToString() + "');"); //Response.End(); } else { // if login failed, return 0 Response.Clear(); Response.Write("loginCallback(0)"); //Response.End(); } }
private void SetJavascriptStrings() { ApplicationAPI AppUI = new ApplicationAPI(); Hashtable objResult; objResult = AppUI.EkSiteRef.GetPermissions(0, 0, "folder"); litPerReadOnlyLib.Text = Strings.LCase(objResult["ReadOnlyLib"].ToString()); litLanguageId1.Text = AppUI.ContentLanguage.ToString(); litLanguageId2.Text = AppUI.ContentLanguage.ToString(); }
// Render the UI: public void ShowControls() { Literal1.Text = string.Empty; System.Text.StringBuilder result = new System.Text.StringBuilder(); CollectionListData[] gtNavs = null; EkContent gtObj = null; ApplicationAPI AppUI = new ApplicationAPI(); long caller_id = AppUI.RequestInformationRef.CallerId; AppUI.RequestInformationRef.CallerId = EkConstants.InternalAdmin; gtObj = AppUI.EkContentRef; AppUI.RequestInformationRef.CallerId = caller_id; result.Append(m_refStyle.GetClientScript() + "\r\n"); result.Append("<input type=HIDDEN value=\"true\" name=\"postback\" id=\"postback\"/>"); result.Append("<table width=\"100%\" class=\"ektronGrid\">" + "\r\n"); result.Append(" <tr>" + "\r\n"); result.Append(" <td class=\"ektronTitlebar forceTitlebar\">" + "\r\n"); if (_isMenu) { result.Append(" " + m_refMsg.GetMessage("lbl select menu") + "\r\n"); } else if (_isUser) { result.Append(" " + m_refMsg.GetMessage("lbl select user") + "\r\n"); } else { result.Append(" " + m_refMsg.GetMessage("lbl select collection") + "\r\n"); } result.Append(" </td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); if (_isUser) { result.Append(" <tr>" + "\r\n"); result.Append(" <td class=\"ektronToolbar forceToolbar\">" + "\r\n"); result.Append(" <table>" + "\r\n"); result.Append(" <tr>" + "\r\n"); result.Append(" <td> </td>" + "\r\n"); result.Append("<td class=\"label\"> " + m_refMsg.GetMessage("btn search") + ":<input type=text class=\"ektronTextMedium\" id=txtSearch name=txtSearch value=\"" + m_strKeyWords + "\" onkeydown=\"CheckForReturn(event)\">"); result.Append("<select id=searchlist name=searchlist>"); result.Append("<option value=-1" + IsSelected("-1") + ">All</option>"); result.Append("<option value=\"last_name\"" + IsSelected("last_name") + ">" + m_refMsg.GetMessage("generic lastname") + "</option>"); result.Append("<option value=\"first_name\"" + IsSelected("first_name") + ">" + m_refMsg.GetMessage("generic firstname") + "</option>"); result.Append("<option value=\"display_name\"" + IsSelected("display_name") + ">" + m_refMsg.GetMessage("display name label") + "</option>"); result.Append("</select><input type=button value=" + m_refMsg.GetMessage("btn search") + " id=btnSearch name=btnSearch onclick=\"searchuser();\" title=\"Search Users\"></td>"); result.Append(" </tr>" + "\r\n"); result.Append(" </table>" + "\r\n"); result.Append(" </td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); } result.Append("</table>" + "\r\n"); if (_isMenu) { PageRequestData req = new PageRequestData(); req.PageSize = m_refContentApi.RequestInformationRef.PagingSize; req.CurrentPage = _currentPageNumber; string searchText = string.Empty; caller_id = AppUI.RequestInformationRef.CallerId; AppUI.RequestInformationRef.CallerId = EkConstants.InternalAdmin; Collection menu_list = AppUI.EkContentRef.GetMenuReport(searchText, ref req); AppUI.RequestInformationRef.CallerId = caller_id; ConfigurePaging(req.TotalPages); result.Append("<table width=\"100%\" class=\"ektronGrid\">" + "\r\n"); result.Append(" <tr>" + "\r\n"); result.Append(" <td class=\"title-header\" width=\"30%\">" + m_refMsg.GetMessage("generic title") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\" width=\"5%\">" + m_refMsg.GetMessage("generic id") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\">" + m_refMsg.GetMessage("generic description") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\">" + m_refMsg.GetMessage("generic language") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\">" + m_refMsg.GetMessage("generic path") + "</td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); if (menu_list != null && menu_list.Count > 0) { string strBoldStart = ""; string strBoldEnd = ""; string title = ""; foreach (Collection temp_cList in menu_list) { title = Server.HtmlDecode(temp_cList["MenuTitle"].ToString()); if (m_nId == Convert.ToInt64(temp_cList["MenuID"])) { strBoldStart = "<b>"; strBoldEnd = "</b>"; } else { strBoldStart = ""; strBoldEnd = ""; } result.Append(" <tr> " + "\r\n"); result.Append(" <td>" + strBoldStart); result.Append(" <a href=\"#\" onclick=\"UpdateFormData(\'" + temp_cList["MenuID"]); result.Append("\', \'" + title.Replace("\'", "\\\'") + "\', \'" + m_nMetadataFormTagId + "\');return false;\">"); result.Append(title + "</a>"); result.Append(strBoldEnd + "</td> " + "\r\n"); result.Append(" <td>" + strBoldStart + temp_cList["MenuID"] + strBoldEnd + "</td>" + "\r\n"); result.Append(" <td>" + strBoldStart + temp_cList["MenuDescription"] + strBoldEnd + "</td>" + "\r\n"); result.Append(" <td>" + strBoldStart + temp_cList["ContentLanguage"] + strBoldEnd + "</td>" + "\r\n"); result.Append(" <td>" + strBoldStart + temp_cList["Path"] + strBoldEnd + "</td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); } } result.Append("</table>" + "\r\n"); Literal1.Text += result.ToString(); result = null; gtObj = null; menu_list = null; } else if (_isUser) { Ektron.Cms.API.User.User refUserApi = new Ektron.Cms.API.User.User(); UserData[] user_list; UserRequestData req = new UserRequestData(); int idx; string dispName; req.Type = -1; // Assigning -1 to retrieve all users in the system req.SearchText = m_strSearchText; req.PageSize = m_refContentApi.RequestInformationRef.PagingSize; // unlimited. req.CurrentPage = _currentPageNumber; user_list = refUserApi.GetAllUsers(ref req); ConfigurePaging(req.TotalPages); result.Append("<table width=\"100%\" class=\"ektronGrid forceMarginTop40\">" + "\r\n"); result.Append(" <tr>" + "\r\n"); result.Append(" <td class=\"title-header\" width=\"5%\">" + m_refMsg.GetMessage("generic id") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\" >" + m_refMsg.GetMessage("display name label") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\" >" + m_refMsg.GetMessage("lbl first name") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\" >" + m_refMsg.GetMessage("lbl last name") + "</td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); if (user_list != null) { for (idx = 0; idx <= user_list.Length - 1; idx++) { if (999999999 == user_list[idx].Id) { continue; } dispName = (string) ((0 < user_list[idx].DisplayName.Length) ? (user_list[idx].DisplayName) : (user_list[idx].FirstName)); result.Append(" <tr> " + "\r\n"); result.Append(" <td>" + user_list[idx].Id + "</td>" + "\r\n"); result.Append(" <td>"); result.Append(" <a href=\"#\" onclick=\"UpdateFormData(\'" + user_list[idx].Id); result.Append("\', \'" + dispName.Replace("\'", "\\\'") + "\', \'" + m_nMetadataFormTagId + "\');return false;\">"); result.Append(dispName + "</a>"); result.Append("</td> " + "\r\n"); result.Append(" <td>" + user_list[idx].FirstName + "</td>" + "\r\n"); result.Append(" <td>" + user_list[idx].LastName + "</td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); } } result.Append("</table>" + "\r\n"); Literal1.Text += result.ToString(); result = null; refUserApi = null; } else { // collections: result.Append("<table width=\"100%\" class=\"ektronGrid forceMarginTop40\">" + "\r\n"); result.Append(" <tr>" + "\r\n"); result.Append(" <td class=\"title-header\" width=\"30%\">" + m_refMsg.GetMessage("generic title") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\" width=\"5%\">" + m_refMsg.GetMessage("generic id") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\">" + m_refMsg.GetMessage("generic description") + "</td>" + "\r\n"); result.Append(" <td class=\"title-header\">" + m_refMsg.GetMessage("generic path") + "</td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); PageRequestData req = new PageRequestData(); req.PageSize = m_refContentApi.RequestInformationRef.PagingSize; req.CurrentPage = _currentPageNumber; string searchText = string.Empty; gtNavs = gtObj.GetCollectionList(searchText, ref req); ConfigurePaging(req.TotalPages); if (gtNavs != null && gtNavs.Length > 0) { int count = 0; string strBoldStart = ""; string strBoldEnd = ""; string title = ""; for (count = 0; count <= gtNavs.Length - 1; count++) { title = ""; title = Server.HtmlDecode(gtNavs[count].Title.ToString()); if (m_nId == gtNavs[count].Id) { strBoldStart = "<b>"; strBoldEnd = "</b>"; } else { strBoldStart = ""; strBoldEnd = ""; } result.Append(" <tr> " + "\r\n"); result.Append(" <td>" + strBoldStart); result.Append(" <a href=\"#\" onclick=\"UpdateFormData(\'" + gtNavs[count].Id); result.Append("\', \'" + title.Replace("\'", "\\\'") + "\', \'" + m_nMetadataFormTagId + "\');return false;\">"); result.Append(title + "</a>"); result.Append(strBoldEnd + "</td> " + "\r\n"); result.Append(" <td>" + strBoldStart + gtNavs[count].Id + strBoldEnd + "</td>" + "\r\n"); result.Append(" <td>" + strBoldStart + gtNavs[count].Description + strBoldEnd + "</td>" + "\r\n"); result.Append(" <td>" + strBoldStart + gtNavs[count].FolderPath + strBoldEnd + "</td>" + "\r\n"); result.Append(" </tr>" + "\r\n"); } gtObj = null; gtNavs = null; } result.Append("</table>" + "\r\n"); Literal1.Text += result.ToString(); result = null; } }
protected void Page_Load(object sender, EventArgs e) { Collection gtLink = new Collection(); EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); nId = Convert.ToInt64(Request.QueryString["nid"]); ApplicationAPI AppUI = new ApplicationAPI(); ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); if (ContentLanguage == ALL_CONTENT_LANGUAGES) { ContentLanguage = AppUI.DefaultContentLanguage; } AppUI.FilterByLanguage=ContentLanguage; if (!string.IsNullOrEmpty(Request.QueryString["checkout"])) checkout = "&checkout=" + Request.QueryString["checkout"].ToString(); Collection gtLinks = new Collection(); string ErrorString = ""; if (checkout != "") gtLinks = AppUI.EkContentRef.GetEcmStageCollectionByID(nId, false, false, ref ErrorString, true, false, true); else { if (string.IsNullOrEmpty(Request.QueryString["status"]) && Request.QueryString["status"] == "o") gtLinks = AppUI.EkContentRef.GetEcmStageCollectionByID(nId, false, false, ref ErrorString,true, false, true); else gtLinks = AppUI.EkContentRef.GetEcmCollectionByID(nId, false, false, ref ErrorString,true, false, true); } if (!string.IsNullOrEmpty(Request.QueryString["status"])) { if (Request.QueryString["status"].ToString().ToLower() == "o") bAction = "&status=o"; } else { if (Convert.ToBoolean(gtLinks["ApprovalRequired"]) == true && gtLinks["Status"].ToString().ToUpper() == "O") bAction = "&status=o"; } string CollectionTitle = ""; if (ErrorString == "") { if (gtLinks.Count > 0) { CollectionTitle = gtLinks["CollectionTitle"].ToString(); gtLink = (Collection)gtLinks["Contents"]; } } OrderList.Size =(gtLinks.Count < 20 ? gtLinks.Count : 20); reOrderList = ""; foreach (Collection gtNav in gtLink) { if (reOrderList.Length > 0) reOrderList = reOrderList + "," + gtNav["ContentID"] + "|" + gtNav["ContentLanguage"]; else reOrderList = gtNav["ContentID"] + "|" + gtNav["ContentLanguage"]; OrderList.Items.Add(new ListItem(Server.HtmlDecode(gtNav["ContentTitle"].ToString()), gtNav["ContentID"] + "|" + gtNav["ContentLanguage"])); } if (gtLinks.Count > 0) OrderList.SelectedIndex = 0; long folderId = 0; if (string.IsNullOrEmpty(Request.QueryString["folderId"])) { folderId = Convert.ToInt64(Request.QueryString["folderId"]); } reOrderList = ""; if (ErrorString != "") { divError.InnerHtml = ErrorString; divErrors.Visible = true; } litReOrder.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("reorder collection title")); litReOrderTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("reorder collection title") + " \"" + CollectionTitle + "\""); litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?Action=View&nid=" + nId + "&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt: update collection order text"), MsgHelper.GetMessage("btn update"), "onclick=\"return SubmitForm(\'link_order\', \'\');\"", StyleHelper.SaveButtonCssClass, true); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("ReOrderLinks", "") + "</td>"; frm_folder_id.Value = folderId.ToString(); Up.Src = AppUI.AppPath + "images/UI/Icons/arrowHeadUp.png"; Up.Alt = MsgHelper.GetMessage("move selection up msg"); Down.Src = AppUI.AppPath + "images/UI/Icons/arrowHeadDown.png"; Down.Alt = MsgHelper.GetMessage("move selection down msg"); }
protected void Page_Load(object sender, EventArgs e) { MsgHelper = new EkMessageHelper(ContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); Collection gtNavs = new Collection(); string action = ""; string checkout = ""; string ErrorString = ""; string CollectionTitle = ""; ApplicationAPI AppUI = new ApplicationAPI(); Int32 ContentLanguage = 0; if (Request.QueryString["LangType"] != null) { if (!string.IsNullOrEmpty(Request.QueryString["LangType"])) { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); if (ContentLanguage == 0) ContentLanguage = AppUI.DefaultContentLanguage; ContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (!string.IsNullOrEmpty(ContentApi.GetCookieValue("LastValidLanguageID"))) { ContentLanguage = Convert.ToInt32(ContentApi.GetCookieValue("LastValidLanguageID")); } } } else { if (!string.IsNullOrEmpty(ContentApi.GetCookieValue("LastValidLanguageID"))) { ContentLanguage = Convert.ToInt32(ContentApi.GetCookieValue("LastValidLanguageID")); if (ContentLanguage == 0) { ContentLanguage = AppUI.DefaultContentLanguage; ContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } } } AppUI.FilterByLanguage = ContentLanguage; long nId = Convert.ToInt64(Request.QueryString["nid"]); if (!string.IsNullOrEmpty(Request.QueryString["action"])) action = Request.QueryString["action"]; if (!string.IsNullOrEmpty(Request.QueryString["bpage"]) | !string.IsNullOrEmpty(Request.QueryString["treeViewId"])) bpage = "&bpage=reports"; if (action.ToString().ToLower() == "viewstage") gtNavs = AppUI.EkContentRef.GetEcmStageCollectionByID(nId, false, false, ref ErrorString, true, false, false); else { gtNavs = AppUI.EkContentRef.GetEcmCollectionByID(nId, false, false, ref ErrorString, true, false, false); checkout = ""; } if (Convert.ToBoolean(gtNavs["ApprovalRequired"]) == true && (((string)gtNavs["Status"] == "A") || ((string)gtNavs["Status"] == "S"))) checkout = "&checkout=true"; if (Convert.ToBoolean(gtNavs["ApprovalRequired"]) == true && (string)gtNavs["Status"] == "O") checkout = checkout + "&status=o"; if (string.IsNullOrEmpty(Request.QueryString["folderid"])) { _folderId = Convert.ToInt64(gtNavs["FolderID"]); report = true; } else { _folderId = Convert.ToInt64(Request.QueryString["folderid"]); } if (ErrorString == "") { if (gtNavs.Count > 0) CollectionTitle = gtNavs["CollectionTitle"].ToString(); } if (ErrorString != "") { divError.InnerHtml = ErrorString; } // Toolbar if (Request.QueryString["bpage"] == "reports" || _folderId == 0 || report) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewCollectionReport", MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?folderid=" + _folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); bool primaryStyleApplied = false; if (action.ToString().ToLower() == "viewstage") { litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/contentViewPublished.png", "collections.aspx?action=View&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("btn view publish"), MsgHelper.GetMessage("btn view publish"), "", StyleHelper.ViewPublishedButtonCssClass, !primaryStyleApplied); primaryStyleApplied = true; if ((string)gtNavs["Status"] == "S") { if (IsCollectionApprover) { litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/contentPublish.png", "collections.aspx?action=doPublishCol&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("generic Publish"), MsgHelper.GetMessage("generic Publish"), ""); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/ui/icons/approvalDenyItem.png", "collections.aspx?action=doDeclineApprCol&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("lbl decline"), MsgHelper.GetMessage("lbl decline"), ""); } } else if ((string)gtNavs["Status"] == "M") { if (CanDoCollections) { litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/contentPublish.png", "collections.aspx?action=doDelete&nId=" + nId + "&folderid=" + _folderId + checkout + bpage, MsgHelper.GetMessage("alt: delete collection text"), MsgHelper.GetMessage("btn delete"), "onclick=\"return ConfirmNavDelete();\""); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/ui/icons/approvalDenyItem.png", "collections.aspx?action=doDeclineDelCol&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("lbl decline"), MsgHelper.GetMessage("lbl decline"), ""); } } else { if (IsCollectionApprover) litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/contentPublish.png", "collections.aspx?action=doPublishCol&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("generic Publish"), MsgHelper.GetMessage("generic Publish"), ""); else litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/approvalSubmitFor.png", "collections.aspx?action=doSubmitCol&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("generic Submit"), MsgHelper.GetMessage("generic Submit"), ""); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/contentRestore.png", "collections.aspx?action=doUndoCheckoutCol&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("generic Undocheckout"), MsgHelper.GetMessage("generic Undocheckout"), ""); } } else { if ((string)gtNavs["Status"] != "A") { litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/preview.png", "collections.aspx?action=ViewStage&LangType=" + ContentLanguage + "&nid=" + nId + "&folderid=" + _folderId, MsgHelper.GetMessage("btn view stage"), MsgHelper.GetMessage("btn view stage"), "", StyleHelper.ViewStagedButtonCssClass, !primaryStyleApplied); primaryStyleApplied = true; } } string enableQDOparam = null; if (gtNavs["EnableReplication"].ToString().Length == 1) enableQDOparam = "&qdo=1"; litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/contentAdd.png", "collections.aspx?LangType=" + ContentLanguage + "&action=AddLink&nid=" + nId + "&folderid=" + _folderId + checkout + enableQDOparam, MsgHelper.GetMessage("alt: add collection items text"), MsgHelper.GetMessage("add collection items"), "", StyleHelper.AddButtonCssClass, !primaryStyleApplied); primaryStyleApplied = true; if (((Collection)gtNavs["Contents"]).Count > 0) { litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/remove.png", "collections.aspx?LangType=" + ContentLanguage + "&action=DeleteLink&nid=" + nId + "&folderid=" + _folderId + checkout, MsgHelper.GetMessage("alt: remove collection items text"), MsgHelper.GetMessage("remove collection items"), "", StyleHelper.RemoveButtonCssClass); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/arrowUpDown.png", "collections.aspx?LangType=" + ContentLanguage + "&action=ReOrderLinks&nid=" + nId + "&folderid=" + _folderId + checkout, MsgHelper.GetMessage("alt: reorder collection text"), MsgHelper.GetMessage("btn reorder"), "", StyleHelper.ReOrderButtonCssClass); } if ((string)gtNavs["Status"] != "M") { if (CanDoCollections) { if (string.IsNullOrEmpty(bpage) && !string.IsNullOrEmpty(Request.QueryString["folderid"]) && Request.QueryString["folderid"] == "0") { bpage = "&bpage=reports"; } litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/delete.png", "collections.aspx?action=doDelete&nId=" + nId + "&folderid=" + _folderId + checkout + bpage, MsgHelper.GetMessage("alt: delete collection text"), MsgHelper.GetMessage("btn delete"), "onclick=\"return ConfirmNavDelete();\"", StyleHelper.DeleteButtonCssClass); } else litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/delete.png", "collections.aspx?action=doSubmitDelCol&nId=" + nId + "&folderid=" + _folderId + checkout, MsgHelper.GetMessage("alt: delete collection text"), MsgHelper.GetMessage("btn delete"), "onclick=\"return ConfirmNavDelete();\"", StyleHelper.DeleteButtonCssClass); } litButtons.Text += StyleHelper.ActionBarDivider; if (action == "ViewStage") litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/properties.png", "collections.aspx?LangType=" + ContentLanguage + "&action=ViewStageAttributes&nid=" + nId + "&folderid=" + _folderId + checkout + enableQDOparam, MsgHelper.GetMessage("alt collection properties button text"), MsgHelper.GetMessage("properties text"), "", StyleHelper.ViewPropertiesButtonCssClass); else litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/properties.png", "collections.aspx?LangType=" + ContentLanguage + "&action=ViewAttributes&nid=" + nId + "&folderid=" + _folderId + enableQDOparam, MsgHelper.GetMessage("alt collection properties button text"), MsgHelper.GetMessage("properties text"), "", StyleHelper.ViewPropertiesButtonCssClass); if (((string)gtNavs["Status"] == "A") && (Convert.ToInt32(gtNavs["EnableReplication"]) == 1)) { litButtons.Text += StyleHelper.ActionBarDivider; litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/translation.png", "DynReplication.aspx?collid=" + nId, MsgHelper.GetMessage("alt quickdeploy collection button text"), MsgHelper.GetMessage("alt quickdeploy collection button text"), "", StyleHelper.TranslationButtonCssClass); } litViewCollection.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("view collection title") + " \"" + CollectionTitle + "\""); litCollItems.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("ViewCollectionItems", "") + "</td>"; string genericView = MsgHelper.GetMessage("generic View"); Collection gtLinks = (Collection)gtNavs["Contents"]; DataTable dtCollection = new DataTable(); dtCollection.Columns.Add("HTML"); dtCollection.Columns.Add("ContentLanguage"); dtCollection.Columns.Add("ContentID"); dtCollection.Columns.Add("ContentLinks"); foreach (Collection gtLink in gtLinks) { DataRow dRow = dtCollection.NewRow(); String backPage = "Action=View&nid=" + nId + "&folderid=" + _folderId; String contentUrl = "content.aspx?action=View&LangType=" + gtLink["ContentLanguage"].ToString() + "&id=" + gtLink["ContentID"] + "&callerpage=collections.aspx&origurl=" + EkFunctions.UrlEncode(backPage); String contentTitle = genericView + " " + gtLink["ContentTitle"].ToString().Replace("'", "`"); String iconurl = ""; try { iconurl = gtLink["ImageUrl"].ToString(); } catch { // ignore errors if we try getting imageurl on regular content } ContentApi.ContentLanguage = ContentLanguage; string dmsmenuhtml = ContentApi.GetDmsContextMenuHTML(Convert.ToInt64(gtLink["ContentID"]), Convert.ToInt64(gtLink["ContentLanguage"]), Convert.ToInt64(gtLink["ContentType"]), Convert.ToInt64(gtLink["ContentSubtype"]), gtLink["ContentTitle"].ToString(), MsgHelper.GetMessage("generic Title") + " " + gtLink["ContentTitle"], contentUrl, "", iconurl); dRow["HTML"] = dmsmenuhtml; dRow["ContentLanguage"] = gtLink["ContentLanguage"].ToString(); dRow["ContentID"] = gtLink["ContentID"].ToString(); dRow["ContentLinks"] = gtLink["ContentLinks"].ToString(); dtCollection.Rows.Add(dRow); } rptColl.DataSource = dtCollection; rptColl.DataBind(); if (ContentApi.EnableMultilingual == 1) { litEnableMult.Text = StyleHelper.ActionBarDivider; litViewLang.Text = MsgHelper.GetMessage("view language") + LangDD(false, ""); } gtNavs = null; if ((Request.QueryString["rf"] != null && Request.QueryString["rf"] == "1") || (Request.QueryString["reloadtrees"] != null && Request.QueryString["reloadtrees"] == "coll")) { ReloadClientScript(""); litRefreshCollAccordion.Text = "<script language=\"javascript\">" + ("\r\n" + "top.refreshCollectionAccordion(") + ContentLanguage + ");" + ("\r\n" + "</script>") + "\r\n"; } }
protected void Page_Load(object sender, EventArgs e) { EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); string MenuTitle = ""; ApplicationAPI AppUI = new ApplicationAPI(); nId = Convert.ToInt64(Request.QueryString["nid"]); Collection gtLinks = AppUI.EkContentRef.GetMenuByID(nId, 0, false); if (gtLinks.Count > 0) { MenuTitle = gtLinks["MenuTitle"].ToString(); gtLinks = (Collection)gtLinks["Items"]; } long folderId = 0; if (!string.IsNullOrEmpty(Request.QueryString["folderId"])) folderId = Convert.ToInt64(Request.QueryString["folderId"]); string action = ""; if (!string.IsNullOrEmpty(Request.QueryString["action"])) action = Request.QueryString["action"].ToString(); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton(action, "") + "</td>"; litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("reorder menu item title") + " \"" + MenuTitle + "\""); if (string.IsNullOrEmpty(Request.QueryString["back"])) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["iframe"] == "true") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true); else { if (m_refApi.TreeModel == 1) { string treeViewIdParam = ""; if (!string.IsNullOrEmpty(Request.QueryString["treeViewId"])) treeViewIdParam = "&treeViewId=" + Request.QueryString["treeViewId"].ToString(); litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menu.aspx?Action=viewcontent&menuid=" + nId + "&folderid=" + folderId + treeViewIdParam, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?Action=ViewMenu&nid=" + nId + "&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt: update menu order text"), MsgHelper.GetMessage("btn update"), "onclick=\"return SubmitForm(\'link_order\', \'true\');\"", StyleHelper.SaveButtonCssClass, true); if (gtLinks.Count < 20) OrderList.Size = gtLinks.Count; else OrderList.Size = 20; reOrderList = ""; foreach (Collection gtNav in gtLinks) { if (reOrderList.Length > 0) reOrderList = reOrderList + "," + gtNav["ID"]; else reOrderList = gtNav["ID"].ToString(); if (Char.IsNumber(gtNav["ID"].ToString(), 0)) { OrderList.Items.Add(new ListItem(gtNav["ItemTitle"].ToString(), gtNav["ID"].ToString())); } } if (gtLinks.Count > 0) OrderList.SelectedIndex = 0; frmfolderid.Value = folderId.ToString(); UP.Src = AppUI.AppPath + "images/UI/Icons/arrowHeadUp.png"; UP.Alt = MsgHelper.GetMessage("move selection up msg"); DOWN.Src = AppUI.AppPath + "images/UI/Icons/arrowHeadDown.png"; DOWN.Alt = MsgHelper.GetMessage("move selection down msg"); }
protected void Page_Load(object sender, EventArgs e) { MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); ApplicationAPI AppUI = new ApplicationAPI(); long Id = Convert.ToInt64(Request.QueryString["id"]); MenuId = Convert.ToInt64(Request.QueryString["nid"]); FolderId = Convert.ToInt64(Request.QueryString["folderid"]); gtLinks = AppUI.EkContentRef.GetMenuItemByID(MenuId, Id, true); sitePath = AppUI.SitePath; AppPath = AppUI.AppPath; long t_ID = Convert.ToInt64(gtLinks["ID"]); string t_ItemType = gtLinks["ItemType"].ToString(); Int32 t_ContentLanguage = Convert.ToInt32(gtLinks["ContentLanguage"]); string t_iframe = ""; if (!string.IsNullOrEmpty(Request.QueryString["iframe"])) t_iframe = Request.QueryString["iframe"].ToString(); Title.Value = gtLinks["ItemTitle"].ToString(); if ((string)gtLinks["ItemType"] == "1") { litInfo.Text += "<tr><td class=\"label\" title=\"Link\">"; litInfo.Text += MsgHelper.GetMessage("lbl Link") + ":</td>"; litInfo.Text += "<td class=\"value\">"; litInfo.Text += "<input type=\"radio\" name=\"linkType\" value=\"0\" " + (((string)gtLinks["LinkType"] == "0" || (string)gtLinks["LinkType"] == "") ? "checked=\"checked\"" : "") + " title=\"QuickLink\" />" + MsgHelper.GetMessage("lbl QuickLink"); litInfo.Text += "<input type=\"radio\" name=\"linkType\" value=\"1\" " + ((string)gtLinks["LinkType"] == "1" ? "checked=\"checked\"" : "") + " title=\"Menu Template\" />" + MsgHelper.GetMessage("lbl Menu Template") + "</td></tr>"; } if ((Convert.ToInt32(t_ItemType) == 1) && (string.IsNullOrEmpty(gtLinks["ItemLink"].ToString()))) { //Using the contentblock control to get the exact quicklink for asset which is not in contendata used above. //This is because the contentdata or assetdata has nothing to show difference btw assets and privateassets. //Regarding the defect #58344 Ektron.Cms.Controls.ContentBlock cBlock = new Ektron.Cms.Controls.ContentBlock(); cBlock.Page = this.Page; cBlock.DefaultContentID = Convert.ToInt64(gtLinks["ItemID"]); cBlock.Fill(); //urlLink.["URL"] = cBlock.EkItem.QuickLink; tdItemLink.Visible = false; tdURLLink.Visible = true; urlLink.Value = cBlock.EkItem.QuickLink; } if (t_ItemType != "5" && t_ItemType != "2") { if ((string)gtLinks["ItemLink"] != "") litInfo.Text += "<tr><td class=\"label\" title=\"Quick Link\">" + MsgHelper.GetMessage("lbl Quick Link") + ":</td><td class=\"readOnlyValue\">" + (string)gtLinks["ItemLink"] + "</td></tr>"; if ((string)gtLinks["FolderId"] != "") litInfo.Text += "<tr><td class=\"label\" title=\"Folder Id\">" + MsgHelper.GetMessage("lbl Folder ID") + ":</td><td class=\"readOnlyValue\">" + (string)gtLinks["FolderId"] + "</td></tr>"; } litImageLink.Text = MsgHelper.GetMessage("lbl Image Link"); litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("edit Menu items title")); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("editmenuitem", "") + "</td>"; litGenericTitle.Text = MsgHelper.GetMessage("generic title label"); if (Request.QueryString["back"] != "") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["iframe"] == "true") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true); else { if (m_refApi.TreeModel == 1) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + MenuId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenu&nId=" + MenuId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt save menu item"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'AddMenuItem\', \'VerifyAddMenuItem()\');\"", StyleHelper.SaveButtonCssClass, true); }
private void Page_Load(System.Object sender, System.EventArgs e) { RegisterResources(); Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; stylesheetjs.Text = m_refStyle.GetClientScript(); ApplicationAPI AppUI = new ApplicationAPI(); Ektron.Cms.Common.EkMessageHelper MsgHelper = AppUI.EkMsgRef; long currentUserID = AppUI.UserId; int EnableMultilingual = AppUI.EnableMultilingual; string AppPath = AppUI.AppPath; string AppImgPath = AppUI.AppImgPath; string SelectedEditControl = ""; string sitePath = AppUI.SitePath; string AppName = AppUI.AppName; string AppeWebPath = AppUI.AppeWebPath; if (AppUI.RequestInformationRef.IsMembershipUser == 1 || AppUI.RequestInformationRef.UserId == 0) { Response.Redirect("blank.htm", false); return; } this.pageTitle.Text = MsgHelper.GetMessage("ektron translation"); btnTranslate.Text = MsgHelper.GetMessage("lbl translate"); btnTranslate.ToolTip = btnTranslate.Text; TransTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("machine translation title")); TransTitle.ToolTip = TransTitle.Text; lblSrcLang.Text = MsgHelper.GetMessage("lbl source language"); lblSrcLang.ToolTip = lblSrcLang.Text; lblTrgLang.Text = MsgHelper.GetMessage("lbl target language"); lblTrgLang.ToolTip = lblTrgLang.Text; lblGlossary.Text = MsgHelper.GetMessage("lbl glossary"); lblGlossary.ToolTip = lblGlossary.Text; StringBuilder sbButton = new StringBuilder(); sbButton.AppendLine("<table width=\"100%\">"); sbButton.AppendLine("<tr>"); SelectedEditControl = Utilities.GetEditorPreference(Request); if (SelectedEditControl == "ContentDesigner") { sbButton.AppendLine(m_refStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic cancel"), MsgHelper.GetMessage("btn cancel"), "Onclick=\"javascript:CloseDlg();\"", StyleHelper.CancelButtonCssClass,true)); } else { sbButton.AppendLine(m_refStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic cancel"), MsgHelper.GetMessage("btn cancel"), "Onclick=\"javascript:window.close();\"", StyleHelper.CancelButtonCssClass, true)); } sbButton.AppendLine("</tr>"); sbButton.AppendLine("</table>"); tblButton.InnerHtml = sbButton.ToString(); if (IsPostBack) { formpage.Visible = false; resultPage.Visible = true; } else { ListItem selLang; string lang; SourceLanguage = "0"; lang = Request.QueryString["DefaultContentLanguage"]; if (Information.IsNumeric(lang)) { SourceLanguage = lang; } if (Convert.ToInt32(SourceLanguage) <= 0) { SourceLanguage = "1033"; // English } string langCode; langCode = (string) (LangSwitch(SourceLanguage)); selLang = wl_srclang.Items.FindByValue(langCode); if (selLang != null) { selLang.Selected = true; } htmleditor = Request.QueryString["htmleditor"]; TargetLanguage = "0"; lang = Request.QueryString["LangType"]; if (Information.IsNumeric(lang)) { TargetLanguage = lang; } if (Convert.ToInt32(TargetLanguage) <= 0) { TargetLanguage = "1033"; } langCode = (string) (LangSwitch(TargetLanguage)); selLang = wl_trglang.Items.FindByValue(langCode); if (selLang != null) { selLang.Selected = true; } formpage.Visible = true; resultPage.Visible = false; } }
private String GetTitlesFromFolderIds(string associatedFolderIdList) { ApplicationAPI AppUI = new ApplicationAPI(); string result = String.Empty; string[] listArray = associatedFolderIdList.Split(';'); foreach (string lsArray in listArray) { if (lsArray.Length > 0) { if (Char.IsNumber(lsArray, 0)) { if (result.Length > 0) result += ";"; result += AppUI.EkContentRef.GetFolderPath(Convert.ToInt64(lsArray)); } } } return result; }
/// <summary> /// Get the both collection and menu collection to the folder the current item is in. /// If no such menu exists, return 0. /// </summary> public static Dictionary<string, long> getAssignedMenuNCollectionId(long folderId) { Dictionary<string, long> menuCollection = new Dictionary<string, long>(); ApplicationAPI AppUI = new ApplicationAPI(); AppUI.RequestInformationRef.CallerId = (int)Ektron.Cms.Common.EkEnumeration.UserGroups.InternalAdmin; Microsoft.VisualBasic.Collection gtNavs = new Microsoft.VisualBasic.Collection(); gtNavs = AppUI.EkContentRef.GetAllCollectionsInfo(folderId, "title"); string mainCollectionId = string.Empty; if (gtNavs.Count > 0) { // gtNavs["CollectionID"].ToString(); foreach (Microsoft.VisualBasic.Collection gtNav in gtNavs) { // if (gtNav["MenuTitle"].ToString() == menuTitle) // { mainCollectionId = mainCollectionId + gtNav["CollectionID"]; // return long.Parse(mainCollectionId); // } try { menuCollection.Add("CollectionID", long.Parse(mainCollectionId)); } catch { } } } return menuCollection; }
protected void Page_Load(object sender, EventArgs e) { MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); ApplicationAPI AppUI = new ApplicationAPI(); sitePath = AppUI.SitePath; AppPath = AppUI.AppPath; AxMenuData menuData = new AxMenuData(); string ErrorString =""; MenuId = Convert.ToInt64(Request.QueryString["nid"]); FolderId = Convert.ToInt64(Request.QueryString["folderid"]); if (Request.QueryString["LangType"] == "-1") { ContentLanguage = AppUI.DefaultContentLanguage; AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); AppUI.ContentLanguage = ContentLanguage; } else { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); if (ContentLanguage == 0) { ContentLanguage = AppUI.DefaultContentLanguage; AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); AppUI.ContentLanguage = ContentLanguage; } } Hashtable cPerms = AppUI.EkSiteRef.GetPermissions(FolderId, 0, "folder"); if (!(IsCollectionMenuRoleMember() || (cPerms.Contains("Collections") && Convert.ToBoolean(cPerms["Collections"])))) ErrorString = MsgHelper.GetMessage("com: user does not have permission"); if (ErrorString == "") { if (m_refApi.TreeModel == 1) gtLinks = AppUI.EkContentRef.GetMenuByID(MenuId, 0,false); else gtLinks = AppUI.EkContentRef.GetMenuByID(MenuId, 0, true); menuData = AppUI.EkContentRef.GetMenuDataByID(MenuId); if (!string.IsNullOrEmpty(menuData.AssociatedFolderIdList)) { AssociatedFolderIdListString = menuData.AssociatedFolderIdList; AssociatedFolderTitleListString = GetTitlesFromFolderIds(menuData.AssociatedFolderIdList); } if (!string.IsNullOrEmpty(menuData.AssociatedTemplates)) AssociatedTemplatesString = menuData.AssociatedTemplates; } litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("edit menu title")); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("editmenu", "") + "</td>"; if (Request.QueryString["back"] != "") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["iframe"] == "true") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true); else { if (m_refApi.TreeModel == 1) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenu&nid=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", "Save Menu", MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'menu\', \'VerifyMenuForm()\');\"", StyleHelper.SaveButtonCssClass, true); LanguageName = gtLinks["ContentLanguage"].ToString(); }
protected void Page_Load(System.Object sender, System.EventArgs e) { ApplicationAPI AppUI = new ApplicationAPI(); long CurrentUserID; EkContent cObj1 = new EkContent(AppUI.RequestInformationRef); Collection cComments; object retVal; string CommentText; string ErrorString = ""; int iMaxContLength; string AppName; string AppeWebPath; int ContentLanguage; int EnableMultilingual; string platform; object IsMac; string AppImgPath = ""; EkMessageHelper MsgHelper; MsgHelper = (new CommonApi()).EkMsgRef; if (!Utilities.ValidateUserLogin()) { return; } ltrScript.Text = (new StyleHelper()).GetClientScript(); if (m_siteRef.RequestInformationRef.IsMembershipUser == 1) { Response.Redirect("reterror.aspx?info=" + MsgHelper.GetMessage("msg login cms user"), false); return; } ContentLanguage = -1; if (!string.IsNullOrEmpty(Request.QueryString["LangType"])) { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (!string.IsNullOrEmpty(AppUI.GetCookieValue("LastValidLanguageID").ToString())) { ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID")); } } AppUI.ContentLanguage = ContentLanguage; m_siteRef.RequestInformationRef.ContentLanguage = ContentLanguage; EnableMultilingual = AppUI.EnableMultilingual; cObj1 = AppUI.EkContentRef; CurrentUserID = AppUI.UserId; AppName = AppUI.AppName; AppeWebPath = AppUI.AppeWebPath; AppImgPath = AppUI.AppImgPath; AppPath = AppUI.AppPath; RefType = EkFunctions.HtmlEncode(Request["ref_type"]); iMaxContLength = 65000; if ("" == Request["commentkey_id"]) { CommentKeyId = 0; } else { CommentKeyId = Convert.ToInt64(Request["commentkey_id"]); } Action = EkFunctions.HtmlEncode(Request.QueryString["action"]); ActionType = EkFunctions.HtmlEncode(Request.QueryString["ty"]); if ("" == Request["Comment_Id"]) { CommentId = 0; } else { CommentId = Convert.ToInt64(Request["Comment_Id"]); } RefId = System.Convert.ToInt64(Request["ref_id"]); OrderBy = EkFunctions.HtmlEncode(Request["orderby"]); platform = Request.ServerVariables["HTTP_USER_AGENT"]; if (platform.ToString().IndexOf("Windows") + 1 > 0) { IsMac = 0; } else { IsMac = 1; } this.Title = AppName + " Comments"; ltrCancel.Text = MsgHelper.GetMessage("generic cancel"); if (Action == null || "Add" == Action || "" == Action) { ltrSubmit.Text = MsgHelper.GetMessage("btn insert"); } else if ("Edit" == Action) { ltrSubmit.Text = MsgHelper.GetMessage("btn update"); } this.ctlEditor.ErrorMessage = MsgHelper.GetMessage("content size exceeded"); this.ctlEditor.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(System.Convert.ToInt32(iMaxContLength)); CommentText = ""; if (IsPostBack) { this.ctlEditor.Validate(); if (this.ctlEditor.IsValid) { if (Action == null || "Add" == Action) { CommentText = this.ctlEditor.Content; retVal = cObj1.AddComment(CommentKeyId, CommentId, RefId, RefType, CurrentUserID, CommentText); if (ErrorString != "") { Response.Redirect("../reterror.aspx?info=" + ErrorString); } } else if ("Update" == Action) { CommentText = this.ctlEditor.Content; retVal = cObj1.UpdateComment(CommentId, CommentText); if (ErrorString != "") { Response.Redirect("../reterror.aspx?info=" + ErrorString); } } Response.Write("<script type=\"text/javascript\">" + "\r\n"); Response.Write("<!--" + "\r\n"); Response.Write("if (opener != null)" + "\r\n"); Response.Write("{" + "\r\n"); Response.Write("window.top.opener.location.href = window.top.opener.location.href;" + "\r\n"); Response.Write("}" + "\r\n"); Response.Write("self.close();" + "\r\n"); Response.Write("//-->" + "\r\n"); Response.Write("</script>"); } } else { if ("Edit" == Action) { cComments = cObj1.GetAllComments(CommentKeyId, CommentId, RefId, RefType, CurrentUserID, ""); if (ErrorString != "") { Response.Redirect("../reterror.aspx?info=" + ErrorString); } for (int i = 1; i <= cComments.Count; i++) { Collection coll = (Collection)cComments[i]; CommentText = coll["COMMENTS_TEXT"].ToString(); } this.ctlEditor.Content = CommentText.ToString(); } } }
private void SetJavascriptStrings() { ApplicationAPI AppUI = new ApplicationAPI(); Hashtable objResult; Ektron.Cms.Site.EkSite SiteObj; SiteObj = AppUI.EkSiteRef; objResult = SiteObj.GetPermissions(0, 0, "folder"); litPerReadOnlyLib.Text = Convert.ToString(objResult["ReadOnlyLib"]).ToLower(); litLanguageId1.Text = AppUI.ContentLanguage.ToString(); litLanguageId2.Text = AppUI.ContentLanguage.ToString(); }
private void Page_Load(object sender, EventArgs e) { bool IsRunning = EkThreads.URLCheckerClass.ThreadRunning; StyleSheetJS.Text = m_refStyle.GetClientScript(); SiteAPI m_refSiteApi = new SiteAPI(); m_refMsg = m_refSiteApi.EkMsgRef; btnCheck.ToolTip = m_refMsg.GetMessage("btn Check Links"); if (m_RequestInfo == null) { ContentAPI refContentApi = new ContentAPI(); m_RequestInfo = refContentApi.RequestInformationRef; } RegisterResources(); Utilities.ValidateUserLogin(); if ( Convert.ToBoolean( m_RequestInfo.IsMembershipUser ) || m_RequestInfo.UserId == 0) { Response.Redirect("blank.htm", false); return; } if (IsRunning) { Response.AppendHeader("Refresh", "5"); } // set initial values of fields on page if (Page.IsPostBack == false) { var m_refContentApi = new ContentAPI(); var styleHelper = new StyleHelper(); if (IsRunning) { checkWrapper.Visible = false; btnCheck.Visible = false; //printWrapper.Visible = false; //btnPrint.Visible = false; cancelWrapper.Visible = true; btnCancel.Visible = true; //CancelButton.Text = styleHelper.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/cancel.png", "javascript:btnCancel_Click();", m_refMsg.GetMessage("generic cancel"), m_refMsg.GetMessage("generic cancel"), "", StyleHelper.CancelButtonCssClass, true); lnkTabTestURL.Visible = false; lnkTabStatus.Enabled = false; // purge page state HttpContext.Current.Session["_PAGE_STATE_" + Request.Url.AbsolutePath] = null; } else { //CancelButton.Text = String.Empty; PrintButton.Text = styleHelper.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/print.png", "#", m_refMsg.GetMessage("Print Report button text"), m_refMsg.GetMessage("btn print"), "onclick=\"PrintReport();\"", StyleHelper.PrintButtonCssClass, true); btnCancel.Visible = false; cancelWrapper.Visible = false; } if (ConfigurationManager.AppSettings["ek_DebugLinkCheck"] != "True") { lnkTabTestURL.Visible = false; } if (! IsRunning) { txtStatus.Text = m_refMsg.GetMessage("txt linkcheck idle"); txtStatus.ToolTip = txtStatus.Text; } else { txtStatus.Text = EkThreads.URLCheckerClass.ThreadStatus; txtStatus.ToolTip = txtStatus.Text; } if (EkThreads.URLCheckerClass.ThreadLog.Length == 0) { ApplicationAPI m_AppRef = new ApplicationAPI(); string reportfile = m_AppRef.RequestInformationRef.PhysicalAppPath + "ekbadlinkrpt.html"; if (File.Exists(reportfile)) { System.IO.StreamReader oRead; try { oRead = System.IO.File.OpenText(reportfile); EkThreads.URLCheckerClass.ThreadLog = new StringBuilder(oRead.ReadToEnd()); } catch { // ignore errors reading from report file } } else { txtStatus.Text = ""; // don't display status if it was never run txtStatus.ToolTip = txtStatus.Text; } } if (EkThreads.URLCheckerClass.ThreadLog.Length > 0) { txtReport.Text = txtReport.Text; if (IsRunning) { txtReport.Text = txtReport.Text + "<ul style=\'margin: .5em 2em\'>" + "<li>Objects Checked: " + EkThreads.URLCheckerClass.CountObjsChecked.ToString(); txtReport.Text = txtReport.Text + "</ li>" + "<li>Links Checked: " + EkThreads.URLCheckerClass.CountLinksChecked.ToString(); txtReport.Text = txtReport.Text + "</li>" + "<li>Bad Links: " + EkThreads.URLCheckerClass.CountBadLinks.ToString() + "</li></ul>"; if (EkThreads.URLCheckerClass.CountBadLinks > 500) { txtReport.Text = txtReport.Text + "Too many errors. Please wait for report to be completed."; } else { txtReport.Text = txtReport.Text + EkThreads.URLCheckerClass.ThreadLog.ToString(); } } else { txtReport.Text = txtReport.Text + "<span id=\"ReportDataGrid\">"; txtReport.Text = txtReport.Text + "<span id=\"viewApprovalList_ViewGrid\">"; txtReport.Text = txtReport.Text + "<table><tr><td>"; txtReport.Text = txtReport.Text + EkThreads.URLCheckerClass.ThreadLog.ToString(); txtReport.Text = txtReport.Text + "</td></tr></table>"; txtReport.Text = txtReport.Text + "</span>"; txtReport.Text = txtReport.Text + "</span>"; } } // handle localization text StyleHelper m_refStyle1 = new StyleHelper(); if (! IsRunning) { m_refStyle1.MakeToolbarButton(btnCheck, m_refMsg.GetMessage("alt linkcheck button text"), m_refMsg.GetMessage("alt linkcheck button text")); //m_refStyle1.MakeToolbarButton(btnPrint, m_refMsg.GetMessage("btn print"), m_refMsg.GetMessage("btn print")); } else { //m_refStyle1.MakeToolbarButton(btnCancel, m_refMsg.GetMessage("generic cancel"), m_refMsg.GetMessage("generic cancel")); } lnkTabStatus.Text = m_refMsg.GetMessage("tab linkcheck status"); lnkTabStatus.ToolTip = lnkTabStatus.Text; lnkTabTestURL.Text = m_refMsg.GetMessage("tab linkcheck testurl"); lnkTabTestURL.ToolTip = lnkTabTestURL.Text; lblStatus.Text = m_refMsg.GetMessage("lbl linkcheck status"); lblStatus.ToolTip = lblStatus.Text; lblURL.Text = m_refMsg.GetMessage("lbl linkcheck testurl"); lblURL.ToolTip = lblURL.Text; btnHelp.Text = m_refStyle.GetHelpButton("badlinkcheck", ""); } }
protected void Page_Load(System.Object sender, System.EventArgs e) { ApplicationAPI AppUI = new ApplicationAPI(); EkContent cContObj = new EkContent(AppUI.RequestInformationRef); taskObj = new EkTask(AppUI.RequestInformationRef); long cid; string[] tasksArray; int lCounter; string RefType; long CurrentUserID; string AppPath; string AppImgPath; string SitePath; string AppeWebPath; long CommentKeyId = 0; long CommentId = 0; string Action; object ActionType; object IsMac; object platform; bool Flag; object retVal; object CommentText; object NS4; object OrderBy; object iMaxContLength; object localeFileString; object var1; object var2; string taskIDs; object height; object width; int EnableMultilingual; int ContentLanguage; Ektron.Cms.Common.EkMessageHelper MsgHelper; System.Text.StringBuilder sbScript = new System.Text.StringBuilder(); MsgHelper = AppUI.EkMsgRef; AppPath = AppUI.AppPath; AppImgPath = AppUI.AppImgPath; SitePath = AppUI.SitePath; AppeWebPath = AppUI.AppeWebPath; AppPath = AppUI.AppPath; AppName = AppUI.AppName; EnableMultilingual = AppUI.EnableMultilingual; ContentLanguage = 1033; //set default value if (!Utilities.ValidateUserLogin()) { return; } if (Convert.ToBoolean(AppUI.RequestInformationRef.IsMembershipUser)) { Response.Redirect("reterror.aspx?info=" + MsgHelper.GetMessage("msg login cms user"), false); return; } if (!string.IsNullOrEmpty(Request.QueryString["LangType"])) { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (!string.IsNullOrEmpty(AppUI.GetCookieValue("LastValidLanguageID"))) { ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID")); } } platform = Request.ServerVariables["HTTP_USER_AGENT"]; if (platform.ToString().IndexOf("Windows") + 1 > 0) { IsMac = 0; } else { IsMac = 1; } RefType = "T"; Flag = false; iMaxContLength = 65000; localeFileString = "0000"; var1 = Request.ServerVariables["SERVER_NAME"]; if (!string.IsNullOrEmpty(Request.QueryString["commentkey_id"])) { CommentKeyId = Convert.ToInt64(Request.QueryString["commentkey_id"]); } Action = Request.QueryString["action"]; ActionType = Request.QueryString["ty"]; OrderBy = Request.QueryString["orderby"]; cid = Convert.ToInt64(Request.QueryString["id"]); if (!string.IsNullOrEmpty(Request.QueryString["Comment_Id"])) { CommentId = Convert.ToInt64(Request.QueryString["Comment_Id"]); } if (!string.IsNullOrEmpty((Request.QueryString["height"]))) { height = Convert.ToDouble(Request.QueryString["height"]); } if (!string.IsNullOrEmpty((Request.QueryString["width"]))) { width = Convert.ToDouble(Request.QueryString["width"]); } lCounter = 0; CurrentUserID = AppUI.UserId; ltrComments.Text = MsgHelper.GetMessage("lbl task comment") + ":"; if (Request.QueryString["action"] != null && Request.QueryString["action"].ToString().ToLower() == "declinecontentaction") ltrComments.Text = MsgHelper.GetMessage("reason to decline"); cContObj = AppUI.EkContentRef; if (Request.ServerVariables["http_user_agent"].ToString().IndexOf("Mozilla") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("4.7") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("GECKO") < 0) { NS4 = true; } else { NS4 = false; } var2 = cContObj.GetEditorVariablev2_0(0, "tasks"); ctlEditor.Validate(); if (Action == "Add" && ctlEditor.IsValid) { CommentText = this.ctlEditor.Content; if (cid != 0) { //Get all tasks associated with the content and add same comment taskObj = AppUI.EkTaskRef; object strStates; strStates = EkEnumeration.TaskState.NotStarted.ToString() + "," + EkEnumeration.TaskState.Active.ToString() + "," + EkEnumeration.TaskState.AwaitingData.ToString() + "," + EkEnumeration.TaskState.OnHold.ToString() + "," + EkEnumeration.TaskState.Pending.ToString() + "," + EkEnumeration.TaskState.Reopened.ToString(); taskIDs = taskObj.GetTaskIDs(cid, strStates, -1, (int)EkEnumeration.CMSTaskItemType.TasksByStateAndContentID); if (taskIDs != "") { tasksArray = Strings.Split(taskIDs.ToString(), ",", -1, 0); while (lCounter <= (tasksArray.Length - 1)) { retVal = cContObj.AddComment(Convert.ToInt64(CommentKeyId), Convert.ToInt64(CommentId), Convert.ToInt64(tasksArray.GetValue(lCounter)), RefType, CurrentUserID, Strings.Replace(CommentText.ToString(), "\'", "\'\'", 1, -1, 0)); lCounter++; } } } Flag = true; } if (true == Flag) { sbScript.Append("<script language=\"JavaScript\" type=\"text/javascript\">" + "\r\n"); sbScript.Append("<!--"); sbScript.Append("if (IsBrowserIE())"); sbScript.Append("{"); sbScript.Append(" parent.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + \"&id=\" + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );"); sbScript.Append("}"); sbScript.Append("else"); sbScript.Append("{"); sbScript.Append(" top.opener.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + " + ID == " + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );"); sbScript.Append(" close();"); sbScript.Append("}"); sbScript.Append("//-->"); sbScript.Append("</script>" + "\r\n"); ClosePanel.Text = sbScript.ToString(); } if ((Request.QueryString["action"]) == "Add") { actionName.Value = Request.QueryString["actionName"]; } else { actionName.Value = Request.QueryString["action"]; } this.ctlEditor.AllowFonts = true; ctlEditor.ErrorMessage = MsgHelper.GetMessage("content size exceeded"); ctlEditor.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(System.Convert.ToInt32(iMaxContLength)); }
protected void Page_Load(object sender, EventArgs e) { EkMessageHelper MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); Collection gtNavs = new Collection(); ApplicationAPI AppUI = new ApplicationAPI(); long nId = Convert.ToInt64(Request.QueryString["nid"]); if (!string.IsNullOrEmpty(Request.QueryString["LangType"])) { Int32 ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); if (ContentLanguage == ALL_CONTENT_LANGUAGES) { ContentLanguage = AppUI.DefaultContentLanguage; } AppUI.FilterByLanguage=ContentLanguage; } string ErrorString = ""; if (!string.IsNullOrEmpty(Request.QueryString["action"])) { string action = Request.QueryString["action"].ToString(); if (action.ToString().ToLower() == "viewstageattributes") { gtNavs = AppUI.EkContentRef.GetEcmStageCollectionByID(nId, false, false, ref ErrorString, true, false, true); } else { gtNavs = AppUI.EkContentRef.GetEcmCollectionByID( nId, false, false, ref ErrorString, true, false, true); } } string checkout = ""; if (Convert.ToBoolean(gtNavs["ApprovalRequired"]) == true && ((gtNavs["Status"].ToString() == "A") || (gtNavs["Status"].ToString() == "S"))) checkout = "&checkout=true"; if (Convert.ToBoolean(gtNavs["ApprovalRequired"]) == true && gtNavs["Status"].ToString() == "O") checkout = checkout + "&status=o"; string CollectionTitle = ""; if (ErrorString == "") { if (gtNavs.Count > 0) CollectionTitle = gtNavs["CollectionTitle"].ToString(); } if (ErrorString != "") { titlebarerror.InnerHtml = ErrorString; } litViewCollection.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("view collection title")); litViewToolBarCollection.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("view collection title")) + " " + CollectionTitle; long folderId = 0; if (!string.IsNullOrEmpty(Request.QueryString["folderId"])) { folderId = Convert.ToInt64(Request.QueryString["folderId"]); } if (Request.QueryString["bpage"] == "reports") litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewCollectionReport", MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=View&nid=" + nId + "&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/contentEdit.png", "collections.aspx?action=Edit&nid=" + nId + "&folderid=" + folderId + checkout, MsgHelper.GetMessage("alt: edit collection text"), MsgHelper.GetMessage("btn edit"), "", StyleHelper.EditButtonCssClass, true); if (m_refApi.EnableMultilingual == 1) { litLang.Text = StyleHelper.ActionBarDivider + "<td>" + MsgHelper.GetMessage("view language") + LangDD(false, "") + "</td>"; } litTitle.Text = MsgHelper.GetMessage("generic title label"); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("ViewCollectionItems", "") + "</td>"; litLabel.Text = MsgHelper.GetMessage("id label"); litPath.Text = MsgHelper.GetMessage("lbl path") + ":"; litTemplate.Text = MsgHelper.GetMessage("generic template label"); litContentLUE.Text = MsgHelper.GetMessage("content LUE label"); litLED.Text = MsgHelper.GetMessage("content LED label"); litDC.Text = MsgHelper.GetMessage("content DC label"); litDesc.Text = MsgHelper.GetMessage("description label"); litStatus.Text = MsgHelper.GetMessage("lbl linkcheck status"); litSubFolders.Text = MsgHelper.GetMessage("generic include subfolders msg"); litApproval.Text = MsgHelper.GetMessage("lbl approval required"); tdTitle.InnerHtml = gtNavs["CollectionTitle"].ToString(); tdID.InnerHtml = gtNavs["CollectionID"].ToString(); if (gtNavs.Contains("FolderPath") && !string.IsNullOrEmpty(gtNavs["FolderPath"].ToString())) { tdPath.InnerHtml = gtNavs["FolderPath"].ToString(); } tdTemplate.InnerHtml = gtNavs["TemplatePath"].ToString(); tdLUE.InnerHtml = gtNavs["EditorFName"] + " " + gtNavs["EditorLName"]; tdLastEditDate.InnerHtml = gtNavs["DisplayLastEditDate"].ToString(); tdDateCreated.InnerHtml = gtNavs["DisplayDateCreated"].ToString(); tdDesc.InnerHtml = gtNavs["CollectionDescription"].ToString(); tdStatus.InnerHtml = gtNavs["Status"].ToString(); frm_recursive.Checked = (Convert.ToInt32(gtNavs["Recursive"]) == 1 ? true : false); approval.Checked = Convert.ToBoolean(gtNavs["ApprovalRequired"]); gtNavs = null; }
/// <summary> /// Get the menu assigned to the folder the current item is in. /// If no such menu exists, return 0. /// </summary> public static long getAssignedMenuId(long folderId) { ApplicationAPI AppUI = new ApplicationAPI(); AppUI.RequestInformationRef.CallerId = (int)Ektron.Cms.Common.EkEnumeration.UserGroups.InternalAdmin; Microsoft.VisualBasic.Collection gtNavs = new Microsoft.VisualBasic.Collection(); gtNavs = AppUI.EkContentRef.GetAllMenusInfo(folderId, "title"); string mainMenuId = string.Empty; if (gtNavs.Count > 0) { foreach (Microsoft.VisualBasic.Collection gtNav in gtNavs) { // if (gtNav["MenuTitle"].ToString() == menuTitle) // { mainMenuId = mainMenuId + gtNav["MenuID"]; return long.Parse(mainMenuId); // } } } return 0; }
private void InitEnvironment() { m_strCmdAction = EkFunctions.HtmlEncode(Request.QueryString["Action"]); m_strActionType = EkFunctions.HtmlEncode(Request.QueryString["ty"]); m_iCommentKeyId = System.Convert.ToInt64(Request["commentkey_id"]); m_iCommentId = System.Convert.ToInt64(Request["Comment_Id"]); m_strCommentType = EkFunctions.HtmlEncode(Request["comment_type"]); m_strOrderBy = EkFunctions.HtmlEncode(Request["orderby"]); m_iRefId = System.Convert.ToInt64(Request["ref_id"]); m_strRefType = EkFunctions.HtmlEncode(Request["ref_type"]); m_strEditorName = EkFunctions.HtmlEncode(Request["editorName"]); m_strAppeWebPath = ""; m_strLocaleFileString = "0000"; m_objAppUI = new ApplicationAPI(); m_objContentObj1 = m_objAppUI.EkContentRef; m_strAppeWebPath = m_objAppUI.ApplicationPath + m_objAppUI.AppeWebPath; if (Request["LangType"] != "") { m_iContentLanguage = Convert.ToInt32(Request["LangType"]); m_objAppUI.SetCookieValue("LastValidLanguageID", m_iContentLanguage.ToString()); } else { if (m_objAppUI.GetCookieValue("LastValidLanguageID") != "") { m_iContentLanguage = int.Parse(m_objAppUI.GetCookieValue("LastValidLanguageID")); } } m_objAppUI.ContentLanguage = m_iContentLanguage; m_objContentObj1 = m_objAppUI.EkContentRef; m_iCurrentUserId = m_objAppUI.UserId; m_strAppeWebPath = m_objAppUI.ApplicationPath + m_objAppUI.AppeWebPath; m_strServerName = Request.ServerVariables["SERVER_NAME"]; this.Page.Title = m_objAppUI.AppName + " Comments"; m_strvar2 = m_objContentObj1.GetEditorVariablev2_0(0, "tasks"); if ((Strings.UCase(Request.ServerVariables["http_user_agent"])).IndexOf("MOZILLA") > -1 && (Strings.UCase(Request.ServerVariables["http_user_agent"])).IndexOf("4.7") > -1 && (!(Strings.UCase(Request.ServerVariables["http_user_agent"]).IndexOf("GECKO") > -1))) { m_bNS4 = true; } else { m_bNS4 = false; } }
protected void Page_Load(object sender, EventArgs e) { MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); StyleHelper m_refStyle = new StyleHelper(); CommonApi m_refApi = new CommonApi(); ApplicationAPI AppUI = new ApplicationAPI(); if (Request.QueryString["LangType"] == "-1") { ContentLanguage = AppUI.DefaultContentLanguage; AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); AppUI.ContentLanguage = ContentLanguage; } else { AppUI.ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); ContentLanguage = AppUI.ContentLanguage; } if (!string.IsNullOrEmpty(Request.QueryString["noworkarea"]) && Request.QueryString["noworkarea"] == "1") { noWorkAreaString = "&noworkarea=1"; } long mpID = Convert.ToInt64(Request.QueryString["parentid"]); long maID = Convert.ToInt64(Request.QueryString["ancestorid"]); string AncestorIDParam = ""; string ParentIDParam = ""; Collection gtNavs = new Collection(); if (string.IsNullOrEmpty(Request.QueryString["ancestorid"])) AncestorIDParam = "&ancestorid=" + Request.QueryString["ancestorid"]; if (string.IsNullOrEmpty(Request.QueryString["parentid"])) ParentIDParam = "&parentid=" + Request.QueryString["parentid"]; FolderId = Convert.ToInt64(Request.QueryString["folderid"]); MenuId = Convert.ToInt64(Request.QueryString["nId"]); string ItemType = Request.Form["ItemType"]; if (mpID != 0) { gtNavs = AppUI.EkContentRef.GetMenuByID(mpID, 0, false); if (gtNavs.Count > 0) { if (gtNavs.Contains("EnableReplication")) enableQDOparam = "&qdo=1"; } } switch (ItemType) { case "content": Response.Redirect("collections.aspx?action=AddLink&addto=Menu&folderid=" + FolderId + "&nid=" + MenuId + "&LangType=" + ContentLanguage + "&iframe=" + Request.QueryString["iframe"] + AncestorIDParam + ParentIDParam + "&back=" + Server.UrlEncode(Request.QueryString["back"]) + enableQDOparam + noWorkAreaString); break; case "newcontent": Response.Redirect("collectiontree.aspx?action=AddLink&addto=menu&noworkarea=1&nid=" + MenuId + "&folderid=" + FolderId + "&LangType=" + ContentLanguage); break; case "submenu": string enableReplicationFlag = ""; if ((gtNavs.Count > 0) && (gtNavs.Contains("EnableReplication"))) enableReplicationFlag = gtNavs["EnableReplication"].ToString(); string strPath = "collections.aspx?action=AddSubMenu&folderid=" + FolderId + "&nId=" + MenuId + "&parentid=" + mpID + "&ancestorid=" + maID + "&LangType=" + ContentLanguage + "&iframe=" + Request.QueryString["iframe"] + "&back=" + Server.UrlEncode(Request.QueryString["back"]) + "&QD=" + enableReplicationFlag + noWorkAreaString; Response.Redirect(strPath); break; case "library": divLibrary.Visible = true; Collection gtFolderInfo = AppUI.EkContentRef.GetFolderInfoWithPath(FolderId); FolderPath = gtFolderInfo["Path"].ToString(); if (FolderPath.Substring(FolderPath.Length - 1, 1) == "\\") FolderPath = FolderPath.Remove(FolderPath.Length - 1, 1); FolderPath = FolderPath.Replace(@"\", @"\\"); divLibrary.Visible = true; litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("Add Menu Item Title")); litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("pAddMenuItem", "") + "</td>"; if (!string.IsNullOrEmpty(Request.QueryString["back"])) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["iframe"] == "true") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true); else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"top.close();\"", StyleHelper.CancelButtonCssClass, true); litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt Save Menu Item"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'AddMenuItem\', \'VerifyLibraryAssest()\');\"", StyleHelper.SaveButtonCssClass, true); break; default: divOther.Visible = true; litHelp1.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("pAddMenuItem", "") + "</td>"; litTitle1.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("Add Menu Item Title")); if (!string.IsNullOrEmpty(Request.QueryString["back"])) litButtons1.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["iframe"] == "true") litButtons1.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true); else litButtons1.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"top.close();\"", StyleHelper.CancelButtonCssClass, true); litButtons1.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt Save Menu Item"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'AddMenuItem\', \'VerifyAddMenuItem()\');\"", StyleHelper.SaveButtonCssClass, true); break; } }
protected void Page_Load(object sender, EventArgs e) { MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef); ApplicationAPI AppUI = new ApplicationAPI(); sitePath = AppUI.SitePath; if (Request.QueryString["LangType"] == "-1") { ContentLanguage = AppUI.DefaultContentLanguage; AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); AppUI.ContentLanguage = ContentLanguage; } else { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); if (ContentLanguage == 0) { ContentLanguage = AppUI.DefaultContentLanguage; AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); AppUI.ContentLanguage = ContentLanguage; } } if (!string.IsNullOrEmpty(Request.QueryString["noworkarea"]) && Request.QueryString["noworkarea"] == "1") { noWorkAreaString = "&noworkarea=1"; } LanguageData language_data = (new SiteAPI()).GetLanguageById(ContentLanguage); if (language_data != null) LanguageName = language_data.Name; folderId = Convert.ToInt64(Request.QueryString["folderid"]); nId = Convert.ToInt64(Request.QueryString["nId"]); if (!CanManageMenus) { Response.Redirect((string)("reterror.aspx?info=" + m_refContentApi.EkMsgRef.GetMessage("msg login menu administrator")), false); return; } action = Request.QueryString["action"]; switch (action) { case "AddMenu": if (Request.QueryString["back"] != "" && Request.QueryString["back"] != null) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["bPage"] == "ViewMenuReport") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenuReport&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewAllMenus&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); break; case "AddSubMenu": if (Request.QueryString["back"] != "") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else if (Request.QueryString["iframe"] == "true") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true); else { if (Request.QueryString["noworkarea"] == "1") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "close.aspx", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else { if (CommonAPI.TreeModel == 1) litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + nId + "&folderid=" + folderId + "&noworkarea=" + Request.QueryString["noworkarea"], MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenu&nid=" + nId + "&folderid=" + folderId + "&noworkarea=" + Request.QueryString["noworkarea"], MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); } } break; case "AddTransMenu": if (Request.QueryString["back"] != "") litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true); else litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?langtype=" + Request.QueryString["backlang"] + "+action=ViewAllMenus+folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true); break; } litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt save menu"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'menu\', \'VerifyMenuForm()\');\"", StyleHelper.SaveButtonCssClass, true); }