Link | directory_tree |
Author | Jason Huck |
Category | File |
Version | 8.5.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 27 Feb 2007 |
Updated | 27 Feb 2007 |
More by this author... |
This is a recursive directory crawler that outputs nested unordered lists. You can specify lists of file extensions to include or exclude from crawling. It requires all the same permissions as the built-in file tags.
inline( -username='xxxxxx', -password='xxxxxx' ); var('list') = directory_tree( '/ExamplesPack/', -include=(: 'js'), -exclude=(: 'php'), -hidden=false ); /inline;
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'tree', -namespace='directory_', -req='path', -opt='include', -type='array', -opt='exclude', -type='array', -opt='hidden', -type='boolean', -opt='depth', -type='integer', -priority='replace', -description='Returns nested unordered lists of files/folders within the given path.' ); fail_if( !file_isdirectory(#path), -1, 'The path supplied is not a directory.' ); local('out') = string; !local_defined('include') ? local('include') = array; !local_defined('exclude') ? local('exclude') = array; !local_defined('hidden') ? local('hidden') = false; !local_defined('depth') ? local('depth') = 0; #depth == 0 ? #out += '' + string(#path)->removetrailing('/')&split('/')->last + '
\n'; #out += ('\t' * #depth) + '
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft