Пример #1
0
 /// <summary>
 /// Outputs the JavaScript instances used to make this control work
 /// </summary>
 protected virtual string GetJSScript()
 {
     /* 0 = this control's client id
      * 1 = label
      * 2 = itemIdValueClientID
      * 3 = itemTitleClientID
      * 4 = itemPickerUrl
      * 5 = popup width
      * 6 = popup height
      * 7 = show header
      * 8 = umbraco path
      */
     return(string.Format(@"
         var mc_{0} = new Umbraco.Controls.TreePicker('{0}','{1}','{2}','{3}','{4}',{5},{6},{7},'{8}');",
                          new string[]
     {
         this.ClientID,
         ModalWindowTitle,
         ItemIdValue.ClientID,
         ItemTitle.ClientID,
         TreePickerUrl,
         ModalWidth.ToString(),
         ModalHeight.ToString(),
         ShowHeader.ToString().ToLower(),
         Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco).TrimEnd('/')
     }));
 }
Пример #2
0
        private string GetIBoxLink()
        {
            string link = "ibox";

            if (this.ModalHeight > 0)
            {
                link += "&amp;height=" + ModalHeight.ToString(CultureInfo.InvariantCulture);
            }
            if (this.ModalWidth > 0)
            {
                link += "&amp;width=" + ModalWidth.ToString(CultureInfo.InvariantCulture);
            }

            return(link);
        }
Пример #3
0
 protected override string GetJSScript()
 {
     if (!_showpreview)
     {
         return(base.GetJSScript());
     }
     else
     {
         /* 0 = this control's client id
          * 1 = label
          * 2 = mediaIdValueClientID
          * 3 = previewContainerClientID
          * 4 = imgViewerClientID
          * 5 = mediaTitleClientID
          * 6 = mediaPickerUrl
          * 7 = popup width
          * 8 = popup height
          * 9 = umbraco path
          */
         return(string.Format(@"
         var mc_{0} = new Umbraco.Controls.MediaChooser('{1}','{2}','{3}','{4}','{5}','{6}',{7},{8},'{9}');",
                              new string[]
         {
             this.ClientID,
             ModalWindowTitle,
             ItemIdValue.ClientID,
             _showpreview ? PreviewContainer.ClientID : "__NOTSET",
             _showpreview ? ImgViewer.ClientID : "_NOTSET",
             ItemTitle.ClientID,
             TreePickerUrl,
             ModalWidth.ToString(),
             ModalHeight.ToString(),
             IOHelper.ResolveUrl(SystemDirectories.Umbraco).TrimEnd('/')
         }));
     }
 }