Esempio n. 1
0
 public async Task <ActionResult> GetHtaToolbarMarkUp([FromBody] HtAreaToolbarViewModel model)
 {
     return(Json(new
     {
         html = await RenderPartialView("HTAreaToolbar", model)
     }));
 }
Esempio n. 2
0
        public async Task <ActionResult> GetInsertPopUpMarkUp([FromBody] HtAreaToolbarViewModel model)
        {
            int?   languageId;
            string assemblingType;
            bool   isForm, isContainer;
            int?   pageId    = null;
            int?   contentId = null;

            if (model.FormatId.HasValue)
            {
                var format = _pageTemplateService.ReadFormatProperties(model.FormatId.Value, true, false);
                languageId     = format.NetLanguageId;
                assemblingType = _pageTemplateService.ReadPageTemplateProperties(model.TemplateId.Value).Site.AssemblingType;

                var obj = _pageTemplateService.ReadObjectProperties(format.ObjectId, false);
                isContainer = obj.IsObjectContainerType;
                pageId      = obj.PageId;
                isForm      = obj.IsObjectFormType;

                if (isForm)
                {
                    contentId = obj.ContentForm.ContentId;
                }
                else if (isContainer)
                {
                    contentId = obj.Container.ContentId;
                }
            }
            else
            {
                var template = _pageTemplateService.ReadPageTemplateProperties(model.TemplateId.Value);
                languageId     = template.NetLanguageId;
                assemblingType = template.Site.AssemblingType;
                isContainer    = false;
                isForm         = false;
            }

            return(Json(new
            {
                html = await RenderPartialView("InsertPopupWindow", new InsertPopupViewModel(
                                                   model.TemplateId.Value, languageId, assemblingType, model.PresentationOrCodeBehind, isContainer, isForm, contentId, pageId, _pageTemplateService
                                                   ))
            }));
        }