+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Show only certain folders in file manager

Show only certain folders in file manager

4 posts, 0 answered
  1. Zyad Rujeedawa
    Zyad Rujeedawa avatar
    31 posts
    Registered:
    18 Feb 2010
    21 Dec 2010
    Link to this post
    Hello,
    I want to limit the folders my webmasters can see in the File Manager section.

    I need to show one folder, and all of its subfolders.  It's very important that I see the subfolders as well.

    I saw a thread on this:
    http://www.sitefinity.com/devnet/forums/sitefinity-3-x/developing-with-sitefinity/file-manager-hide-folders.aspx

    However here we can only filter by the folder name.  I need to get the all subfolders as well.

    Any way to do this ?

    Thanks,
    Zyad

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Dec 2010
    Link to this post
    Hi Zyad,

    For the RadTreeView you can use Nodes collection of each node. For the RadGrid, you can use its ItemCreated event

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Zyad Rujeedawa
    Zyad Rujeedawa avatar
    31 posts
    Registered:
    18 Feb 2010
    21 Dec 2010
    Link to this post
    Thanks.  That worked.

    I now want to do the same in the imageeditordialog, within the WYSIWYG.

    See attached file.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Dec 2010
    Link to this post
    Hi Zyad,

    You have to substitute UrlWebEditor control declared in   ~/Sitefnity/Admin/ControlTemplates/Libraries/Dialogs/ItemSelector.ascx. UrlWebEditor control populates the folders in grid structure.

    sample

    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.Text;
    usingTelerik.Cms.Web.UI;
    usingSystem.Drawing.Design;
    usingSystem.IO;
    usingSystem.Web.UI.HtmlControls;
    usingTelerik.FileManager;
      
    /// <summary>
    /// Summary description for UrlWebEditorCustom
    /// </summary>
    ///
    namespaceSitefinity.Samples
    {
        publicclassUrlWebEditorCustom : Telerik.FileManager.UrlWebEditor
        {
            publicUrlWebEditorCustom()
            {
      
            }
      
            protectedoverridevoidCreateChildControls()
            {
                // base.CreateChildControls();
      
                this.Controls.Clear();
      
                this.manageFiles = newManageFiles();
      
                this.manageFiles.SetFilesGridColumnVisibility(false, false, false);
                this.manageFiles.SelectedFolderChanged += newTelerik.FileManager.FileSystemEventHandler(manageFiles_SelectedFolderChanged);
                DirectoryInfo di = newDirectoryInfo(@"C:\Sitefinity\WorkProject\App_Code");
                manageFiles.SelectedFolder = di;
                this.Controls.Add(this.manageFiles);
            }
      
            voidmanageFiles_SelectedFolderChanged(objectsource, Telerik.FileManager.FileSystemEventArgs e)
            {
                base.OnValueChanged(newTelerik.Cms.Web.UI.ValueChangedEventArgs(e.Path));
            }
      
            privateManageFiles manageFiles;
        }
    }

    Sitefinity\Admin\ControlTemplates\Libraries\Dialogs\ItemSelector.ascx

    <telerik:RadPageViewrunat="server"ID="pageViewFiles">
           <divid="fileManagerWrapepr">
      <ccEditor:UrlWebEditorCustomrunat="server"ID="urlWebEditor"/>  
           <%--<cc:UrlWebEditorid="urlWebEditor"runat="server"/>--%></div>
           <scripttype="text/javascript">
               var fmWrapper = document.getElementById("fileManagerWrapepr");
               if (typeof fmWrapper != 'undefined' && fmWrapper != null) {
                   var fmBody = fmWrapper.getElementsByTagName("TABLE")[0];
                   if (typeof fmBody != 'undefined' && fmBody != null) {
                       var TRs = fmBody.getElementsByTagName("TR");
      
                       for (var i = 0; i < TRs.length; i++) {
                           var folders= TRs[i].getElementsByTagName("A");
                           if (folders.length == 0)
                               TRs[i].onclick= function() {
                                   switchClasses(1, "show", "hidden", 'doneActions');
                                   switchClasses(1, "hidden", "show", 'actionsDisabled');
                               }
                       }
                   }
               }
           </script>
       </telerik:RadPageView>

    This post shows how to access the RadGrid control.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered