Эх сурвалжийг харах

Add capability to the editor to work with grammar, script, php, xml, and provsion directories.

Mark Crane 12 жил өмнө
parent
commit
e42c905021
7 өөрчлөгдсөн 183 нэмэгдсэн , 23 устгасан
  1. 142 15
      app_config.php
  2. 15 1
      filelist.php
  3. 4 3
      filenew.php
  4. 15 1
      fileoptionslist.php
  5. 2 1
      header.php
  6. 3 0
      index.php
  7. 2 2
      list.php

+ 142 - 15
app_config.php

@@ -19,21 +19,86 @@
 		$apps[$x]['description']['pt-br'] = '';
 
 	//menu details
-		$apps[$x]['menu'][0]['title']['en-us'] = 'Script 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 de Scripts';
-		$apps[$x]['menu'][0]['title']['pt-br'] = '';
-		$apps[$x]['menu'][0]['uuid'] = 'f1905fec-0577-daef-6045-59d09b7d3f94';
-		$apps[$x]['menu'][0]['parent_uuid'] = '594d99c5-6128-9c88-ca35-4b33392cec0f';
-		$apps[$x]['menu'][0]['category'] = 'external';
-		$apps[$x]['menu'][0]['path'] = '/app/script_edit/index.php';
-		$apps[$x]['menu'][0]['groups'][] = 'superadmin';
+		$y = 0;
+		$apps[$x]['menu'][$y]['title']['en-us'] = 'Script Editor';
+		$apps[$x]['menu'][$y]['title']['es-mx'] = '';
+		$apps[$x]['menu'][$y]['title']['de'] = '';
+		$apps[$x]['menu'][$y]['title']['de-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['de-at'] = '';
+		$apps[$x]['menu'][$y]['title']['fr'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ca'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['pt-pt'] = 'Editor de Scripts';
+		$apps[$x]['menu'][$y]['title']['pt-br'] = '';
+		$apps[$x]['menu'][$y]['uuid'] = 'f1905fec-0577-daef-6045-59d09b7d3f94';
+		$apps[$x]['menu'][$y]['parent_uuid'] = '594d99c5-6128-9c88-ca35-4b33392cec0f';
+		$apps[$x]['menu'][$y]['category'] = 'external';
+		$apps[$x]['menu'][$y]['path'] = '/app/edit/index.php?dir=scripts';
+		$apps[$x]['menu'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['menu'][$y]['title']['en-us'] = 'XML Editor';
+		$apps[$x]['menu'][$y]['title']['es-mx'] = '';
+		$apps[$x]['menu'][$y]['title']['de'] = '';
+		$apps[$x]['menu'][$y]['title']['de-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['de-at'] = '';
+		$apps[$x]['menu'][$y]['title']['fr'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ca'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['pt-pt'] = 'Editor XML';
+		$apps[$x]['menu'][$y]['title']['pt-br'] = '';
+		$apps[$x]['menu'][$y]['uuid'] = '16013877-606a-2a05-7d6a-c1b215839131';
+		$apps[$x]['menu'][$y]['parent_uuid'] = '594d99c5-6128-9c88-ca35-4b33392cec0f';
+		$apps[$x]['menu'][$y]['category'] = 'external';
+		$apps[$x]['menu'][$y]['path'] = '/app/edit/index.php?dir=xml';
+		$apps[$x]['menu'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['menu'][$y]['title']['en-us'] = 'Provision Editor';
+		$apps[$x]['menu'][$y]['title']['es-mx'] = '';
+		$apps[$x]['menu'][$y]['title']['de'] = '';
+		$apps[$x]['menu'][$y]['title']['de-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['de-at'] = '';
+		$apps[$x]['menu'][$y]['title']['fr'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ca'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['pt-pt'] = 'Editor de Provisionamento';
+		$apps[$x]['menu'][$y]['title']['pt-br'] = '';
+		$apps[$x]['menu'][$y]['uuid'] = '57773542-a565-1a29-605d-6535da1a0870';
+		$apps[$x]['menu'][$y]['parent_uuid'] = '594d99c5-6128-9c88-ca35-4b33392cec0f';
+		$apps[$x]['menu'][$y]['category'] = 'external';
+		$apps[$x]['menu'][$y]['path'] = '/app/edit/index.php?dir=provision';
+		$apps[$x]['menu'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['menu'][$y]['title']['en-us'] = 'PHP Editor';
+		$apps[$x]['menu'][$y]['title']['es-mx'] = '';
+		$apps[$x]['menu'][$y]['title']['de'] = '';
+		$apps[$x]['menu'][$y]['title']['de-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['de-at'] = '';
+		$apps[$x]['menu'][$y]['title']['fr'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ca'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['pt-pt'] = 'Editor de PHP';
+		$apps[$x]['menu'][$y]['title']['pt-br'] = '';
+		$apps[$x]['menu'][$y]['uuid'] = 'eae1f2d6-789b-807c-cc26-44501e848693';
+		$apps[$x]['menu'][$y]['parent_uuid'] = '594d99c5-6128-9c88-ca35-4b33392cec0f';
+		$apps[$x]['menu'][$y]['category'] = 'external';
+		$apps[$x]['menu'][$y]['path'] = '/app/edit/index.php?dir=php';
+		$apps[$x]['menu'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['menu'][$y]['title']['en-us'] = 'Grammar Editor';
+		$apps[$x]['menu'][$y]['title']['es-mx'] = 'Editor Gramático';
+		$apps[$x]['menu'][$y]['title']['de'] = '';
+		$apps[$x]['menu'][$y]['title']['de-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['de-at'] = '';
+		$apps[$x]['menu'][$y]['title']['fr'] = "L'éditeur grammairien";
+		$apps[$x]['menu'][$y]['title']['fr-ca'] = '';
+		$apps[$x]['menu'][$y]['title']['fr-ch'] = '';
+		$apps[$x]['menu'][$y]['title']['pt-pt'] = 'Editor Gramático';
+		$apps[$x]['menu'][$y]['title']['pt-br'] = '';
+		$apps[$x]['menu'][$y]['uuid'] = 'c3db739e-89f9-0fa2-44ce-0f4c2ff43b1a';
+		$apps[$x]['menu'][$y]['parent_uuid'] = '594d99c5-6128-9c88-ca35-4b33392cec0f';
+		$apps[$x]['menu'][$y]['category'] = 'external';
+		$apps[$x]['menu'][$y]['path'] = '/app/edit/index.php?dir=grammar';
+		$apps[$x]['menu'][$y]['groups'][] = 'superadmin';
 
 	//permission details
 		$apps[$x]['permissions'][0]['name'] = 'script_editor_view';
@@ -41,4 +106,66 @@
 
 		$apps[$x]['permissions'][1]['name'] = 'script_editor_save';
 		$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
+
+		$apps[$x]['permissions'][0]['name'] = 'provision_editor_view';
+		$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
+		
+		$apps[$x]['permissions'][1]['name'] = 'provision_editor_save';
+		$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
+
+		$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';
+
+		$apps[$x]['permissions'][0]['name'] = 'php_editor_view';
+		$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
+
+		$apps[$x]['permissions'][1]['name'] = 'php_editor_save';
+		$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
+
+		$apps[$x]['permissions'][0]['name'] = 'grammar_view';
+		$apps[$x]['permissions'][0]['groups'][] = 'admin';
+		$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
+
+		$apps[$x]['permissions'][1]['name'] = 'grammar_save';
+		$apps[$x]['permissions'][1]['groups'][] = 'admin';
+		$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
+
+	//schema details
+		$y = 0; //table array index
+		$z = 0; //field array index
+		$apps[$x]['db'][$y]['table'] = 'v_clips';
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'clip_uuid';
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'clip_name';
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'clip_folder';
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'clip_text_start';
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'clip_text_end';
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'clip_order';
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'clip_desc';
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+
 ?>

+ 15 - 1
filelist.php

@@ -232,7 +232,21 @@ 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'> ".$text['label-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 recur_dir($_SESSION['switch']['scripts']['dir']);
+if ($_SESSION["app"]["edit"]["dir"] == "scripts") {
+	echo recur_dir($_SESSION['switch']['scripts']['dir']);
+}
+if ($_SESSION["app"]["edit"]["dir"] == "php") {
+	echo recur_dir($_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH);
+}
+if ($_SESSION["app"]["edit"]["dir"] == "grammar") {
+	echo recur_dir($_SESSION['switch']['grammar']['dir']);
+}
+if ($_SESSION["app"]["edit"]["dir"] == "provision") {
+	echo recur_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/");
+}
+if ($_SESSION["app"]["edit"]["dir"] == "xml") {
+	echo recur_dir($_SESSION['switch']['conf']['dir']);
+}
 
 echo "</div></td></tr></table>\n";
 

+ 4 - 3
filenew.php

@@ -56,6 +56,7 @@ if (strlen($folder) > 0 && strlen($file) > 0) {
 }
 else {
 	require_once "header.php";
+
 	echo "<br>";
 	echo "<div align='left'>";
 	echo "<form method='get' action=''>";
@@ -81,9 +82,9 @@ else {
 
 	echo "	<tr>";
 	echo "		<td colspan='1' align='right'>";
-	echo "      <input type='hidden' name='folder' value='$folder'>";
-	echo "		  <input type='submit' value='".$text['button-new-file']."'>";
-	echo "    </td>";
+	echo "			<input type='hidden' name='folder' value='$folder'>";
+	echo "			<input type='submit' value='".$text['button-new-file']."'>";
+	echo "		</td>";
 	echo "	</tr>";
 	echo "</table>";
 	echo "</form>";

+ 15 - 1
fileoptionslist.php

@@ -229,7 +229,21 @@ echo "      <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><IMG SRC=\"i
 //echo "</DIV></TD></TR></TABLE>\n";
 //echo "</DIV></TD></TR></TABLE>\n";
 
-echo recur_dir($_SESSION['switch']['scripts']['dir']);
+if ($_SESSION["app"]["edit"]["dir"] == "scripts") {
+	echo recur_dir($_SESSION['switch']['scripts']['dir']);
+}
+if ($_SESSION["app"]["edit"]["dir"] == "php") {
+	echo recur_dir($_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH);
+}
+if ($_SESSION["app"]["edit"]["dir"] == "grammar") {
+	echo recur_dir($_SESSION['switch']['grammar']['dir']);
+}
+if ($_SESSION["app"]["edit"]["dir"] == "provision") {
+	echo recur_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/");
+}
+if ($_SESSION["app"]["edit"]["dir"] == "xml") {
+	echo recur_dir($_SESSION['switch']['conf']['dir']);
+}
 
 echo "</DIV></TD></TR></TABLE>\n";
 

+ 2 - 1
header.php

@@ -26,7 +26,8 @@
 */
 
 //add multi-lingual support
-	require_once "app_languages.php";
+	unset($text);
+	require "app_languages.php";
 	foreach($text as $key => $value) {
 		$text[$key] = $value[$_SESSION['domain']['language']['code']];
 	}

+ 3 - 0
index.php

@@ -41,6 +41,9 @@ else {
 		$text[$key] = $value[$_SESSION['domain']['language']['code']];
 	}
 
+//set the directory
+	$_SESSION["app"]["edit"]["dir"] = $_GET["dir"];
+
 echo "<html>\n";
 echo "<head>\n";
 echo "	<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";

+ 2 - 2
list.php

@@ -85,10 +85,10 @@ else { //received results
 			//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);
+	} //end foreach
+	unset($sql, $result, $row_count);
 	echo "</table>\n";
 	echo "</div>\n";