App->Sip_status, added initial support for translations.

This commit is contained in:
James Rose
2012-11-24 02:45:39 +00:00
parent ccc380fc12
commit bfd9756647
2 changed files with 43 additions and 6 deletions

View File

@@ -0,0 +1,32 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
$text['error-event-socket']['en-us'] = 'Connection to Event Socket failed.';
$text['label-message']['en-us'] = 'Message';
$text['title-sofia-status']['en-us'] = 'sofia status';
$text['title-sofia-status-profile']['en-us'] = 'sofia status profile';
$text['title-status']['en-us'] = 'status';
?>

View File

@@ -22,6 +22,7 @@
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
include "root.php";
require_once "includes/require.php";
@@ -36,7 +37,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']];
}
//define variables
$c = 0;
$row_style["0"] = "row_style0";
@@ -71,13 +76,13 @@ require_once "includes/header.php";
$msg = $_GET["savemsg"];
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if (!$fp) {
$msg = "<div align='center'>Connection to Event Socket failed.<br /></div>";
$msg = "<div align='center'>".$text['error-event-socket']."<br /></div>";
}
if (strlen($msg) > 0) {
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
echo "<th align='left'>Message</th>\n";
echo "<th align='left'>".$text['label-message']."</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='row_style1'><strong>$msg</strong></td>\n";
@@ -100,7 +105,7 @@ if (strlen($msg) > 0) {
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%'>\n";
echo " <b>sofia status</b> \n";
echo " <b>".$text['title-sofia-status']."</b> \n";
echo "</td>\n";
echo "<td width='50%' align='right'>\n";
echo " <input type='button' class='btn' value='Reload ACL' onclick=\"document.location.href='cmd.php?cmd=api+reloadacl';\" />\n";
@@ -174,7 +179,7 @@ if (strlen($msg) > 0) {
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%'>\n";
echo " <b>sofia status profile $sip_profile_name</b> \n";
echo " <b>".$text['title-sofia-status-profile']." $sip_profile_name</b> \n";
echo "</td>\n";
echo "<td width='50%' align='right'>\n";
echo " <input type='button' class='btn' value='registrations' onclick=\"document.location.href='".PROJECT_PATH."/app/registrations/v_status_registrations.php?show_reg=1&profile=".$sip_profile_name."';\" />\n";
@@ -246,7 +251,7 @@ if (strlen($msg) > 0) {
if ($fp && permission_exists('sip_status_switch_status')) {
$cmd = "api status";
$response = event_socket_request($fp, $cmd);
echo "<b>status</b><br />\n";
echo "<b>".$text['title-status']."</b><br />\n";
echo "<pre style=\"font-size: 9pt;\">";
echo trim($response);
echo "</pre>\n";