FusionPBX 6 роки тому
батько
коміт
f6b4f1265c
1 змінених файлів з 34 додано та 17 видалено
  1. 34 17
      index.php

+ 34 - 17
index.php

@@ -17,23 +17,26 @@
 
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
-	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 <[email protected]>
 	James Rose <[email protected]>
 */
-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';