Exemple #1
0
    void OnMouseDown()
    {
        if (!pause)
        {
            //Debug.Log("pause" + pause);
            var v3 = Input.mousePosition;
            v3.z = distance;
            pos  = Camera.main.ScreenToWorldPoint(v3);
            if (pos.x > 0)
            {
                pos.x = Mathf.Round((int)pos.x / 2) * 2 + 1;
            }
            if (pos.x <= 0)
            {
                pos.x = Mathf.Round((int)pos.x / 2) * 2 - 1;
            }
            if (pos.y < 0)
            {
                pos.y = Mathf.Round((int)pos.y / 2) * 2 - 1;
            }
            if (pos.y >= 0)
            {
                pos.y = Mathf.Round((int)pos.y / 2) * 2 + 1;
            }
            //Debug.Log("OnMouseDown " + pos);
            mouseDown = true;
            if (isSafePlant((int)pos.x, (int)pos.y))
            {
                if (input)
                {
                    GameObject obj = (GameObject)Instantiate(backgroundIn, pos, Quaternion.identity);
                    // obj.AddComponent<RemovePortal>();
                    obj.AddComponent <PortalId>();
                    obj.GetComponent <Renderer>().material.color = portalColor;
                    //obj.GetComponent<Renderer>().material.mainTexture = inPortal;
                    obj.GetComponent <SpriteRenderer>().sprite = inPortal;
                    inPos = pos;
                    //Debug.Log("inPos: " + pos);

                    PortalId idOfNewPortal = obj.GetComponent <PortalId>();
                    idOfNewPortal.setId(id);
                    por = new InputPortal(id);
                    por.InputPortalGO = obj;
                    input             = false;
                }
                else
                {
                    currentOutputPortal = (GameObject)Instantiate(backgroundOut, pos, Quaternion.identity);
                    //currentOutputPortal.AddComponent<RemovePortal>();
                    currentOutputPortal.AddComponent <PortalId>();
                    currentOutputPortal.GetComponent <Renderer>().material.color = portalColor;
                    currentOutputPortal.GetComponent <SpriteRenderer>().sprite   = inPortal;
                    PortalId idOfNewPortal = currentOutputPortal.GetComponent <PortalId>();
                    idOfNewPortal.setId(id);
                    outputPortal = true;
                    input        = true;
                }
            }
        }
    }
        public override int GetHashCode()
        {
            int hash = 1;

            if (SceneId.Length != 0)
            {
                hash ^= SceneId.GetHashCode();
            }
            if (PortalId.Length != 0)
            {
                hash ^= PortalId.GetHashCode();
            }
            if (ObjectPlacementId.Length != 0)
            {
                hash ^= ObjectPlacementId.GetHashCode();
            }
            if (PortalPlacementId.Length != 0)
            {
                hash ^= PortalPlacementId.GetHashCode();
            }
            if (PortkeyAsset.Length != 0)
            {
                hash ^= PortkeyAsset.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        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);
        }
Exemple #4
0
        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 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);
            }
        }
Exemple #6
0
        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));
        }
        /// <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);
                }
            }
        }
Exemple #8
0
        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());
        }
Exemple #9
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        List <AddPortal.Tuple> portals = AddPortalScript.portals;

        //Debug.Log("collision with: " + coll.name);
        if ((coll.name.StartsWith(outputPortal.name)))
        {
            PortalId something = coll.gameObject.GetComponent <PortalId>();
            int      id        = something.id;
            // Debug.Log("Collision portal id: " + id);
            AddPortal.Tuple onIndex = null;
            foreach (AddPortal.Tuple tup in portals)
            {
                if (tup.outputPortal.getId() == id)
                {
                    onIndex = tup;
                    break;
                }
            }
            Destroy(coll.gameObject);
            Destroy(onIndex.inputPortal.InputPortalGO);
        }

        if (coll.name.StartsWith(portalPart.name))
        {
            Destroy(coll.gameObject, SnakeScript.moveTime);
        }
    }
Exemple #10
0
        /// -----------------------------------------------------------------------------
        /// <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);
            }
        }
        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());
 }
Exemple #13
0
 /// -----------------------------------------------------------------------------
 /// <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);
     }
 }
Exemple #14
0
        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);
        }
Exemple #16
0
        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);
        }
Exemple #17
0
        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);
        }
Exemple #18
0
        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));
        }
Exemple #19
0
        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);
                }
            }
        }
Exemple #21
0
        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);
            }
        }
Exemple #22
0
 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???
        }
Exemple #27
0
        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);
            }
        }
Exemple #29
0
        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);
            }
        }
Exemple #30
0
        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)));
            }
        }