From 22a7603d84d50971a82db3a65dba77fe80db3a93 Mon Sep 17 00:00:00 2001 From: James Rose Date: Sat, 24 Nov 2012 05:23:48 +0000 Subject: [PATCH] Advanced->Script Editor, added preliminary support for translations. --- app/script_edit/app_languages.php | 93 +++++++++++++++++++++++++++++ app/script_edit/clipadd.php | 19 ++++-- app/script_edit/clipdelete.php | 9 ++- app/script_edit/cliplist.php | 13 +++- app/script_edit/clipoptions.php | 15 +++-- app/script_edit/clipoptionslist.php | 12 +++- app/script_edit/clipsearch.php | 1 + app/script_edit/filedelete.php | 13 ++-- app/script_edit/filelist.php | 14 ++++- app/script_edit/filenew.php | 11 +++- app/script_edit/fileoptions.php | 22 ++++--- app/script_edit/fileoptionslist.php | 14 ++++- app/script_edit/filerename.php | 15 +++-- app/script_edit/filesave.php | 9 ++- app/script_edit/foldernew.php | 13 +++- app/script_edit/header.php | 9 ++- app/script_edit/index.php | 12 +++- app/script_edit/list.php | 12 +++- 18 files changed, 257 insertions(+), 49 deletions(-) create mode 100644 app/script_edit/app_languages.php diff --git a/app/script_edit/app_languages.php b/app/script_edit/app_languages.php new file mode 100644 index 0000000000..79a942a3c8 --- /dev/null +++ b/app/script_edit/app_languages.php @@ -0,0 +1,93 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane + James Rose +*/ + $text['message-add']['en-us'] = 'Add Complete'; + $text['label-folder']['en-us'] = 'Folder:'; + $text['label-before-selection']['en-us'] = 'Before Selection:'; + $text['label-after-selection']['en-us'] = 'After Selection:'; + $text['label-notes']['en-us'] = 'Notes:'; + $text['button-add']['en-us'] = 'Add'; + $text['message-delete']['en-us'] = 'Delete Complete'; + + $text['message-give-up']['en-us'] = 'Giving up :( Cannot create an XMLHTTP instance'; + $text['message-problem']['en-us'] = 'There was a problem with the request.'; + $text['label-clip-library']['en-us'] = 'Clip Library'; + + $text['button-edit-clip']['en-us'] = 'Edit Clip'; + $text['button-add-clip']['en-us'] = 'Add Clip'; + $text['message-delete-clip']['en-us'] = 'Are you sure you want to delete the selected clip?'; + $text['button-delete']['en-us'] = ' Delete '; + $text['button-close']['en-us'] = ' Close '; + + $text['label-path']['en-us'] = 'Path:'; + $text['label-file-name']['en-us'] = 'File Name:'; + $text['button-new-file']['en-us'] = 'New File'; + $text['label-file-name-orig']['en-us'] = 'Original File Name:'; + $text['label-rename-file-to']['en-us'] = 'Rename File To:'; + + $text['label-files']['en-us'] = 'Files'; + + $text['button-add-file']['en-us'] = 'Add File'; + $text['button-add-dir']['en-us'] = 'Add Dir'; //add directory + $text['button-rename-file']['en-us'] = 'Rename File'; + $text['message-delete-file']['en-us'] = 'Are you sure you want to delete the selected file?'; + $text['button-del-file']['en-us'] = 'Delete File'; + $text['message-delete-folder']['en-us'] = 'Are you sure you want to delete the selected folder?'; + $text['button-del-dir']['en-us'] = 'Delete Dir'; //delete directory + + $text['message-error']['en-us'] = 'Error!!'; + + $text['label-folder-name']['en-us'] = 'Folder Name:'; + $text['button-new-folder']['en-us'] = 'New Folder'; + + $text['button-delete-this']['en-us'] = 'Are you sure want to delete this?'; + + $text['button-search']['en-us'] = 'Search'; + $text['button-add']['en-us'] = 'Add'; + + + + + + $text['button-back']['en-us'] = 'Back'; + $text['button-save']['en-us'] = 'Save'; + $text['title']['en-us'] = 'Service Add'; + + $text['description']['en-us'] = 'Shows a list of processes and provides ability to start and stop them.'; + $text['label-name']['en-us'] = 'Name:'; + $text['description-name']['en-us'] = 'Enter the service name.'; + $text['label-type']['en-us'] = 'Type:'; + $text['description-type']['en-us'] = 'Select the service type.'; + $text['label-data']['en-us'] = 'Data:'; + $text['description-data']['en-us'] = 'Enter the service data.'; + $text['label-start']['en-us'] = 'Start Command:'; + $text['description-start']['en-us'] = 'Enter the command to start the service.'; + $text['label-stop']['en-us'] = 'Stop Comand'; + $text['description-stop']['en-us'] = 'Enter the command to stop the service.'; + $text['label-description']['en-us'] = 'Description:'; + $text['description-description']['en-us'] = 'Enter the service description.'; + +?> \ No newline at end of file diff --git a/app/script_edit/clipadd.php b/app/script_edit/clipadd.php index 0b9b326d8a..179d063b0e 100644 --- a/app/script_edit/clipadd.php +++ b/app/script_edit/clipadd.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,6 +35,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + if (count($_POST)>0) { $clip_name = check_str($_POST["clip_name"]); $clip_folder = check_str($_POST["clip_folder"]); @@ -68,7 +75,7 @@ if (count($_POST)>0) { require_once "header.php"; echo "\n"; - echo "Add Complete"; + echo $text['message-add']; require_once "footer.php"; return; } @@ -90,29 +97,29 @@ if (count($_POST)>0) { echo " "; echo " "; - echo " Folder:"; + echo " ".$text['label-folder'].""; echo " "; echo " "; echo " "; - echo " Before Selection:
"; + echo " ".$text['label-before-selection']."
"; echo " "; echo " "; echo " "; echo " "; - echo " After Selection:
"; + echo " ".$text['label-after-selection']."
"; echo " "; echo " "; echo " "; echo " "; - echo " Notes:
"; + echo " ".$text['label-notes']."
"; echo " "; echo " "; echo " "; - echo " "; + echo " "; echo " "; echo ""; echo ""; diff --git a/app/script_edit/clipdelete.php b/app/script_edit/clipdelete.php index 043332a193..ff2e2c9e16 100644 --- a/app/script_edit/clipdelete.php +++ b/app/script_edit/clipdelete.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,6 +35,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //get the uuid from http values $clip_uuid = check_str($_GET["id"]); @@ -49,7 +56,7 @@ else { //redirect the browser require_once "header.php"; echo "\n"; - echo "Delete Complete"; + echo $text['message-delete']; require_once "footer.php"; return; diff --git a/app/script_edit/cliplist.php b/app/script_edit/cliplist.php index 94750847ad..39fe24a9ea 100644 --- a/app/script_edit/cliplist.php +++ b/app/script_edit/cliplist.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -35,6 +36,12 @@ else { exit; } //require_once "edit/header.php"; +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + echo ""; echo ""; @@ -81,7 +88,7 @@ echo " }\n"; echo " }\n"; echo "\n"; echo " if (!http_request) {\n"; -echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n"; +echo " alert('".$text['message-give-up']."');\n"; echo " return false;\n"; echo " }\n"; echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n"; @@ -112,7 +119,7 @@ echo "\n"; echo " }\n"; echo " else {\n"; -echo " alert('There was a problem with the request.');\n"; +echo " alert('".$text['message-problem']."');\n"; echo " }\n"; echo " }\n"; echo "\n"; @@ -159,7 +166,7 @@ echo "
"; echo "\n"; echo "\n"; echo "
\n"; -echo "
Clip Library
\n"; //display:none +echo " \n"; diff --git a/app/script_edit/clipoptionslist.php b/app/script_edit/clipoptionslist.php index ba406f8114..34a908413b 100644 --- a/app/script_edit/clipoptionslist.php +++ b/app/script_edit/clipoptionslist.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -33,6 +34,11 @@ else { echo "access denied"; exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } echo ""; echo ""; @@ -81,7 +87,7 @@ function space($count) { echo " }\n"; echo "\n"; echo " if (!http_request) {\n"; - echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n"; + echo " alert('".$text['message-give-up']."');\n"; echo " return false;\n"; echo " }\n"; echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n"; @@ -105,7 +111,7 @@ function space($count) { 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 " alert('".$text['message-problem']."');\n"; echo " }\n"; echo " }\n"; echo " }\n"; @@ -153,7 +159,7 @@ echo ""; echo "\n"; echo "
".$text['label-clip-library']."
\n"; //display:none $sql = "select * from v_clips "; $sql .= "order by clip_folder "; diff --git a/app/script_edit/clipoptions.php b/app/script_edit/clipoptions.php index ce27c640dd..ce742729af 100644 --- a/app/script_edit/clipoptions.php +++ b/app/script_edit/clipoptions.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -33,6 +34,12 @@ else { echo "access denied"; exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + require_once "header.php"; echo "
"; @@ -53,13 +60,13 @@ echo " "; //echo " \n"; //echo " \n"; -echo " \n"; -echo " \n"; +echo " \n"; +echo " \n"; //echo " \n"; -echo " \n"; +echo " \n"; echo " \n"; -echo " \n"; +echo " \n"; echo "
Options











"; echo "
\n"; - echo "
Clip Library
\n"; //display:none + echo "
".$text['label-clip-library']."
\n"; //display:none $sql = "select * from v_clips "; $sql .= "order by clip_folder "; diff --git a/app/script_edit/clipsearch.php b/app/script_edit/clipsearch.php index 69e3b9a487..4b1dc9050d 100644 --- a/app/script_edit/clipsearch.php +++ b/app/script_edit/clipsearch.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/checkauth.php"; diff --git a/app/script_edit/filedelete.php b/app/script_edit/filedelete.php index 0607661bb7..7ddd61899f 100644 --- a/app/script_edit/filedelete.php +++ b/app/script_edit/filedelete.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -33,7 +34,11 @@ else { echo "access denied"; exit; } - +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } $folder = $_GET["folder"]; $folder = str_replace ("\\", "/", $folder); if (substr($folder, -1) != "/") { $folder = $folder.'/'; } @@ -51,7 +56,7 @@ else { echo "
"; echo ""; echo " "; - echo " "; + echo " "; echo " "; echo " "; echo " "; @@ -62,7 +67,7 @@ else { echo "
Path:".$text['label-path']."
".$folder.$file."
"; echo " "; - echo " "; + echo " "; echo " "; echo " "; @@ -72,7 +77,7 @@ else { echo " "; echo " "; echo " "; echo "
File Name:".$text['label-file-name']."
"; echo " "; - echo " "; + echo " "; echo "
"; diff --git a/app/script_edit/filelist.php b/app/script_edit/filelist.php index e924ea2bc5..0232331000 100644 --- a/app/script_edit/filelist.php +++ b/app/script_edit/filelist.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -33,6 +34,13 @@ else { echo "access denied"; exit; } + +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + require_once "header.php"; function isfile($filename) { @@ -140,7 +148,7 @@ echo " }\n"; echo " }\n"; echo "\n"; echo " if (!http_request) {\n"; -echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n"; +echo " alert('".$text['message-give-up']."');\n"; echo " return false;\n"; echo " }\n"; echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n"; @@ -179,7 +187,7 @@ echo "\n"; //echo "\n"; echo " }\n"; echo " else {\n"; -echo " alert('There was a problem with the request.');\n"; +echo " alert('".$text['message-problem']."');\n"; echo " }\n"; echo " }\n"; echo "\n"; @@ -227,7 +235,7 @@ echo "
\n"; //echo "
"; echo "\n"; -echo "
Files
\n"; //display:none +echo "
".$text['label-files']."
\n"; //display:none //echo "
Files
\n"; //display:none echo recur_dir($_SESSION['switch']['scripts']['dir']); diff --git a/app/script_edit/filenew.php b/app/script_edit/filenew.php index 3dfd2a69fc..29272ab2d1 100644 --- a/app/script_edit/filenew.php +++ b/app/script_edit/filenew.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,6 +35,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + $folder = $_GET["folder"]; $folder = str_replace ("\\", "/", $folder); if (substr($folder, -1) != "/") { $folder = $folder.'/'; } @@ -65,7 +72,7 @@ else { echo ""; echo " "; - echo " "; + echo " "; echo " "; echo " "; @@ -75,7 +82,7 @@ else { echo " "; echo " "; echo " "; echo "
File Name:".$text['label-file-name']."
"; echo " "; - echo " "; + echo " "; echo "
"; diff --git a/app/script_edit/fileoptions.php b/app/script_edit/fileoptions.php index 78b54ec3a5..82eede5cb2 100644 --- a/app/script_edit/fileoptions.php +++ b/app/script_edit/fileoptions.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -33,6 +34,13 @@ else { echo "access denied"; exit; } + +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + require_once "header.php"; $file = $_GET["file"]; @@ -48,7 +56,7 @@ echo "
"; echo ""; echo ""; -echo "\n"; +echo "\n"; echo "\n"; echo ""; echo "
Path:
".$text['label-path']."
File:
"; @@ -66,13 +74,13 @@ echo "
"; echo "
"; echo ""; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; +echo " \n"; echo " \n"; -echo " \n"; +echo " \n"; echo "





"; echo "
"; diff --git a/app/script_edit/fileoptionslist.php b/app/script_edit/fileoptionslist.php index 7f4938d8c5..5c1b343507 100644 --- a/app/script_edit/fileoptionslist.php +++ b/app/script_edit/fileoptionslist.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -33,6 +34,13 @@ else { echo "access denied"; exit; } + +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + require_once "header.php"; function isfile($filename) { @@ -125,7 +133,7 @@ echo " }\n"; echo " }\n"; echo "\n"; echo " if (!http_request) {\n"; -echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n"; +echo " alert('".$text['message-give-up']."');\n"; echo " return false;\n"; echo " }\n"; echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n"; @@ -162,7 +170,7 @@ echo "\n"; //echo "\n"; echo " }\n"; echo " else {\n"; -echo " alert('There was a problem with the request.');\n"; +echo " alert('".$text['message-problem']."');\n"; echo " }\n"; echo " }\n"; echo "\n"; @@ -211,7 +219,7 @@ echo "\n"; echo "
\n"; echo "\n"; -echo "
Files
\n"; //display:none +echo "
".$text['label-files']."
\n"; //display:none //echo "
Files
\n"; //display:none //echo "
Tools
\n"; diff --git a/app/script_edit/filerename.php b/app/script_edit/filerename.php index 8a6bc58ddf..95ed15bd8d 100644 --- a/app/script_edit/filerename.php +++ b/app/script_edit/filerename.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,6 +35,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + $folder = $_GET["folder"]; //$folder = str_replace ("\\", "/", $folder); //if (substr($folder, -1) != "/") { $folder = $folder.'/'; } @@ -57,7 +64,7 @@ else { //display form echo "
"; echo ""; echo " "; - echo " "; + echo " "; echo " "; echo " "; echo " "; @@ -66,7 +73,7 @@ else { //display form echo " "; echo " "; echo " "; - echo " "; + echo " "; echo " "; echo " "; echo " "; @@ -77,7 +84,7 @@ else { //display form echo "
Path:".$text['label-path']."
".$folder.$filename."
Original file name:".$text['label-file-name-orig']."
".$filename."
"; echo " "; - echo " "; + echo " "; echo " "; echo " "; @@ -88,7 +95,7 @@ else { //display form echo " "; echo " "; echo "
Rename file to:".$text['label-rename-file-to']."
"; echo " "; echo " "; - echo " "; + echo " "; echo "
"; diff --git a/app/script_edit/filesave.php b/app/script_edit/filesave.php index 4d1c007bd2..f36d22628b 100644 --- a/app/script_edit/filesave.php +++ b/app/script_edit/filesave.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,11 +35,17 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + $filename = $_POST["file"]; //filename with the path $filename = str_replace ("\\", "/", $filename); $content = $_POST["content"]; -$handle = fopen($filename, 'wb') or die("Error!!"); +$handle = fopen($filename, 'wb') or die($text['message-error']); fwrite($handle, $content); fclose($handle); diff --git a/app/script_edit/foldernew.php b/app/script_edit/foldernew.php index 336b9d3633..970d9ac8d0 100644 --- a/app/script_edit/foldernew.php +++ b/app/script_edit/foldernew.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,6 +35,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + $folder = $_GET["folder"]; $folder = str_replace ("\\", "/", $folder); $foldername = $_GET["foldername"]; @@ -50,7 +57,7 @@ else { //display form echo ""; echo ""; echo " "; - echo " "; + echo " "; echo " "; echo " "; echo " "; @@ -61,7 +68,7 @@ else { //display form echo "
Path:".$text['label-path']."
".$folder."
"; echo " "; - echo " "; + echo " "; echo " "; echo " "; @@ -71,7 +78,7 @@ else { //display form echo " "; echo " "; echo " "; echo "
Folder Name:".$text['label-folder-name']."
"; echo " "; - echo " "; + echo " "; echo "
"; diff --git a/app/script_edit/header.php b/app/script_edit/header.php index bd10f557d3..6670ca1797 100644 --- a/app/script_edit/header.php +++ b/app/script_edit/header.php @@ -22,8 +22,15 @@ Contributor(s): Mark J Crane + James Rose */ +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + echo ""; echo ""; echo ""; @@ -69,7 +76,7 @@ echo "