public ImageGalleryItem(string name, Id imageId, string headline, string content)
 {
     this.Text = name;
     this.Id = Guid.NewGuid().ToString();
     Icon = "/umbraco/Images/umbraco/headings.png";
     Headline = headline;
     Content = content;
     ImageId = imageId.IsNull? "" : imageId.ToString();
 }
示例#2
0
        public static Control LoadModule(string moduleId, int? columnSpan)
        {
            if (string.IsNullOrEmpty(moduleId))
                throw new ArgumentNullException("moduleId");

            var id = new Id(moduleId);
            var module = CmsService.Instance.GetItem<Entity>(id);
            var modulePath = string.Format("~/modules/{0}Rendering.ascx", module.Template.Name);

            var page = (System.Web.UI.Page)HttpContext.Current.Handler;

            var control = (IGridModuleRendering)page.LoadControl(modulePath);
            control.InitializeModule(id.ToString(), columnSpan);
            return (Control)control;
        }
示例#3
0
 private static Control LoadControl(int? columnSpan, Id id, GridModuleRenderingDefinition renderingDefinition)
 {
     var control = TypeUtility.Activate<IGridModuleRendering>(renderingDefinition.Type);
     control.InitializeModule(id.ToString(), columnSpan);
     return (Control)control;
 }
示例#4
0
 private static Control LoadUsercontrol(int? columnSpan, Id id, GridModuleRenderingDefinition renderingDefinition)
 {
     var modulePath = renderingDefinition.Path;
     var page = (System.Web.UI.Page)HttpContext.Current.Handler;
     var control = (IGridModuleRendering)page.LoadControl(modulePath);
     control.InitializeModule(id.ToString(), columnSpan);
     return (Control)control;
 }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            using (CmsContext.Editing)
            {
                var itemId = new Id(Request.QueryString["itemid"]);
                if (!Page.IsPostBack)
                {
                    hiddenId.Value = Request.QueryString["hiddenId"];

                    var sessionId = Guid.NewGuid().ToString();
                    hiddenReference.Value = sessionId;

                    var page = CmsService.Instance.GetItem<Entity>(itemId);
                    var fieldName = "accordionContent";

                    // Parse the accordion data into session

                    var accordionData = AccordionData.Parse(itemId.ToString(), page.EntityName, page.Icon, page[fieldName]);

                    //#region Test Data

                    //accordionData.AddItem(accordionData.Id, "Yo Wazzup", "Im in content", "");

                    //#endregion

                    HttpContext.Current.Session["AccordionData_" + sessionId] = accordionData;
                    treeview.ProviderReferenceId = sessionId;
                    treeview.Provider = typeof(AccordionEditorProvider).GetShortAssemblyName();
                    treeview.ItemId = itemId.ToString();

                    modulePicker.ProviderReferenceId = itemId.ToString();
                    modulePicker.Provider = typeof (LinqIt.UmbracoCustomFieldTypes.UmbracoTreeModuleProvider).GetShortAssemblyName();
                    modulePicker.ItemId = itemId.ToString();
                }
            }
        }
示例#6
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            using (CmsContext.Editing)
            {
                var itemId = new Id(Request.QueryString["itemid"]);
                if (!Page.IsPostBack)
                {
                    hiddenId.Value = Request.QueryString["hiddenId"];

                    var sessionId = Guid.NewGuid().ToString();
                    hiddenReference.Value = sessionId;

                    var page = CmsService.Instance.GetItem<Entity>(itemId);
                    const string fieldName = "imageGalleryContent";

                    // Parse the ImageGallery data into session
                    var imageGalleryData = ImageGalleryData.Parse(page[fieldName]);

                    //#region Test Data

                    //ImageGalleryData.AddItem(ImageGalleryData.Id, "Yo Wazzup", "Im in content", "");

                    //#endregion

                    HttpContext.Current.Session["ImageGalleryData_" + sessionId] = imageGalleryData;
                    treeview.ProviderReferenceId = sessionId;
                    treeview.Provider = typeof(ImageGalleryProvider).GetShortAssemblyName();
                    treeview.ItemId = itemId.ToString();

                    imagePicker.ProviderReferenceId = itemId.ToString();
                    imagePicker.Provider = typeof(UmbracoImageTreeProvider).GetShortAssemblyName();
                    imagePicker.ItemId = itemId.ToString();
                }
            }
        }