예제 #1
0
 public void SetItemViewModel(ItemViewModel itemViewModel)
 {
     this.Item = itemViewModel;
 }
예제 #2
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                base.OnInit(e);

                jQuery.RequestDnnPluginsRegistration();

                var fileId = Convert.ToInt32(Request.Params["FileId"]);
                file = FileManager.Instance.GetFile(fileId, true);
                fileItem = controller.GetFile(fileId);
                folder = FolderManager.Instance.GetFolder(file.FolderId);

                SaveButton.Click += OnSaveClick;
                CancelButton.Click += OnCancelClick;

                if (FolderPermissionController.CanViewFolder((FolderInfo)folder))
                {
                    var mef = new ExtensionPointManager();
                    var preViewPanelExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "PreviewInfoPanelExtensionPoint");
                    previewPanelControl = Page.LoadControl(preViewPanelExtension.UserControlSrc);
                    PreviewPanelContainer.Controls.Add(previewPanelControl);

                    var fileFieldsExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "FileFieldsControlExtensionPoint");
                    fileFieldsControl = Page.LoadControl(fileFieldsExtension.UserControlSrc);
                    fileFieldsControl.ID = fileFieldsControl.GetType().BaseType.Name;
                    FileFieldsContainer.Controls.Add(fileFieldsControl);

                    PrepareFilePreviewInfoControl();
                    PrepareFileFieldsControl();

                    // Tab Extension Point
                    var tabContentControlsInstances = new List<PropertiesTabContentControl>();
                    foreach (var extension in mef.GetEditPageTabExtensionPoints("DigitalAssets", "FilePropertiesTab"))
                    {
                        if (FolderPermissionController.HasFolderPermission(folder.FolderPermissions, extension.Permission))
                        {
                            var liElement = new HtmlGenericControl("li") { InnerHtml = "<a href=\"#" + extension.EditPageTabId + "\">" + extension.Text + "</a>", };
                            liElement.Attributes.Add("class", extension.CssClass);
                            liElement.Attributes.Add("id", extension.EditPageTabId + "_tab");
                            Tabs.Controls.Add(liElement);

                            var container = new PanelTabExtensionControl { PanelId = extension.EditPageTabId };
                            var control = (PortalModuleBase)Page.LoadControl(extension.UserControlSrc);
                            control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc);
                            control.ModuleConfiguration = ModuleConfiguration;
                            var contentControl = control as PropertiesTabContentControl;
                            if (contentControl != null)
                            {
                                contentControl.OnItemUpdated += OnItemUpdated;
                                tabContentControlsInstances.Add(contentControl);
                            }
                            container.Controls.Add(control);
                            TabsPanel.Controls.Add(container);
                        }
                    }
                    tabContentControls = tabContentControlsInstances.ToList();
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
 public virtual PreviewInfoViewModel GetFilePreviewInfo(IFileInfo file, ItemViewModel item)
 {
     var result = new PreviewInfoViewModel
     {
         Title = LocalizationHelper.GetString("PreviewPanelTitle.Text"),
         ItemId = file.FileId,
         IsFolder = false,
         PreviewImageUrl = item.IconUrl,
         Fields = GetFilePreviewFields(file)
     };
     return result;
 }
 public void SetItemViewModel(ItemViewModel itemViewModel)
 {
     _Item = itemViewModel;
 }