Beispiel #1
0
        private void SetupScript()
        {
            if (assumeScriptsAreLoaded)
            {
                return;
            }

            Page.ClientScript.RegisterClientScriptBlock(typeof(Page),
                                                        "gbVar", "\n<script  type=\"text/javascript\">"
                                                        + "var GB_ROOT_DIR = '" + Page.ResolveUrl(scriptBaseUrl) + "'; var GBCloseText = '" + dialogCloseText + "';" + " </script>");

            if (Page is mojoBasePage)
            {
                mojoBasePage mojoPage = Page as mojoBasePage;
                mojoPage.ScriptConfig.IncludeGreyBox = true;
            }
            else
            {
                //Page.ClientScript.RegisterClientScriptBlock(typeof(Page),
                //        "GreyBoxJs", "\n<script  src=\""
                //        + Page.ResolveUrl(scriptBaseUrl + "gbcombined.js") + "\" type=\"text/javascript\" ></script>");

                //The commented version above is the preferred syntax, the uncommented one below is the deprecated version.
                //There is a reason we are using the deprecated version, greybox is registered also by NeatUpload using the deprecated
                //syntax, the reason they use the older syntax is because they also support .NET v1.1
                //We use the old syntax here for compatibility with NeatUpload so that it does not get registered more than once
                // on pages that use NeatUpload. Otherwise we would have to always modify our copy of NeatUpload.
                Page.RegisterClientScriptBlock("GreyBoxJs", "\n<script  src=\""
                                               + Page.ResolveUrl(scriptBaseUrl + "gbcombined.js") + "\" type=\"text/javascript\" ></script>");
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            CssClass += " cblink";             // We need to create a theme.skin setting to override this and add custom attributes

            siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (siteSettings == null)
            {
                Visible = false;
                return;
            }

            if ((WebUser.IsAdminOrContentAdmin) || (WebUser.IsInRoles(siteSettings.GeneralBrowseAndUploadRoles)) || (WebUser.IsInRoles(siteSettings.UserFilesBrowseAndUploadRoles)))
            {
                canBrowse = true;
                mojoBasePage basePage = Page as mojoBasePage;

                if (basePage != null)
                {
                    basePage.ScriptConfig.IncludeColorBox = true;
                }
            }

            if (!canBrowse)
            {
                Visible = false;
                return;
            }

            SetupLink();
        }
Beispiel #3
0
        public static Module GetSuperFlexiModule(int moduleId)
        {
            mojoBasePage bp = new mojoBasePage();
            Module       m  = bp.GetModule(moduleId);

            if (m != null)
            {
                return(m);
            }

            bool isSiteEditor = SiteUtils.UserIsSiteEditor();

            // these extra checks allow for editing an instance from modulewrapper
            m = new Module(moduleId);
            if (
                //(m.FeatureGuid != featureGuid)
                //||
                (m.SiteId != CacheHelper.GetCurrentSiteSettings().SiteId) ||
                (m.ModuleId == -1) ||
                ((!WebUser.IsInRoles(m.AuthorizedEditRoles)) && (!WebUser.IsAdminOrContentAdmin) && (!isSiteEditor))
                )
            {
                m = null;
            }

            return(m);
        }
        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);
        }
Beispiel #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
#if !NET35
            // this leaves out a style block that was rendered for the menu under .NET 2/3.5
            IncludeStyleBlock = false;

            // this doesn't really make it render as a table since we use the css adapters
            // but it does turn off the ASP.NET 4 menu javascript that we don't want
            // because the javascript adds hard coded inlne styles.
            // the down side of setting this to table is that it also restores the things we didn't like about .NET 2/3.5 Menu
            // it causes it to ignore the IncludeStyleBlock setting above and it will render
            if (useNet35Mode)
            {
                RenderingMode = MenuRenderingMode.Table;
            }

            //this is needed under .NET 4 because the menu javscript otherwise adds events for mouseover that interfere with the superfish mouseover transitions
            //this.Enabled = false;
#endif

            if (includeAdapterScripts)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                if (basePage != null)
                {
                    basePage.ScriptConfig.IncludeAspMenu = true;
                }
            }
        }
Beispiel #6
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (HttpContext.Current == null) { return; }
            EnableViewState = false;
            basePage = Page as mojoBasePage;

            Visible = ShouldRender();
            if (!Visible) { return; }

            if (basePage == null) { return; }

            if (CssClass.Length > 0)
            {
                CssClass = "adminlink pagetreelink " + CssClass;
            }
            else
            {
                CssClass = "adminlink pagetreelink";
            }

            if (SiteUtils.SslIsAvailable())
            {
                NavigateUrl = Page.ResolveUrl(basePage.SiteRoot + relativeUrl);
            }
            else
            {
                NavigateUrl = Page.ResolveUrl(basePage.RelativeSiteRoot + relativeUrl);
            }
        }
Beispiel #7
0
        //private AttributeCollection attributes;
        //public AttributeCollection Attributes
        //{
        //    get { return attributes; }
        //    set { attributes = value; }
        //}
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            CssClass += " cblink";

            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null)
            {
                this.Visible = false; return;
            }

            if ((WebUser.IsAdminOrContentAdmin) || (WebUser.IsInRoles(siteSettings.GeneralBrowseAndUploadRoles)) || (WebUser.IsInRoles(siteSettings.UserFilesBrowseAndUploadRoles)))
            {
                canBrowse = true;
                mojoBasePage basePage = Page as mojoBasePage;
                if (basePage != null)
                {
                    basePage.ScriptConfig.IncludeColorBox = true;
                }
            }

            if (!canBrowse)
            {
                this.Visible = false;
                return;
            }

            // this.ClientClick = "return GB_showCenter(this.title, this.href, 670,670)";

            SetupLink();
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (HttpContext.Current == null) { return; }
            EnableViewState = false;
            basePage = Page as mojoBasePage;

            Visible = ShouldRender();
            if (!Visible) { return; }
            if (basePage == null) { return; }

            basePage.ScriptConfig.IncludeColorBox = true;

            if (CssClass.Length > 0)
            {
                CssClass = "adminlink filemanlink cblink " + CssClass;
            }
            else
            {
                CssClass = "adminlink filemanlink cblink";
            }

            Text = Resource.AdminMenuFileManagerLink;
            ToolTip = Resource.AdminMenuFileManagerLink;

            if (SiteUtils.SslIsAvailable())
            {
                if (WebConfigSettings.UseAlternateFileManagerAsDefault)
                {
                    NavigateUrl = basePage.SiteRoot + "/Dialog/FileManagerAltDialog.aspx";
                }
                else
                {
                    NavigateUrl = basePage.SiteRoot + "/Dialog/FileManagerDialog.aspx";
                }
            }
            else
            {
                if (WebConfigSettings.UseAlternateFileManagerAsDefault)
                {
                    NavigateUrl = basePage.RelativeSiteRoot + "/Dialog/FileManagerAltDialog.aspx";
                }
                else
                {
                    NavigateUrl = basePage.RelativeSiteRoot + "/Dialog/FileManagerDialog.aspx";
                }
            }
            //#if MONO

            //            NavigateUrl = basePage.SiteRoot + "/Dialog/FileManagerAltDialog.aspx";
            //#endif

            if (basePage.UseIconsForAdminLinks)
            {
                ImageUrl = Page.ResolveUrl("~/Data/SiteImages/folder_explore.png");

            }
            //ClientClick = "GB_showFullScreen(this.title, this.href); return false;";
            //DialogCloseText = Resource.CloseDialogButton;
        }
Beispiel #9
0
        private void SetupNivoScripts()
        {
            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                basePage.ScriptConfig.IncludeNivoSlider = true;
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(
                    this,
                    typeof(Page),
                    "nivoslidermain",
                    $"\n<script src=\"{Page.ResolveUrl("~/ClientScript/jqmojo/jquery.nivo.slider.pack3-2.js")}\"></script>",
                    false
                    );
            }

            string nivoInstanceScript = $@"
$(document).ready(function() {{
	$('#{pnlNivoInner.ClientID}').nivoSlider({{{displaySettings.NivoConfig}}});
}});";

            ScriptManager.RegisterStartupScript(
                this,
                GetType(),
                "startSlider" + pnlNivoInner.ClientID,
                nivoInstanceScript,
                true
                );
        }
Beispiel #10
0
        private void PopulateLabels()
        {
            if (commentLabel.Length > 0)
            {
                lblComments.Text = commentLabel;
            }
            else
            {
                lblComments.Text = Resource.RatingCommentsLabel;
            }

            if (promptText.Length > 0)
            {
                litPrompt.Text = promptText;
            }
            else
            {
                litPrompt.Text = Resource.RatingPrompt;
            }

            lblEmail.Text    = Resource.RatingEmailLabel;
            btnComments.Text = Resource.RatingSubmitButton;
            btnNoThanks.Text = Resource.RatingNoThanksButton;

            if (WebUser.IsAdminOrContentAdmin)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                if (basePage != null)
                {
                    basePage.ScriptConfig.IncludeColorBox = true;
                }
            }
        }
Beispiel #11
0
        protected virtual void PopulateLabels()
        {
            EditBlogAltText = BlogResources.EditImageAltText;
            FeedBackLabel   = BlogResources.BlogFeedbackLabel;

            mojoBasePage basePage = Page as mojoBasePage;

            if (basePage != null)
            {
                if (!basePage.UseTextLinksForFeatureSettings)
                {
                    EditLinkImageUrl = ImageSiteRoot + "/Data/SiteImages/" + EditContentImage;
                }

                if (basePage.AnalyticsSection.Length == 0)
                {
                    basePage.AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsBlogSection", "blog");
                }
            }

            if (displaySettings.OverridePostCategoriesLabel.Length > 0)
            {
                CategoriesResourceKey = displaySettings.OverridePostCategoriesLabel;
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load += new EventHandler(Page_Load);

            basePage = Page as mojoBasePage;
        }
Beispiel #13
0
        private void SetupDialogScript()
        {
            mojoBasePage basePage = Page as mojoBasePage;

            basePage.ScriptConfig.IncludeColorBox = true;

            StringBuilder script = new StringBuilder();

            script.Append("\nfunction RefreshRoles(){");

            script.Append("var btn = document.getElementById('" + btnRefreshRoles.ClientID + "');  ");
            script.Append("btn.click(); ");

            script.Append("}\n");

            ScriptManager.RegisterClientScriptBlock(this, typeof(Page),
                                                    "refreshroles", "\n<script type=\"text/javascript\" >"
                                                    + script.ToString() + "</script>", false);

            script = new StringBuilder();

            script.Append("\n$('#" + lnkRolesDialog.ClientID + "').colorbox(");
            script.Append("{width:'85%', height:'85%', iframe:true, onClosed:RefreshRoles}");

            script.Append(");");

            ScriptManager.RegisterStartupScript(this, typeof(Page),
                                                "userrolesdialog", "\n<script type=\"text/javascript\" >"
                                                + script.ToString() + "</script>", false);
        }
Beispiel #14
0
        private void LoadSettings()
        {
            config = new ForumConfiguration(Settings);

            forumList.Config         = config;
            forumList.ModuleId       = ModuleId;
            forumList.PageId         = PageId;
            forumList.SiteRoot       = SiteRoot;
            forumList.NonSslSiteRoot = SiteUtils.GetInSecureNavigationSiteRoot();
            forumList.ImageSiteRoot  = ImageSiteRoot;
            forumList.IsEditable     = IsEditable;

            forumListAlt.Config         = config;
            forumListAlt.ModuleId       = ModuleId;
            forumListAlt.PageId         = PageId;
            forumListAlt.SiteRoot       = SiteRoot;
            forumListAlt.NonSslSiteRoot = forumList.NonSslSiteRoot;
            forumListAlt.ImageSiteRoot  = ImageSiteRoot;
            forumListAlt.IsEditable     = IsEditable;

            if (displaySettings.UseAltForumList)
            {
                forumList.Visible    = false;
                forumListAlt.Visible = true;
            }

            if (!config.ShowForumSearchBox)
            {
                searchBoxTop.Visible = false;
            }
            if (displaySettings.HideSearchOnForumList)
            {
                searchBoxTop.Visible = false;
            }

            if (searchBoxTop.Visible && displaySettings.UseBottomSearchOnForumList)
            {
                searchBoxTop.Visible    = false;
                searchBoxBottom.Visible = true;
            }

            if (config.InstanceCssClass.Length > 0)
            {
                pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass);
            }

            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                if (basePage != null)
                {
                    basePage.ScriptConfig.IncludeColorBox = true;
                    if (basePage.AnalyticsSection.Length == 0)
                    {
                        basePage.AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsForumSection", "forums");
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current == null)
            {
                return;
            }

            EnableViewState = false;

            siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (siteSettings == null)
            {
                return;
            }

            currentPage = CacheHelper.GetCurrentPage();

            if (currentPage == null)
            {
                return;
            }

            siteMapDataSource = (SiteMapDataSource)Page.Master.FindControl("SiteMapData");

            if (siteMapDataSource == null)
            {
                return;
            }

            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            if (WebConfigSettings.DisableViewStateOnSiteMapDataSource)
            {
                siteMapDataSource.EnableViewState = false;
            }

            isAdmin = WebUser.IsAdmin;

            if (!isAdmin)
            {
                isContentAdmin = WebUser.IsContentAdmin;
            }

            if (!isAdmin && !isContentAdmin)
            {
                isSiteEditor = SiteUtils.UserIsSiteEditor();
            }

            siteRoot = SiteUtils.GetNavigationSiteRoot();

            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                enableUnclickableLinks = basePage.StyleCombiner.EnableNonClickablePageLinks;
            }

            DoRendering();
        }
Beispiel #16
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (HttpContext.Current == null) { return; }
            EnableViewState = false;
            basePage = Page as mojoBasePage;

            Visible = ShouldRender();
            if (!Visible) { return; }

            if (basePage == null) { return; }

            if (CssClass.Length > 0)
            {
                CssClass = "adminlink newpagelink " + CssClass;
            }
            else
            {
                CssClass = "adminlink newpagelink";
            }

            ToolTip = Resource.AddPageTooltip;
            if (SiteUtils.SslIsAvailable())
            {
                if (
                    basePage.CurrentPage != null)
                {
                    NavigateUrl = basePage.SiteRoot + "/Admin/PageSettings.aspx?start=" + basePage.CurrentPage.PageId.ToInvariantString();
                }
                else
                {
                    NavigateUrl = basePage.SiteRoot + "/Admin/PageSettings.aspx";
                }
            }
            else
            {
                if (
                    basePage.CurrentPage != null)
                {
                    NavigateUrl = basePage.RelativeSiteRoot + "/Admin/PageSettings.aspx?start=" + basePage.CurrentPage.PageId.ToInvariantString();
                }
                else
                {
                    NavigateUrl = basePage.RelativeSiteRoot + "/Admin/PageSettings.aspx";
                }

            }

            if (basePage.UseIconsForAdminLinks)
            {
                ImageUrl = Page.ResolveUrl("~/Data/SiteImages/" + ConfigurationManager.AppSettings["NewPageImage"]);
                Text = Resource.PagesAddButton;
            }
            else
            {
                Text = Resource.AddPageLink;
            }
        }
Beispiel #17
0
        private void SetupScript()
        {
            if (scriptFullUrl.Length > 0)
            {
                if (isStartup)
                {
                    ScriptManager.RegisterStartupScript(
                        this,
                        typeof(Page),
                        ClientID,
                        string.Format(CultureInfo.InvariantCulture, scriptRefFormat, scriptFullUrl),
                        false);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(
                        this,
                        typeof(Page),
                        ClientID,
                        string.Format(CultureInfo.InvariantCulture, scriptRefFormat, scriptFullUrl),
                        false);
                }
                return;
            }

            if (scriptFileName.Length == 0)
            {
                return;
            }
            string scriptUrl = SiteUtils.DetermineSkinBaseUrl(true, WebConfigSettings.UseFullUrlsForSkins, Page) + scriptFileName;

            if (isStartup)
            {
                ScriptManager.RegisterStartupScript(
                    this,
                    typeof(Page),
                    scriptFileName,
                    string.Format(CultureInfo.InvariantCulture, scriptRefFormat, scriptUrl),
                    false);
            }
            else
            {
                if (addToCombinedScript && (scriptUrl.StartsWith("/")) && (Page is mojoBasePage))
                {
                    mojoBasePage basePage = Page as mojoBasePage;
                    basePage.ScriptConfig.AddPathScriptReference(scriptUrl);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(
                        this,
                        typeof(Page),
                        scriptFileName,
                        string.Format(CultureInfo.InvariantCulture, scriptRefFormat, scriptUrl),
                        false);
                }
            }
        }
        public ForumParameterParser(mojoBasePage basePage)
        {
            if (basePage == null)
            {
                throw new ArgumentException("You must pass in mojoBasePage");
            }

            BasePage = basePage;
        }
Beispiel #19
0
        override protected void OnInit(EventArgs e)
        {
            this.Load += new EventHandler(this.Page_Load);
            base.OnInit(e);

            basePage      = Page as mojoBasePage;
            SiteRoot      = basePage.SiteRoot;
            ImageSiteRoot = basePage.ImageSiteRoot;
        }
Beispiel #20
0
 private void LoadV2()
 {
     if (Page is mojoBasePage)
     {
         mojoBasePage basePage = Page as mojoBasePage;
         basePage.ScriptConfig.IncludeGoogleSearchV2 = true;
         basePage.ScriptConfig.GoogleSearchV2Id      = SiteUtils.GetGoogleCustomSearchId();
     }
 }
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (Page is mojoBasePage)
     {
         mojoBasePage basePage = Page as mojoBasePage;
         //include the main script
         basePage.ScriptConfig.IncludeInterface = true;
     }
 }
Beispiel #22
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                basePage.ScriptConfig.IncludeJQTable = true;
            }
        }
Beispiel #23
0
        private void SetupColorPicker()
        {
            if (Page is mojoBasePage)
            {
                mojoBasePage p = Page as mojoBasePage;
                p.IncludeColorPickerCss           = true;
                p.ScriptConfig.IncludeColorPicker = true;
            }

            pnlPicker.Attributes.Add("style", "position: relative; height:205px;");
        }
Beispiel #24
0
        protected override void OnPreRender(System.EventArgs e)
        {
            base.OnPreRender(e);

            if (addToCombinedScript && (Page is mojoBasePage))
            {
                mojoBasePage basePage = Page as mojoBasePage;
                basePage.ScriptConfig.AddPathScriptReference(scriptRelativeToRoot);
                renderScript = false;
            }
        }
Beispiel #25
0
        private void SetUpDefaultClick()
        {
            // Add form and submit CSS classes
            if (String.IsNullOrEmpty(actionCssClass))
            {
                actionCssClass = actionSubmitCssClass;
            }
            else
            {
                actionCssClass += " " + actionSubmitCssClass;
            }

            if (String.IsNullOrEmpty(searchContainerCssClass))
            {
                searchContainerCssClass = searchContainerSubmitCssClass;
            }
            else
            {
                searchContainerCssClass += " " + searchContainerSubmitCssClass;
            }

            // Register JQuery function to handle enter key triggering the action
            // http://www.sentia.com.au/blog/fixing-the-enter-key-in-aspnet-with-jquery
            mojoBasePage basePage = Page as mojoBasePage;

            if (basePage != null)
            {
                basePage.ScriptConfig.IncludeColorBox = true;

                StringBuilder script = new StringBuilder();

//      private string actionJavaScriptVarname = "mpfs_act";
//      private string searchContainerJavaScriptVarname = "mpfs_frm";
                script.Append("$(document).ready(function() {");
                script.Append(" var " + actJSVarname + " = $('." + actionSubmitCssClass + "');");
                script.Append(" var " + srchContJSVarname + " = " + actJSVarname + ".parents('." + searchContainerSubmitCssClass + "');");
                script.Append(" " + srchContJSVarname + ".keypress(function(e) {");
                script.Append(" if (e.which == 13 && e.target.type != 'textarea') {");
                script.Append(" if (" + actJSVarname + "[0].type == 'submit')");
                script.Append(" " + actJSVarname + "[0].click();");
                script.Append(" else");
                script.Append(" eval(" + actJSVarname + "[0].href);");
                script.Append(" return false;");
                script.Append(" }");
                script.Append(" });");
                script.Append(" });");

                ScriptManager.RegisterStartupScript(this, typeof(Page),
                                                    "info-init", "\n<script type=\"text/javascript\" >"
                                                    + script.ToString() + "</script>", false);
            }
        }
Beispiel #26
0
        private void LoadSettings()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null)
            {
                return;
            }

            basePage = Page as mojoBasePage;

            themeCookieName += siteSettings.SiteId.ToInvariantString();
            themeCookieValue = CookieHelper.GetCookieValue(themeCookieName);
        }
        private void LoadSettings()
        {
            mojoBasePage basePage = Page as mojoBasePage;

            if (basePage != null)
            {
                //enable the main script
                basePage.ScriptConfig.IncludeFlickrGallery = true;
                basePage.ScriptConfig.IncludeJQueryMigrate = true;
            }

            config = new FlickrGalleryConfiguration(Settings);
        }
Beispiel #28
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (disableYui)
     {
         return;
     }
     if (Page is mojoBasePage)
     {
         mojoBasePage p = Page as mojoBasePage;
         p.ScriptConfig.IncludeYuiDataTable = true;
     }
 }
Beispiel #29
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (string.IsNullOrEmpty(section))
            {
                if (Page is mojoBasePage)
                {
                    mojoBasePage basePage = Page as mojoBasePage;
                    section = basePage.AnalyticsSection;
                }
            }
        }
Beispiel #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (WebConfigSettings.AlwaysLoadYuiTabs) { IncludeYuiTabs = true; }

            if ((addBodyClassForiPad) && (Page is mojoBasePage))
            {
                if (BrowserHelper.IsIpad())
                {
                    mojoBasePage basePage = Page as mojoBasePage;
                    basePage.AddClassToBody("ipad");
                }
            }
        }
Beispiel #31
0
        private void LoadSettings()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            store        = new Store(siteSettings.SiteGuid, ModuleId);

            config = new WebStoreConfiguration(Settings);

            //enableRatingsInProductList = WebUtils.ParseBoolFromHashtable(
            //    Settings, "EnableContentRatingInProductListSetting", enableRatingsInProductList);

            //enableRatingComments = WebUtils.ParseBoolFromHashtable(
            //    Settings, "EnableRatingCommentsSetting", enableRatingComments);


            //if (Settings.Contains("ProductListGroupingSetting"))
            //{
            //    groupingMode = Settings["ProductListGroupingSetting"].ToString();
            //}

            switch (config.GroupingMode)
            {
            case GroupByOffer:
                this.offerList1.Visible   = true;
                this.productList1.Visible = false;

                break;

            default:

                this.offerList1.Visible   = false;
                this.productList1.Visible = true;

                break;
            }

            //pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1);

            //if (store == null) { return; }

            //currencyCulture = ResourceHelper.GetCurrencyCulture(store.DefaultCurrency);
            currencyCulture = ResourceHelper.GetCurrencyCulture(siteSettings.GetCurrency().Code);

            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                if (basePage.AnalyticsSection.Length == 0)
                {
                    basePage.AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsWebStoreSection", "store");
                }
            }
        }
        private void LoadV1()
        {
            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                basePage.ScriptConfig.IncludeGoogleSearch = true;
                basePage.StyleCombiner.IncludeGoogleCustomSearchCss = includeGoogleCustomSearchCss;

            }

            if (customSearchId.Length == 0) { customSearchId = SiteUtils.GetGoogleCustomSearchId(); }

            if (loadingText.Length == 0) { loadingText = Resource.Loading; }
        }
Beispiel #33
0
        public void HookupScript()
        {
            if (!(Page is mojoBasePage))
            {
                return;
            }
            mojoBasePage mojoPage = Page as mojoBasePage;

            mojoPage.ScriptConfig.IncludeClueTip = true;

            //ScriptReference script = new ScriptReference();
            //script.Path = "~/ClientScript/jqmojo/jquery.cluetip.js";
            //mojoPage.ScriptConfig.AddPathScriptReference(script);
        }
Beispiel #34
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (HttpContext.Current == null) { return; }
            EnableViewState = false;
            basePage = Page as mojoBasePage;

            Visible = ShouldRender();
            if (!Visible) { return; }

            if (basePage == null) { return; }

            if (CssClass.Length > 0)
            {
                CssClass = "adminlink adminmenulink " + CssClass;
            }
            else
            {
                CssClass = "adminlink adminmenulink";
            }
            //ToolTip = Resource.AdminMenuLink;
            if (SiteUtils.SslIsAvailable())
            {
                NavigateUrl = Page.ResolveUrl(basePage.SiteRoot + relativeUrl);
            }
            else
            {
                NavigateUrl = Page.ResolveUrl(basePage.RelativeSiteRoot + relativeUrl);
            }
            //if (basePage.UseIconsForAdminLinks)
            //{
            //    ImageUrl = Page.ResolveUrl("~/Data/SiteImages/admin.png");
            //    Text = Resource.AdminMenuLink;
            //}
            //else
            //{
            //    Text = Resource.AdminLink;
            //}
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load += new EventHandler(Page_Load);

            config = new FolderGalleryConfiguration(Settings);

            string pathToGallery = string.Empty;

            if (config.GalleryRootFolder.Length > 0)
            {
                pathToGallery = config.GalleryRootFolder;

            }
            else
            {
                pathToGallery = GetDefaultGalleryPath();
                if (pathToGallery.Length > 0) CreateDefaultFolderSetting(pathToGallery);

            }

            //if (pathToGallery.Length == 0)
            //{
            //    pathToGallery = GetDefaultGalleryPath();
            //    if (pathToGallery.Length > 0) CreateDefaultFolderSetting(pathToGallery);
            //}

            try
            {

                if (!Directory.Exists(Server.MapPath(pathToGallery)))
                {
                    //pathToGallery = GetDefaultGalleryPath();
                    Directory.CreateDirectory(Server.MapPath(pathToGallery));
                }
            }
            catch (IOException ex)
            {

                log.Error(ex);

            }
            catch (HttpException ex)
            {
                log.Error(ex);
                //thrown at Server.MapPath if the path is not a valid virtual path
                pathToGallery = GetDefaultGalleryPath();

            }

            ShowPermaLinksSetting = config.ShowPermaLinks;
            ShowMetaDetailsSetting = config.ShowMetaDetails;

            if (Page is mojoBasePage)
            {
                basePage = Page as mojoBasePage;
                useMobileTemplate = basePage.UseMobileSkin;
            }

            if (useMobileTemplate)
            {
                this.Album1.Visible = false;
                this.Album2.Visible = true;
                this.Album2.GalleryRootPath = pathToGallery;
                this.Album2.DoSetup();
            }
            else
            {
                this.Album1.GalleryRootPath = pathToGallery;
                this.Album1.DoSetup();
            }
        }
        private void LoadSettings()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null) { return; }

            basePage = Page as mojoBasePage;

            themeCookieName += siteSettings.SiteId.ToInvariantString();
            themeCookieValue = CookieHelper.GetCookieValue(themeCookieName);
        }
        public ForumParameterParser(mojoBasePage basePage)
        {
            if (basePage == null) { throw new ArgumentException("You must pass in mojoBasePage"); }

            BasePage = basePage;
        }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     this.Load += new EventHandler(Page_Load);
     basePage = Page as mojoBasePage;
 }
        protected override void OnInit(EventArgs e)
        {
            this.Load += new EventHandler(this.Page_Load);
            base.OnInit(e);

            basePage = Page as mojoBasePage;
            SiteRoot = basePage.SiteRoot;
            ImageSiteRoot = basePage.ImageSiteRoot;
        }
        protected override void OnInit(EventArgs e)
        {
            this.Load += new EventHandler(this.Page_Load);
            this.btnPostComment.Click += new EventHandler(this.btnPostComment_Click);
            this.dlComments.ItemCommand += new RepeaterCommandEventHandler(dlComments_ItemCommand);
            this.dlComments.ItemDataBound += new RepeaterItemEventHandler(dlComments_ItemDataBound);
            base.OnInit(e);
            //this.EnableViewState = this.UserCanEditPage();
            basePage = Page as mojoBasePage;
            SiteRoot = basePage.SiteRoot;
            ImageSiteRoot = basePage.ImageSiteRoot;

            SiteUtils.SetupEditor(this.edComment, true, Page);
        }
Beispiel #41
0
        protected virtual void LoadSettings()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            siteId = siteSettings.SiteId;
            currentUser = SiteUtils.GetCurrentSiteUser();
            TimeOffset = SiteUtils.GetUserTimeOffset();
            timeZone = SiteUtils.GetUserTimeZone();
            GmapApiKey = SiteUtils.GetGmapApiKey();
            addThisAccountId = siteSettings.AddThisDotComUsername;

            if (config.AddThisAccountId.Length > 0)
            {
                addThisAccountId = config.AddThisAccountId;
            }

            pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", pageNumber);
            categoryId = WebUtils.ParseInt32FromQueryString("cat", categoryId);
            Month = WebUtils.ParseInt32FromQueryString("month", Month);
            Year = WebUtils.ParseInt32FromQueryString("year", Year);
            attachmentBaseUrl = SiteUtils.GetFileAttachmentUploadPath();

            if (Page is mojoBasePage)
            {
                basePage = Page as mojoBasePage;
                module = basePage.GetModule(moduleId, Blog.FeatureGuid);
            }

            if (module == null) { return; }

            MaxAllowedGravatarRating = SiteUtils.GetMaxAllowedGravatarRating();
            UserNameTooltipFormat = displaySettings.AvatarUserNameTooltipFormat;

            switch (siteSettings.AvatarSystem)
            {
                case "gravatar":
                    allowGravatars = true;
                    disableAvatars = false;
                    break;

                case "internal":
                    allowGravatars = false;
                    disableAvatars = false;
                    break;

                case "none":
                default:
                    allowGravatars = false;
                    disableAvatars = true;
                    break;

            }

            //if (!config.ShowAuthorAvatar) { disableAvatars = true; }

            if (config.UseExcerpt && !displaySettings.ShowAvatarWithExcerpt) { disableAvatars = true; }

            CalendarDate = WebUtils.ParseDateFromQueryString("blogdate", DateTime.UtcNow).Date;

            if (CalendarDate > DateTime.UtcNow.Date)
            {
                CalendarDate = DateTime.UtcNow.Date;
            }

            if ((config.UseExcerpt) && (!config.GoogleMapIncludeWithExcerpt)) { ShowGoogleMap = false; }

            EnableContentRating = config.EnableContentRating && !displaySettings.PostListDisableContentRating;
            if (config.UseExcerpt) { EnableContentRating = false; }

            //if (config.AddThisCustomBrand.Length > 0)
            //{
            //    addThisCustomBrand = config.AddThisCustomBrand;
            //}

            if (config.DisqusSiteShortName.Length > 0)
            {
                DisqusSiteShortName = config.DisqusSiteShortName;
            }
            else
            {
                DisqusSiteShortName = siteSettings.DisqusSiteShortName;
            }

            if (config.IntenseDebateAccountId.Length > 0)
            {
                IntenseDebateAccountId = config.IntenseDebateAccountId;
            }
            else
            {
                IntenseDebateAccountId = siteSettings.IntenseDebateAccountId;
            }

            navTop.ModuleId = ModuleId;
            navTop.ModuleGuid = module.ModuleGuid;
            navTop.PageId = PageId;
            navTop.IsEditable = IsEditable;
            navTop.Config = config;
            navTop.SiteRoot = SiteRoot;
            navTop.ImageSiteRoot = ImageSiteRoot;

            navBottom.ModuleId = ModuleId;
            navBottom.ModuleGuid = module.ModuleGuid;
            navBottom.PageId = PageId;
            navBottom.IsEditable = IsEditable;
            navBottom.Config = config;
            navBottom.SiteRoot = SiteRoot;
            navBottom.ImageSiteRoot = ImageSiteRoot;

            TitleOnly = config.TitleOnly || displaySettings.PostListForceTitleOnly;
            ShowTweetThisLink = config.ShowTweetThisLink && !config.UseExcerpt;
            ShowPlusOneButton = config.ShowPlusOneButton && !config.UseExcerpt;
            UseFacebookLikeButton = config.UseFacebookLikeButton && !config.UseExcerpt;
            useExcerpt = config.UseExcerpt || displaySettings.PostListForceExcerptMode;
            pageSize = config.PageSize;
            AllowComments = Config.AllowComments && ShowCommentCounts;

            //TODO: should we use separate settings for each displaymode?
            switch (displayMode)
            {
                case "ByCategory":

                    if (displaySettings.CategoryListForceTitleOnly)
                    {
                        TitleOnly = true;
                    }

                    if (displaySettings.CategoryListOverridePageSize > 0)
                    {
                        pageSize = displaySettings.CategoryListOverridePageSize;
                    }

                    if (displaySettings.ArchiveViewHideFeedbackLink)
                    {
                        AllowComments = false;
                    }

                    if (displaySettings.OverrideCategoryListItemHeadingElement.Length > 0)
                    {
                        itemHeadingElement = displaySettings.OverrideCategoryListItemHeadingElement;
                    }

                    break;

                case "ByMonth":

                    if (displaySettings.ArchiveListForceTitleOnly)
                    {
                        TitleOnly = true;
                    }

                    if (displaySettings.ArchiveListOverridePageSize > 0)
                    {
                        pageSize = displaySettings.ArchiveListOverridePageSize;
                    }

                    if (displaySettings.OverrideArchiveListItemHeadingElement.Length > 0)
                    {
                        itemHeadingElement = displaySettings.OverrideArchiveListItemHeadingElement;
                    }

                    break;

                case "DescendingByDate":
                default:

                    if (displaySettings.PostListOverridePageSize > 0)
                    {
                        pageSize = displaySettings.PostListOverridePageSize;
                    }

                    if (displaySettings.OverrideListItemHeadingElement.Length > 0)
                    {
                        itemHeadingElement = displaySettings.OverrideListItemHeadingElement;
                    }

                    break;

            }

            if (config.AllowComments)
            {
                if ((DisqusSiteShortName.Length > 0) && (config.CommentSystem == "disqus"))
                {
                    disqusFlag = "#disqus_thread";
                    disqus.SiteShortName = DisqusSiteShortName;
                    disqus.RenderCommentCountScript = true;
                    navTop.ShowCommentCount = false;
                    navBottom.ShowCommentCount = false;

                }

                if ((IntenseDebateAccountId.Length > 0) && (config.CommentSystem == "intensedebate"))
                {
                    ShowCommentCounts = false;

                    navTop.ShowCommentCount = false;
                    navBottom.ShowCommentCount = false;
                }

                if (config.CommentSystem == "facebook")
                {
                    ShowCommentCounts = false;
                    navTop.ShowCommentCount = false;
                    navBottom.ShowCommentCount = false;
                }

            }
            else
            {
                navTop.ShowCommentCount = false;
                navBottom.ShowCommentCount = false;
            }

            if (!config.NavigationOnRight)
            {
                this.divblog.CssClass = "blogcenter-leftnav";
            }

            if (config.Copyright.Length > 0)
            {
                lblCopyright.Text = config.Copyright;
            }

            navTop.Visible = false;

            if (config.ShowCalendar
                || config.ShowArchives
                || config.ShowAddFeedLinks
                || config.ShowCategories
                || config.ShowFeedLinks
                || config.ShowStatistics
                || (config.UpperSidebar.Length > 0)
                || (config.LowerSidebar.Length > 0)
                )
            {

                navTop.Visible = true;
            }

            if (!navTop.Visible)
            {
                divblog.CssClass = "blogcenter-nonav";
            }

            if (displaySettings.PostListExtraCss.Length > 0)
            {
                divblog.ExtraCssClasses = " " + displaySettings.PostListExtraCss;
            }

            navBottom.Visible = false;

            if ((navTop.Visible) && (displaySettings.UseBottomNavigation))
            {
                navTop.Visible = false;
                navBottom.Visible = true;
            }

            //if (IsEditable)
            //{
            //    countOfDrafts = Blog.CountOfDrafts(ModuleId);
            //}

            useFriendlyUrls = BlogConfiguration.UseFriendlyUrls(moduleId);
            if (!WebConfigSettings.UseUrlReWriting) { useFriendlyUrls = false; }
        }