<?php
function smarty_function_admin_get_data_directories($params, &$smarty) {
	//
	clearstatcache();
	$spool = array();
	$registry = array();

	//
	$dir = HOME_DIR."data/";
	if (@$handle = opendir($dir)) {
		while (false !== ($data_dir = readdir($handle))) {
			if (is_dir($dir.$data_dir) && $data_dir != "." && $data_dir != "..") {
				array_push($spool, $data_dir);
			}
		}
		closedir($handle);
	}
	sort($spool);
	$smarty->assign("directories_spool", $spool);
}
?>