Пример #1
0
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            this.DesignerMode = ControlDesignerModes.Simple;

            //var kendoTheme = new HtmlLink();
            //kendoTheme.Attributes["href"] = ResolveClientUrl("EventsRegistration.Resources.KendoWidgetStyle.css");
            //kendoTheme.Attributes["rel"] = "stylesheet";
            //kendoTheme.Attributes["type"] = "text/css";
            //this.Page.Header.Controls.Add(kendoTheme);

            var listOne = getCustomFields(typeof(Event), typeof(Decimal));
            var listTwo = getCustomFields(typeof(Event));

            this.comboMaxAtt.DataSource      = listOne;
            this.comboCurrAtt.DataSource     = listOne;
            this.comboProductName.DataSource = listTwo;
            this.comboMaxAtt.DataBind();
            this.comboCurrAtt.DataBind();
            this.comboProductName.DataBind();

            var item = new DataMemberInfo
            {
                Name           = "Title",
                HeaderText     = "Title",
                ColumnTemplate = "<span>{{Title}}</span>",
                IsSearchField  = true
            };

            // set root node for page selector
            PageSelector.RootNodeID = Telerik.Sitefinity.Abstractions.SiteInitializer.FrontendRootNodeId;
        }
        /// <summary>
        /// Initializes the designer.
        /// </summary>
        /// <param name="container">
        ///     Represents base implementation for template container. Template containers
        ///     are controls that are used as containers for other controls defined through
        ///     control templates (ITemplate).
        /// </param>
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            EmailBodyHTML.DisplayMode          = Telerik.Sitefinity.Web.UI.Fields.Enums.FieldDisplayMode.Write;
            EmailBodyHTML.FixCursorIssue       = true;
            ClientEmailBodyHTML.DisplayMode    = Telerik.Sitefinity.Web.UI.Fields.Enums.FieldDisplayMode.Write;
            ClientEmailBodyHTML.FixCursorIssue = true;

            GridSelector.DataMembers.Clear();

            var item = new DataMemberInfo
            {
                Name           = "Title",
                HeaderText     = "Title",
                ColumnTemplate = " <strong>{{Title}}</strong>",
                IsSearchField  = true
            };

            GridSelector.DataMembers.Add(item);
            GridSelector.ShowHeader         = false;
            GridSelector.ShowSelectedFilter = false;
            GridSelector.BindOnLoad         = true;

            if (this.PropertyEditor != null)
            {
                var uiCulture = this.PropertyEditor.PropertyValuesCulture;
                this.PageSelectorRedirectPage.UICulture = uiCulture;
            }

            this.DesignerMode = ControlDesignerModes.Simple;
        }
 protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
 {
     if (this.PropertyEditor != null)
     {
         var uiCulture = this.PropertyEditor.PropertyValuesCulture;
         this.PageSelectorDetailsPageId.UICulture = uiCulture;
     }
 }
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            // Place your initialization logic here

            if (this.PropertyEditor != null)
            {
                var uiCulture = this.PropertyEditor.PropertyValuesCulture;
                this.PageSelectorPageId.UICulture = uiCulture;
            }
        }
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            base.InitializeControls(container);


            //Injects the the css class .hideTextBox into the head section of the current page. This css class is used to hide the
            //FormTextBox that holds the title of the event
            this.Page.Header.Controls.Add(new LiteralControl("<style type=\"text/css\"> .hideTextBox {display: none !important;} </style>"));

            //Get the event by the current url
            int index = HttpContext.Current.Request.Url.AbsolutePath.LastIndexOf('/') + 1;

            eventUrlName = HttpContext.Current.Request.Url.AbsolutePath.Substring(index);

            if (!SingleWidgetPerEachEvent)
            {
                currentEvent = GetEventByUrl(eventUrlName);

                //Check whether a custom field with the name Thumbnail exists
                var productField = App.WorkWith().DynamicData().Type(typeof(Event)).Fields().Where(f => f.FieldName == FieldProductName).Get().SingleOrDefault();

                if (currentEvent != null && productField != null && !currentEvent.GetValue(FieldProductName).ToString().IsNullOrEmpty())
                {
                    ProductId = new Guid(currentEvent.GetValue(FieldProductName).ToString());
                }

                if (currentEvent != null && productField != null && currentEvent.GetValue(FieldProductName).ToString().IsNullOrEmpty())
                {
                    this.Visible = false;
                }
            }

            //Hide the text field that holds the event name
            foreach (var fieldControl in this.FieldControls)
            {
                if (fieldControl is FormTextBox && ((FormTextBox)fieldControl).MetaField.FieldName == FormFieldForEvents)
                {
                    //Holds the FormTextBox with the event's title
                    textBox = ((FormTextBox)fieldControl);

                    //Hide the FormTextBox with CSS
                    textBox.CssClass = "hideTextBox";

                    //Sets the Value of the FormTextBox to the title of the event
                    if (currentEvent != null)
                    {
                        ((FormTextBox)textBox).DefaultStringValue = currentEvent.Title.ToString();
                    }
                    else
                    {
                        ((FormTextBox)textBox).DefaultStringValue = EventsName;
                    }
                }
            }
        }
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            // Place your initialization logic here

            if (this.PropertyEditor != null)
            {
                var uiCulture = this.PropertyEditor.PropertyValuesCulture;
                this.ProductIdItemSelector.UICulture      = uiCulture;
                this.ProductIdItemSelector.ConstantFilter = "Visible=true";
            }
        }
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            // ItemType should be resolved from the dialog parameters for each module
            if (this.ItemType.BaseType != null && this.ItemType.BaseType.FullName == typeof(DynamicContent).FullName)
            {
                var binderContainer = this.ImageBinder.Containers.Where <BinderContainer>(c => c.ID == "BinderContainer1").FirstOrDefault();
                if (binderContainer != null)
                {
                    binderContainer.Markup =
                        @"<span sys:title=""{{Title.PersistedValue}}"" style=""border:1px solid #000"" >{{(Title.PersistedValue.length > 22) ? Title.PersistedValue.substring(0,22) + '...' : Title.PersistedValue}}</span>";
                }

                this.ImageBinder.HandleItemReordering     = true;
                this.ImageBinder.AutoUpdateOrdinals       = false;
                this.ImageBinder.ServiceUrl               = this.GetServiceUrl();
                this.ImageBinder.ServiceChildItemsBaseUrl = this.GetChildServiceUrl();
                this.BackButton.Text          = string.Format(Res.Get <Labels>().BackToAllItemsParameter, this.ItemsName);
                DragToChangeOrderLiteral.Text = string.Format(Res.Get <LibrariesResources>().DragToChangeOrder, this.ItemNameWithArticle);
            }
            else
            {
                base.InitializeControls(container);
            }
        }
Пример #8
0
 /// <summary>
 /// Initializes the form handler captcha
 /// </summary>
 /// <param name="container"></param>
 protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
 {
     // Place your initialization logic here
     this.ConfigureMetaFieldName();
 }
Пример #9
0
 protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
 {
     // Place your initialization logic here
 }
Пример #10
0
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            WidgetDesignerHelper helper = new WidgetDesignerHelper();

            helper.AddStandardValue(container.Controls[0].Controls.Cast <Control>());
        }
 protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
 {
 }
Пример #12
0
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        {
            var    url      = System.Web.HttpContext.Current.Session["PageUrl"].ToString();
            var    regEx    = new System.Text.RegularExpressions.Regex(@"^/([a-zA-Z]+)/[a-zA-Z/]*$");
            var    match    = regEx.Match(url);
            string pageName = "";

            if (!match.Success)
            {
                throw new NullReferenceException("The url did not contain the current page name");
            }

            pageName = match.Groups[1].ToString().ToLower();

            var pManager = Telerik.Sitefinity.Modules.Pages.PageManager.GetManager();

            var sites = new Telerik.Sitefinity.Multisite.MultisiteManager();

            var homePage = pManager.GetPageDataList().Where(p => p.NavigationNode.Title.ToString().ToLower() == pageName && p.NavigationNode.ParentId == new Guid(System.Web.SiteMap.RootNode.Key)).FirstOrDefault();

            if (homePage == null)
            {
                throw new NullReferenceException("The current published page could not be found");
            }

            var homePagePreview = pManager.GetPreview(homePage.NavigationNode.PageId);

            if (homePagePreview == null)
            {
                throw new NullReferenceException("The current preview page could not be found");
            }

            var configPage = pManager.GetPageDataList().Where(p => p.NavigationNode.Title.ToString().ToLower() == "config" && p.NavigationNode.ParentId == new Guid(System.Web.SiteMap.RootNode.Key)).FirstOrDefault();

            if (configPage == null)
            {
                throw new NullReferenceException("The config page could not be found");
            }

            var parentName = configPage.Controls[0].Properties.FirstOrDefault(p => p.Name == "ParentName");

            if (parentName == null)//no parent, most likely is parent site
            {
                return;
            }

            var parentSiteName = parentName.Value;

            if (parentSiteName == "")
            {
                throw new NullReferenceException("The ParentName property is empty");
            }

            var parentSite = sites.GetSites().Where(p => p.Name == parentSiteName).FirstOrDefault();

            if (parentSite == null)
            {
                throw new NullReferenceException("The parent site name: " + parentSiteName + " could not be found");
            }

            var thisPage = pManager.GetPageDataList().Where(p => p.NavigationNode.Title.ToString().ToLower() == pageName && p.NavigationNode.ParentId == parentSite.SiteMapRootNodeId).FirstOrDefault();

            if (thisPage == null)
            {
                throw new NullReferenceException("The current page of the parent site could not be found");
            }

            thisPage.Controls[0].Properties.ToList().ForEach(p =>
            {
                ControlProperty homeProperty = null;
                if ((homeProperty = homePagePreview.Controls[0].Properties.FirstOrDefault(n => n.Name == p.Name)) != null)
                {
                    if (p.Value != homeProperty.Value)
                    {
                        StandardValue.Visible = false;
                    }
                }
            });
        }