protected void OnRatingClick(object sender, EventArgs e)
        {
            string[] ratingInfo = ((LinkButton)sender).CommandArgument.Split(new char[] { '_' });
            if (ratingInfo.Length == 2)
            {
                int rating = int.Parse(ratingInfo[1]);

                DataObject.AddRating(Udc, ratingInfo[0].ToNullableGuid(), dataObject.ObjectType, rating);

                _4screen.CSB.Extensions.Business.IncentivePointsManager.AddIncentivePointEvent(string.Format("{0}_RATE", Helper.GetObjectType(dataObject.ObjectType).Id.ToUpper()), Udc, ratingInfo[0]);
            }
            DrawRating();

            List <string> pageNames = new List <string>();

            pageNames.Add("RatingUpload");
            List <Dialog> dialogs = DialogEngine.GetDialogByPageName(pageNames, UserProfile.Current.UserId);

            if (dialogs.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                foreach (Dialog dialog in dialogs)
                {
                    sb.AppendFormat("<div><b>{0}</b><br/>{1}</div>", dialog.Title, dialog.Content);
                    sb.AppendFormat("<div style=\"margin-top:10px;margin-bottom:10px;height:1px;background-color:#CCCCCC;\"></div>");
                }
                string content = Regex.Replace(sb.ToString(), "<(.*?)>", "&lt;$1&gt;"); // Ugly, but safari needs it
                ScriptManager.RegisterStartupScript((Control)this.objVp, this.objVp.GetType(), "DialogWin", "SetPopupWindow('" + this.ClientID + string.Format("', 700, 0, 200, '{0}', '", language.GetString("TitleRating").StripForScript()) + content + "', true);", true);
            }
        }
Exemple #2
0
        private void ShowDialog()
        {
            List <string> pageNames = new List <string>();

            pageNames.Add("ProfileEditWidget");
            List <Dialog> dialogs = DialogEngine.GetDialogByPageName(pageNames, UserProfile.Current.UserId);

            if (dialogs.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                foreach (Dialog dialog in dialogs)
                {
                    sb.AppendFormat("<div><b>{0}</b><br/>{1}</div>", dialog.Title, dialog.Content);
                    sb.AppendFormat("<div style=\"margin-top:10px;margin-bottom:10px;height:1px;background-color:#CCCCCC;\"></div>");
                }
                string content = Regex.Replace(sb.ToString(), "<(.*?)>", "&lt;$1&gt;"); // Ugly, but safari needs it
                ScriptManager.RegisterStartupScript((Control)this, this.GetType(), "DialogWin", "SetPopupWindow('" + this.ClientID + string.Format("', 700, 0, 200, '{0}', '", language.GetString("LableWidgetMessages").StripForScript()) + content + "', true);", true);
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!isReadOnly)
            {
                ScriptManager.GetCurrent(this).Services.Add(new ServiceReference("/Services/WidgetService.asmx"));
            }

            // Show customization bar
            if (!string.IsNullOrEmpty(Request.QueryString["edit"]) && !isReadOnly)
            {
                if (Request.QueryString["edit"] == "content")
                {
                    CustomizationBarContent customizationBar = (CustomizationBarContent)LoadControl("~/UserControls/CustomizationBarContent.ascx");
                    customizationBar.ID          = "cb";
                    customizationBar.CommunityID = PageInfo.EffectiveCommunityId.Value;
                    PhCB.Controls.Add(customizationBar);
                }
                else if (Request.QueryString["edit"] == "style")
                {
                    CustomizationBarStyle customizationBar = (CustomizationBarStyle)LoadControl("~/UserControls/CustomizationBarStyle.ascx");
                    customizationBar.ID          = "cb";
                    customizationBar.CommunityID = PageInfo.EffectiveCommunityId.Value;
                    PhCB.Controls.Add(customizationBar);
                }

                // Show dialogs
                if (pageOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity"))
                {
                    List <string> pageNames = new List <string>();
                    pageNames.Add("ProfileEditStyle");
                    List <Dialog> dialogs = DialogEngine.GetDialogByPageName(pageNames, UserProfile.Current.UserId);
                    if (dialogs.Count > 0)
                    {
                        StringBuilder sb = new StringBuilder();
                        foreach (Dialog dialog in dialogs)
                        {
                            sb.AppendFormat("<div><b>{0}</b><br/>{1}</div>", dialog.Title, dialog.Content);
                            sb.AppendFormat("<div style=\"margin-top:10px;margin-bottom:10px;height:1px;background-color:#CCCCCC;\"></div>");
                        }
                        string content = Regex.Replace(sb.ToString(), "<(.*?)>", "&lt;$1&gt;"); // Ugly, but safari needs it
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "DialogWin", "SetPopupWindow('" + this.ClientID + "', 700, 0, 200, 'Mitteilungen', '" + content + "', true);", true);
                    }
                }
            }

            // Load tabbar
            if (pageOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("Community") || pageOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity"))
            {
                TabBar tabBar = (TabBar)LoadControl("~/UserControls/TabBar.ascx");
                tabBar.ID              = "tb";
                tabBar.WDC             = wdc;
                tabBar.Pages           = pages;
                tabBar.CurrentPage     = currentPage;
                tabBar.IsOwner         = isOwner;
                tabBar.IsMember        = isMember;
                tabBar.PageOrCommunity = pageOrCommunity;
                tabBar.Community       = community;
                Ph.Controls.Add(tabBar);
            }

            // Load layout
            Layout layout = Layouts.GetLayout(community.CTY_Layout);

            if (layout == null)
            {
                layout = Layouts.GetLayout("Default");
                community.CTY_Layout = "Default";
                wdc.SubmitChanges();
                wdc.hisp_WidgetInstance_ReorderColumns(PageInfo.EffectiveCommunityId.Value, layout.NumberDropZones);
            }
            if (isReadOnly)
            {
                Ph2.Controls.Add(Page.ParseControl(layout.DisplayTemplate));
            }
            else
            {
                Ph2.Controls.Add(Page.ParseControl(layout.DragDropTemplate));
            }
            columnWidths = layout.ColumnWidths;
            columnPanels = new Panel[layout.NumberDropZones];
            for (int i = 0; i < columnPanels.Length; i++)
            {
                columnPanels[i] = (Panel)Ph2.FindControl("WCP" + i);
                if (!isReadOnly)
                {
                    columnPanels[i].Attributes["PageId"] = currentPage.PAG_ID.ToString();
                }
            }

            LoadWidgets();
        }