protected void lvPages_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        if (e.Item.ItemType != ListViewItemType.DataItem)
        {
            return;
        }

        PagesConfig pagesConfig = Config.Get <PagesConfig>();

        PageSiteNode node = (PageSiteNode)e.Item.DataItem;
        PageNode     page = pageManager.GetPageNode(node.Id);

        if (!node.ShowInNavigation || string.IsNullOrEmpty(node.Title))
        {
            e.Item.Visible = false;
            return;
        }

        HyperLink hlPage = (HyperLink)e.Item.FindControl("hlPage");

        hlPage.Text        = node.Title;
        hlPage.NavigateUrl = page.GetFullUrl(Thread.CurrentThread.CurrentCulture, false);

        if (node.HasChildNodes)
        {
            ListView lvPages = e.Item.FindControl("lvPages") as ListView;
            if (lvPages != null)
            {
                lvPages.DataSource = node.ChildNodes;
                lvPages.DataBind();
            }
        }
    }
Example #2
0
        public override bool SaveStep(ref System.Collections.Specialized.NameValueCollection queryString)
        {
            Page.Validate("WizardStep1");
            if (Page.IsValid)
            {
                page.Title       = Common.Extensions.StripHTMLTags(this.TxtTitle.Text);
                page.VirtualURL  = this.txtCommName.Text;
                page.PageType    = (PageType)Enum.Parse(typeof(PageType), RCBPageType.SelectedValue);
                page.Description = this.RadEditor1.Content;
                page.TagList     = Common.Extensions.StripHTMLTags(this.HFTagWords.Value);
                page.ShowState   = ObjectShowState.Published;
                InsertRoles();
                page.Status    = (ObjectStatus)Enum.Parse(typeof(ObjectStatus), this.HFStatus.Value);
                page.Copyright = int.Parse(this.HFCopyright.Value);
                double geoLat;
                if (double.TryParse(this.HFGeoLat.Value, out geoLat))
                {
                    page.Geo_Lat = geoLat;
                }
                double geoLong;
                if (double.TryParse(this.HFGeoLong.Value, out geoLong))
                {
                    page.Geo_Long = geoLong;
                }
                page.Zip                = this.HFZip.Value;
                page.City               = this.HFCity.Value;
                page.Street             = this.HFStreet.Value;
                page.CountryCode        = this.HFCountry.Value;
                community.CtyVirtualUrl = page.VirtualURL;

                using (TransactionScope scope = new TransactionScope())
                {
                    page.Update(UserDataContext.GetUserDataContext());

                    if (community.CtyStatus == (int)CommunityStatus.Initializing)
                    {
                        var thePage = PagesConfig.CreateNewPage(ObjectID.Value, "Page", "Start", "Home");
                        // TODO: Insert Default Widgets
                    }
                    community.CtyStatus = (int)CommunityStatus.Ready;
                    community.Save();
                    scope.Complete();
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
 static Configurations()
 {
     _adminUI = new AdminUIConfig();
     _providers = new ProvidersConfig();
     _pages = new PagesConfig();
     _webData = new WebDataConfig();
     _authentication = new AuthenticationConfig();
     _imageCompressor = new ImageCompressorConfig();
     _autoUpdate = new AutoUpdateConfig();
     _logSystem = new LogSystemConfig();
     _netProxy = new NetProxyConfig();
     _userOptions = new UserOptionsConfig();
     _userAccessControlConfig = new UserAccessControlConfig();
     ReadSettings();
 }
Example #4
0
        private void OnNewPageClick(object sender, EventArgs e)
        {
            string pageType = "Community";

            if (PageOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity"))
            {
                pageType = "Profile";
            }
            else if (PageOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("Page"))
            {
                pageType = "Page";
            }

            var subSonicPage = PagesConfig.CreateNewPage(PageOrCommunity.ObjectID.Value, pageType, "NewPage", language.GetString("TextTabUnnamed"));
            var page         = WDC.hitbl_Page_PAGs.Where(x => x.PAG_ID == subSonicPage.PagId).Single();

            Pages.Add(page);

            LoadTabBar();
        }
Example #5
0
        public override bool SaveStep(ref System.Collections.Specialized.NameValueCollection queryString)
        {
            if (Page.IsValid)
            {
                currDatatObjectCommunity.Title       = Common.Extensions.StripHTMLTags(this.TxtTitle.Text);
                currDatatObjectCommunity.VirtualURL  = this.txtCommName.Text;
                currDatatObjectCommunity.Description = this.RadEditor1.Content;
                currDatatObjectCommunity.TagList     = Common.Extensions.StripHTMLTags(this.HFTagWords.Value);
                currDatatObjectCommunity.ShowState   = ObjectShowState.Published;
                currDatatObjectCommunity.Managed     = Convert.ToBoolean(Convert.ToInt32((string)this.HFManaged.Value));
                currDatatObjectCommunity.Status      = (ObjectStatus)Enum.Parse(typeof(ObjectStatus), this.HFStatus.Value);
                currDatatObjectCommunity.Copyright   = int.Parse(this.HFCopyright.Value);
                double geoLat;
                if (double.TryParse(this.HFGeoLat.Value, out geoLat))
                {
                    currDatatObjectCommunity.Geo_Lat = geoLat;
                }
                double geoLong;
                if (double.TryParse(this.HFGeoLong.Value, out geoLong))
                {
                    currDatatObjectCommunity.Geo_Long = geoLong;
                }
                currDatatObjectCommunity.Zip         = this.HFZip.Value;
                currDatatObjectCommunity.City        = this.HFCity.Value;
                currDatatObjectCommunity.Street      = this.HFStreet.Value;
                currDatatObjectCommunity.CountryCode = this.HFCountry.Value;
                currComm.CtyVirtualUrl = currDatatObjectCommunity.VirtualURL;

                using (TransactionScope scope = new TransactionScope())
                {
                    currDatatObjectCommunity.Update(UserDataContext.GetUserDataContext());

                    if (currComm.CtyStatus == (int)CommunityStatus.Initializing)
                    {
                        var privatePage = PagesConfig.CreateNewPage(ObjectID.Value, "Community", "Private", "Dashboard");
                        var thePage     = PagesConfig.CreateNewPage(ObjectID.Value, "Community", "Start", "Home");
                        HirelCommunityUserCur.Insert(currComm.CtyId, udc.UserID, true, 0, DateTime.Now, Guid.Empty);
                        SPs.HispDataObjectAddMemberCount(currComm.CtyId, 1).Execute();
                        try
                        {
                            if (udc.UserID != Constants.ADMIN_USERID.ToGuid())
                            {
                                HirelCommunityUserCur.Insert(currComm.CtyId, new Guid(Constants.ADMIN_USERID), true, 0, DateTime.Now, Guid.Empty);
                                SPs.HispDataObjectAddMemberCount(currComm.CtyId, 1).Execute();
                            }
                        }
                        catch
                        {
                        }
                    }
                    currComm.CtyStatus = (int)CommunityStatus.Ready;
                    currComm.Save();
                    _4screen.CSB.Extensions.Business.IncentivePointsManager.AddIncentivePointEvent("COMMUNITY_UPLOAD", udc, ObjectID.Value.ToString());
                    scope.Complete();
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }