Blocks

YUI course files directory tree Block

 
DeeKnow
YUI course files directory tree Block
 
Have just added an entry in the add-ons database for a Moodle block we've written to display course files in a YUI TreeView widget. The block includes a bunch of config settings that allow a teacher/admin to specify:screenshot.png

* which folder from their files directory should be displayed
* how deeply the folders should be crawled and made visible
* what the name of the block should be

Note: This block only displays files and folders from the course files area. It does not include course activities, other resources likes web links, and broader control panel or course topic/week type navigation. You should consider existing blocks like "YUI Course Menu" for that purpose.

This is a standard block installation. The only external dependencies are the YUI and JSON libraries which will already be installed with Moodle versions 1.8 or later.

See the add-ons page for more detail on installation, browser support, technical implementation details and the actual code itself. Comments, suggestions, feedback about usefulness or otherwise welcomed here in this forum thread.

This is really an optional transitional block for some of our teaching folks to use when coming from other environments where they were delivering resources more than activities. Possible tweaks/enhancements might include:
  • minify the CSS and JS
  • consider using CSS sprites for the icons
  • work out how to get the block <link> and <script> into the header
  • look at repository API integration in future?
  • filtering file types in/out of the listings
  • associating more than one folder with a block instance
 
Average of ratings: -
Picture of Faren Heit
Re: YUI course files directory tree Block
 
Your links are directed to 123 flashchat??
 
Average of ratings: -
DeeKnow
Re: YUI course files directory tree Block
 
whoops, bother, looks like it hasn't been approved yet, will post again when the final URL is made available
 
Average of ratings: -
DeeKnow
Re: YUI course files directory tree Block
 
The block is now available from the add-ons page
 
Average of ratings: -
DeeKnow
Re: YUI course files directory tree Block
 
The block has been updated this week to make the CSS handling and icon selection for various file-types a little smarter, and to fix links to resources when JavaScript is disabled in the browser.

Following an enquiry from Barry Oosthuizen and his excellent assistance subsequently we have also ironed an issue with installation of the block. The JSON lib (by Michal Migurski) used in the block was missing and have now added that to the archive. Barry also noticed the url() attributes in the included style.css file are absolute and point to the /pix/ folder assuming its at the top of your Moodle path. This may not be the case in your install so you may need to tweak style.css locally to suit.

I have also included a patch file in the distribution for the directory resource class file should you wish to use the YUI directory tree display in your directory display resource types as we are now at Waikato University. Following is a screenshot of a modified copy of the class used to display a sample set of folders:

screemnshot
 
Average of ratings: -
Picture of Alex Lee
Re: YUI course files directory tree Block
 
This looks great. I have tried installing on Moodle 1.9.7 and get these errors, with both of the downloads on this page. Any ideas?


Notice: Trying to get property of non-object in /srv/www/htdocs/lrtmoodle/blocks/dir_tree/block_dir_tree.php on line 44

Notice: Trying to get property of non-object in /srv/www/htdocs/lrtmoodle/blocks/dir_tree/block_dir_tree.php on line 67

Notice: Trying to get property of non-object in /srv/www/htdocs/lrtmoodle/blocks/dir_tree/block_dir_tree.php on line 70

Thanks
Alex
 
Average of ratings: -
Picture of simin noori
Re: YUI course files directory tree Block
 

Hi!

I have this error on 1.9 too. Where am I wrong?

Thanks

Notice: Trying to get property of non-object in C:\locals\wamp\www\md199\blocks\dir_tree\block_dir_tree.php on line 44

Notice: Trying to get property of non-object in C:\locals\wamp\www\md199\blocks\dir_tree\block_dir_tree.php on line 67

Notice: Trying to get property of non-object in C:\locals\wamp\www\md199\blocks\dir_tree\block_dir_tree.php on line 70

 
Average of ratings: -
Picture of José Ángel Polo
Re: YUI course files directory tree Block
 

Hi, can you help me to solve this issue?

CSS Problem

CSS, div... problems?

Thanks in advance.

Regards 

 
Average of ratings: -
Picture of José Ángel Polo
Re: YUI course files directory tree Block
 

Solved. CSS problem.

Any ideas about searching question?

Regards

 
Average of ratings: -
Picture of José Ángel Polo
Re: YUI course files directory tree Block
 

How I show more than three levels depth?

 
Average of ratings: -
Picture of José Ángel Polo
Re: YUI course files directory tree Block
 

I found it: file: locallib.php line 23: function crawl_directory($dirPath, $maxDepth = 3, $depth=1, $array=array(), $foundFileTypes = array()) {

And the last one: folder icon disappears when I expand the directory.

Can you help me?

Thanks. Regards.

 
Average of ratings: -
nothin' to do
Re: YUI course files directory tree Block
 
Hello people, I want to let you know that the block has compatibility problem with mootools whenever the website uses, I tried everything on theme's header and footers.html, also changed some attributes on the require_js and tried to modify everything but I didn't had luck.. I know this uses the JSON library as mootools uses too, there's something avoiding to display the block in the yui treeview, I also tested with different mootools version without luck, Please I need some help from you. Thanks for all, I really found this block very interesting for our website.
 
Average of ratings: -
Picture of José Ángel Polo
Re: YUI course files directory tree Block
 

It would be possible to use this block to search datafolder files of a course?

Regards

 
Average of ratings: -