/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <remarks> /// </remarks> /// <history> /// [VMasanas] 23/09/2004 Created /// </history> /// ----------------------------------------------------------------------------- protected override void OnLoad(EventArgs e) { base.OnLoad(e); cmdCancel.Click += cmdCancel_Click; cmdExport.Click += cmdExport_Click; cboPortals.SelectedIndexChanged += cboPortals_SelectedIndexChanged; try { if (!Page.IsPostBack) { var objportals = new PortalController(); cboPortals.DataTextField = "PortalName"; cboPortals.DataValueField = "PortalId"; cboPortals.DataSource = objportals.GetPortals(); cboPortals.DataBind(); cboPortals.SelectedValue = PortalId.ToString(CultureInfo.InvariantCulture); SetupSettings(); } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
public Dictionary <String, String> ToDictionary(String xpathroot = "") { var rtnDictionary = new Dictionary <string, string>(); if (XMLDoc != null) { rtnDictionary = AddToDictionary(rtnDictionary, xpathroot + "genxml/hidden/*"); rtnDictionary = AddToDictionary(rtnDictionary, xpathroot + "genxml/textbox/*"); rtnDictionary = AddToDictionary(rtnDictionary, xpathroot + "genxml/checkbox/*"); rtnDictionary = AddToDictionary(rtnDictionary, xpathroot + "genxml/dropdownlist/*"); rtnDictionary = AddToDictionary(rtnDictionary, xpathroot + "genxml/radiobuttonlist/*"); } if (!rtnDictionary.ContainsKey("moduleid")) { rtnDictionary.Add("moduleid", ModuleId.ToString("")); } if (!rtnDictionary.ContainsKey("portalid")) { rtnDictionary.Add("portalid", PortalId.ToString("")); } if (!rtnDictionary.ContainsKey("itemid")) { rtnDictionary.Add("itemid", ItemID.ToString("")); } return(rtnDictionary); }
/// <summary> /// Updates module settings. /// </summary> public void Update() { var controller = new ModuleController(); { controller.UpdateModuleSetting(_moduleId, "PortalId", PortalId.ToString()); int mode = (int)LeaderboardMode; { controller.UpdateModuleSetting(_moduleId, "LeaderboardMode", mode.ToString()); } string showPaging = ShowPaging.ToString(); { controller.UpdateModuleSetting(_moduleId, "ShowPaging", showPaging); } if (!String.IsNullOrEmpty(TemplateDirectory)) { controller.UpdateModuleSetting(_moduleId, "TemplateDirectory", TemplateDirectory.ToString()); } string pageSize = PageSize.ToString(); { controller.UpdateModuleSetting(_moduleId, "PageSize", pageSize); } } }
private string ReplaceTokens(Dictionary <string, string> testFields, string url, string tabId) { var defaultAlias = testFields.GetValue("DefaultAlias", String.Empty); var httpAlias = testFields.GetValue("Alias", String.Empty); var tabName = testFields["Page Name"]; var vanityUrl = testFields.GetValue("VanityUrl", String.Empty); var homeTabId = testFields.GetValue("HomeTabId", String.Empty); var userName = testFields.GetValue("UserName", String.Empty); string userId = String.Empty; if (!String.IsNullOrEmpty(userName)) { var user = UserController.GetUserByName(PortalId, userName); if (user != null) { userId = user.UserID.ToString(); } } return(url.Replace("{alias}", httpAlias) .Replace("{usealias}", defaultAlias) .Replace("{tabName}", tabName) .Replace("{tabId}", tabId) .Replace("{portalId}", PortalId.ToString()) .Replace("{vanityUrl}", vanityUrl) .Replace("{userId}", userId) .Replace("{defaultPage}", _defaultPage)); }
public override void ProcessRequest(HttpContext context) { base.ProcessRequest(context); // var isAdmin = false; context.Response.ContentType = "text/javascript"; var basePath = VirtualPathUtility.ToAbsolute("~/DesktopModules/dnncorp/forums/"); var scriptPath = VirtualPathUtility.ToAbsolute("~/DesktopModules/dnncorp/forums/scripts/"); var sb = new StringBuilder(); sb.Append("var rshScriptPath = '" + scriptPath + "';"); sb.AppendLine(Utilities.GetFile(context.Server.MapPath(scriptPath + "json2009.min.js"))); string langKey = "en-US"; if (context.Request.QueryString["language"] != null) { langKey = context.Request.QueryString["language"]; } if (context.Request.QueryString["isadmin"] != null) { // isAdmin = true; sb.AppendLine(Utilities.GetFile(context.Server.MapPath(scriptPath + "rsh.min.js"))); sb.AppendLine(Utilities.GetFile(context.Server.MapPath(scriptPath + "dnnforums.admin.js"))); } //sb.AppendLine(Utilities.GetFile(context.Server.MapPath(scriptPath + "dnnforums.js"))); sb.Replace("[SERVICESPATH]", basePath); sb.Replace("[PORTALID]", PortalId.ToString()); sb.Replace("[MODULEID]", ModuleId.ToString()); sb.Replace("[LANGUAGE]", langKey); // context.Response.Write(Utilities.LocalizeControl(sb.ToString(), isAdmin)); context.Response.Write(sb.ToString()); }
protected void btnSave_Click(object sender, EventArgs e) { try { CategoryInfo cat = new CategoryInfo(); if (Request.QueryString["id"] != null) { cat.CatID = Request.QueryString["id"]; } else { cat.CatID = PortalId.ToString() + "_" + txtCatID.Text; } cat.Description = txtDescription.Text.Trim(); if (ddlBookingPageID.SelectedValue != "-1") { cat.CatCode = "@@Booking_" + ddlBookingPageID.SelectedValue + "," + txtCatCode.Text.Trim(); } else { cat.CatCode = txtCatCode.Text.Trim(); } cat.DesktopListID = Convert.ToInt32(ddlDesktopListID.SelectedValue); cat.DesktopViewID = Convert.ToInt32(ddlDesktopViewID.SelectedValue); cat.CatName = txtCatName.Text; cat.OrderNumber = Convert.ToInt32(txtOrderNumber.Text); cat.ParentID = ddlParentID.SelectedValue; cat.PortalID = PortalId; cat.Visible = chkVisible.Checked; try { cat.NewsID = Convert.ToInt32(ddlNews.SelectedValue); } catch { } if (cat.CatID == "") { cat.CatID = PortalId.ToString() + "_" + lblCatID.Text; } CategoryController db = new CategoryController(); if (Request.QueryString["id"] != null) { db.Update(cat); } else { db.Insert(cat); } string url = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "admin_cat", "mid/" + this.ModuleId.ToString()); Response.Redirect(url); } catch (Exception ex) { Response.Write(ex.Message); } }
private string ReemplazoTags(string Query) { var mySQL = Settings[Query].ToString(); mySQL = mySQL.Replace("[DNN:UserID]", UserId.ToString()); mySQL = mySQL.Replace("[DNN:TabID]", TabId.ToString()); mySQL = mySQL.Replace("[DNN:ModuleID]", ModuleId.ToString()); mySQL = mySQL.Replace("[DNN:PortalID]", PortalId.ToString()); try // si está logueado exite user info { if (UserId != -1) // si está logueado exite user info { mySQL = mySQL.Replace("[DNN:Username]", UserInfo.Username.ToString()); mySQL = mySQL.Replace("[DNN:DisplayName]", UserInfo.DisplayName.ToString()); mySQL = mySQL.Replace("[DNN:Email]", UserInfo.Email.ToString()); mySQL = mySQL.Replace("[DNN:LastName]", UserInfo.LastName.ToString()); mySQL = mySQL.Replace("[DNN:FirstName]", UserInfo.FirstName.ToString()); } } catch (Exception ex) // error en userinfo { Excepcion(ex); } return(mySQL); }
protected override void ResolveIds(int currentModuleId) { base.ResolveIds(currentModuleId); //display tab using (IDataReader dr = DataProvider.Instance().GetPublishTabId(ChildDisplayTabName, PortalId)) { if (dr.Read()) { _childDisplayTabId = (int)dr["TabId"]; } else { //Default to setting for module string settingName = Utility.PublishDefaultDisplayPage + PortalId.ToString(CultureInfo.InvariantCulture); string setting = HostController.Instance.GetString(settingName); _childDisplayTabId = Convert.ToInt32(setting, CultureInfo.InvariantCulture); } } // For situations where the user is importing content from another system (file not generated from Publish) // they have no way of knowing what the top level category GUIDS are nor to include the entries in the // relationships section of the file. Note, the stored procedure verifies the relationship doesn't exist // before inserting a new row. var relationship = new ItemRelationship { RelationshipTypeId = Util.RelationshipType.CategoryToTopLevelCategory.GetId(), ParentItemId = TopLevelCategoryItemType.Category.GetId() }; Relationships.Add(relationship); bool save = false; //now the Unique Id's //Does this ItemVersion exist in my db? using (IDataReader dr = DataProvider.Instance().GetItemVersion(ItemVersionIdentifier, PortalId)) { if (dr.Read()) { //this item already exists //update some stuff??? } else { //this version does not exist. ItemId = -1; ItemVersionId = -1; ModuleId = currentModuleId; save = true; } } if (save) { Save(RevisingUserId); } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (Terms != null) { Attributes.Add("SelectedTerms", String.Join(",", Terms.Select(t => t.TermId.ToString()).ToArray())); } Attributes.Add("IncludeSystemVocabularies", IncludeSystemVocabularies.ToString().ToLowerInvariant()); Attributes.Add("IncludeTags", IncludeTags.ToString().ToLowerInvariant()); Attributes.Add("PortalId", PortalId.ToString()); }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// ----------------------------------------------------------------------------- protected void Page_Load(object sender, System.EventArgs e) { try { ClientAPI.RegisterClientVariable(Page, "portalId", PortalId.ToString(CultureInfo.InvariantCulture), true); ClientAPI.RegisterClientVariable(Page, "moduleId", ModuleId.ToString(CultureInfo.InvariantCulture), true); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
string FormatDoneUrl(string doneUrlTemplate, bool openInPopup, int userId) { var doneUrl = doneUrlTemplate.Replace("[USERID]", userId.ToString()) .Replace("[PORTALID]", PortalId.ToString()) .Replace("[TABID]", TabId.ToString()); if (openInPopup) { return(UrlUtils.PopUpUrl(doneUrl, PortalSettings, false, false, 550, 950)); } return(doneUrl); }
void AddLog(string message, EventLogController.EventLogType logType) { var log = new LogInfo(); log.AddProperty("Module", ModuleConfiguration.ModuleDefinition.DefinitionName); log.AddProperty("PortalId", PortalId.ToString()); log.AddProperty("UserId", UserId.ToString()); log.AddProperty("UserEmail", UserInfo.Email); log.AddProperty("RawUrl", Request.RawUrl); log.AddProperty("Message", message); log.LogTypeKey = logType.ToString(); EventLogController.Instance.AddLog(log); }
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "beaconid": // Int return(BeaconId.ToString(strFormat, formatProvider)); case "portalid": // Int return(PortalId.ToString(strFormat, formatProvider)); case "code": // NVarChar return(PropertyAccess.FormatString(Code, strFormat)); case "name": // NVarChar return(PropertyAccess.FormatString(Name, strFormat)); case "description": // NVarChar if (Description == null) { return(""); } ; return(PropertyAccess.FormatString(Description, strFormat)); case "coords": // VarChar return(PropertyAccess.FormatString(Coords, strFormat)); case "latitude": // Float return(Latitude.ToString(strFormat, formatProvider)); case "longitude": // Float return(Longitude.ToString(strFormat, formatProvider)); case "altitude": // Int return(Altitude.ToString(strFormat, formatProvider)); case "region": // Int return(Region.ToString(strFormat, formatProvider)); case "points": // Int return(Points.ToString(strFormat, formatProvider)); default: propertyNotFound = true; break; } return(Null.NullString); }
protected override void OnInit(EventArgs e) { base.OnInit(e); ServicesFramework.Instance.RequestAjaxScriptSupport(); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); DotNetNuke.UI.Utilities.ClientAPI.RegisterClientVariable(Page, "oc_websiteRoot", HostingEnvironment.ApplicationVirtualPath, true); if (System.IO.File.Exists(Server.MapPath("~/Providers/HtmlEditorProviders/CKEditor/ckeditor.js"))) { ClientResourceManager.RegisterScript(Page, "~/Providers/HtmlEditorProviders/CKEditor/ckeditor.js", FileOrder.Js.DefaultPriority); DotNetNuke.UI.Utilities.ClientAPI.RegisterClientVariable(Page, "PortalId", PortalId.ToString(), true); CKDNNporid.Value = PortalId.ToString(); } var folderId = Convert.ToInt32(Request.Params["FolderId"]); Folder = FolderManager.Instance.GetFolder(folderId); }
public override string ToString() { var data = new string[] { "Portal ID: " + PortalId.ToString(), "Tab ID: " + TabId.ToString(), "Module ID: " + ModuleId.ToString(), "Mod. Def.ID: " + ModuleDefId.ToString(), "Url: " + Url, "Unique Key: " + UniqueKey, "Last Modified: " + ModifiedTimeUtc.ToString("o"), "Culture: " + CultureCode, }; return(string.Join(", ", data)); }
protected void Page_Load(object sender, EventArgs e) { ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); var gettingStartedSrc = "http://gettingstarted.2sexycontent.org/router.aspx?"; // Add desired destination gettingStartedSrc += "destination=" + (ModuleConfiguration.DesktopModule.ModuleName == "2sxc" ? "autoconfigurecontent" : "autoconfigureapp"); // Add DNN Version gettingStartedSrc += "&DnnVersion=" + Assembly.GetAssembly(typeof(DotNetNuke.Common.Globals)).GetName().Version.ToString(4); // Add 2SexyContent Version gettingStartedSrc += "&2SexyContentVersion=" + SexyContent.ModuleVersion; // Add module type gettingStartedSrc += "&ModuleName=" + ModuleConfiguration.DesktopModule.ModuleName; // Add module id gettingStartedSrc += "&ModuleId=" + ModuleID; // Add Portal ID gettingStartedSrc += "&PortalID=" + PortalId.ToString(); // Add VDB / Zone ID (if set) var ZoneID = SexyContent.GetZoneID(PortalId); gettingStartedSrc += ZoneID.HasValue ? "&ZoneID=" + ZoneID.Value.ToString() : ""; // Add AppStaticName and Version if (AppId.HasValue && !IsContentApp) { var app = SexyContent.GetApp(ZoneId.Value, AppId.Value, Sexy.OwnerPS); gettingStartedSrc += "&AppGuid=" + app.AppGuid; if (app.Configuration != null) { gettingStartedSrc += "&AppVersion=" + app.Configuration.Version; gettingStartedSrc += "&AppOriginalId=" + app.Configuration.OriginalId; } } // Add DNN Guid var HostSettings = HostController.Instance.GetSettingsDictionary(); gettingStartedSrc += HostSettings.ContainsKey("GUID") ? "&DnnGUID=" + HostSettings["GUID"].ToString() : ""; // Add Portal Default Language gettingStartedSrc += "&DefaultLanguage=" + PortalSettings.DefaultLanguage; // Add current language gettingStartedSrc += "&CurrentLanguage=" + PortalSettings.CultureCode; // Set src to iframe frGettingStarted.Attributes["src"] = gettingStartedSrc; }
/// <summary> /// Updates module settings. /// </summary> public void Update() { var controller = new ModuleController(); { controller.UpdateModuleSetting(_moduleId, "PortalId", PortalId.ToString()); string showPaging = ShowPaging.ToString(); { controller.UpdateModuleSetting(_moduleId, "ShowPaging", showPaging); } if (!String.IsNullOrEmpty(TemplateDirectory)) { controller.UpdateModuleSetting(_moduleId, "TemplateDirectory", TemplateDirectory.ToString()); } string pageSize = PageSize.ToString(); { controller.UpdateModuleSetting(_moduleId, "PageSize", pageSize); } string showDateFilter = ShowDateFilter.ToString(); { controller.UpdateModuleSetting(_moduleId, "ShowDateFilter", showDateFilter); } string learnerModuleId = LearnerModuleId.ToString(); { controller.UpdateModuleSetting(_moduleId, "LearnerModuleId", learnerModuleId); } string beginDate = BeginDate.ToString(); { controller.UpdateModuleSetting(_moduleId, "BeginDate", beginDate); } string endDate = EndDate.ToString(); { controller.UpdateModuleSetting(_moduleId, "EndDate", endDate); } string dateRange = DateRange; { controller.UpdateModuleSetting(_moduleId, "DateRange", dateRange); } } }
protected void Page_Load(object sender, EventArgs e) { try { System.Web.UI.ScriptManager.GetCurrent(this.Page).EnablePageMethods = true; //Check that in any case this module cannot be accessed by anounymous users //set the session variable that will stop auto-loading from launcher if (UserInfo.UserID <= 0) { Session["UManage_StopAutoLauncher"] = 1; Response.Redirect(DotNetNuke.Common.Globals.NavigateURL()); } DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxScriptSupport(); if (this.IsPostBack == false) { VAR_PageBase.Text = DotNetNuke.Common.Globals.NavigateURL(); VAR_ModulePath.Text = this.ControlPath; VAR_ProfilePicBasePath.Text = Page.ResolveUrl("~/profilepic.ashx?userid="); VAR_CurrentLanguage.Text = (System.Threading.Thread.CurrentThread.CurrentCulture.Name).Split('-')[0].ToString(); VAR_PortalID.Text = PortalId.ToString(); var moduleController = new ModuleController(); var adminUserModule = moduleController.GetModuleByDefinition(PortalId, "User Accounts"); var url = DotNetNuke.Common.Globals.NavigateURL(adminUserModule.TabID, "Edit", "mid=" + adminUserModule.ModuleID, "userId={{userid}}", "popUp=true"); VAR_FullEditPath.Text = url; //set the session variable that will stop auto-loading from launcher Session["UManage_StopAutoLauncher"] = 1; if (UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) { this.VAR_IsAdmin.Text = "1"; } } } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
void LlenarIMGLogo() { try { //http://190.105.214.230/Portals/0/UsersConfig/1/Logo.gif //Direcotory = PortalSettings.HomeDirectoryMapPath + "\\" + "UsersConfig\\" + UserId.ToString(); string DIR = PortalSettings.HomeDirectoryMapPath + "\\" + "UsersConfig\\" + UserId.ToString(); string[] FilesList = Directory.GetFiles(DIR, "Logo.*"); string extension = ""; if (FilesList.Length == 1) { string[] splitter = { "." }; extension = FilesList[0].Split(splitter, StringSplitOptions.None)[1]; } img_logo.ImageUrl = "~/Portals/" + PortalId.ToString() + "/UsersConfig/" + UserId.ToString() + "/Logo." + extension + "?preventcache=" + DateTime.Now.Millisecond.ToString(); } catch {} }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// ----------------------------------------------------------------------------- protected void Page_Load(object sender, System.EventArgs e) { try { ClientAPI.RegisterClientVariable(Page, "portalId", PortalId.ToString(CultureInfo.InvariantCulture), true); ClientAPI.RegisterClientVariable(Page, "moduleId", ModuleId.ToString(CultureInfo.InvariantCulture), true); ClientAPI.RegisterClientVariable(Page, "AreYouSure", LocalizeString("AreYouSure"), true); ClientAPI.RegisterClientVariable(Page, "DeleteMessage", LocalizeString("DeleteMessage"), true); ClientAPI.RegisterClientVariable(Page, "Yes", LocalizeString("Yes"), true); ClientAPI.RegisterClientVariable(Page, "Cancel", LocalizeString("Cancel"), true); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
/// <summary> /// Updates module settings. /// </summary> public void Update() { var controller = new ModuleController(); { controller.UpdateModuleSetting(_moduleId, "PortalId", PortalId.ToString()); if (!String.IsNullOrEmpty(TemplateDirectory)) { controller.UpdateModuleSetting(_moduleId, "TemplateDirectory", TemplateDirectory.ToString()); } string showChart = ShowChart.ToString(); { controller.UpdateModuleSetting(_moduleId, "ShowChart", showChart); } } }
private NBrightInfo GetStats(int portalId, bool forceRefresh = false) { var cachekey = "nbrightbuydashboard*" + PortalId.ToString(""); var statsInfo = (NBrightInfo)Utils.GetCache(cachekey); if (statsInfo == null || StoreSettings.Current.DebugMode || forceRefresh) { var objCtrl = new NBrightBuyController(); statsInfo = new NBrightInfo(true); var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier; var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner; var statsXml = objCtrl.GetSqlxml("exec " + dbOwner + objQual + "NBrightBuy_DashboardStats " + portalId); statsInfo.XMLData = statsXml; Utils.SetCache(cachekey, statsInfo); } return(statsInfo); }
private void DisplayProductError(String msg) { //display the error if superuser (don;t want to log it.) var errmsg = ModCtrl.GetTemplateData(ModSettings, "productunavailable.html", Utils.GetCurrentCulture(), DebugMode); if (UserInfo.IsSuperUser) { errmsg += msg; } var obj = new NBrightInfo(true); var razorTemplateKey = "NBrightBuyRazorKey*productunavailable" + PortalId.ToString() + "*" + Utils.GetCurrentCulture(); errmsg = RazorUtils.RazorRender(obj, errmsg, razorTemplateKey, StoreSettings.Current.DebugMode); var l = new Literal(); l.Text = errmsg; phData.Controls.Add(l); //Response.StatusCode = 404; //causes 404 page on live site??? }
private string ParseControls(string Template) { string sOutput = Template; sOutput = sOutput.Replace("[JUMPTO]", "<asp:placeholder id=\"plhQuickJump\" runat=\"server\" />"); if (sOutput.Contains("[STATISTICS]")) { sOutput = sOutput.Replace("[STATISTICS]", "<am:Stats id=\"amStats\" MID=\"" + ModuleId + "\" PID=\"" + PortalId.ToString() + "\" runat=\"server\" />"); } if (sOutput.Contains("[WHOSONLINE]")) { sOutput = sOutput.Replace("[WHOSONLINE]", MainSettings.UsersOnlineEnabled ? "<asp:placeholder id=\"plhUsersOnline\" runat=\"server\" />" : string.Empty); } sOutput = sOutput.Replace("[PORTALID]", PortalId.ToString()); sOutput = sOutput.Replace("[MODULEID]", ModuleId.ToString()); sOutput = sOutput.Replace("[TABID]", TabId.ToString()); sOutput = sOutput.Replace("[USERID]", CurrentUserId.ToString()); return(sOutput); }
protected void btnSave_Click(object sender, EventArgs e) { try { NewsGroupInfo group = new NewsGroupInfo(); if (Request.QueryString["id"] != null) { group.NewsGroupID = Request.QueryString["id"]; } else { group.NewsGroupID = PortalId.ToString() + "_" + txtGroupID.Text; } group.Description = txtDescription.Text.Trim(); group.NewsGroupCode = txtGroupCode.Text.Trim(); group.NewsGroupName = txtGroupName.Text; group.OrderNumber = Convert.ToInt32(txtOrderNumber.Text); group.PortalID = PortalId; group.DesktopListID = Convert.ToInt32(ddlDesktopListID.SelectedValue); group.DesktopViewID = Convert.ToInt32(ddlDesktopViewID.SelectedValue); if (group.NewsGroupID == "") { group.NewsGroupID = PortalId.ToString() + "_" + lblGroupID.Text; } NewsGroupController db = new NewsGroupController(); if (Request.QueryString["id"] != null) { db.Update(group); } else { db.Insert(group); } string url = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "admin_group", "mid/" + this.ModuleId.ToString()); Response.Redirect(url); } catch (Exception ex) { Response.Write(ex.Message); } }
private void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { lblPortalId.Text = PortalId.ToString(CultureInfo.CurrentCulture); gvReport.PagerSettings.FirstPageText = Localization.GetString("FirstPageText", LocalResourceFile); gvReport.PagerSettings.LastPageText = Localization.GetString("LastPageText", LocalResourceFile); LoadItemTypes(); } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
protected void cmdUpdate_Click(object sender, EventArgs e) { if (Page.IsValid) { //subscriber settings //if (rbSubscriber.Checked) //{ HostController.Instance.Update(Utility.PublishAutoArchiveContent + PortalId.ToString(CultureInfo.InvariantCulture), chkArchiveContent.Checked.ToString(CultureInfo.InvariantCulture)); HostController.Instance.Update(Utility.PublishAutoApproveContent + PortalId.ToString(CultureInfo.InvariantCulture), chkApproveContent.Checked.ToString(CultureInfo.InvariantCulture)); HostController.Instance.Update(Utility.PublishSubscriberKey + PortalId.ToString(CultureInfo.InvariantCulture), txtAuthorizationKey.Text.ToString(CultureInfo.InvariantCulture)); HostController.Instance.Update(Utility.PublishSubscriberUrl + PortalId.ToString(CultureInfo.InvariantCulture), txtSubscriberServiceUrl.Text.ToString(CultureInfo.InvariantCulture)); //settingsController.UpdateHostSetting(Utility.PublishSyndicationMode + PortalId.ToString(CultureInfo.InvariantCulture), PublishSyndicationModes.Subscriber.ToString(CultureInfo.InvariantCulture)); //} //else //{ // settingsController.UpdateHostSetting(Utility.PublishSyndicationMode + PortalId.ToString(CultureInfo.InvariantCulture), PublishSyndicationModes.Publisher.ToString(CultureInfo.InvariantCulture)); //} Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, Utility.AdminContainer, "&mid=" + ModuleId.ToString(CultureInfo.InvariantCulture))); } }
public void WriteXml(XmlWriter writer) { writer.WriteStartElement("Exception"); writer.WriteElementString("AssemblyVersion", AssemblyVersion); writer.WriteElementString("PortalId", PortalId.ToString()); writer.WriteElementString("UserId", UserId.ToString()); writer.WriteElementString("TabId", TabId.ToString()); writer.WriteElementString("RawUrl", RawUrl); writer.WriteElementString("Referrer", Referrer); writer.WriteElementString("UserAgent", UserAgent); writer.WriteElementString("ExceptionHash", ExceptionHash); writer.WriteElementString("Message", Message); writer.WriteElementString("StackTrace", StackTrace); writer.WriteElementString("InnerMessage", InnerMessage); writer.WriteElementString("InnerStackTrace", InnerStackTrace); writer.WriteElementString("Source", Source); writer.WriteElementString("FileName", FileName); writer.WriteElementString("FileLineNumber", FileLineNumber.ToString()); writer.WriteElementString("FileColumnNumber", FileColumnNumber.ToString()); writer.WriteElementString("Method", Method); writer.WriteEndElement(); }
private void LoadSettings() { lblAuthorizationKey.Text = PortalController.Instance.GetCurrentPortalSettings().GUID.ToString(); lblServiceUrl.Text = Utility.WebServiceUrl; //PublishSyndicationModes mode = (PublishSyndicationModes) Enum.Parse(typeof(PublishSyndicationModes), s); //if (mode == PublishSyndicationModes.Publisher) //{ // rbPublisher.Checked = true; // rbSubscriber.Checked = false; //} //else //{ // rbSubscriber.Checked = true; // rbPublisher.Checked = false; //} string s = HostController.Instance.GetString(Utility.PublishAutoArchiveContent + PortalId.ToString(CultureInfo.InvariantCulture)); if (Utility.HasValue(s)) { chkArchiveContent.Checked = Convert.ToBoolean(s, CultureInfo.InvariantCulture); } s = HostController.Instance.GetString(Utility.PublishAutoApproveContent + PortalId.ToString(CultureInfo.InvariantCulture)); if (Utility.HasValue(s)) { chkApproveContent.Checked = Convert.ToBoolean(s, CultureInfo.InvariantCulture); } s = HostController.Instance.GetString(Utility.PublishSubscriberKey + PortalId.ToString(CultureInfo.InvariantCulture)); if (Utility.HasValue(s)) { txtAuthorizationKey.Text = s.ToString(CultureInfo.InvariantCulture); } s = HostController.Instance.GetString(Utility.PublishSubscriberUrl + PortalId.ToString(CultureInfo.InvariantCulture)); if (Utility.HasValue(s)) { txtSubscriberServiceUrl.Text = s.ToString(CultureInfo.InvariantCulture); } }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// ----------------------------------------------------------------------------- protected void Page_Load(object sender, System.EventArgs e) { try { ClientAPI.RegisterClientVariable(Page, "portalId", PortalId.ToString(CultureInfo.InvariantCulture), true); ClientAPI.RegisterClientVariable(Page, "moduleId", ModuleId.ToString(CultureInfo.InvariantCulture), true); ClientAPI.RegisterClientVariable(Page, "AreYouSure", LocalizeString("AreYouSure"), true); ClientAPI.RegisterClientVariable(Page, "DeleteMessage", LocalizeString("DeleteMessage"), true); ClientAPI.RegisterClientVariable(Page, "ExportMessage", LocalizeString("ExportMessage"), true); ClientAPI.RegisterClientVariable(Page, "YesDownload", LocalizeString("YesDownload"), true); ClientAPI.RegisterClientVariable(Page, "Cancel", LocalizeString("Cancel"), true); ClientAPI.RegisterClientVariable(Page, "customAttributes", Utils.GetTabModuleSetting(TabModuleId, "CustomFields").Replace(" ", ""), true); var settings = new AzureConfig(AzureConfig.ServiceName, PortalId); ClientAPI.RegisterClientVariable(Page, "customAttributesPrefix", $"extension_{settings.B2cApplicationId.Replace("-", "")}_", true); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }