Update index.php

This commit is contained in:
FusionPBX 2018-12-14 21:13:45 -07:00 committed by GitHub
parent 0474dc3e79
commit 80bb383b8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 17 deletions

View File

@ -17,23 +17,26 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2016
Portions created by the Initial Developer are Copyright (C) 2008-2018
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('script_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('script_editor_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
@ -44,15 +47,29 @@ else {
$title = escape($_GET["dir"]);
unset($mode);
switch ($_GET["dir"]) {
case 'xml': $mode = 'xml'; break;
case 'provision': $mode = 'xml'; break;
case 'php': $mode = 'php'; break;
case 'scripts': $mode = 'lua'; break;
case 'grammar': //use default
case 'xml':
$title = 'XML';
$mode = 'xml';
break;
case 'provision':
$title = 'Provision';
$mode = 'xml';
break;
case 'php':
$title = 'PHP';
$mode = 'php';
break;
case 'scripts':
$title = 'Scripts';
$mode = 'lua';
break;
case 'grammar':
$title = 'Grammar';
$mode = 'xml';
default: $mode = 'text';
}
// load editor preferences/defaults
//load editor preferences/defaults
$setting_size = ($_SESSION["editor"]["font_size"]["text"] != '') ? $_SESSION["editor"]["font_size"]["text"] : '12px';
$setting_theme = ($_SESSION["editor"]["theme"]["text"] != '') ? $_SESSION["editor"]["theme"]["text"] : 'cobalt';
$setting_invisibles = ($_SESSION["editor"]["invisibles"]["boolean"] != '') ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false';