Remove xml_edit functionality is being replaced by edit.

This commit is contained in:
Mark Crane 2013-05-25 16:07:13 +00:00
parent 0f197cddbf
commit ef2e7aaad7
39 changed files with 0 additions and 2916 deletions

View File

@ -1,44 +0,0 @@
<?php
//application details
$apps[$x]['name'] = "XML Editor";
$apps[$x]['uuid'] = '784772b5-6004-4ff3-ca21-cad4acab158f';
$apps[$x]['category'] = 'Switch';;
$apps[$x]['subcategory'] = '';
$apps[$x]['version'] = '';
$apps[$x]['license'] = 'Mozilla Public License 1.1';
$apps[$x]['url'] = 'http://www.fusionpbx.com';
$apps[$x]['description']['en-us'] = 'XML Editor is an easy ajax based xml editor.';
$apps[$x]['description']['es-mx'] = '';
$apps[$x]['description']['de'] = '';
$apps[$x]['description']['de-ch'] = '';
$apps[$x]['description']['de-at'] = '';
$apps[$x]['description']['fr'] = '';
$apps[$x]['description']['fr-ca'] = '';
$apps[$x]['description']['fr-ch'] = '';
$apps[$x]['description']['pt-pt'] = 'Editor de XML é um fácil editor de ajax baseado em XML.';
$apps[$x]['description']['pt-br'] = '';
//menu details
$apps[$x]['menu'][0]['title']['en-us'] = 'XML Editor';
$apps[$x]['menu'][0]['title']['es-mx'] = '';
$apps[$x]['menu'][0]['title']['de'] = '';
$apps[$x]['menu'][0]['title']['de-ch'] = '';
$apps[$x]['menu'][0]['title']['de-at'] = '';
$apps[$x]['menu'][0]['title']['fr'] = '';
$apps[$x]['menu'][0]['title']['fr-ca'] = '';
$apps[$x]['menu'][0]['title']['fr-ch'] = '';
$apps[$x]['menu'][0]['title']['pt-pt'] = 'Editor XML';
$apps[$x]['menu'][0]['title']['pt-br'] = '';
$apps[$x]['menu'][0]['uuid'] = '16013877-606a-2a05-7d6a-c1b215839131';
$apps[$x]['menu'][0]['parent_uuid'] = '594d99c5-6128-9c88-ca35-4b33392cec0f';
$apps[$x]['menu'][0]['category'] = 'external';
$apps[$x]['menu'][0]['path'] = '/app/xml_edit/';
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
//permission details
$apps[$x]['permissions'][0]['name'] = 'xml_editor_view';
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
$apps[$x]['permissions'][1]['name'] = 'xml_editor_save';
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
?>

Binary file not shown.

View File

@ -1,123 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
if (count($_POST)>0) {
$clip_name = check_str($_POST["clip_name"]);
$clip_folder = check_str($_POST["clip_folder"]);
$clip_text_start = check_str($_POST["clip_text_start"]);
$clip_text_end = check_str($_POST["clip_text_end"]);
$clip_desc = check_str($_POST["clip_desc"]);
$clip_order = check_str($_POST["clip_order"]);
$sql = "insert into v_clip_library ";
$sql .= "(";
$sql .= "clip_name, ";
$sql .= "clip_folder, ";
$sql .= "clip_text_start, ";
$sql .= "clip_text_end, ";
$sql .= "clip_desc, ";
$sql .= "clip_order ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'$clip_name', ";
$sql .= "'$clip_folder', ";
$sql .= "'$clip_text_start', ";
$sql .= "'$clip_text_end', ";
$sql .= "'$clip_desc', ";
$sql .= "'$clip_order' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql,$db);
require_once "header.php";
echo "<meta http-equiv=\"refresh\" content=\"1;url=clipoptions.php\">\n";
echo "Add Complete";
require_once "footer.php";
return;
}
require_once "header.php";
echo "<div align='left'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo "<form method='post' action=''>";
echo "<table width='100%' border='0'>";
echo " <tr>";
echo " <td>Name:</td>";
echo " <td><input type='text' class='txt' name='clip_name'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Folder:</td>";
echo " <td><input type='text' class='txt' name='clip_folder'></td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2'>Before Selection:<br>";
echo " <textarea name='clip_text_start' class='txt'></textarea>";
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2'>After Selection:<br>";
echo " <textarea name='clip_text_end' class='txt'></textarea>";
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2'>Notes:<br>";
echo " <textarea name='clip_desc' class='txt'></textarea>";
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2' align='right'><input type='submit' name='submit' value='Add'></td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
require_once "footer.php";
?>

View File

@ -1,54 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
$id = $_GET["id"];
if (strlen($id)>0) {
$sql = "";
$sql .= "delete from v_clip_library ";
$sql .= "where id = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql,$db);
}
require_once "header.php";
echo "<meta http-equiv=\"refresh\" content=\"1;url=clipoptions.php\">\n";
echo "Delete Complete";
require_once "footer.php";
return;
?>

View File

@ -1,224 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
echo "<html>";
echo "<head>";
echo "<style>\n";
echo "TD {\n";
echo " font-size: 11.5px;\n";
echo "}\n";
echo "A {\n";
echo " text-decoration:none\n";
echo "}\n";
echo "</style>";
function isfile($filename) {
if (@filesize($filename) > 0) { return true; } else { return false; }
}
function space($count) {
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
}
//show the content
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " }\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";
echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "</script>";
echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node) {\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";
echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>";
echo "<head>";
echo "<body onfocus='null;'>";
echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><a href='javascript:void(0);' onclick=\"window.open('clipoptions.php?id=".$row[id]."','null','left=20,top=20,width=310,height=300,toolbar=0,resizable=0');\" style='text-decoration:none;' title=''><IMG SRC=\"images/folder.gif\" border='0'> Clip Library</a><DIV style=''>\n"; //display:none
$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "order by clip_folder ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
if ($result_count > 0) {
$last_folder = '';
$tag_open = '';
$x = 0;
$current_depth = 0;
$previous_depth = 0;
foreach($result as $row) {
$current_depth = count(explode ("/", $row[clip_folder]));
if ($current_depth < $previous_depth) {
$count = ($previous_depth - $current_depth);
$i=0;
while($i < $count){
echo "</DIV></TD></TR></TABLE>\n";
$i++;
}
echo "</DIV></TD></TR></TABLE>\n";
}
if ($last_folder != $row[clip_folder]) {
$clip_folder_name = str_replace ($previous_folder_name, "", $row[clip_folder]);
$clip_folder_name = str_replace ("/", "", $clip_folder_name);
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A href='javascript:void(0);' onClick=\"Toggle(this);\"><IMG SRC=\"images/plus.gif\" border='none'> <IMG SRC=\"images/folder.gif\" border='none'> &nbsp;".$clip_folder_name." &nbsp; </A><DIV style='display:none'>\n\n";
$tag_open = 1;
}
$previous_depth = $current_depth;
$previous_folder_name = $row[clip_folder];
echo "<textarea style='display:none' id='clip_lib_start".$row[id]."'>".$row[clip_text_start]."</textarea>\n";
echo "<textarea style='display:none' id='clip_lib_end".$row[id]."'>".$row[clip_text_end]."</textarea>\n";
echo "\n";
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=12></TD><TD align='bottom'><IMG SRC=\"images/file.png\" border='0'> \n";
echo "<a href='javascript:void(0);' onclick=\"parent.editAreaLoader.insertTags('edit1', document.getElementById('clip_lib_start".$row[id]."').value, document.getElementById('clip_lib_end".$row[id]."').value);\">".$row[clip_name]."</a>\n";
echo "</TD></TR></TABLE>\n";
echo "\n\n";
$last_folder = $row[clip_folder];
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";
echo "<br><br>";
echo "</body>";
echo "</html>";
?>

View File

@ -1,73 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
require_once "header.php";
echo "<div align='left'>";
echo "<table border='0' style=\"height: 100%; width: 100%;\">\n";
echo "<form method='post' name='frm' action=''>";
echo "<tr><td colspan='2'><div id='selectedclip'>Selected Clip: <input type='text' name='clip_name' id='clip_name' value=''><input type='hidden' name='clipid' id='clipid' value=''></div></td></tr>\n";
echo "</form>";
echo "<tr>\n";
echo "<td valign='top' width='200' nowrap>";
echo " <IFRAME SRC='/xml_edit/clipoptionslist.php' style='border: solid 1px #CCCCCC; height: 100%; width: 100%;' WIDTH='100%' TITLE=''>\n";
echo " <!-- Clip List: Requires IFRAME support -->\n";
echo " </IFRAME>";
echo "</td>\n";
echo "<td valign='top' style=\"height: 100%;\">";
echo " <table width='' class='border'>";
//echo " <tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
//echo " <tr><th>Options</th></tr>\n";
//echo " <tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='clipupdate.php?id='+document.getElementById('clipid').value;\" value='Edit Clip'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='clipadd.php'\" value='Add Clip'></td></tr>\n";
//echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='clipadd.php'\" value=' Search '></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you want to delete the selected clip?')){ window.location='clipdelete.php?id='+document.getElementById('clipid').value; }\" value=' Delete '></td></tr>\n";
echo " <tr><td><br><br><br><br><br><br><br><br><br><br><br></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick='javascript:self.close();' value=' Close '></td></tr>\n";
echo " </table>";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
require_once "footer.php";
?>

View File

@ -1,247 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
echo "<html>";
echo "<head>";
echo "<style>\n";
echo "TD {\n";
echo " font-size: 11.5px;\n";
echo "}\n";
echo "A {\n";
echo " text-decoration:none\n";
echo "}\n";
echo "</style>";
function isfile($filename) {
if (@filesize($filename) > 0) { return true; } else { return false; }
}
function space($count) {
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
}
//show the content
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
//echo " alert('none');\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
//echo " alert(strpost);\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
//echo " http_request.send('name=value&foo=bar');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo "\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";
echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
//echo " alert(http_request.responseText);\n";
echo "\n";
//echo " //var xmldoc = http_request.responseXML;\n";
//echo " //var root_node = xmldoc.getElementsByTagName('doc').item(0);\n";
//echo " //alert(xmldoc.getElementByID('fr1').value);\n";
//echo " //alert(root_node.firstChild.data);\n";
//echo "\n";
echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "</script>";
echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node) {\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
//echo " node.style.color = '#FFFFFF';\n"; //FFFFFF
//echo " node.style.background = '#4682BF';\n"; //4682BF
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";
echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
//echo " node.style.color = '#000000';\n"; //FFFFFF
//echo " node.style.background = '#FFFFFF';\n"; //4682BF
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>";
echo "<head>";
echo "<body>";
echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><a onclick=\"window.open('clipoptions.php?id=".$row[id]."','Clip Options','left=20,top=20,width=500,height=500,toolbar=0,resizable=0');\" style='text-decoration:none;' title=''><IMG SRC=\"images/folder.gif\" border='0'> Clip Library</a><DIV style=''>\n"; //display:none
$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "order by clip_folder ";
//$sql .= "and clip_name asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
if ($result_count == 0) {
//no results
}
else { //received results
$last_folder = '';
$tag_open = '';
$x = 0;
$current_depth = 0;
$previous_depth = 0;
foreach($result as $row) {
$current_depth = count(explode("/", $row[clip_folder]));
if ($current_depth < $previous_depth) {
$count = ($previous_depth - $current_depth);
$i=0;
while($i < $count){
echo "</DIV></TD></TR></TABLE>\n";
$i++;
}
echo "</DIV></TD></TR></TABLE>\n";
}
if ($last_folder != $row[clip_folder]) {
$clip_folder_name = str_replace ($previous_folder_name, "", $row[clip_folder]);
$clip_folder_name = str_replace ("/", "", $clip_folder_name);
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A onClick=\"Toggle(this);\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/folder.gif\"> &nbsp;".$clip_folder_name." &nbsp; </A><DIV style='display:none'>\n\n";
$tag_open = 1;
}
$previous_depth = $current_depth;
$previous_folder_name = $row[clip_folder];
echo "<textarea style='display:none' id='clip_lib_start".$row[id]."'>".$row[clip_text_start]."</textarea>\n";
echo "<textarea style='display:none' id='clip_lib_end".$row[id]."'>".$row[clip_text_end]."</textarea>\n";
echo "\n";
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=12></TD><TD align='bottom'><IMG SRC=\"images/file.png\" border='0'> \n";
echo "<a href='javascript:void(0);' onclick=\"parent.document.getElementById('clip_name').value='".$row[clip_name]."';parent.document.getElementById('clipid').value=".$row[id].";\">".$row[clip_name]."</a>\n";
echo "</TD></TR></TABLE>\n";
echo "\n\n";
$last_folder = $row[clip_folder];
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "\n";
echo " </div></td></tr></table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";
echo "<br><br>";
echo "</body>";
echo "</html>";
?>

View File

@ -1,187 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "config.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
if (count($_POST)>0) {
$id = $_POST["id"];
$clip_name = $_POST["clip_name"];
$clip_folder = $_POST["clip_folder"];
$clip_text_start = $_POST["clip_text_start"];
$clip_text_end = $_POST["clip_text_end"];
$clip_desc = $_POST["clip_desc"];
$clip_order = $_POST["clip_order"];
require_once "header.php";
echo "<div align='left'>";
echo "<table width='175' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "where ";
if (strlen($id) > 0) { $sql .= "and id like '%$id%' "; }
if (strlen($clip_name) > 0) { $sql .= "and clip_name like '%$clip_name%' "; }
if (strlen($clip_folder) > 0) { $sql .= "and clip_folder like '%$clip_folder%' "; }
if (strlen($clip_text_start) > 0) { $sql .= "and clip_text_start like '%$clip_text_start%' "; }
if (strlen($clip_text_end) > 0) { $sql .= "and clip_text_end like '%$clip_text_end%' "; }
if (strlen($clip_desc) > 0) { $sql .= "and clip_desc like '%$clip_desc%' "; }
if (strlen($clip_order) > 0) { $sql .= "and clip_order like '%$clip_order%' "; }
$sql = trim($sql);
if (substr($sql, -5) == "where"){ $sql = substr($sql, 0, (strlen($sql)-5)); }
$sql = str_replace ("where and", "where", $sql);
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
$c = 0;
$row_style["0"] = "background-color: #F5F5DC;";
$row_style["1"] = "background-color: #FFFFFF;";
echo "<div align='left'>\n";
echo "<table border='0' cellpadding='1' cellspacing='1'>\n";
echo "<tr><td colspan='1'><img src='/edit/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";
if ($result_count == 0) { //no results
echo "<tr><td>&nbsp;</td></tr>";
}
else { //received results
echo "<tr>";
//echo "<th nowrap>&nbsp; &nbsp; Id&nbsp; &nbsp; </th>";
echo "<th nowrap>&nbsp; &nbsp; clip_name Search &nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_folder&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_start&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_end&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_desc&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_order&nbsp; &nbsp; </th>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
foreach($result as $row) {
//print_r( $row );
echo "<tr style='".$row_style[$c]."'>\n";
//echo "<td valign='top'><a href='update.php?id=".$row[id]."'>".$row[id]."</a></td>";
echo "<td valign='top'><a href='clipupdate.php?id=".$row[id]."'>".$row[clip_name]."</a></td>";
//echo "<td valign='top'>".$row[clip_folder]."</td>";
//echo "<td valign='top'>".$row[clip_text_start]."</td>";
//echo "<td valign='top'>".$row[clip_text_end]."</td>";
//echo "<td valign='top'>".$row[clip_desc]."</td>";
//echo "<td valign='top'>".$row[clip_order]."</td>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach unset($sql, $result, $row_count);
echo "</table>\n";
echo "</div>\n";
echo " <br><br>";
echo " </td>\n";
echo "</tr>\n";
} //end if results
echo "</table>\n";
echo "</div>";
echo "<br><br>";
require_once "footer.php";
unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);
}
else {
require_once "header.php";
echo "<div align='left'>";
echo "<table with='175' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Name:</td>";
echo " <td><input type='text' class='txt' name='clip_name'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Folder:</td>";
echo " <td><input type='text' class='txt' name='clip_folder'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Start:</td>";
echo " <td><input type='text' class='txt' name='clip_text_start'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>End:</td>";
echo " <td><input type='text' class='txt' name='clip_text_end'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Desc:</td>";
echo " <td><input type='text' class='txt' name='clip_desc'></td>";
echo " </tr>";
//echo " <tr>";
//echo " <td>clip_order:</td>";
//echo " <td><input type='text' class='txt' name='clip_order'></td>";
//echo " </tr>";
echo " <tr>";
echo " <td colspan='2' align='right'><input type='submit' name='submit' value='Search'></td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
require_once "footer.php";
} //end if not post
?>

View File

@ -1,142 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
if (count($_POST)>0) {
$id = check_str($_POST["id"]);
$clip_name = check_str($_POST["clip_name"]);
$clip_folder = check_str($_POST["clip_folder"]);
$clip_text_start = check_str($_POST["clip_text_start"]);
$clip_text_end = check_str($_POST["clip_text_end"]);
$clip_desc = check_str($_POST["clip_desc"]);
$clip_order = check_str($_POST["clip_order"]);
//sql update
$sql = "update v_clip_library set ";
$sql .= "clip_name = '$clip_name', ";
$sql .= "clip_folder = '$clip_folder', ";
$sql .= "clip_text_start = '$clip_text_start', ";
$sql .= "clip_text_end = '$clip_text_end', ";
$sql .= "clip_desc = '$clip_desc', ";
$sql .= "clip_order = '$clip_order' ";
$sql .= "where id = '$id' ";
$count = $db->exec(check_sql($sql));
//echo "Affected Rows: ".$count;
//edit: make sure the meta redirect url is correct
require_once "header.php";
echo "<meta http-equiv=\"refresh\" content=\"1;url=clipoptions.php\">\n";
echo "Update Complete";
require_once "footer.php";
return;
}
else {
//get data from the db
$id = $_GET["id"];
$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "where id = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$clip_name = $row["clip_name"];
$clip_folder = $row["clip_folder"];
$clip_text_start = $row["clip_text_start"];
$clip_text_end = $row["clip_text_end"];
$clip_desc = $row["clip_desc"];
$clip_order = $row["clip_order"];
break; //limit to 1 row
}
echo "</table>";
echo "<div>";}
require_once "header.php";
echo "<div align='left'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo "<form method='post' action=''>";
echo "<table border='0' width='100%'>";
echo " <tr>";
echo " <td>Name:</td>";
echo " <td><input type='text' class='txt' name='clip_name' value='$clip_name'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Folder:</td>";
echo " <td><input type='text' class='txt' name='clip_folder' value='$clip_folder'></td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2'>Before Selection:<br>";
echo " <textarea class='txt' name='clip_text_start'>$clip_text_start</textarea>";
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2'>After Selection:<br>";
echo " <textarea class='txt' name='clip_text_end'>$clip_text_end</textarea>";
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2'>Notes:<br>";
echo " <textarea class='txt' name='clip_desc'>$clip_desc</textarea>";
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2' align='right'>";
echo " <input type='hidden' name='id' value='$id'>";
echo " <input type='submit' name='submit' value='Update'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
require_once "footer.php";
?>

View File

@ -1,176 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
error_reporting (E_ALL ^ E_NOTICE);
$applicationname = 'Edit';
$bodyoptions = "";
$dbfilename = "clip.db";
$db_file_path = PROJECT_PATH."/xml_edit/";
//$temp = $_ENV["TEMP"]."\\";
if (is_writable($db_file_path.$dbfilename)) { //is writable
//use database in current location
echo "yes";
}
else { //not writable
/*
//running from a non writable location so copy to temp directory
if (file_exists($temp.$dbfilename)) {
$db_file_path = $temp; //file already exists use existing file
}
else { //file doese not exist
//copy the file to the temp dir
if (copy($db_file_path.$dbfilename, $temp.$dbfilename)) {
//echo "copy succeeded.\n";
$db_file_path = $temp;
}
else {
echo "Copy Failed ";
exit;
}
}
*/
}
function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
//$fullstring = "this is my [tag]dog[/tag]";
//$parsed = get_string_between($fullstring, "[tag]", "[/tag]");
//database connection
try {
//$db = new PDO('sqlite2:example.db'); //sqlite 2
//$db = new PDO('sqlite::memory:'); //sqlite 3
if (!function_exists('phpmd5')) {
function phpmd5($string) {
return md5($string);
}
}
if (!function_exists('phpmd5')) {
function phpunix_timestamp($string) {
return strtotime($string);
}
}
if (!function_exists('phpnow')) {
function phpnow() {
return date('r');
}
}
if (!function_exists('phpleft')) {
function phpleft($string, $num) {
return substr($string, 0, $num);
}
}
if (!function_exists('phpright')) {
function phpright($string, $num) {
return substr($string, (strlen($string)-$num), strlen($string));
}
}
if (!function_exists('phpsqlitedatatype')) {
function phpsqlitedatatype($string, $field) {
//--- Begin: Get String Between start and end characters -----
$start = '(';
$end = ')';
$ini = stripos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = stripos($string,$end,$ini) - $ini;
$string = substr($string,$ini,$len);
//--- End: Get String Between start and end characters -----
$strdatatype = '';
$stringarray = split (',', $string);
foreach($stringarray as $lnvalue) {
//$strdatatype .= "-- ".$lnvalue ." ".strlen($lnvalue)." delim ".strrchr($lnvalue, " ")."---<br>";
//$delimpos = stripos($lnvalue, " ");
//$strdatatype .= substr($value,$delimpos,strlen($value))." --<br>";
$fieldlistarray = split (" ", $value);
//$strdatatype .= $value ."<br>";
//$strdatatype .= $fieldlistarray[0] ."<br>";
//echo $fieldarray[0]."<br>\n";
if ($fieldarray[0] == $field) {
//$strdatatype = $fieldarray[1]." ".$fieldarray[2]." ".$fieldarray[3]." ".$fieldarray[4]; //strdatatype
}
unset($fieldarray, $string, $field);
}
//$strdatatype = $string;
return $strdatatype;
}
} //end function
/*
$db = new PDO('sqlite:'.$db_file_path.$dbfilename); //sqlite 3
//bool PDO::sqliteCreateFunction ( string function_name, callback callback [, int num_args] )
$db->sqliteCreateFunction('md5', 'phpmd5', 1);
//$db->sqliteCreateFunction('unix_timestamp', 'phpunix_timestamp', 1);
$db->sqliteCreateFunction('now', 'phpnow', 0);
$db->sqliteCreateFunction('sqlitedatatype', 'phpsqlitedatatype', 2);
$db->sqliteCreateFunction('strleft', 'phpleft', 2);
$db->sqliteCreateFunction('strright', 'phpright', 2);
*/
}
catch (PDOException $error) {
print "error: " . $error->getMessage() . "<br/>";
die();
}
if(!function_exists('escapejs')){
function escapejs($strtemp) {
$strtemp = str_replace ("\"", "\\\"", $strtemp); //escape the single quote
//$strtemp = str_replace ("'", "''", $strtemp); //escape the single quote
return $strtemp;
}
}
if(!function_exists('check_str')){
function check_str($strtemp) {
//$strtemp = str_replace ("\$", "\\\$", $strtemp); //escape the single quote
//$strtemp = str_replace ("\'", "''", $strtemp); //escape the single quote
$strtemp = str_replace ("'", "''", $strtemp); //escape the single quote
//echo "strtemp $strtemp";
return $strtemp;
}
}
?>

View File

@ -1,87 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
$folder = $_GET["folder"];
$folder = str_replace ("\\", "/", $folder);
if (substr($folder, -1) != "/") { $folder = $folder.'/'; }
$file = $_GET["file"];
//echo $folder.$file;
if (strlen($folder) > 0 && strlen($file) > 0) {
unlink($folder.$file);
header("Location: fileoptions.php");
}
else {
//display form
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$file."</td>";
echo " </tr>";
echo "</table>";
echo "<br />";
echo "<table>";
echo " <tr>";
echo " <td>File Name:</td>";
echo " </tr>";
echo " <tr>";
echo " <td><input type='text' name='file' value=''></td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";
require_once "footer.php";
}
?>

View File

@ -1,281 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "app/xml_edit/config.php";
require_once "app/xml_edit/header.php";
function isfile($filename) {
//if (@filesize($filename) > 0) { return true; } else { return false; }
}
function space($count) {
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
}
function recur_dir($dir) {
clearstatcache();
$htmldirlist = '';
$htmlfilelist = '';
$dirlist = opendir($dir);
$dir_array = array();
while (false !== ($file = readdir($dirlist))) {
if ($file != "." AND $file != ".."){
$newpath = $dir.'/'.$file;
$level = explode('/',$newpath);
if (substr($newpath, -4) == ".svn") {
//ignore .svn dir and subdir
}
elseif (substr($newpath, -3) == ".db") {
//ignore .db files
}
else {
$dir_array[] = $newpath;
}
if ($x > 1000) { break; };
$x++;
}
}
asort($dir_array);
foreach ($dir_array as $newpath){
$level = explode('/',$newpath);
if (is_dir($newpath)) {
/*$mod_array[] = array(
'level'=>count($level)-1,
'path'=>$newpath,
'name'=>end($level),
'type'=>'dir',
'mod_time'=>filemtime($newpath),
'size'=>'');
$mod_array[] = recur_dir($newpath);
*/
$dirname = end($level);
$htmldirlist .= space(count($level))."<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap><a onClick=\"Toggle(this)\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/folder.gif\" border='0'> $dirname </a><DIV style='display:none'>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap><A onClick=\"Toggle(this)\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/gear.png\"> Tools </A><DIV style='display:none'>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='foldernew.php?folder=".urlencode($newpath)."' title=''>New Folder </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='filenew.php?folder=".urlencode($newpath)."' title=''>New File </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/gear.png\"><a href='fileoptions.php?folder=".urlencode($newpath)."' title=''>Options </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
$htmldirlist .= recur_dir($newpath);
$htmldirlist .= space(count($level))."</DIV></TD></TR></TABLE>\n";
}
else {
/*$mod_array[] = array(
'level'=>count($level)-1,
'path'=>$newpath,
'name'=>end($level),
'type'=>'file',
'mod_time'=>filemtime($newpath),
'size'=>filesize($newpath));
*/
$filename = end($level);
$filesize = round(filesize($newpath)/1024, 2);
$htmlfilelist .= space(count($level))."<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><a href='javascript:void(0);' onclick=\"parent.document.title='".$newpath."';parent.document.getElementById('file').value='".urlencode($newpath)."'; parent.window.frames['frame_'+'edit1'].editArea.previous= new Array(); parent.window.frames['frame_'+'edit1'].editArea.switchClassSticky(document.getElementById('undo'), 'editAreaButtonDisabled', true); makeRequest('fileread.php','file=".urlencode($newpath)."'); window.setTimeout('parent.my_setSelectionRange(\'edit1\')','100');\" title='$filesize KB'><IMG SRC=\"images/file.png\" border='none'> $filename </a><DIV style='display:none'>\n";
$htmlfilelist .= space(count($level))."</DIV></TD></TR></TABLE>\n";
}
}
closedir($dirlist);
return $htmldirlist ."\n". $htmlfilelist;
}
//begin the content
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
//echo " alert(url); \n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " }\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
//echo " alert('none');\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
//echo " alert(strpost);\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
//echo " http_request.send('name=value&foo=bar');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo "\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";
echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
//echo " alert(http_request.responseText);\n";
echo "\n";
//echo " //var xmldoc = http_request.responseXML;\n";
//echo " //var root_node = xmldoc.getElementsByTagName('doc').item(0);\n";
//echo " //alert(xmldoc.getElementByID('fr1').value);\n";
//echo " //alert(root_node.firstChild.data);\n";
//echo "\n";
echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "</script>";
echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node) {\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";
echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>";
echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><a href='javascript:void(0);' onclick=\"if (typeof(clipwin)!='undefined') { clipwin.close(); } clipwin = window.open('fileoptions.php?folder=".urlencode($_SERVER["DOCUMENT_ROOT"])."','null','left=20,top=20,width=310,height=300,toolbar=0,resizable=0');\" style='text-decoration:none;' title=''><IMG SRC=\"images/folder.gif\" border='0'> Files </a><DIV style=''>\n"; //display:none
//echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><A onClick=\"Toggle(this)\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/folder.gif\"> Files </A><DIV style=''>\n"; //display:none
//echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap><A onClick=\"Toggle(this)\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/gear.png\"> Tools </A><DIV style='display:none'>\n";
//echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='/xml_edit/foldernew.php?folder=".urlencode($_SERVER["DOCUMENT_ROOT"])."' title=''>New Folder </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//echo "</DIV></TD></TR></TABLE>\n";
//echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='/xml_edit/filenew.php?folder=".urlencode($_SERVER["DOCUMENT_ROOT"])."' title=''>New File </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//echo "</DIV></TD></TR></TABLE>\n";
//echo "</DIV></TD></TR></TABLE>\n";
echo recur_dir($_SESSION['switch']['conf']['dir']);
echo "</DIV></TD></TR></TABLE>\n";
/*
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><A onClick=\"Toggle(this)\"><IMG SRC=\"/images/plus.gif\"> <IMG SRC=\"/images/folder.gif\"> Files </A><DIV style='display:none'>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A onClick=\"Toggle(this)\"><IMG SRC=\"/images/plus.gif\"> <IMG SRC=\"/images/folder.gif\"> Folder 1</A><DIV style='display:none'>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo1.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo2.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A onClick=\"Toggle(this)\"><IMG SRC=\"/images/plus.gif\"> <IMG SRC=\"/images/folder.gif\"> Folder 2</A><DIV style='display:none'>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo3.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo4.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " </DIV></TD></TR></TABLE>\n";
*/
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";
echo "<br><br>";
require_once "footer.php";
echo "</body>";
echo "</html>";
?>

View File

@ -1,90 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
$folder = $_GET["folder"];
$folder = str_replace ("\\", "/", $folder);
if (substr($folder, -1) != "/") { $folder = $folder.'/'; }
$file = $_GET["file"];
if (strlen($folder) > 0 && strlen($file) > 0) {
//create new file
$handle = fopen($folder.$file, 'wb') or die("Error!!");
$content = "<?php\n\n?>";
fwrite($handle, $content);
fclose($handle);
header("Location: fileoptions.php");
}
else {
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$file."</td>";
echo " </tr>";
echo "</table>";
echo "<br />";
echo "<table>";
echo " <tr>";
echo " <td>File Name:</td>";
echo " </tr>";
echo " <tr>";
echo " <td><input type='text' name='file' value=''></td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";
require_once "footer.php";
}
?>

View File

@ -1,89 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
require_once "header.php";
$file = $_GET["file"];
$file = str_replace ("\\", "/", $file);
$folder = $_GET["folder"];
$folder = str_replace ($file, "", $folder);
$urlpath = str_replace ($_SERVER["DOCUMENT_ROOT"], "", $folder);
echo "<div align='left'>";
echo "<table border='0' style=\"height: 100%; width: 100%;\">\n";
echo "<tr>";
echo "<td colspan='2'>";
echo "<table border='0'>";
echo "<form method='post' name='frm' action=''>";
echo "<tr><td>Path:</td><td width='95%'><input type='text' name='folder' id='folder' style=\"width: 100%;\" value=''></td><tr>\n";
echo "<tr><td>File:</td><td width='95%' style=\"width: 60%;\"><input type='text' name='filename' id='filename' style=\"width: 100%;\" value=''></div></td></tr>\n";
echo "</form>";
echo "</table>";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td valign='top' width='200' nowrap>";
echo " <IFRAME SRC='fileoptionslist.php' style='border: solid 1px #CCCCCC; height: 100%; width: 100%;' TITLE=''>\n";
echo " <!-- Clip List: Requires IFRAME support -->\n";
echo " </IFRAME>";
echo "</td>\n";
echo "<td valign='top' style=\"height: 100%;\">";
echo "<div align='left'>";
echo "<table width='100%' class='border'>";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='filenew.php?folder='+document.getElementById('folder').value;\" value='Add File'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='foldernew.php?folder='+document.getElementById('folder').value;\" value='Add Dir'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='filerename.php?folder='+document.getElementById('folder').value+'&filename='+document.getElementById('filename').value;\" value='Rename File'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you want to delete the selected file?')){ window.location='filedelete.php?folder='+document.getElementById('folder').value+'&file='+document.getElementById('filename').value; }\" value='Delete File'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you want to delete the selected folder?')){ window.location='folderdelete.php?folder='+document.getElementById('folder').value; }\" value='Delete Dir'></td></tr>\n";
echo " <tr><td><br><br><br><br><br></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick='javascript:self.close();' value='Close'></td></tr>\n";
echo "</table>";
echo "</div>";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
require_once "footer.php";
?>

View File

@ -1,270 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
require_once "header.php";
function isfile($filename) {
if (@filesize($filename) > 0) { return true; } else { return false; }
}
function space($count) {
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
}
function recur_dir($dir) {
clearstatcache();
$htmldirlist = '';
$htmlfilelist = '';
$dirlist = opendir($dir);
while ($file = readdir ($dirlist)) {
if ($file != '.' && $file != '..') {
$newpath = $dir.'/'.$file;
$level = explode('/',$newpath);
if (is_dir($newpath)) {
/*$mod_array[] = array(
'level'=>count($level)-1,
'path'=>$newpath,
'name'=>end($level),
'type'=>'dir',
'mod_time'=>filemtime($newpath),
'size'=>'');
$mod_array[] = recur_dir($newpath);
*/
$dirname = end($level);
$htmldirlist .= space(count($level))."<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap><A onClick=\"Toggle(this, '".$newpath."');\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/folder.gif\" border='0'> $dirname </a><DIV style='display:none'>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap><A onClick=\"Toggle(this)\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/gear.png\"> Tools </A><DIV style='display:none'>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='foldernew.php?folder=".urlencode($newpath)."' title=''>New Folder </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='filenew.php?folder=".urlencode($newpath)."' title=''>New File </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
//$htmldirlist .= space(count($level))." <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/gear.png\"><a href='fileoptions.php?folder=".urlencode($newpath)."' title=''>Options </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//$htmldirlist .= space(count($level))." </DIV></TD></TR></TABLE>\n";
$htmldirlist .= recur_dir($newpath);
$htmldirlist .= space(count($level))."</DIV></TD></TR></TABLE>\n";
}
else {
/*$mod_array[] = array(
'level'=>count($level)-1,
'path'=>$newpath,
'name'=>end($level),
'type'=>'file',
'mod_time'=>filemtime($newpath),
'size'=>filesize($newpath));
*/
$filename = end($level);
$filesize = round(filesize($newpath)/1024, 2);
$newpath = str_replace ($filename, "", $newpath);
$htmlfilelist .= space(count($level))."<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><a href='javascript:void(0);' onclick=\"parent.document.getElementById('filename').value='".$filename."'; parent.document.getElementById('folder').value='".$newpath."';\" title='$filesize KB'><IMG SRC=\"images/file.png\" border='none'>$filename</a><DIV style='display:none'>\n";
$htmlfilelist .= space(count($level))."</DIV></TD></TR></TABLE>\n";
}
}
}
closedir($dirlist);
return $htmldirlist ."\n". $htmlfilelist;
}
//show the content
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
//echo " alert(url); \n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
//echo " alert('none');\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
//echo " alert(strpost);\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
//echo " http_request.send('name=value&foo=bar');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo "\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";
echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
//echo " alert(http_request.responseText);\n";
echo "\n";
//echo " //var xmldoc = http_request.responseXML;\n";
//echo " //var root_node = xmldoc.getElementsByTagName('doc').item(0);\n";
//echo " //alert(xmldoc.getElementByID('fr1').value);\n";
//echo " //alert(root_node.firstChild.data);\n";
//echo "\n";
echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "</script>\n";
echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node, path) {\n";
echo " parent.document.getElementById('folder').value=path; \n";
echo " parent.document.getElementById('filename').value='';\n";
echo " parent.document.getElementById('folder').focus();\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";
echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>\n";
echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
//echo " <br>";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><IMG SRC=\"images/folder.gif\" border='0'> Files <DIV style=''>\n"; //display:none
//echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><A onClick=\"Toggle(this, '')\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/folder.gif\"> Files </A><DIV style=''>\n"; //display:none
//echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap><A onClick=\"Toggle(this, '')\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/gear.png\"> Tools </A><DIV style='display:none'>\n";
//echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='/xml_edit/foldernew.php?folder=".urlencode($_SERVER["DOCUMENT_ROOT"])."' title=''>New Folder </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//echo "</DIV></TD></TR></TABLE>\n";
//echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD nowrap WIDTH=12></TD><TD nowrap align='bottom'><IMG SRC=\"images/file.png\"><a href='/xml_edit/filenew.php?folder=".urlencode($_SERVER["DOCUMENT_ROOT"])."' title=''>New File </a><DIV style='display:none'>\n"; //parent.document.getElementById('file').value='".urlencode($newpath)."'
//echo "</DIV></TD></TR></TABLE>\n";
//echo "</DIV></TD></TR></TABLE>\n";
echo recur_dir($_SESSION['switch']['conf']['dir']);
echo "</DIV></TD></TR></TABLE>\n";
/*
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><A onClick=\"Toggle(this, '')\"><IMG SRC=\"/images/plus.gif\"> <IMG SRC=\"/images/folder.gif\"> Files </A><DIV style='display:none'>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A onClick=\"Toggle(this, '')\"><IMG SRC=\"/images/plus.gif\"> <IMG SRC=\"/images/folder.gif\"> Folder 1</A><DIV style='display:none'>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo1.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo2.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A onClick=\"Toggle(this, '')\"><IMG SRC=\"/images/plus.gif\"> <IMG SRC=\"/images/folder.gif\"> Folder 2</A><DIV style='display:none'>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo3.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD align='bottom'><IMG SRC=\"/images/file.png\"> demo4.php <DIV style='display:none'>\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " </DIV></TD></TR></TABLE>\n";
echo "\n";
echo " </DIV></TD></TR></TABLE>\n";
*/
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";
echo "<br><br>";
require_once "footer.php";
echo "</body>";
echo "</html>";
?>

View File

@ -1,48 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
$filename = check_str($_POST["file"]);
$filename = str_replace ("\\", "/", $filename);
$handle = fopen($filename, "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
}
?>

View File

@ -1,102 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
$folder = $_GET["folder"];
//$folder = str_replace ("\\", "/", $folder);
//if (substr($folder, -1) != "/") { $folder = $folder.'/'; }
$newfilename = $_GET["newfilename"];
$filename = $_GET["filename"];
//echo $folder.$file;
if (strlen($folder) > 0 && strlen($newfilename) > 0) {
//echo "new file: ".$newfilename."<br>";
//echo "folder: ".$folder."<br>";
//echo "orig filename: ".$filename."<br>";;
rename($folder.$filename, $folder.$newfilename);
header("Location: fileoptions.php");
}
else { //display form
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$filename."</td>";
echo " </tr>";
echo " <tr>";
echo " <td><br></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Original file name:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$filename."</td>";
echo " </tr>";
echo "</table>";
echo "<br />";
echo "<table>";
echo " <tr>";
echo " <td>Rename file to:</td>";
echo " </tr>";
echo " <tr>";
echo " <td><input type='text' name='newfilename' value=''></td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='hidden' name='filename' value='$filename'>";
echo " <input type='submit' value='Rename File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";
require_once "footer.php";
}
?>

View File

@ -1,50 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
$filename = $_POST["file"]; //filename with the path
$filename = str_replace ("\\", "/", $filename);
$content = $_POST["content"];
$handle = fopen($filename, 'wb') or die("Error!!");
fwrite($handle, $content);
fclose($handle);
//set the reload_xml value to true
$_SESSION["reload_xml"] = true;
echo $content;
?>

View File

@ -1,46 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
$folder = $_GET["folder"];
$folder = str_replace ("\\", "/", $folder);
if (strlen($folder) > 0) {
//delete the folder
rmdir($folder); //, 0700
header("Location: fileoptions.php");
}
?>

View File

@ -1,86 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_save')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "config.php";
$folder = $_GET["folder"];
$folder = str_replace ("\\", "/", $folder);
$foldername = $_GET["foldername"];
if (strlen($folder) > 0 && strlen($foldername) > 0) {
//create new folder
mkdir($folder.'/'.$foldername); //, 0700
header("Location: fileoptions.php");
}
else { //display form
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder."</td>";
echo " </tr>";
echo "</table>";
echo "<br />";
echo "<table>";
echo " <tr>";
echo " <td>Folder Name:</td>";
echo " </tr>";
echo " <tr>";
echo " <td><input type='text' name='foldername' value=''></td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New Folder'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";
require_once "footer.php";
}
?>

View File

@ -1,43 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
/*
echo "<br><br>";
echo "</td></tr></table>";
echo "<span class='smalltext'>";
echo "fusionpbx ";
echo "&nbsp; &nbsp; &nbsp; &nbsp; ";
echo "<a href='http://fusionpbx.com'>http://fusionpbx.com</a>";
echo "&nbsp; &nbsp; &nbsp; &nbsp; ";
echo "Author: Mark J. Crane ";
echo "</span>";
*/
echo "<div>";
echo "</body>";
echo "</html>";
?>

View File

@ -1,83 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
echo "<html>";
echo "<head>";
echo "<title></title>";
//echo "<link href='style.css' rel='stylesheet' type='text/css'>";
echo "<style type='text/css'>";
echo "<!--\n";
echo "th {\n";
echo " color: #5f5f5f;\n";
echo " font-size: 12px;\n";
echo " font-family: arial;\n";
echo " font-weight: bold;\n";
echo " background-color: #EFEFEF;\n";
echo "}\n";
echo "BODY {\n";
echo " font-size: 11px;\n";
echo " font-family: arial;\n";
echo "}\n";
echo "TD {\n";
echo " font-size: 11px;\n";
echo " font-family: arial;\n";
echo "}\n";
echo "INPUT, SELECT, TEXTAREA {\n";
echo " font-size: 11px;\n";
echo " }\n";
echo ".btn {\n";
echo " width: 100%;\n";
echo "}\n";
echo ".txt {\n";
echo " width: 100%;\n";
echo "}\n";
echo "//-->\n";
echo "</style>";
echo "<SCRIPT language=\"JavaScript\">\n";
echo "<!--\n";
echo "function confirmdelete(url)\n";
echo "{\n";
echo " var confirmed = confirm(\"Are you sure want to delete this.\");\n";
echo " if (confirmed == true) {\n";
echo " window.location=url;\n";
echo " }\n";
echo "}\n";
echo "//-->\n";
echo "</SCRIPT>";
echo "</head>";
echo "<body>";
echo "<div align='center'>";
?>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

View File

@ -1,201 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "app/xml_edit/config.php";
echo "<html>\n";
echo "<head>\n";
echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
echo " <title></title>";
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo "// Replaces all instances of the given substring.\n";
echo "String.prototype.replaceall = function(\n";
echo "strTarget, \n"; // The substring you want to replace
echo "strSubString \n"; // The string you want to replace in
echo ")\n";
echo "{\n";
echo " var strText = this;\n";
echo " var intIndexOfMatch = strText.indexOf( strTarget );\n";
echo " \n";
echo " // Keep looping while an instance of the target string\n";
echo " // still exists in the string.\n";
echo " while (intIndexOfMatch != -1){\n";
echo " // Relace out the current instance.\n";
echo " strText = strText.replace( strTarget, strSubString )\n";
echo " \n";
echo " // Get the index of any next matching substring.\n";
echo " intIndexOfMatch = strText.indexOf( strTarget );\n";
echo "}\n";
//echo "// Return the updated string with ALL the target strings\n";
//echo "// replaced out with the new substring.\n";
echo "return( strText );\n";
echo "}\n";
echo "function urlencode(str) {\n";
echo " str=escape(str); \n"; //Escape does not encode '/' and '+' character
echo " str=str.replaceall(\"+\", \"%2B\");\n";
echo " str=str.replaceall(\"/\", \"%2F\");\n";
echo " return str;\n";
echo "}";
echo "</script>\n";
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
echo " var http_request = false;\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " }\n";
echo " http_request.open('POST', url, true);\n";
echo " if (strpost.length == 0) {\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo " }\n";
echo " function returnContent(http_request) {\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";
echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "</script>";
?>
<script language="Javascript" type="text/javascript" src="<?php echo PROJECT_PATH; ?>/includes/edit_area/edit_area_full.js"></script>
<script language="Javascript" type="text/javascript">
// initialisation
editAreaLoader.init({
id: "edit1" // id of the textarea to transform
,start_highlight: false
,allow_toggle: false
,word_wrap: false
,language: "en"
,syntax: "xml"
,toolbar: "save, |, search, go_to_line,|, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
,syntax_selection_allow: "css,html,js,php,xml,c,cpp,sql"
,show_line_colors: true
,load_callback: "my_load"
,save_callback: "my_save"
});
// callback functions
function my_save(id, content){
makeRequest('filesave.php','file='+document.getElementById('file').value+'&content='+urlencode(content));
parent.document.title=''+unescape(document.getElementById('file').value)+' :: Saved';
}
function my_load(elem){
elem.value="The content is loaded from the load_callback function into EditArea";
}
function my_setSelectionRange(id){
editAreaLoader.setSelectionRange(id, 0, 0);
}
function test_setSelectionRange(id){
editAreaLoader.setSelectionRange(id, 0, 0);
}
function test_getSelectionRange(id){
var sel =editAreaLoader.getSelectionRange(id);
alert("start: "+sel["start"]+"\nend: "+sel["end"]);
}
function test_setSelectedText(id){
text= "[REPLACED SELECTION]";
editAreaLoader.setSelectedText(id, text);
}
function test_getSelectedText(id){
alert(editAreaLoader.getSelectedText(id));
}
</script>
</head>
<table border='0' style="height: 100%; width: 100%;">
<tr>
<td id='toolbar' valign='top' width='200' style="width: 200;" height='100%' nowrap>
<IFRAME SRC='filelist.php' style='border: solid 1px #CCCCCC; height: 100%; width: 100%;' WIDTH='100%' HEIGHT='100%' TITLE=''>
<!-- File List: Requires IFRAME support -->
</IFRAME>
</td>
<td valign='top' width="100%" height='100%' style="height: 100%;">
<?php
if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
//IE doesn't work with the 100% width with the IFRAME
echo "<textarea id='edit1' style='height: 100%; width: 800px;' name=''>\n";
echo "</textarea>\n";
}
else {
echo "<textarea id='edit1' style='height: 100%; width: 100%;' name=''>\n";
echo "</textarea>\n";
}
?>
<input type='hidden' id='file' name='file' value='' />
</td>
</tr>
</table>
</body>
</html>

View File

@ -1,113 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/checkauth.php";
if (permission_exists('xml_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "header.php";
//show the content
echo "<div align='left'>";
echo "<table width='175' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
$sql = "";
$sql .= "select * from v_clip_library ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
$c = 0;
$row_style["0"] = "background-color: #F5F5DC;";
$row_style["1"] = "background-color: #FFFFFF;";
echo "<div align='left'>\n";
echo "<table width='100%' border='0' cellpadding='1' cellspacing='1'>\n";
echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";
if ($result_count == 0) { //no results
echo "<tr><td>&nbsp;</td></tr>";
}
else { //received results
echo "<tr>";
//echo "<th nowrap>&nbsp; &nbsp; Id &nbsp;</th>";
echo "<th nowrap>&nbsp; &nbsp; clip_name &nbsp;</th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_folder&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_start&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_end&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_desc&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_order&nbsp; &nbsp; </th>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
foreach($result as $row) {
//print_r( $row );
echo "<tr style='".$row_style[$c]."'>\n";
//echo "<td valign='top'><a href='update.php?id=".$row[id]."'>".$row[id]."</a></td>";
echo "<td valign='top'><a href='/xml_edit/update.php?id=".$row[id]."'>".$row[clip_name]."</a></td>";
//echo "<td valign='top'>".$row[clip_folder]."</td>";
//echo "<td valign='top'>".$row[clip_text_start]."</td>";
//echo "<td valign='top'>".$row[clip_text_end]."</td>";
//echo "<td valign='top'>".$row[clip_desc]."</td>";
//echo "<td valign='top'>".$row[clip_order]."</td>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
echo "</table>\n";
echo "</div>\n";
echo " </td>\n";
echo "</tr>\n";
} //end if results
echo "</table>\n";
echo "<table width='175'><tr><td align='right'>\n";
echo "<input type='button' class='btn' name='' onclick=\"window.location='clipsearch.php'\" value='Search'>&nbsp; &nbsp;\n";
echo "<input type='button' class='btn' name='' onclick=\"window.location='clipadd.php'\" value='Add'>&nbsp; &nbsp;\n";
echo "</td></tr><table>\n";
echo "</div>";
echo "<br><br>";
require_once "footer.php";
?>

View File

@ -1,7 +0,0 @@
Notes
IFrame
http://www.quirksmode.org/js/iframe.html
Tree View
http://www.dddekerf.dds.nl/DHTML_Treeview/DHTML_Treeview.htm

View File

@ -1,50 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
if (!defined("PATH_SEPARATOR")) {
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
}
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
// if the project directory exists then add it to the include path otherwise add the document root to the include path
if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
}
else {
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
}
?>