* @copyright 2009 Deon George * @link http://osb.leenooks.net * * @link http://www.agileco.com/ * @copyright 2004-2008 Agileco, LLC. * @license http://www.agileco.com/agilebill/license1-4.txt * @author Tony Landis * @package AgileBill * @subpackage Smarty */ /** * SMARTY template helper - list files */ function list_menu_files($id,$name,$default,$path,$pre,$ext,$class) { global $C_translate; switch ($path) { case 'product_cat': $path = sprintf('%s%s/blocks/product_cat/',PATH_THEMES,DEF_THEME_N); break; case 'whois_plugin': $path = sprintf('%s/whois/',PATH_PLUGINS); break; case 'product': $path = sprintf('%s/product/',PATH_PLUGINS); break; case 'e911': $path = sprintf('%s/e911/',PATH_PLUGINS); break; case 'provision_plugin': $path = sprintf('%s/provision/',PATH_PLUGINS); break; case 'affiliate_plugin': $path = sprintf('%s/affiliate/',PATH_PLUGINS); break; case 'checkout_plugin': $path = sprintf('%s/checkout/',PATH_PLUGINS); break; case 'theme': $path = PATH_THEMES; break; case 'language': $path = sprintf('%s/core/',PATH_LANGUAGE); break; } $dir = opendir($path); while ($file_name = readdir($dir)) { $display = true; if (in_array($file_name,array('.','..'))) continue; if (! empty($ext)) { $cute = preg_replace("/{$ext}$/",'',$file_name); if (! preg_match("/{$ext}$/",$file_name)) $display = false; } if (! empty($pre)) { $cute = preg_replace("/^{$pre}/",'',$cute); if (! preg_match("/^{$pre}/",$file_name)) $display = false; } if ($display) $arr[$cute] = preg_replace('/_/',' ',$cute); } asort($arr); $return = sprintf(''; } echo $return; } ?>