• Great to have so many feedbacks. Sorry I forgot to enable comments on here before, now it is enabled. Thanks again!

  • Hi Mark,

    this feature has always been on my mind. However, more thoughts would have to be put into it because we do not want to by pass Elgg's file engine, but to integrate it seamlessly with the normal file systems. I would love to hear any suggestions the Elgg community has.

    I just tried your folder plugin, it is awsome!
    It would be great to be able to move files from the normal file system
    into folders in order to organise the site after activation of the folders
    plugin... but maybe not possible.  Thanks for a great plugin.
    Can't make comments on the plugin listing though... seems to be switched off.

  • Hi,

    indeed the plugin was developed for 1.7, I could not recall from the top of my head why it would not work with 1.6.2.


    On your second comment, I have considered extensively about the semantics of this folder plugin. In the beginning, the plugin actually supported moving of files between Groups or Friends folders depending on the access control set on those folders. However it quickly became confusing to who owns what and also makes the the UI design more complicated. Therefore I decided to stick to the files plugin's semantics, where the folders are only readable and not writable outside of your ownership. Similar to Groups files, when you create a folder under the Group's context, the owner of the folder belongs to the group and only group's files can be moved in and out of that group's folder.


    Regarding the admin comments, it is possible to implement functionalities to create folders for users and move user files inbetween their folders. But again cross-folder functionalities can be confusing as mentioned above.

    @Hi txtan,
    the folder plugin adds a very useful functionality to the files section.
    Thanks a lot.
    I would have asked the following question by writing a comment, if
    comments would be allowed on the plugins page. I've tested it in Elgg 1.6.2
    as my productive site is still running with this Elgg version and it seems
    the folder plugin was developed for Elgg 1.7+. Am I right or should it/will
    it run in Elgg 1.6.2 at some time, too?
    Creating a folder works, and files can also be moved between folders via
    the dropdown menu. But the drag and drop feature doesn't work properly. The
    files in Unspecific aren't shown in Elgg 1.6.2 while they show in Elgg
    1.7.1. In the drag and drop view it's also not possible to delete a folder
    ("Missing token" - in Elgg 1.6.2?).
    Would it be possible to add some additional admin functionality. For
    example it would be nice if admins could create folders for other users and
    also move their files between their folders at least to sort out the Files
    section once and keep it ordered. Would it be also possible to move files
    between the different group Files sections or between the generic Files
    section and groups, again also files of other users when being admin?
    Best regards,

  • Hi Tom,

    I am not sure why it says 'misconfigured plugin' , more information and perhaps some screenshots are needed for me to debug this.

    @Thanks for your folder plugin, Txtan...but I tried to enable it on 1.7.1
    and it gave me "misconfigured plugin" so could not. Also: you did not allow
    feedback on the plugin page?

  • Hi txtan, thanks for the reply... so where are the files kept then?  I am not sure it matters having two differant systems, on of icons etc, and yours, but the visability and workflows between them need to be considered I guess.  Anyway... champion!

  • Hi Mark,

    physically, elgg files are stored in the data/ folder, in order to let your system files be registered in elgg, you will have to go through the elgg files registration process which includes, creating the necessary database and metadata entries. Also it should be copied to the data/ folder or change the way elgg look for these elgg files. More thoughts have to be put into this and the implications they will make to the way Elgg functions.

  • This plugin is a real must. Great work Txtan.

    example it would be nice if admins could create folders for other users

    We have a default profile widgets and default dashboard widgets plugin available. A default folders option would be nice for admins to control on site setup. A new user registers and he already has a default set of folders, but he can change them and add more etc.

    As to swopping files between owners. A give function could perhaps work. User can give his files to someone else (including group) group admin can give group files to other groups or individual users. I guess it would need to do the following:

    Register in database new ownership of object
    Somehow move object in data folder from old user to new user.

    Sounds like a bit of work for this one. But I imagine it could be useful to some people.

    Keep up the good work.

  • As an after thought the receiving user might have to accept the give request for safety reasons.

  • I have needed this for a very long time.  Awesome work.

    I'm migrating out of tidypics and izap_videos to this and working on adding more filetype filters.

    Thank you much!

  • @trajan, good suggestion, a copy_file() or change_file_owner() function can be implemented as elgg core

  • Hi txta,

    The plugin looks fantastic!

    I've installed it and I get the following message:

    Fatal error: Call to undefined function elgg_get_entities() in /home/select/public_html/mod/folder/read.php on line 21

    It appears on the right hand side of the folders.

    Any ideas?

  • @Canterbury: are you using Elgg 1.6? Unfortunately, elgg_get_entities() is unknown for Elgg 1.6 (was get_entities() before).

    elgg_get_entities() is used only once. Unfortunately, there seem to be other problems with Elgg 1.6 and this plugin. By using the Backwards plugin I could even leave the elgg_get_entitities() function unchanged. Nonetheless I don't get the files in Unspecified listed. I could create a folder, but drag and drop doesn't work, but files can be moved via the dropdown menu in Edit. Unfortunately, it's also not possible to delete a folder. When I try to delete it I get a Missing token error - in Elgg 1.6?!

    I'm not completely sure yet, if the problems may be caused by a side effect with another plugin. So far, I've not found any likely candidate. But the Token error is really very strange, especially because it works in Elgg 1.7.1.

    If anyone has any ideas how to get the plugin working in Elgg 1.6.2, I would like to hear as I can't upgrade to 1.7.1 yet on my productive site.

  • Thanks iionly.  I am indeed usimg Elgg 1.6 still.

    I was holding off till 1.8 comes out, though maybe I should upgrade to 1.7 in the meantime after all.

    One weakness in my site is way files are stored and displayed as this is one of the main utilities of my site: to exchange teaching resources.

  • @iionly & @Canterbudy, elgg_get_entities() is indeed causing a problem in 1.6 and it is not as simple as replacing elgg_get_entities() with get_entities(). Sadly I cannot provide backward support to 1.6. If you find a solution, I am happy to incorporate it in the release.


    @iionly, for your second problem, you can comment out action_gatekeeper() in mod/folder/actions/delete.php

  • Thanks txtan. I managed to delete the folder.

    I guess it's not easy to get it running in Elgg 1.6, maybe even not without changes in Elgg core files.

  • @txtan: New download and still I get "misconfigured plugin". So, we first deactivated ALL other plugins... and still same error. What could this be? I will upgrade dev server from 1.7 to 1.7.1 .. see if that makes any difference ....

  • Hi Tom be sure you are uploading the right folder named folder. I know this is a simple step but even I forget to double check this at times. The mod folder unzips to a folder named folder, but within that folder is another named folder and that is the right one to upload. If you upload it as it is unzipped it will give you the misconfigured error. Yes we all know this but I also bet we all forget to check this at times too.

  • @wolfepk1: well indeed a beginners mistake it was: the permission of the folder were not correct.... so now it enables just fine ;)

  • Weird thing: the facebox does not pop up correctly. It also obscures the pop-up itself.

    What we found:

    As a standard, using Netbeans, code highlighting, we surround the css code in the css.php with "<style type="text/css">..</style>" in all our plugins we develop.

    After long fiddling, if in one of our other plugins we remove this "<style type="text/css">..</style>", leaving all other intact... it works!!!

    No idea how that could be of influence... very strange!! Anybody a clue?

  • @Txtan - change_file_owner() function would be more suitable I think. Copying files will fill up space on potentially small hosting service plans.

    On another note, why not take a look at demo.elgg.com and see how they're doing the files plugin for 1.8 They organize files by format type. i.e. .pdfs, .doc, .xml, etc. A sorting feature would be nice.


    • View by folders
    • View by file format
    :-) Just thinking out loud. Look forward to the next release.
  • @txtan, @iionly & @Canterbudy: I think I might have gotten it to work for 1.6.2. My initial tests seem to be working (with drag and drop), though it doesn't remove files from 'Unspecified' when you move them into a folder, but that might be how the plug-in is designed.

    In read.php, I replaced the elgg_get_entities (under the if ($folderguid==none) case) with code that mirrors the following 'else' (i.e. viewing contents of a folder) case (which works under 1.6.2):

    This is what it looks like from lines 21 to 34:

        if($folderguid == 'none'){
           $folder = get_entity($container);   
            $area1 = elgg_view_title(sprintf(elgg_echo('All files: %s'),$folder->name));
            $count .= get_entities('object','file',$folder->getGUID(),'',9999,0,true);
            if($count > 0){
                $files = get_entities('object','file',$folder->getGUID(),'',9999);
                $area1 .= elgg_view('folder/file/filelist',array('viewtype'=>'singlefolder','files'=>$files));
                $area1 .= '<p>No files in folder</p>';

  • Hi Chris, your code is not complete. It breaks how the plugin should work. I say this because

    1) Files should disappear from 'Unspecified' when you move them and this is already broken in your case.

    2) The cause of case 1 is because the original code under if($folderguid == 'none') is meant to check the files that are not currently in folders and display them


    The fix for 1.6.2 is along the lines of replacing

    >$tfiles = elgg_get_entities(array('types' => 'object', 'subtypes' => 'file', 'container_guid' => $container,'limit'=>9999));


    >$tfiles = get_entities('object','file',0,'',9999,0,false,0,$container);

    but this is not tested as I do not have a 1.6 site to run it on. Please check it out and let me know if it works.


  • Hi txtan,

    Thanks for the reply. I think I figured out the problem. Elgg 1.6.2's get_entity_relationships() function doesn't support inverse relationships. I updated the core file (I know, bad form) to allow it to check inverse relationships, and voila, it worked--though I did have to add the line $files=array(); to read.php

    Again, thanks for the killer plug-in.

  • Oh, I forgot to mention that I scraped my initial changed and followed your advice of replacing

    >$tfiles = elgg_get_entities(array('types' => 'object', 'subtypes' => 'file', 'container_guid' => $container,'limit'=>9999));


    >$tfiles = get_entities('object','file',0,'',9999,0,false,0,$container);

    Though, as I said, I had to also add


    to get it to work

  • @Chris, excellent work. Thanks for figuring it out for 1.6, many users are going to be very happy.


  • Category: Tools
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 2456
  • Recommendations: 11

Other Projects

View txtan's plugins