Пример #1
0
    protected Telerik.Web.UI.FileExplorer.FileExplorerControls GetVisibleControls()
    {
        Telerik.Web.UI.FileExplorer.FileExplorerControls explorerControls = 0;

        //explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.AddressBox;

        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.Grid;

        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.ListView;

        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.Toolbar;

        explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.TreeView;

        //explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.ContextMenus;

        return(explorerControls);
    }
Пример #2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    //load skins
                    ddlSkins.Items.Add("Default");
                    ddlSkins.Items.Add("Black");
                    ddlSkins.Items.Add("Forest");
                    ddlSkins.Items.Add("Office2007");
                    ddlSkins.Items.Add("Office2010Black");
                    ddlSkins.Items.Add("Office2010Blue");
                    ddlSkins.Items.Add("Office2010Silver");
                    ddlSkins.Items.Add("Outlook");
                    ddlSkins.Items.Add("Metro");
                    ddlSkins.Items.Add("MetroTouch");
                    ddlSkins.Items.Add("Simple");
                    ddlSkins.Items.Add("Sitefinity");
                    ddlSkins.Items.Add("Sunset");
                    //ddlSkins.Items.Add("Telerik");
                    ddlSkins.Items.Add("Transparent");
                    ddlSkins.Items.Add("Vista");
                    ddlSkins.Items.Add("Web20");
                    ddlSkins.Items.Add("WebBlue");
                    ddlSkins.Items.Add("Windows7");

                    //load view modes
                    ddlViewMode.Items.Add("Default");
                    ddlViewMode.Items.Add("Thumbnails");
                    ddlViewMode.Items.Add("File Tree");

                    //get controls embedded in vertical menu
                    //RadFileExplorer feSelectFolder = (RadFileExplorer)RootSelectorPanelBar.FindItemByValue("Explorer").FindControl("feSelectFolder");
                    //RadTextBox txtRootPath = (RadTextBox)RootSelectorPanelBar.FindItemByValue("Path").FindControl("txtRootFolder");

                    #region assign-provider_cs
                    feSelectFolder.Configuration.ContentProviderTypeName = typeof(QuickDocsFileSystemProvider).AssemblyQualifiedName;
                    #endregion

                    string[] paths = new string[] { this.PortalSettings.HomeDirectory };
                    feSelectFolder.Configuration.ViewPaths = paths;
                    feSelectFolder.EnableOpenFile = false;
                    feSelectFolder.ExplorerMode = Telerik.Web.UI.FileExplorer.FileExplorerMode.Default;

                    Telerik.Web.UI.FileExplorer.FileExplorerControls visibleControls = new Telerik.Web.UI.FileExplorer.FileExplorerControls();
                    visibleControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.TreeView;
                    visibleControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.AddressBox;
                    visibleControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.Toolbar;
                    feSelectFolder.VisibleControls = visibleControls;

                    if ((string)TabModuleSettings["MaxFileSize"] != null)
                    {
                        int intMax = Convert.ToInt32((string)TabModuleSettings["MaxFileSize"]);
                        intMax = intMax / 1024;
                        txtMaxFileSize.Text = intMax.ToString();
                        int intHeight = Convert.ToInt32((string)TabModuleSettings["ExplorerHeight"]);
                        txtExplorerHeight.Text = intHeight.ToString();
                        String strUseIconMode = (string)TabModuleSettings["UseIconMode"];
                        String strRootFolder = (string)TabModuleSettings["RootFolder"];
                        String strShowFilter = (string)TabModuleSettings["ShowFilter"];
                        String strUsePath = (string)TabModuleSettings["UsePathAsRoot"];
                        String strSkin = (string)TabModuleSettings["Skin"];
                        String strHideTree = (string)TabModuleSettings["HideTree"];
                        String strHideToolbar = (string)TabModuleSettings["HideToolbar"];
                        String strRecycleBinFolder = (string)TabModuleSettings["RecycleBinFolder"];
                        String strUseRecycleBin = (string)TabModuleSettings["UseRecycleBin"];
                        //String strUsePermissions = (string)TabModuleSettings["UsePermissions"];
                        String strEnableVersions = (string)TabModuleSettings["EnableVersions"];
                        //String strFileTreeMode = (string)TabModuleSettings["UseFileTreeMode"];
                        String strViewMode = (string)TabModuleSettings["ViewMode"];
                        int intVersionCount = Convert.ToInt32((string)TabModuleSettings["VersionCount"]);
                        txtVersionCount.Text = intVersionCount.ToString();

                        //Legacy: set new ddl value for legacy modules
                        if (strUseIconMode == "true")
                            ddlViewMode.Items.FindByText("Thumbnails").Selected = true;
                        //    chkUseIconMode.Checked = true;

                        if (strShowFilter == "true")
                            chkShowFilter.Checked = true;

                        if (strHideTree == "true")
                            chkHideTree.Checked = true;

                        if (strHideToolbar == "true")
                            chkHideToolbar.Checked = true;

                        if (strSkin != null && strSkin != "")
                        {
                            ddlSkins.Items.FindByText(strSkin).Selected = true;
                        }

                        if (strViewMode != null && strViewMode != "")
                        {
                            ddlViewMode.Items.FindByText(strViewMode).Selected = true;
                        }

                        if (strUseRecycleBin == "true")
                        {
                            chkUseRecycleBin.Checked = true;
                        }
                        else
                        {
                            chkUseRecycleBin.Checked = false;
                        }

                        if (strEnableVersions == "true")
                        {
                            chkEnableVersions.Checked = true;
                        }
                        else
                        {
                            chkEnableVersions.Checked = false;
                        }

                        //if (strUsePermissions == "true")
                        //{
                        //    chkUsePermissions.Checked = true;
                        //}
                        //else
                        //{
                        //    chkUsePermissions.Checked = false;
                        //}

                        //if (strFileTreeMode == "true")
                        //{
                        //    chkUseFileTreeMode.Checked = true;
                        //}
                        //else
                        //{
                        //    chkUseFileTreeMode.Checked = false;
                        //}

                        //RootSelectorPanelBar.FindItemByValue("Explorer").Expanded = true;
                        //RootSelectorPanelBar.FindItemByValue("Explorer").Selected = true;

                        if (strUsePath != "true")
                        {
                            //folder selected
                            feSelectFolder.InitialPath = strRootFolder;
                        }
                        else
                        {
                            //path selected
                            //txtRootPath.Text = strRootFolder;
                            //RootSelectorPanelBar.FindItemByValue("Path").Selected = true;
                            //RootSelectorPanelBar.FindItemByValue("Path").Expanded = true;
                        }
                    }

                    //string regCode = PortalController.GetPortalSetting("QuickDocsRegNumber", PortalId, "");
                    //txtRegistration.Text = regCode;
                    //v1 BA8D3E9E-96BE-4A2E-9447-C1B53EC5A71E
                    //v2 0588A9100-0A29-407A-9AA9-A872811FCED6
                    //v7 209496d4-b0ef-45a8-a6e5-f67bce152311
                    //if (regCode != "0588A9100-0A29-407A-9AA9-A872811FCED6" && regCode != "209496d4-b0ef-45a8-a6e5-f67bce152311" )
                    //{
                    //    lblRegistrationMessage.Text = "Enter Registeration Code:";
                    //}
                    //else
                    //{
                    //    lblRegistrationMessage.Text = "QuickDocs is registered for this portal!";
                    //    txtRegistration.Visible = false;
                    //}
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }