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

View File

@@ -33,7 +33,16 @@ 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 "includes/header.php";
$page["title"] = $text['title-sip_profiles'];
require_once "includes/paging.php";
//get variables used to control the order
@@ -49,12 +58,12 @@ require_once "includes/paging.php";
echo "<table width='100%' border='0'>\n";
echo " <tr>\n";
echo " <td align='left' width='50%' nowrap='nowrap'><b>Sip Profiles</b></td>\n";
echo " <td align='left' width='50%' nowrap='nowrap'><b>".$text['header-sip_profiles']."</b></td>\n";
echo " <td width='50%' align='right'>&nbsp;</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
echo " Manage settings for SIP profiles.<br /><br />\n";
echo " ".$text['description-sip_profiles']."<br /><br />\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
@@ -78,9 +87,9 @@ require_once "includes/paging.php";
$rows_per_page = 10;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from v_sip_profiles ";
@@ -99,11 +108,11 @@ require_once "includes/paging.php";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('sip_profile_name', 'Name', $order_by, $order);
echo "<th align='left' width='60%'>Description</th>\n";
echo th_order_by('sip_profile_name', $text['label-name'], $order_by, $order);
echo "<th align='left' width='60%'>".$text['label-description']."</th>\n";
echo "<td align='right' width='42'>\n";
if (permission_exists('sip_profile_add')) {
echo " <a href='sip_profiles_edit.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='sip_profiles_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
@@ -115,10 +124,10 @@ require_once "includes/paging.php";
echo " <td valign='top' class='row_stylebg'>".$row['sip_profile_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('sip_profile_edit')) {
echo " <a href='sip_profiles_edit.php?id=".$row['sip_profile_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='sip_profiles_edit.php?id=".$row['sip_profile_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('sip_profile_delete')) {
echo " <a href='sip_profiles_delete.php?id=".$row['sip_profile_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='sip_profiles_delete.php?id=".$row['sip_profile_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@@ -135,7 +144,7 @@ require_once "includes/paging.php";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('sip_profile_add')) {
echo " <a href='sip_profiles_edit.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='sip_profiles_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";