Esempio n. 1
0
        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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        private void PopulateLabels()
        {
            Title1.EditText = GroupResources.GroupEditLabel;
            //EditAltText = Resource.EditImageAltText;

            divEditSubscriptions.Visible = tdSubscribedHead.Visible = Page.Request.IsAuthenticated;
            notificationUrl = SiteRoot + "/Groups/EditSubscriptions.aspx?mid="
                              + ModuleId.ToString(CultureInfo.InvariantCulture)
                              + "&pageid=" + PageId.ToString(CultureInfo.InvariantCulture);

            editSubscriptionsLink.NavigateUrl = notificationUrl;

            notificationLink = "<a title='" + GroupResources.GroupModuleEditSubscriptionsLabel
                               + "' href='" + SiteRoot + "/Groups/EditSubscriptions.aspx?mid="
                               + ModuleId.ToString(CultureInfo.InvariantCulture)
                               + "&amp;pageid=" + PageId.ToString(CultureInfo.InvariantCulture)
                               + "'><img src='" + ImageSiteRoot + "/Data/SiteImages/FeatureIcons/email.png' /></a>";

            lnkModuleRSS.NavigateUrl = SiteRoot
                                       + "/Groups/RSS.aspx?mid=" + this.ModuleId.ToString()
                                       + "&pageid=" + CurPageSettings.PageId.ToString();

            lnkModuleRSS.ImageUrl = ImageSiteRoot + "/Data/SiteImages/" + RssImageFile;

            lnkModuleRSS.Text = "RSS";

            lnkModuleRSS.Visible = EnableRSSAtModuleLevel;

            editSubscriptionsLink.Text = GroupResources.GroupModuleEditSubscriptionsLabel;
        }
Esempio n. 4
0
        protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            //there is no parent category to display for Top Level items - BD
            if (ddlCategory.SelectedValue == "-1")
            {
                lblShowParent.Visible            = false;
                chkShowParent.Visible            = false;
                chkShowParentDescription.Visible = false;
                lblShowParentDescription.Visible = false;
            }
            else
            {
                lblShowParent.Visible            = true;
                chkShowParent.Visible            = true;
                chkShowParentDescription.Visible = true;
                lblShowParentDescription.Visible = true;
            }

            var qsp = new QueryStringParameters();

            qsp.ClearKeys();
            qsp.Add("ctl", Utility.AdminContainer);
            qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture));
            qsp.Add("adminType", "categorysort");
            qsp.Add("itemid", ddlCategory.SelectedValue);


            lnkSortCategory.NavigateUrl = BuildSortUrl();
        }
Esempio n. 5
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 "rideid": // Int
                return(RideId.ToString(strFormat, formatProvider));

            case "moduleid": // Int
                return(ModuleId.ToString(strFormat, formatProvider));

            case "userid": // Int
                return(UserId.ToString(strFormat, formatProvider));

            case "incoming": // Bit
                return(Incoming.ToString());

            case "location": // NVarChar
                return(PropertyAccess.FormatString(Location, strFormat));

            case "notes": // NVarCharMax
                return(PropertyAccess.FormatString(Notes, strFormat));

            case "placesavailable": // Int
                return(PlacesAvailable.ToString(strFormat, formatProvider));

            default:
                propertyNotFound = true;
                break;
            }

            return(Null.NullString);
        }
        public string BuildEditUrl(string currentItemType)
        {
            string url = string.Empty;

            try
            {
                //find the location of the ams admin module on the site.
                //DotNetNuke.Entities.Modules.ModuleController objModules = new ModuleController();

                if (ItemId > -1)
                {
                    int versionId = -1;
                    if (!VersionInfoObject.IsNew)
                    {
                        versionId = VersionInfoObject.ItemVersionId;
                    }

                    url = DotNetNuke.Common.Globals.NavigateURL(TabId, string.Empty, "ctl=" + Utility.AdminContainer,
                                                                "mid=" + ModuleId.ToString(CultureInfo.InvariantCulture), "adminType=" + currentItemType + "Edit",
                                                                "versionId=" + versionId.ToString(CultureInfo.InvariantCulture), "returnUrl=" + HttpUtility.UrlEncode(Request.RawUrl));
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }

            return(url);
        }
Esempio n. 7
0
        //*******************************************************
        //
        // The Page_Load event handler on this User Control is used to
        // obtain a DataReader of link information from the Links
        // table, and then databind the results to a templated DataList
        // server control.  It uses the ASPNET.StarterKit.Portal.LinkDB()
        // data component to encapsulate all data functionality.
        //
        //*******************************************************

        private void Page_Load(object sender, System.EventArgs e)
        {
            // Set the link image type
            if (IsEditable)
            {
                linkImage = "~/images/edit.gif";
            }
            else
            {
                linkImage = "~/images/navlink.gif";
            }

            // Obtain links information from the Links table
            // and bind to the list control
            ASPNET.StarterKit.Portal.LinkDB links = new ASPNET.StarterKit.Portal.LinkDB();

            myDataList.DataSource = links.GetLinks(ModuleId);
            myDataList.DataBind();

            // Ensure that only users in role may add links
            if (PortalSecurity.IsInRoles(ModuleConfiguration.AuthorizedEditRoles))
            {
                EditButton.Text        = "Add Link";
                EditButton.NavigateUrl = "~/DesktopModules/EditLinks.aspx?mid=" + ModuleId.ToString();
            }
        }
        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 "namespaceid": // Int
                return(NamespaceId.ToString(strFormat, formatProvider));

            case "parentid": // Int
                return(ParentId.ToString(strFormat, formatProvider));

            case "moduleid": // Int
                return(ModuleId.ToString(strFormat, formatProvider));

            case "namespacename": // NVarChar
                return(PropertyAccess.FormatString(NamespaceName, strFormat));

            case "lastqualifier": // NVarChar
                return(PropertyAccess.FormatString(LastQualifier, strFormat));

            case "description": // NVarCharMax
                if (Description == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(Description, strFormat));

            default:
                propertyNotFound = true;
                break;
            }

            return(Null.NullString);
        }
Esempio n. 9
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());
        }
Esempio n. 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!Page.IsPostBack)
         {
             CategoryController engine = new CategoryController();
             menu.MenuName = "BCM_" + ModuleId.ToString();
             int menuwidth = Convert.ToInt32(Settings["menuwidth"]);
             if (menuwidth > 0)
             {
                 menu.MenuWidth = Convert.ToInt32(Settings["menuwidth"]);
             }
             bool ExpandAll = false;
             if (Settings["ExpandAll"] != null)
             {
                 ExpandAll = Convert.ToBoolean(Settings["ExpandAll"]);
             }
             string CSSPrefix = "";
             if (Settings["CSSPrefix"] != null)
             {
                 CSSPrefix = Settings["CSSPrefix"].ToString();
             }
             menu.ExpandAll  = ExpandAll;
             menu.CSSPrefix  = CSSPrefix;
             menu.DataSource = engine.LoadTreeForMenu(PortalId, Convert.ToInt32(Settings["source"]), Convert.ToString(Settings["code"]), Convert.ToString(Settings["parentcat"]), System.Threading.Thread.CurrentThread.CurrentCulture.ToString());
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Esempio n. 11
0
        protected override void LoadNewItem()
        {
            List <Term> terms = null;

            // Stream: get terms from module settings
            if (ModuleConfiguration.ModuleDefinition.DefinitionName == Const.StreamModuleDefinitionName)
            {
                var settings = new StreamSettingsRepository().GetSettings(ModuleConfiguration);
                terms = settings.IncludeTerms;
            }

            // Agent: get terms from current tab
            if (ModuleConfiguration.ModuleDefinition.DefinitionName == Const.AgentModuleDefinitionName)
            {
                terms = PortalSettings.ActiveTab.Terms;

                txtAgentModuleId.Text = ModuleId.ToString();
            }

            if (!terms.IsNullOrEmpty())
            {
                var termSelector = new TermSelector();
                termSelector.SelectTerms(selTerms, terms);
            }

            buttonUpdate.Text = LocalizeString("Add.Text");
        }
Esempio n. 12
0
 protected string GetArticleEditUrl(object itemVersionId)
 {
     if (itemVersionId != null)
     {
         return(BuildLinkUrl("&ctl=" + Utility.AdminContainer + "&mid=" + ModuleId.ToString(CultureInfo.InvariantCulture) + "&adminType=articleEdit&versionid=" + itemVersionId));
     }
     return(string.Empty);
 }
Esempio n. 13
0
        protected string GetJsonUrl()
        {
            var url = DotNetNuke.Common.Globals.NavigateURL(this.TabId);

            url += (url.Contains("?") ? "&" : "?") + "mid=" + ModuleId.ToString() +
                   "&standalone=true&type=data&popUp=true";
            return(url);
        }
Esempio n. 14
0
        public override 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 "createdbyuserdisplayname": // NVarChar
                if (CreatedByUserDisplayName == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(CreatedByUserDisplayName, strFormat));

            case "lastmodifiedbyuserdisplayname": // NVarChar
                if (LastModifiedByUserDisplayName == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(LastModifiedByUserDisplayName, strFormat));

            case "documentationcontents": // NVarCharMax
                if (DocumentationContents == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(DocumentationContents, strFormat));

            case "classname": // NVarChar
                return(PropertyAccess.FormatString(ClassName, strFormat));

            case "namespacename": // NVarChar
                return(PropertyAccess.FormatString(NamespaceName, strFormat));

            case "fullqualifier": // NVarChar
                return(PropertyAccess.FormatString(FullQualifier, strFormat));

            case "moduleid": // Int
                return(ModuleId.ToString(strFormat, formatProvider));

            case "componentname": // NVarChar
                return(PropertyAccess.FormatString(ComponentName, strFormat));

            case "latestversion": // VarChar
                return(PropertyAccess.FormatString(LatestVersion, strFormat));

            case "codeblockcount": // Int
                if (CodeBlockCount == null)
                {
                    return("");
                }
                ;
                return(((int)CodeBlockCount).ToString(strFormat, formatProvider));

            default:
                return(base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound));
            }
        }
Esempio n. 15
0
        private string GetRssUrl()
        {
            if (feedburnerFeedUrl.Length > 0)
            {
                return(feedburnerFeedUrl);
            }

            return(String.Format("{0}/blog{1}rss.aspx", SiteRoot, ModuleId.ToString(CultureInfo.InvariantCulture)));
        }
Esempio n. 16
0
 protected string GetVersionsUrl(object itemId)
 {
     if (itemId != null)
     {
         string categoryId = cboCategories.SelectedValue.ToString(CultureInfo.InvariantCulture);
         return(BuildLinkUrl("&ctl=" + Utility.AdminContainer + "&mid=" + ModuleId.ToString(CultureInfo.InvariantCulture) + "&adminType=versionslist&itemid=" + itemId + "&categoryid=" + categoryId));
     }
     return(string.Empty);
 }
Esempio n. 17
0
        protected string FormatBlogUrl(string itemUrl, int itemId)
        {
            if (itemUrl.Length > 0)
            {
                return(SiteRoot + itemUrl.Replace("~", string.Empty));
            }

            return(SiteRoot + "/Blog/ViewPost.aspx?pageid=" + PageId.ToString(CultureInfo.InvariantCulture)
                   + "&ItemID=" + itemId.ToString(CultureInfo.InvariantCulture)
                   + "&mid=" + ModuleId.ToString(CultureInfo.InvariantCulture));
        }
Esempio n. 18
0
        private void BindList()
        {
            if (pageId == -1)
            {
                return;
            }
            if (moduleId == -1)
            {
                return;
            }

            //lnkEditCategories.ToolTip = BlogResources.BlogEditCategoriesLabel;
            //lnkEditCategories.Visible = canEdit;
            //lnkEditCategories.NavigateUrl = SiteRoot
            //    + "/Blog/EditCategory.aspx?pageid=" + PageId.ToString(CultureInfo.InvariantCulture)
            //    + "&mid=" + this.ModuleId.ToString(CultureInfo.InvariantCulture);

            //this.lnkEditCategories.ImageUrl = Page.ResolveUrl("~/Data/SiteImages/" + EditContentImage);
            //this.lnkEditCategories.Text = BlogResources.EditImageAltText;

            using (IDataReader reader = Blog.GetCategories(ModuleId))
            {
                if (renderAsTagCloud)
                {
                    dlCategories.Visible       = false;
                    cloud.DataHrefFormatString = SiteRoot + "/Blog/ViewCategory.aspx?cat={0}&amp;mid="
                                                 + ModuleId.ToString(CultureInfo.InvariantCulture)
                                                 + "&amp;pageid=" + PageId.ToString(CultureInfo.InvariantCulture);

                    cloud.UseWeightInTextFormat = true;
                    cloud.DataHrefField         = "CategoryID";
                    cloud.DataTextField         = "Category";
                    cloud.DataWeightField       = "PostCount";
                    cloud.DataSource            = reader;
                    cloud.DataBind();

                    if (cloud.Items.Count == 0)
                    {
                        Visible = false;
                    }
                }
                else
                {
                    cloud.Visible           = false;
                    dlCategories.DataSource = reader;
                    dlCategories.DataBind();
                    dlCategories.Visible = (dlCategories.Items.Count > 0);
                    if (dlCategories.Items.Count == 0)
                    {
                        Visible = false;
                    }
                }
            }
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params["custom"] != null)
            {
                CustomFilterSelection = Request.Params["custom"];
            }
            TargetModuleId = ModuleId.ToString();
            if (Settings[ModuleSettingNames.HideMapPointsOnPageLoad] != null)
            {
                HidePointsOnPageLoad = Convert.ToBoolean(Settings[ModuleSettingNames.HideMapPointsOnPageLoad]);
            }

            if (!IsPostBack)
            {
                AddMapsDiv();



                litMap.Visible = true;

                CustomFieldLabel = Settings[ModuleSettingNames.CustomFieldLabel] != null?Convert.ToString(Settings[ModuleSettingNames.CustomFieldLabel]) : "Custom Field";

                LoadMembers();
                LoadControls();

                if (HidePointsOnPageLoad)
                {
                    MaxPoints = 0;
                }

                litMarkers.Text = SerializeMarkers(LoadMarkers(ModuleId));

                if (Request.Params["m"] != null && Request.Params["address"] != null)
                {
                    string moduleId = Request.Params["m"];

                    if (moduleId == ModuleId.ToString())
                    {
                        var address   = Request.Params["address"];
                        var custom    = Request.Params["custom"];
                        var proximity = Request.Params["proximity"];

                        IsSearch  = true;
                        MaxPoints = 9999999;
                        Search(address, custom, proximity);

                        txtAddress.Text = address;
                        ddlCustomFilter.SelectedValue = custom;
                        ddlProximity.SelectedValue    = proximity;
                    }
                }
            }
        }
Esempio n. 20
0
        private string BuildSortUrl()
        {
            var qsp = new QueryStringParameters();

            qsp.ClearKeys();
            qsp.Add("ctl", Utility.AdminContainer);
            qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture));
            qsp.Add("adminType", "categorysort");
            qsp.Add("windowClose", "true");
            qsp.Add("itemid", ddlCategory.SelectedValue);
            return(DotNetNuke.Common.Globals.NavigateURL(TabId, "", qsp.ToString()));
        }
Esempio n. 21
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// cmdAddNewRecord_Click redirect to add new record dialog when the add new record button is clicked
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 protected void cmdAddNewRecord_Click(System.Object sender, System.EventArgs e)
 {
     try
     {
         // return to main page
         Response.Redirect(Globals.NavigateURL(AddNewRecord, "mid=" + ModuleId.ToString()));
     }
     catch (Exception exc) //Module failed to load
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
Esempio n. 22
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);
     }
 }
        private void AddPrintAction()
        {
            ModuleAction action = new ModuleAction(GetNextActionID());

            action.Title           = Localization.GetString(ModuleActionType.PrintModule, Localization.GlobalResourceFile);
            action.CommandName     = ModuleActionType.PrintModule;
            action.CommandArgument = "";
            action.Icon            = "action_print.gif";
            action.Url             = Globals.NavigateURL(TabId, "", "mid=" + ModuleId.ToString(), "SkinSrc=" + Globals.QueryStringEncode("[G]" + SkinController.RootSkin + "/" + Globals.glbHostSkinFolder + "/" + "No Skin"), "ContainerSrc=" + Globals.QueryStringEncode("[G]" + SkinController.RootContainer + "/" + Globals.glbHostSkinFolder + "/" + "No Container"), "dnnprintmode=true");
            action.Secure          = SecurityAccessLevel.Anonymous;
            action.UseActionEvent  = true;
            action.Visible         = true;
            action.NewWindow       = true;
            _actions.Add(action);
        }
        protected string GetVersionEditUrl(object row)
        {
            var view = (DataRowView)row;
            var qsp  = new QueryStringParameters();

            qsp.ClearKeys();
            qsp.Add("ctl", Utility.AdminContainer);
            qsp.Add("mid", ModuleId.ToString(CultureInfo.InvariantCulture));
            qsp.Add("adminType", view["adminType"]);
            qsp.Add("versionid", view["ItemVersionId"]);
            //todo: why would we need modid on the URL for editing a version?
            //qsp.Add("modid", view["ModuleId"]);

            return(BuildLinkUrl(qsp.ToString()));
        }
Esempio n. 25
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));
        }
        /// -----------------------------------------------------------------------------
        /// <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);
            }
        }
Esempio n. 27
0
        private void RegisterSyncJS(bool isPostback)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("function SyncWithTranscriptControl" + LearnerModuleId.ToString() + "()");
            sb.Append("{");
            sb.Append("     var moduleId = " + LearnerModuleId.ToString() + ";");
            sb.Append("     var thisModuleId = " + ModuleId.ToString() + ";");
            sb.Append("     var ctrlSourceId = 'dnn_ctr' + moduleId + '_EnrollmentDefault_EnrollmentTranscripts_ctlLearnerPanes_ctlCompletionDate_cmbDateRange';");
            sb.Append("     var cmbDateSource = document.getElementById(ctrlSourceId);");
            sb.Append("     var ctrlActiveLearnerId = 'dnn_ctr' + moduleId + '_EnrollmentDefault_txtActiveLearner';");
            sb.Append("     var txtActiveLearnerSource = document.getElementById(ctrlActiveLearnerId);");
            sb.Append("     if (txtActiveLearnerSource != null)");
            sb.Append("     {");
            sb.Append("         var txtActiveLearnerHidden = document.getElementById('" + txtActiveLearnerHidden.ClientID + "');");
            sb.Append("         txtActiveLearnerHidden.value = txtActiveLearnerSource.value;");
            sb.Append("     }");
            sb.Append("     if (cmbDateSource != null)");
            sb.Append("     {");
            sb.Append("         var dateRange = cmbDateSource.options[cmbDateSource.selectedIndex].value;");
            sb.Append("         var hiddenButton = document.getElementById('" + btnHidden2.ClientID + "');");
            sb.Append("         if (document.getElementById('dnn_ctr' + thisModuleId + '_ActivitySummary_ctlCompletionDate_rdpStartDate') != null)");
            sb.Append("         {");
            sb.Append("             if (dateRange == 'Custom')");
            sb.Append("             {");
            sb.Append("                 var startDateSource = $find('dnn_ctr' + moduleId + '_EnrollmentDefault_EnrollmentTranscripts_ctlLearnerPanes_ctlCompletionDate_rdpStartDate');");
            sb.Append("                 var endDateSource = $find('dnn_ctr' + moduleId + '_EnrollmentDefault_EnrollmentTranscripts_ctlLearnerPanes_ctlCompletionDate_rdpEndDate');");
            sb.Append("                 $find('dnn_ctr' + thisModuleId + '_ActivitySummary_ctlCompletionDate_rdpStartDate').set_selectedDate(startDateSource.get_selectedDate());");
            sb.Append("                 $find('dnn_ctr' + thisModuleId + '_ActivitySummary_ctlCompletionDate_rdpEndDate').set_selectedDate(endDateSource.get_selectedDate());");
            sb.Append("             }");
            sb.Append("             var cmbDateMine = document.getElementById('dnn_ctr' + thisModuleId + '_ActivitySummary_ctlCompletionDate_cmbDateRange');");
            sb.Append("             cmbDateMine.selectedIndex = cmbDateSource.selectedIndex;");
            sb.Append("             hiddenButton.click();");
            sb.Append("         }");
            sb.Append("     }");
            sb.Append("}");
            //if (!isPostback)
            //{
            //    sb.Append("jQuery(document).ready(function(event) {");
            //    sb.Append("SyncWithTranscriptControl" + LearnerModuleId.ToString() + "();");
            //    sb.Append("});");
            //}


            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", sb.ToString(), true);
        }
Esempio n. 28
0
        private void PopulateLabels()
        {
            btnBackToVote.Text    = PollResources.PollBackToVoteButton;
            btnBackToVote.ToolTip = PollResources.PollBackToVoteToolTip;

            btnShowResults.Text    = PollResources.PollShowResultsButton;
            btnShowResults.ToolTip = PollResources.PollShowResultsToolTip;


            lnkMyPollHistory.Text        = PollResources.PollMyPollHistoryButton;
            lnkMyPollHistory.NavigateUrl = SiteRoot + "/Poll/MyPollHistory.aspx?pageid="
                                           + PageId.ToString(CultureInfo.InvariantCulture)
                                           + "&mid=" + ModuleId.ToString(CultureInfo.InvariantCulture);

            moduleTitle.EditText = PollResources.PollModuleEditText;
            moduleTitle.EditUrl  = SiteRoot + "/Poll/PollChoose.aspx";
        }
Esempio n. 29
0
        private void SetupImageArray(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }

            StringBuilder script = new StringBuilder();

            script.Append("var imset" + ModuleId.ToString(CultureInfo.InvariantCulture) + " = [");
            string comma = string.Empty;

            foreach (DataRow row in dt.Rows)
            {
                script.Append(comma);
                script.Append("{'caption':'");
                script.Append(Server.HtmlEncode(row["Caption"].ToString()).HtmlEscapeQuotes());
                script.Append("','url':'");
                script.Append(ImageSiteRoot + webSizeBaseUrl);
                script.Append(row["WebImageFile"].ToString());
                script.Append("'");
                script.Append("}");

                comma = ",";
            }


            script.Append("];");

            gbLauncher.Visible     = true;
            gbLauncher.NavigateUrl = Request.RawUrl;
            gbLauncher.ToolTip     = GalleryResources.LaunchGalleryLink;
            gbLauncher.ClientClick = "return GB_showImageSet(imset" + ModuleId.ToInvariantString() + ", 1)";

            Page.ClientScript.RegisterClientScriptBlock(typeof(Page),
                                                        "img" + ModuleId.ToInvariantString(), "\n<script type=\"text/javascript\">\n"
                                                        + script.ToString()
                                                        + "\n</script>");
        }
Esempio n. 30
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);
        }