Changeset 11449
- Timestamp:
- 02/18/11 16:04:35 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/freepbx_conf.class.php
r11363 r11449 1022 1022 } 1023 1023 } 1024 1025 1026 /**1027 * These functions are LEFT OVER Legacy functions very minimally used and should probably be1028 * removed and the offending usage eliminated.1029 */1030 1031 /** Replaces variables in a string with the values from ampconf1032 * eg, "%AMPWEBROOT%/admin" => "/var/www/html/admin"1033 */1034 function ampconf_string_replace($string) {1035 $freepbx_conf =& freepbx_conf::create();1036 1037 $target = array();1038 $replace = array();1039 1040 foreach ($freepbx_conf->conf as $key=>$value) {1041 $target[] = '%'.$key.'%';1042 $replace[] = $value;1043 }1044 1045 return str_replace($target, $replace, $string);1046 }1047 1048 /** Expands variables from amportal.conf1049 * Replaces any variables enclosed in percent (%) signs with their value1050 * eg, "%AMPWEBROOT%/admin/functions.inc.php"1051 */1052 //TODO: seems this the exact same as the above function. Should either be removed?1053 function expand_variables($string) {1054 return ampconf_string_replace($string);1055 }1056 1024 ?> freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/module.functions.php
r11104 r11449 509 509 case 'file': // file exists 510 510 // replace embedded amp_conf %VARIABLES% in string 511 $file = ampconf_string_replace($value); 511 512 513 514 515 516 $file = _module_ampconf_string_replace($value); 512 517 513 518 if (!file_exists( $file )) { … … 1528 1533 } 1529 1534 1535 /** Replaces variables in a string with the values from ampconf 1536 * eg, "%AMPWEBROOT%/admin" => "/var/www/html/admin" 1537 */ 1538 function _module_ampconf_string_replace($string) { 1539 $freepbx_conf =& freepbx_conf::create(); 1540 1541 $target = array(); 1542 $replace = array(); 1543 1544 foreach ($freepbx_conf->conf as $key=>$value) { 1545 $target[] = '%'.$key.'%'; 1546 $replace[] = $value; 1547 } 1548 1549 return str_replace($target, $replace, $string); 1550 } 1530 1551 ?>
