protected void Page_Load(object sender, System.EventArgs e) { msgHelper = _refCommonApi.EkMsgRef; string pageAction; Ektron.Cms.Content.EkContent objContentRef; objContentRef = _refContentApi.EkContentRef; RegisterResources(); SetServerJSVariables(); //Licensing For 7.6 if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false)) { Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("feature locked error")); return; } if (!(_refCommonApi.IsAdmin() || objContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin, _refCommonApi.RequestInformationRef.UserId, false))) { Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("User not authorized")); return; } _communityAliasAPI = new Ektron.Cms.UrlAliasing.UrlAliasCommunityApi(); _manualAliasAPI = new Ektron.Cms.UrlAliasing.UrlAliasManualApi(); pageAction = Request.QueryString["action"]; langType = Request.QueryString["Langtype"]; siteID = Request.QueryString["fId"]; ddltype.Attributes.Add("onchange", "ToggleExamplePath(this);"); lblPrimary.Text = msgHelper.GetMessage("lbl primary"); lblActive.Text = msgHelper.GetMessage("active label"); lblType.Text = msgHelper.GetMessage("lbl source") + " " + msgHelper.GetMessage("generic type"); lblAliasPath.Text = msgHelper.GetMessage("lbl alias path"); lblExt.Text = msgHelper.GetMessage("lbl extension"); lblReplaceChar.Text = msgHelper.GetMessage("lbl rpl char"); lblExample.Text = msgHelper.GetMessage("lbl link ex preview"); lblQueryStringParam.Text = msgHelper.GetMessage("lbl querystringparam"); lblPrimary.ToolTip = lblPrimary.Text; lblActive.ToolTip = lblActive.Text; lblType.ToolTip = lblType.Text; lblAliasPath.ToolTip = lblAliasPath.Text; lblExt.ToolTip = lblExt.Text; lblReplaceChar.ToolTip = lblReplaceChar.Text; lblExample.ToolTip = lblExample.Text; lblQueryStringParam.ToolTip = lblQueryStringParam.Text; primaryChkBox.Attributes.Add("onclick", "$ektron(\'#activeChkBox\')[0].checked = true;"); _communityType = _communityAliasAPI.GetCommunityAliasTypes(); int.TryParse(langType, out langId); switch (pageAction) { case "addalias": DisplayAdd(); break; case "view": DisplayView(); break; case "editalias": DisplayEdit(); break; } }
protected void Page_Load(object sender, System.EventArgs e) { msgHelper = _refCommonApi.EkMsgRef; Ektron.Cms.Content.EkContent objContentRef; objContentRef = _refContentApi.EkContentRef; RegisterResources(); SetServerJSVariables(); string pageAction = ""; long siteID = 0; //Licensing For 7.6 if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false)) { Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("feature locked error")); return; } if (!Utilities.ValidateUserLogin()) { return; } if (_refCommonApi.RequestInformationRef.IsMembershipUser > 0 || _refCommonApi.RequestInformationRef.UserId == 0) { Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("msg login cms user")); return; } if (!(_refCommonApi.IsAdmin() || objContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin, _refCommonApi.RequestInformationRef.UserId, false))) { Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("User not authorized")); return; } _manualAliasList = new Ektron.Cms.UrlAliasing.UrlAliasManualApi(); _autoAliasList = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi(); _communityAliasList = new Ektron.Cms.UrlAliasing.UrlAliasCommunityApi(); siteDictionary = new System.Collections.Generic.Dictionary<long, string>(); PageLabel.Text = PageLabel.ToolTip = msgHelper.GetMessage("lbl pagecontrol page"); OfLabel.Text = OfLabel.ToolTip = msgHelper.GetMessage("lbl pagecontrol of"); FirstPage.ToolTip = msgHelper.GetMessage("lbl first page"); PreviousPage1.ToolTip = msgHelper.GetMessage("lbl previous page"); NextPage.ToolTip = msgHelper.GetMessage("lbl next page"); LastPage.ToolTip = msgHelper.GetMessage("lbl last page"); FirstPage.Text = "[" + msgHelper.GetMessage("lbl first page") + "]"; PreviousPage1.Text = "[" + msgHelper.GetMessage("lbl previous page") + "]"; NextPage.Text = "[" + msgHelper.GetMessage("lbl next page") + "]"; LastPage.Text = "[" + msgHelper.GetMessage("lbl last page") + "]"; if (!String.IsNullOrEmpty(Request.QueryString["LangType"])) { if (Request.QueryString["LangType"] != "") { contentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); _refContentApi.SetCookieValue("LastValidLanguageID", contentLanguage.ToString()); } else { if (_refContentApi.GetCookieValue("LastValidLanguageID") != "") { contentLanguage = Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID")); } } } else { if (_refContentApi.GetCookieValue("LastValidLanguageID") != "") { contentLanguage = Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID")); } } _refContentApi.FilterByLanguage = contentLanguage; _refCommonApi.EkContentRef.RequestInformation.ContentLanguage = contentLanguage; if (!String.IsNullOrEmpty(Request.QueryString["action"])) { pageAction = Request.QueryString["action"]; } if (!String.IsNullOrEmpty(Request.QueryString["fId"])) { siteID = Convert.ToInt64(Request.QueryString["fId"]); } if (pageAction == "removealias") { AddDeleteMenuBar(siteID.ToString()); DeleteAlias(siteID.ToString()); } else if (pageAction == "refresh") { RefreshManualAliasList(siteID.ToString()); return; } else if ((string)(pageAction) == "clearcache") { ClearAutoAliasCache(siteID.ToString()); return; } else if ((string)(pageAction) == "clearcommunitycache") { ClearCommunityCache(siteID.ToString()); return; } else if ((string)(pageAction) == "") { AddDefaultMenuBar(siteID.ToString()); } if (((pageAction == "" || pageAction == "removealias") && !Page.IsPostBack) || ((pageAction == "" || pageAction == "removealias") && Page.IsPostBack && Request.Form[isCPostData.UniqueID] != "")) { if (siteID > 0) { LoadManualAliasList(siteID.ToString()); } else { LoadManualAliasList(string.Empty); } } }