protected void Page_Init(object sender, System.EventArgs e) { // resource text string tokens m_refMsg = m_refContentApi.EkMsgRef; string closeDialogText = (string) (m_refMsg.GetMessage("close this dialog")); string cancelText = (string) (m_refMsg.GetMessage("btn cancel")); // assign resource text string values btnConfirmOk.Text = m_refMsg.GetMessage("lbl ok"); btnConfirmOk.NavigateUrl = "#" + m_refMsg.GetMessage("lbl ok"); btnConfirmCancel.Text = cancelText; btnConfirmCancel.NavigateUrl = "#" + cancelText; btnCloseSyncStatus.Text = m_refMsg.GetMessage("close title"); btnCloseSyncStatus.NavigateUrl = "#" + m_refMsg.GetMessage("close title"); btnStartSync.Text = m_refMsg.GetMessage("btn sync now"); closeDialogLink.Text = "<span class=\"ui-icon ui-icon-closethick\">" + m_refMsg.GetMessage("close title") + "</span>"; closeDialogLink.NavigateUrl = "#" + System.Text.RegularExpressions.Regex.Replace((string) (m_refMsg.GetMessage("close title")), "\\s+", ""); closeDialogLink.ToolTip = closeDialogText; closeDialogLink2.Text = closeDialogLink.Text; closeDialogLink2.NavigateUrl = closeDialogLink.NavigateUrl; closeDialogLink2.ToolTip = closeDialogText; closeDialogLink3.Text = closeDialogLink.Text; closeDialogLink3.NavigateUrl = closeDialogLink.NavigateUrl; closeDialogLink3.ToolTip = closeDialogText; lblSyncStatus.Text = string.Format(m_refMsg.GetMessage("lbl sync status"), " <span class=\"statusHeaderProfileId\"></span>"); m_jsResources = (SyncResources) (LoadControl("sync/SyncResources.ascx")); m_jsResources.ID = "jsResources"; sync_jsResourcesPlaceholder.Controls.Add(m_jsResources); }
//finds and sets other scripts to use public components in them private void Awake() { tm = FindObjectOfType <MultiplayerTurnManager>(); rm = FindObjectOfType <MultiplayerResourceManager>(); bb = FindObjectOfType <MultiplayerBiomeBuilding>(); bm = FindObjectOfType <MultiplayerBuildingManager>(); sr = FindObjectOfType <SyncResources>(); }
private void Page_Init(System.Object sender, System.EventArgs e) { m_refMsg = m_refContentApi.EkMsgRef; if (m_refContentApi.RequestInformationRef.IsMembershipUser == 1 || m_refContentApi.RequestInformationRef.UserId == 0) { Response.Redirect(m_refContentApi.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(m_refMsg.GetMessage("msg login cms user")), false); return; } this.ShowAjaxTreeJsValues(); this.SetEktronContentTemplateJsValues(); this.RegisterJs(); this.RegisterCss(); Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; if (m_refContentApi.GetCookieValue("user_id") == "0") { if (!(Request.QueryString["callerpage"] == null)) { Session["RedirectLnk"] = "Content.aspx?" + AntiXss.UrlEncode(Request.QueryString.ToString()); } Response.Redirect("login.aspx?fromLnkPg=1", false); return; } if (!string.IsNullOrEmpty(Request.QueryString["action"])) { PageAction = Convert.ToString(Request.QueryString["action"]).ToLower().Trim(); } if (!string.IsNullOrEmpty(Request.QueryString["membership"])) { m_strMembership = Convert.ToString(Request.QueryString["membership"]).ToLower().Trim(); } if (m_refContentApi.TreeModel == 1) { m_bAjaxTree = true; } Int32 lastValidLanguageID; string LastValidLanguage = m_refContentApi.GetCookieValue("LastValidLanguageID"); if (LastValidLanguage == null || !Int32.TryParse(LastValidLanguage, out lastValidLanguageID)) lastValidLanguageID = Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED; if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { if (Request.QueryString["LangType"] != null) Int32.TryParse(Request.QueryString["LangType"], out ContentLanguage); if (ContentLanguage != lastValidLanguageID) { m_bLangChange = true; } m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (lastValidLanguageID != Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { ContentLanguage = lastValidLanguageID; } } } else { if (lastValidLanguageID != Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { ContentLanguage = lastValidLanguageID; } } if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES; } else { m_refContentApi.ContentLanguage = ContentLanguage; } StyleHelper styleHelper = new StyleHelper(); ltrStyleSheetJs.Text = styleHelper.GetClientScript(); txtContentLanguage.Text = m_refContentApi.ContentLanguage.ToString(); txtDefaultContentLanguage.Text = m_refContentApi.DefaultContentLanguage.ToString(); txtEnableMultilingual.Text = m_refContentApi.EnableMultilingual.ToString(); switch (PageAction) { case "viewarchivecontentbycategory": case "viewcontentbycategory": UniqueLiteral.Text = "viewfolder"; m_viewfolder = (viewfolder)(LoadControl("controls/folder/viewfolder.ascx")); m_viewfolder.ID = "viewfolder"; if (m_bLangChange == true) { m_viewfolder.ResetPostData(); } DataHolder.Controls.Add(m_viewfolder); break; case "deletecontentbycategory": UniqueLiteral.Text = "deletecontentbycategory"; removefolderitem m_removefolderitem; m_removefolderitem = (removefolderitem)(LoadControl("controls/folder/removefolderitem.ascx")); m_removefolderitem.ID = "deletecontentbycategory"; DataHolder.Controls.Add(m_removefolderitem); break; case "movecontentbycategory": UniqueLiteral.Text = "movefolderitem"; movefolderitem m_movefolderitem; m_movefolderitem = (movefolderitem)(LoadControl("controls/folder/movefolderitem.ascx")); m_movefolderitem.ID = "movefolderitem"; DataHolder.Controls.Add(m_movefolderitem); break; case "selectpermissions": UniqueLiteral.Text = "permission"; selectpermissions m_selectpermissions; m_selectpermissions = (selectpermissions)(LoadControl("controls/permission/selectpermissions.ascx")); m_selectpermissions.ID = "permission"; DataHolder.Controls.Add(m_selectpermissions); break; } EmailHelper m_mail = new EmailHelper(); string strEmailArea; strEmailArea = m_mail.EmailJS(); strEmailArea += m_mail.MakeEmailArea(); ltrEmailAreaJs.Text = strEmailArea; if (PageAction.ToLower().ToString() != "viewcontentbycategory") { ShowDropUploader(false); } // resource text string tokens string closeDialogText = m_refMsg.GetMessage("close this dialog"); string cancelText = m_refMsg.GetMessage("btn cancel"); // assign resource text string values btnConfirmOk.Text = m_refMsg.GetMessage("lbl ok"); btnConfirmOk.NavigateUrl = "#" + m_refMsg.GetMessage("lbl ok"); btnConfirmCancel.Text = cancelText; btnConfirmCancel.NavigateUrl = "#" + cancelText; btnCloseSyncStatus.Text = m_refMsg.GetMessage("close title"); btnCloseSyncStatus.NavigateUrl = "#" + m_refMsg.GetMessage("close title"); btnStartSync.Text = m_refMsg.GetMessage("btn sync now"); btnCloseConfigDialog.Text = m_refMsg.GetMessage("close title"); closeDialogLink.Text = "<span class=\"ui-icon ui-icon-closethick\">" + m_refMsg.GetMessage("close title") + "</span>"; closeDialogLink.NavigateUrl = "#" + System.Text.RegularExpressions.Regex.Replace(m_refMsg.GetMessage("close title"), "\\s+", ""); closeDialogLink.ToolTip = closeDialogText; closeDialogLink2.Text = closeDialogLink.Text; closeDialogLink2.NavigateUrl = closeDialogLink.NavigateUrl; closeDialogLink2.ToolTip = closeDialogText; closeDialogLink3.Text = closeDialogLink.Text; closeDialogLink3.NavigateUrl = closeDialogLink.NavigateUrl; closeDialogLink3.ToolTip = closeDialogText; lblSyncStatus.Text = string.Format(m_refMsg.GetMessage("lbl sync status"), " <span class=\"statusHeaderProfileId\"></span>"); m_jsResources = (SyncResources)(LoadControl("sync/SyncResources.ascx")); m_jsResources.ID = "jsResources"; sync_jsResourcesPlaceholder.Controls.Add(m_jsResources); }