private void LoadSettings()
        {
            pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", pageNumber);

            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                if (displaySettings.UsejPlayerForMediaTeasers)
                {
                    basePage.ScriptConfig.IncludejPlayer         = true;
                    basePage.ScriptConfig.IncludejPlayerPlaylist = true;
                }
                else
                {
                    basePage.ScriptConfig.IncludeYahooMediaPlayer = true;
                }
            }

            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (siteSettings == null)
            {
                return;
            }

            teaserFileBaseUrl = WebUtils.GetSiteRoot() + "/Data/Sites/" + siteSettings.SiteId.ToString()
                                + "/webstoreproductpreviewfiles/";

            if (Settings != null)
            {
                pageSize = WebUtils.ParseInt32FromHashtable(Settings, "ProductListPageSize", pageSize);
            }

            canEdit = WebUser.HasEditPermissions(siteSettings.SiteId, ModuleId, PageId);
        }
Exemplo n.º 2
0
        private void PopulateControls()
        {
            if (!WebUser.HasEditPermissions(siteSettings.SiteId, moduleId, CurrentPage.PageId))
            {
                this.lnkNewEvent.Visible = false;
            }

            if (moduleId > 0)
            {
                Module module = new Module(moduleId);
                this.litDate.Text = module.ModuleTitle + " " + this.theDate.ToShortDateString();

                lnkNewEvent.HRef = SiteRoot + "/EventCalendar/EditEvent.aspx?"
                                   + "mid=" + moduleId.ToString()
                                   + "&date=" + Server.UrlEncode(this.theDate.ToString("s"))
                                   + "&pageid=" + CurrentPage.PageId.ToString();

                lnkNewEvent.InnerHtml = Resources.EventCalResources.EventCalendarAddEventLabel;

                DataSet ds = CalendarEvent.GetEvents(this.moduleId, theDate, theDate);
                //				DataView dv = ds.Tables[0].DefaultView;
                //				dv.Sort = "StartTime ASC ";
                this.rptEvents.DataSource = ds;
                this.rptEvents.DataBind();
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Request.IsAuthenticated)
            {
                SiteUtils.RedirectToLoginPage(this);
                return;
            }

            SecurityHelper.DisableBrowserCache();

            LoadSettings();

            if (!WebUser.HasEditPermissions(siteSettings.SiteId, moduleId, CurrentPage.PageId))
            {
                SiteUtils.RedirectToEditAccessDeniedPage();
            }

            PopulateLabels();
            PopulateControls();
        }
Exemplo n.º 4
0
        private void Page_Load(object sender, EventArgs e)
        {
            LoadParams();

            if (
                (BasePage == null) ||
                (!BasePage.UserCanViewPage())
                )
            {
                SiteUtils.RedirectToAccessDeniedPage();
                return;
            }

            if (parametersAreInvalid)
            {
                AllowComments        = false;
                this.pnlBlog.Visible = false;
                return;
            }

            LoadSettings();
            SetupCss();
            PopulateLabels();

            if (!IsPostBack && ModuleId > 0 && ItemId > 0)
            {
                if (Context.User.Identity.IsAuthenticated)
                {
                    if (WebUser.HasEditPermissions(BasePage.SiteInfo.SiteId, ModuleId, BasePage.CurrentPage.PageId))
                    {
                        IsEditable = true;
                    }
                }

                PopulateControls();
            }

            BasePage.LoadSideContent(showLeftContent, showRightContent);
        }