Index: /freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/module.functions.php =================================================================== --- /freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/module.functions.php (revision 11104) +++ /freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/module.functions.php (revision 11449) @@ -509,5 +509,10 @@ case 'file': // file exists // replace embedded amp_conf %VARIABLES% in string - $file = ampconf_string_replace($value); + + + + + + $file = _module_ampconf_string_replace($value); if (!file_exists( $file )) { @@ -1528,3 +1533,19 @@ } +/** Replaces variables in a string with the values from ampconf + * eg, "%AMPWEBROOT%/admin" => "/var/www/html/admin" + */ +function _module_ampconf_string_replace($string) { + $freepbx_conf =& freepbx_conf::create(); + + $target = array(); + $replace = array(); + + foreach ($freepbx_conf->conf as $key=>$value) { + $target[] = '%'.$key.'%'; + $replace[] = $value; + } + + return str_replace($target, $replace, $string); +} ?> Index: /freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/freepbx_conf.class.php =================================================================== --- /freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/freepbx_conf.class.php (revision 11363) +++ /freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/freepbx_conf.class.php (revision 11449) @@ -1022,35 +1022,3 @@ } } - - -/** - * These functions are LEFT OVER Legacy functions very minimally used and should probably be - * removed and the offending usage eliminated. - */ - -/** Replaces variables in a string with the values from ampconf - * eg, "%AMPWEBROOT%/admin" => "/var/www/html/admin" - */ -function ampconf_string_replace($string) { - $freepbx_conf =& freepbx_conf::create(); - - $target = array(); - $replace = array(); - - foreach ($freepbx_conf->conf as $key=>$value) { - $target[] = '%'.$key.'%'; - $replace[] = $value; - } - - return str_replace($target, $replace, $string); -} - -/** Expands variables from amportal.conf - * Replaces any variables enclosed in percent (%) signs with their value - * eg, "%AMPWEBROOT%/admin/functions.inc.php" - */ -//TODO: seems this the exact same as the above function. Should either be removed? -function expand_variables($string) { - return ampconf_string_replace($string); -} ?>