Multilinguified SIP Profiles

This commit is contained in:
Nate Jones
2013-06-06 20:34:18 +00:00
parent 1073ff0dd5
commit 42359137e8
8 changed files with 159 additions and 73 deletions
+20 -13
View File
@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@@ -57,8 +63,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
//if (strlen($sip_profile_name) == 0) { $msg .= "Please provide: Name<br>\n"; }
//if (strlen($sip_profile_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
//if (strlen($sip_profile_name) == 0) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
//if (strlen($sip_profile_description) == 0) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -113,11 +119,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=sip_profiles.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($_POST["persistformvar"] != "true")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
@@ -138,6 +144,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-sip_profile'];
//show the content
echo "<div align='center'>";
@@ -150,37 +157,37 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>Sip Profile</b></td>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-sip_profile']."</b></td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='copy' onclick=\"if (confirm('Do you really want to copy this?')){window.location='sip_profile_copy.php?id=".$sip_profile_uuid."';}\" value='Copy'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='sip_profiles.php'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"if (confirm('".$text['confirm-copy']."')){window.location='sip_profile_copy.php?id=".$sip_profile_uuid."';}\" value='".$text['button-copy']."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='sip_profiles.php'\" value='".$text['button-back']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "Manage settings for the SIP profile.<br /><br />\n";
echo $text['description-sip_profiles']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Name:\n";
echo " ".$text['label-name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='sip_profile_name' maxlength='255' value=\"$sip_profile_name\">\n";
echo "<br />\n";
echo "Enter the SIP Profile name.\n";
echo $text['description-name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Description:\n";
echo " ".$text['label-description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='sip_profile_description' maxlength='255' value=\"$sip_profile_description\">\n";
echo "<br />\n";
echo "Enter the description.\n";
echo $text['description-description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
@@ -188,7 +195,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='sip_profile_uuid' value='$sip_profile_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";