From 4104f5a51f3b839469f5805e7e464629118fd04b Mon Sep 17 00:00:00 2001 From: James Rose Date: Sat, 24 Nov 2012 17:58:54 +0000 Subject: [PATCH] App->conferences_active, added preliminary support for translations. --- app/conferences_active/app_languages.php | 66 ++++++++++++++ app/conferences_active/conference_exec.php | 22 ++++- .../conference_interactive.php | 11 ++- .../conference_interactive_inc.php | 91 ++++++++++--------- app/conferences_active/conferences_active.php | 12 ++- .../conferences_active_inc.php | 17 +++- 6 files changed, 166 insertions(+), 53 deletions(-) create mode 100644 app/conferences_active/app_languages.php diff --git a/app/conferences_active/app_languages.php b/app/conferences_active/app_languages.php new file mode 100644 index 0000000000..793d619dac --- /dev/null +++ b/app/conferences_active/app_languages.php @@ -0,0 +1,66 @@ + + 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-denied']['en-us'] = 'access denied'; + $text['label-interactive']['en-us'] = 'Interactive Conference'; + $text['description-interactive']['en-us'] = 'Use this to monitor and interact with the members of the conference.'; + $text['message-connection']['en-us'] = 'Connection to Event Socket failed.'; + $text['label-message']['en-us'] = 'Message'; + $text['label-tools']['en-us'] = 'Conference Tools'; + $text['button-start-rec']['en-us'] = 'Start Record'; + $text['button-stop-rec']['en-us'] = 'Stop Record'; + $text['label-recording']['en-us'] = 'Recording'; + $text['label-not-recording']['en-us'] = 'Not Recording'; + $text['label-unlock']['en-us'] = 'Unlock'; + $text['label-lock']['en-us'] = 'Lock'; + $text['label-id']['en-us'] = 'ID'; + $text['label-cid-name']['en-us'] = 'Caller ID Name'; + $text['label-cid-num']['en-us'] = 'Caller ID Number'; + $text['label-joined']['en-us'] = 'Joined'; + $text['label-hear']['en-us'] = 'Hear'; + $text['label-speak']['en-us'] = 'Speak'; + $text['label-talking']['en-us'] = 'Talking'; + $text['label-last-talk']['en-us'] = 'Last Talked'; + $text['label-video']['en-us'] = 'Video'; + $text['label-floor']['en-us'] = 'Has Floor'; + $text['label-tool']['en-us'] = 'Tools'; + $text['label-yes']['en-us'] = 'yes'; + $text['label-no']['en-us'] = 'no'; + $text['label-energy']['en-us'] = 'energy'; + $text['label-volume']['en-us'] = 'vol'; + $text['label-gain']['en-us'] = 'gain'; + $text['label-mute']['en-us'] = 'mute'; + $text['label-unmute']['en-us'] = 'unmute'; + $text['label-deaf']['en-us'] = 'deaf'; + $text['label-undeaf']['en-us'] = 'undeaf'; + $text['label-kick']['en-us'] = 'kick'; + $text['label-active']['en-us'] = 'Active Conferences'; + $text['description-active']['en-us'] = 'List all the conferences that are currently active with one or more members.'; + $text['label-name']['en-us'] = 'Name'; + $text['label-member-count']['en-us'] = 'Member Count'; + $text['button-view']['en-us'] = 'view'; + +?> \ No newline at end of file diff --git a/app/conferences_active/conference_exec.php b/app/conferences_active/conference_exec.php index fcf227a2e0..4c018c5a00 100644 --- a/app/conferences_active/conference_exec.php +++ b/app/conferences_active/conference_exec.php @@ -25,6 +25,18 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + The Original Code is FusionPBX + + The Initial Developer of the Original Code is + Mark J Crane + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane + James Rose + */ include "root.php"; require_once "includes/require.php"; @@ -37,6 +49,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 http values and set them as php variables if (count($_GET)>0) { $cmd = trim(check_str($_GET["cmd"])); @@ -52,13 +70,13 @@ else { //authorized; } else { //not found. this command is not authorized - echo "access denied"; + echo $text['message-denied']; exit; } //check if the domain is in the switch_cmd if(stristr($name, $_SESSION['domain_name']) === FALSE) { - echo "access denied"; + echo $text['message-denied']; exit; } diff --git a/app/conferences_active/conference_interactive.php b/app/conferences_active/conference_interactive.php index 543c67fb28..c3b23c4cca 100644 --- a/app/conferences_active/conference_interactive.php +++ b/app/conferences_active/conference_interactive.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 and prepare the conference name $conference_name = check_str(trim($_REQUEST["c"])); $conference_display_name = str_replace("-", " ", $conference_name); @@ -109,8 +116,8 @@ var record_count = 0; echo "
"; echo "\n"; echo " \n"; -echo " \n"; echo " \n"; echo "
Interactive Conference
\n"; -echo " Use this to monitor and interact with the members of the conference.\n"; +echo "
".$text['label-interactive']."
\n"; +echo " ".$text['description-interactive']."\n"; echo "
\n"; diff --git a/app/conferences_active/conference_interactive_inc.php b/app/conferences_active/conference_interactive_inc.php index 203fb831bb..ba6a698f1b 100644 --- a/app/conferences_active/conference_interactive_inc.php +++ b/app/conferences_active/conference_interactive_inc.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 http get or post and set it as php variables $conference_name = check_str($_REQUEST["c"]); @@ -65,7 +72,7 @@ else { $prep_statement->execute(); $row = $prep_statement->fetch(PDO::FETCH_ASSOC); if ($row['num_rows'] == 0) { - echo "access denied"; + echo $text['message-denied']; exit; } } @@ -80,11 +87,11 @@ else { //connect to event socket, send the command and process the results $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if (!$fp) { - $msg = "
Connection to Event Socket failed.
"; + $msg = "
".$text['message-connection']."
"; echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -124,7 +131,7 @@ else { 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 "\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 "\n"; echo "\n"; foreach ($xml->conference->members->member as $row) { @@ -205,72 +212,72 @@ else { echo "\n"; echo "\n"; if ($flag_can_hear == "true") { - echo "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } if ($flag_can_speak == "true") { - echo "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } if ($flag_talking == "true") { - echo "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; if ($flag_has_video == "true") { - echo "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } if ($flag_has_floor == "true") { - echo "\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } echo "\n"; diff --git a/app/conferences_active/conferences_active.php b/app/conferences_active/conferences_active.php index f7872f79b5..16f6557b96 100644 --- a/app/conferences_active/conferences_active.php +++ b/app/conferences_active/conferences_active.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + James Rose */ include "root.php"; require_once "includes/require.php"; @@ -34,6 +35,13 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + + require_once "includes/header.php"; ?>
Message".$text['label-message']."
$msg\n"; if (permission_exists('conferences_active_record') || permission_exists('conferences_active_lock')) { - echo " Conference Tools: \n"; + echo " ".$text['label-tools'].": \n"; } $recording_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.date("Y").'/'.date("M").'/'.date("d"); @@ -138,44 +145,44 @@ else { if (permission_exists('conferences_active_record')) { if ($recording == "true") { - echo " Stop Record \n"; + echo " ".$text['button-stop-rec']." \n"; } else { - echo " Start Record \n"; + echo " ".$text['button-start-rec']." \n"; } } else { if ($recording == "true") { - echo " Recording  "; + echo " ".$text['label-recording']."  "; } else { - echo " Not Recording  "; + echo " ".$text['label-not-recording']."  "; } } if (permission_exists('conferences_active_lock')) { if ($locked == "true") { - echo " Unlock \n"; + echo " ".$text['label-unlock']." \n"; } else { - echo " Lock \n"; + echo " ".$text['label-lock']." \n"; } } echo "
ID".$text['label-id']."UUIDCaller ID NameCaller ID NumberJoinedHearSpeakTalkingLast TalkedVideoHas FloorTools".$text['label-cid-name']."".$text['label-cid-num']."".$text['label-joined']."".$text['label-hear']."".$text['label-speak']."".$text['label-talking']."".$text['label-last-talk']."".$text['label-video']."".$text['label-floor']."".$text['label-tool']."
$caller_id_number".$join_time_formatted."yes".$text['label-yes']."no".$text['label-no']."yes".$text['label-yes']."no".$text['label-no']."yes".$text['label-yes']."no".$text['label-no']."$last_talking_formattedyes".$text['label-yes']."no".$text['label-no']."yes".$text['label-yes']."no".$text['label-no']."\n"; //energy if (permission_exists('conferences_active_energy')) { - echo " +energy \n"; - echo " -energy \n"; + echo " +".$text['label-energy']." \n"; + echo " -".$text['label-energy']." \n"; } //volume if (permission_exists('conferences_active_volume')) { - echo " +vol \n"; - echo " -vol \n"; + echo " +".$text['label-volume']." \n"; + echo " -".$text['label-volume']." \n"; } if (permission_exists('conferences_active_gain')) { - echo " +gain \n"; - echo " -gain \n"; + echo " +".$text['label-gain']." \n"; + echo " -".$text['label-gain']." \n"; } //mute and unmute if (permission_exists('conferences_active_mute')) { if ($flag_can_speak == "true"){ - echo " mute \n"; + echo " ".$text['label-mute']." \n"; } else { - echo " unmute \n"; + echo " ".$text['label-unmute']." \n"; } } //deaf and undeaf if (permission_exists('conferences_active_deaf')) { if ($flag_can_hear == "true"){ - echo " deaf \n"; + echo " ".$text['label-deaf']." \n"; } else { - echo " undeaf \n"; + echo " ".$text['label-undeaf']." \n"; } } //kick someone from the conference if (permission_exists('conferences_active_kick')) { - echo " kick \n"; + echo " ".$text['label-kick']." \n"; } echo "  "; echo "