Move the references to includes/templates to resources/templates.

This commit is contained in:
Mark Crane
2013-06-09 05:05:17 +00:00
parent 1b8637e532
commit fc33d20f61
14 changed files with 40 additions and 40 deletions

View File

@@ -399,10 +399,10 @@ require_once "includes/require.php";
echo "<td class='vtable' align='left'>\n";
echo "<select id='device_template' name='device_template' class='formfld'>\n";
echo "<option value=''></option>\n";
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$_SESSION["domain_name"])) {
$temp_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$_SESSION["domain_name"];
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$_SESSION["domain_name"])) {
$temp_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$_SESSION["domain_name"];
} else {
$temp_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision";
$temp_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision";
}
if($dh = opendir($temp_dir)) {
while($dir = readdir($dh)) {

View File

@@ -48,7 +48,7 @@
if (is_dir($_SESSION['switch']['dialplan']['dir'])) {
//write the dialplan/default.xml if it does not exist
//get the contents of the dialplan/default.xml
$file_default_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/includes/templates/conf/dialplan/default.xml';
$file_default_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/conf/dialplan/default.xml';
$file_default_contents = file_get_contents($file_default_path);
//prepare the file contents and the path

View File

@@ -243,7 +243,7 @@ if ($_SESSION["app"]["edit"]["dir"] == "grammar") {
echo recur_dir($_SESSION['switch']['grammar']['dir']);
}
if ($_SESSION["app"]["edit"]["dir"] == "provision") {
echo recur_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/");
echo recur_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/");
}
if ($_SESSION["app"]["edit"]["dir"] == "xml") {
echo recur_dir($_SESSION['switch']['conf']['dir']);

View File

@@ -240,7 +240,7 @@ if ($_SESSION["app"]["edit"]["dir"] == "grammar") {
echo recur_dir($_SESSION['switch']['grammar']['dir']);
}
if ($_SESSION["app"]["edit"]["dir"] == "provision") {
echo recur_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/");
echo recur_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/");
}
if ($_SESSION["app"]["edit"]["dir"] == "xml") {
echo recur_dir($_SESSION['switch']['conf']['dir']);

View File

@@ -225,7 +225,7 @@ if ($_GET['act'] == "del" && permission_exists('music_on_hold_delete')) {
require_once "includes/header.php";
//show the title and description
echo "<script language='JavaScript' type='text/javascript' src='".PROJECT_PATH."/includes/javascript/reset_file_input.js'></script>\n";
echo "<script language='JavaScript' type='text/javascript' src='".PROJECT_PATH."/resources/javascript/reset_file_input.js'></script>\n";
echo "<script>\n";
echo "function EvalSound(soundobj) {\n";
echo " var thissound= eval(\"document.\"+soundobj);\n";

View File

@@ -171,7 +171,7 @@ include "root.php";
public function save() {
//get the contents of the template
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/conf/autoload_configs/local_stream.conf.xml");
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/autoload_configs/local_stream.conf.xml");
//replace the variable
$file_contents = str_replace("{v_moh_categories}", $this->xml, $file_contents);

View File

@@ -248,19 +248,19 @@ require_once "includes/require.php";
}
//if the domain name directory exists then only use templates from it
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/includes/templates/provision/'.$_SESSION['domain_name'])) {
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision/'.$_SESSION['domain_name'])) {
$device_template = $_SESSION['domain_name'].'/'.$device_template;
}
//if $file is not provided then look for a default file that exists
if (strlen($file) == 0) {
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$device_template ."/{v_mac}")) {
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$device_template ."/{v_mac}")) {
$file = "{v_mac}";
}
elseif (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$device_template ."/{v_mac}.xml")) {
elseif (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$device_template ."/{v_mac}.xml")) {
$file = "{v_mac}.xml";
}
elseif (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$device_template ."/{v_mac}.cfg")) {
elseif (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$device_template ."/{v_mac}.cfg")) {
$file = "{v_mac}.cfg";
}
else {
@@ -270,7 +270,7 @@ require_once "includes/require.php";
}
else {
//make sure the file exists
if (!file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$device_template ."/".$file)) {
if (!file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$device_template ."/".$file)) {
echo "file not found";
exit;
}
@@ -303,7 +303,7 @@ require_once "includes/require.php";
//$proxy3_address= "";
//get the contents of the template
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$device_template ."/".$file);
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$device_template ."/".$file);
//replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number

View File

@@ -107,7 +107,7 @@ else {
}
//loop through the provision template directory
$provision_template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$device_template;
$provision_template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$device_template;
clearstatcache();
$dir_list = '';
@@ -160,7 +160,7 @@ else {
$file_size = round(filesize($new_path)/1024, 2);
//get the contents of the template
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$device_template ."/".$file_name);
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/provision/".$device_template ."/".$file_name);
//prepare the files
//replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number

View File

@@ -180,7 +180,7 @@ include "root.php";
function copy_phrases() {
clearstatcache();
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/conf/lang";
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/lang";
$dst_dir = $this->switch_conf_dir."/lang";
if (is_readable($this->switch_conf_dir)) {
$this->recursive_copy($src_dir, $dst_dir);

View File

@@ -178,7 +178,7 @@ include "root.php";
$switch_dialplan_dir = $this->switch_dialplan_dir;
if (is_dir($switch_dialplan_dir)) {
//get the contents of the dialplan/default.xml
$file_default_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/includes/templates/conf/dialplan/default.xml';
$file_default_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/conf/dialplan/default.xml';
$file_default_contents = file_get_contents($file_default_path);
//prepare the file contents and the path
if (count($_SESSION['domains']) < 2) {

View File

@@ -3508,7 +3508,7 @@ if (!function_exists('save_call_center_xml')) {
}
//get the contents of the template
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/conf/autoload_configs/callcenter.conf.xml");
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/autoload_configs/callcenter.conf.xml");
//add the Call Center Queues, Agents and Tiers to the XML config
$file_contents = str_replace("{v_queues}", $v_queues, $file_contents);
@@ -3541,7 +3541,7 @@ if (!function_exists('switch_conf_xml')) {
global $db, $domain_uuid;
//get the contents of the template
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/conf/autoload_configs/switch.conf.xml");
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/autoload_configs/switch.conf.xml");
//prepare the php variables
if (stristr(PHP_OS, 'WIN')) {
@@ -3582,7 +3582,7 @@ if (!function_exists('xml_cdr_conf_xml')) {
global $db, $domain_uuid;
//get the contents of the template
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/conf/autoload_configs/xml_cdr.conf.xml");
$file_contents = file_get_contents($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/autoload_configs/xml_cdr.conf.xml");
//replace the values in the template
$file_contents = str_replace("{v_http_protocol}", "http", $file_contents);

View File

@@ -180,7 +180,7 @@ include "root.php";
function copy_phrases() {
clearstatcache();
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/conf/lang";
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/lang";
$dst_dir = $this->switch_conf_dir."/lang";
if (is_readable($this->switch_conf_dir)) {
$this->recursive_copy($src_dir, $dst_dir);

View File

@@ -1258,8 +1258,8 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist
$install->copy();
clearstatcache();
//copy includes/templates/conf to the freeswitch/conf dir
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/conf";
//copy resources/templates/conf to the freeswitch/conf dir
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf";
$dst_dir = $switch_conf_dir;
if (is_readable($dst_dir)) {
$install->recursive_copy($src_dir, $dst_dir);

View File

@@ -1905,112 +1905,112 @@
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision</path>
<path>/resources/templates/provision</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/aastra</path>
<path>/resources/templates/provision/aastra</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/aastra/675x</path>
<path>/resources/templates/provision/aastra/675x</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>file</type>
<path>/includes/templates/provision/aastra/675x/{v_mac}.cfg</path>
<path>/resources/templates/provision/aastra/675x/{v_mac}.cfg</path>
<last_mod>Thu, 19 Aug 2010 07:41:58 GMT</last_mod>
<md5>dabe18bd088393a798ce77e09d4e84c7</md5>
<size>3697</size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/cisco</path>
<path>/resources/templates/provision/cisco</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/cisco/7940</path>
<path>/resources/templates/provision/cisco/7940</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/cisco/7960</path>
<path>/resources/templates/provision/cisco/7960</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/grandstream</path>
<path>/resources/templates/provision/grandstream</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/linksys</path>
<path>/resources/templates/provision/linksys</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/linksys/spa942</path>
<path>/resources/templates/provision/linksys/spa942</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>file</type>
<path>/includes/templates/provision/linksys/spa942/{v_mac}.xml</path>
<path>/resources/templates/provision/linksys/spa942/{v_mac}.xml</path>
<last_mod>Mon, 05 Jul 2010 17:58:03 GMT</last_mod>
<md5>826df81f528099612f785bb68ca542f8</md5>
<size>1364</size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/polycom</path>
<path>/resources/templates/provision/polycom</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/snom</path>
<path>/resources/templates/provision/snom</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/snom/820</path>
<path>/resources/templates/provision/snom/820</path>
<last_mod></last_mod>
<md5></md5>
<size></size>
</src>
<src>
<type>file</type>
<path>/includes/templates/provision/snom/820/{v_mac}.xml</path>
<path>/resources/templates/provision/snom/820/{v_mac}.xml</path>
<last_mod>Sun, 27 Jun 2010 10:02:56 GMT</last_mod>
<md5>46c1aa2b3da420cd26fd7b361bcd3360</md5>
<size>2373</size>
</src>
<src>
<type>directory</type>
<path>/includes/templates/provision/yealink</path>
<path>/resources/templates/provision/yealink</path>
<last_mod></last_mod>
<md5></md5>
<size></size>