コード例 #1
0
        public ActionResult Index(HiveId id)
        {
            using (var uow = BackOfficeRequestContext.Application.Hive.OpenReader<IFileStore>(new Uri("storage://macros")))
            {
                var macros = uow.Repositories.GetAll<File>()
                    .Select(MacroSerializer.FromFile)
                    .Select(x => new SelectListItem { Text = x.Name, Value = x.Alias });

                var model = new SelectMacroModel
                {
                    AvailableMacroItems = macros
                };

                return View(model);
            }
        }
コード例 #2
0
        public ActionResult SelectMacro(HiveId contentId, bool isNew)
        {
            using (var uow = BackOfficeRequestContext.Application.Hive.OpenReader<IFileStore>(new Uri("storage://macros")))
            {
                var macros = uow.Repositories.GetAll<File>()
                    .Select(MacroSerializer.FromFile).Where(x => x.UseInEditor)
                    .Select(x => new SelectListItem { Text = x.Name, Value = x.Alias });

                var model = new Rebel.Cms.Web.Model.BackOffice.TinyMCE.InsertMacro.SelectMacroModel
                {
                    ContentId = contentId,
                    IsNew = isNew,
                    AvailableMacroItems = macros
                };

                return View(
                    EmbeddedViewPath.Create("Rebel.Cms.Web.PropertyEditors.RichTextBox.TinyMCE.Views.InsertMacro.SelectMacro.cshtml, Rebel.Cms.Web.PropertyEditors"),
                    model);
            }
        }
コード例 #3
0
        public ActionResult SelectMacro(HiveId contentId, bool isNew)
        {
            using (var uow = BackOfficeRequestContext.Application.Hive.OpenReader <IFileStore>(new Uri("storage://macros")))
            {
                var macros = uow.Repositories.GetAll <File>()
                             .Select(MacroSerializer.FromFile).Where(x => x.UseInEditor)
                             .Select(x => new SelectListItem {
                    Text = x.Name, Value = x.Alias
                });

                var model = new Rebel.Cms.Web.Model.BackOffice.TinyMCE.InsertMacro.SelectMacroModel
                {
                    ContentId           = contentId,
                    IsNew               = isNew,
                    AvailableMacroItems = macros
                };

                return(View(
                           EmbeddedViewPath.Create("Rebel.Cms.Web.PropertyEditors.RichTextBox.TinyMCE.Views.InsertMacro.SelectMacro.cshtml, Rebel.Cms.Web.PropertyEditors"),
                           model));
            }
        }