<?php
function smarty_function_admin_get_data_files($params, &$smarty) {
	//
	clearstatcache();
	global $section;
	global $data;
	$spool = array();

	//
	$dir = HOME_DIR."data/".$section."/";
	if (@$handle = opendir($dir)) {
		while (false !== ($file = readdir($handle))) {
			if (!is_dir($dir.$file) && substr($file, 0, 1) != ".") {
				array_push($spool, str_replace(".php", "", $file));
			}
		}
		closedir($handle);
	}
	sort($spool);
	$smarty->assign("data_spool", $spool);
}
?>