Esempio n. 1
0
 private void SetMailLinkControls()
 {
     if (this.LinkType == "mailto" && string.IsNullOrEmpty(this.Url.Value))
     {
         this.MailToLink.Value = this.AnalyticsLinkAttributes[Attributes.url];
     }
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.GoalId);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.EventId);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.MailToContainer);
     this.SectionHeader.Text = Translate.Text("Specify the email address and any additional properties. To send a test mail use the 'Send a test mail' button.");
 }
Esempio n. 2
0
 private void SetExternalLinkControls()
 {
     if (this.LinkType == "external" && string.IsNullOrEmpty(this.Url.Value))
     {
         this.Url.Value = this.AnalyticsLinkAttributes[Attributes.url];
     }
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.UrlContainer);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.Target);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.CustomTarget);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.GoalId);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.EventId);
     this.SectionHeader.Text = Translate.Text("Specify the URL, e.g. http://www.sitecore.net and any additional properties.");
 }
Esempio n. 3
0
        private void SetJavaScriptLinkControls()
        {
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.JavascriptCode);
            string str = this.AnalyticsLinkAttributes[Attributes.url];

            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.GoalId);
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.EventId);
            if (this.LinkType != "javascript" && string.IsNullOrEmpty(this.JavascriptCode.Value))
            {
                str = string.Empty;
            }
            this.JavascriptCode.Value = str;
            this.SectionHeader.Text   = Translate.Text("Specify the JavaScript and any additional properties.");
        }
Esempio n. 4
0
 private void SetInternalLinkContols()
 {
     this.LinkAnchor.Value = this.AnalyticsLinkAttributes[Attributes.anchor];
     this.InternalLinkTreeviewContainer.Visible = true;
     this.MediaLinkTreeviewContainer.Visible    = false;
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.TreeviewContainer);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.Querystring);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.GoalId);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.EventId);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.LinkAnchor);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.Target);
     GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.CustomTarget);
     this.SectionHeader.Text = Translate.Text("Select the item that you want to create a link to and specify the appropriate properties.");
 }
Esempio n. 5
0
        private void SetAnchorLinkControls()
        {
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.LinkAnchor);
            string str = this.AnalyticsLinkAttributes[Attributes.anchor];

            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.GoalId);
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.EventId);
            if (this.LinkType != Attributes.anchor && string.IsNullOrEmpty(this.LinkAnchor.Value))
            {
                str = string.Empty;
            }
            if (!string.IsNullOrEmpty(str) && !str.StartsWith("#", StringComparison.InvariantCulture))
            {
                str = "#" + str;
            }
            this.LinkAnchor.Value   = str ?? string.Empty;
            this.SectionHeader.Text = Translate.Text("Specify the name of the anchor, e.g. #header1, and any additional properties");
        }
Esempio n. 6
0
        private void SetMediaLinkControls()
        {
            this.InternalLinkTreeviewContainer.Visible = false;
            this.MediaLinkTreeviewContainer.Visible    = true;
            this.MediaPreview.Visible = true;
            this.UploadMedia.Visible  = true;
            Item folder = this.MediaLinkDataContext.GetFolder();

            if (folder != null)
            {
                this.UpdateMediaPreview(folder);
            }
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.TreeviewContainer);
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.Target);
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.CustomTarget);
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.GoalId);
            GeneralLinkForm.ShowContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.EventId);
            this.SectionHeader.Text = Translate.Text("Select an item from the media library and specify any additional properties.");
        }
Esempio n. 7
0
        protected override void OnLoad(EventArgs e)
        {
            Assert.ArgumentNotNull((object)e, nameof(e));
            base.OnLoad(e);
            if (Context.ClientPage.IsEvent)
            {
                return;
            }

            if (!Context.ClientPage.IsPostBack)
            {
                (new Events.Processors.LoadControl()).Reload();
            }

            this.CurrentMode = this.LinkType ?? string.Empty;
            this.InitControls();
            this.SetModeSpecificControls();
            GeneralLinkForm.RegisterScripts();
        }
Esempio n. 8
0
        private void SetModeSpecificControls()
        {
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.TreeviewContainer);
            this.MediaPreview.Visible = false;
            this.UploadMedia.Visible  = false;
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.UrlContainer);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.Querystring);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.GoalId);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.EventId);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.MailToContainer);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.LinkAnchor);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.JavascriptCode);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.Target);
            GeneralLinkForm.HideContainingRow((Sitecore.Web.UI.HtmlControls.Control) this.CustomTarget);
            string currentMode = this.CurrentMode;

            if (!(currentMode == "internal"))
            {
                if (!(currentMode == "media"))
                {
                    if (!(currentMode == "external"))
                    {
                        if (!(currentMode == "mailto"))
                        {
                            if (!(currentMode == "anchor"))
                            {
                                if (!(currentMode == "javascript"))
                                {
                                    throw new ArgumentException("Unsupported mode: " + this.CurrentMode);
                                }
                                this.SetJavaScriptLinkControls();
                            }
                            else
                            {
                                this.SetAnchorLinkControls();
                            }
                        }
                        else
                        {
                            this.SetMailLinkControls();
                        }
                    }
                    else
                    {
                        this.SetExternalLinkControls();
                    }
                }
                else
                {
                    this.SetMediaLinkControls();
                }
            }
            else
            {
                this.SetInternalLinkContols();
            }
            foreach (Border control in this.Modes.Controls)
            {
                if (control != null)
                {
                    control.Class = control.ID.ToLowerInvariant() == this.CurrentMode ? "selected" : string.Empty;
                }
            }
        }