Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //LoadSettings();
            //SetupScripts();

            module      = new Module(moduleId);
            moduleTitle = module.ModuleTitle;

            siteSettings = CacheHelper.GetCurrentSiteSettings();
            pageSettings = new PageSettings(siteSettings.SiteId, pageId);
            if (config.MarkupDefinition != null)
            {
                displaySettings = config.MarkupDefinition;
            }

            if (config.ProcessItems)
            {
                fields = Field.GetAllForDefinition(config.FieldDefinitionGuid);

                if (config.IsGlobalView)
                {
                    items       = Item.GetAllForDefinition(config.FieldDefinitionGuid, config.DescendingSort);
                    fieldValues = ItemFieldValue.GetItemValuesByDefinition(config.FieldDefinitionGuid);
                }
                else
                {
                    items       = Item.GetModuleItems(moduleId, config.DescendingSort);
                    fieldValues = ItemFieldValue.GetItemValuesByModule(module.ModuleGuid);
                }
            }

            if (SiteUtils.IsMobileDevice() && config.MobileMarkupDefinition != null)
            {
                displaySettings = config.MobileMarkupDefinition;
            }

            if (config.MarkupScripts.Count > 0 || (SiteUtils.IsMobileDevice() && config.MobileMarkupScripts.Count > 0))
            {
                if (SiteUtils.IsMobileDevice() && config.MobileMarkupScripts.Count > 0)
                {
                    SuperFlexiHelpers.SetupScripts(config.MobileMarkupScripts, config, displaySettings, IsEditable, IsPostBack, ClientID, ModuleId, PageId, Page, this);
                }
                else
                {
                    SuperFlexiHelpers.SetupScripts(config.MarkupScripts, config, displaySettings, IsEditable, IsPostBack, ClientID, ModuleId, PageId, Page, this);
                }
            }

            if (config.MarkupCSS.Count > 0)
            {
                SuperFlexiHelpers.SetupStyle(config.MarkupCSS, config, displaySettings, ClientID, ModuleId, PageId, Page, this);
            }

            //if (Page.IsPostBack) { return; }

            PopulateControls();
        }
Пример #2
0
        protected virtual void LoadSettings()
        {
            module      = new Module(ModuleId);
            moduleTitle = module.ModuleTitle;

            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (CurrentPage == null)
            {
                CurrentPage = CacheHelper.GetCurrentPage();
                if (CurrentPage == null)
                {
                    log.Info("Can't use CacheHelper.GetCurrentPage() here.");
                    CurrentPage = new PageSettings(siteSettings.SiteId, PageId);
                }
            }
            if (config.MarkupDefinition != null)
            {
                displaySettings = config.MarkupDefinition;
            }

            fields = Field.GetAllForDefinition(config.FieldDefinitionGuid);

            if (config.IsGlobalView)
            {
                items = Item.GetForDefinition(config.FieldDefinitionGuid, siteSettings.SiteGuid, config.DescendingSort);
            }
            else
            {
                items = Item.GetForModule(ModuleId, config.DescendingSort);
            }


            if (SiteUtils.IsMobileDevice() && config.MobileMarkupDefinition != null)
            {
                displaySettings = config.MobileMarkupDefinition;
            }

            if (config.MarkupScripts.Count > 0 || (SiteUtils.IsMobileDevice() && config.MobileMarkupScripts.Count > 0))
            {
                if (SiteUtils.IsMobileDevice() && config.MobileMarkupScripts.Count > 0)
                {
                    SuperFlexiHelpers.SetupScripts(config.MobileMarkupScripts, config, displaySettings, IsEditable, Page.IsPostBack, ClientID, siteSettings, module, CurrentPage, Page, this);
                }
                else
                {
                    SuperFlexiHelpers.SetupScripts(config.MarkupScripts, config, displaySettings, IsEditable, Page.IsPostBack, ClientID, siteSettings, module, CurrentPage, Page, this);
                }
            }

            if (config.MarkupCSS.Count > 0)
            {
                SuperFlexiHelpers.SetupStyle(config.MarkupCSS, config, displaySettings, IsEditable, ClientID, siteSettings, module, CurrentPage, Page, this);
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //LoadSettings();
            //SetupScripts();

            module      = new Module(ModuleId);
            moduleTitle = module.ModuleTitle;

            siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (CurrentPage == null)
            {
                CurrentPage = CacheHelper.GetCurrentPage();
                //if (CurrentPage == null)
                //{
                //	log.Info("Can't use CacheHelper.GetCurrentPage() here.");
                //	CurrentPage = new PageSettings(siteSettings.SiteId, PageId);
                //}
            }
            if (Config.MarkupDefinition != null)
            {
                displaySettings = Config.MarkupDefinition;
            }

            if (Config.ProcessItems)
            {
                fields = Field.GetAllForDefinition(Config.FieldDefinitionGuid);

                if (Config.IsGlobalView)
                {
                    //items = Item.GetAllForDefinition(Config.FieldDefinitionGuid, siteSettings.SiteGuid, Config.DescendingSort);
                    //fieldValues = ItemFieldValue.GetItemValuesByDefinition(Config.FieldDefinitionGuid);
                    itemsWithValues = Item.GetForDefinitionWithValues(Config.FieldDefinitionGuid, siteSettings.SiteGuid, Config.DescendingSort);
                }
                else
                {
                    //items = Item.GetForModule(ModuleId, Config.DescendingSort);
                    //fieldValues = ItemFieldValue.GetItemValuesByModule(module.ModuleGuid);
                    itemsWithValues = Item.GetForModuleWithValues(ModuleId, Config.DescendingSort);
                }
            }

            if (SiteUtils.IsMobileDevice() && Config.MobileMarkupDefinition != null)
            {
                displaySettings = Config.MobileMarkupDefinition;
            }

            if (Config.MarkupScripts.Count > 0 || (SiteUtils.IsMobileDevice() && Config.MobileMarkupScripts.Count > 0))
            {
                if (SiteUtils.IsMobileDevice() && Config.MobileMarkupScripts.Count > 0)
                {
                    SuperFlexiHelpers.SetupScripts(Config.MobileMarkupScripts, Config, displaySettings, IsEditable, IsPostBack, ClientID, siteSettings, module, CurrentPage, Page, this);
                }
                else
                {
                    SuperFlexiHelpers.SetupScripts(Config.MarkupScripts, Config, displaySettings, IsEditable, IsPostBack, ClientID, siteSettings, module, CurrentPage, Page, this);
                }
            }

            if (Config.MarkupCSS.Count > 0)
            {
                SuperFlexiHelpers.SetupStyle(Config.MarkupCSS, Config, displaySettings, IsEditable, ClientID, siteSettings, module, CurrentPage, Page, this);
            }

            //if (Page.IsPostBack) { return; }

            PopulateControls();
        }