Bridges: Misc updates, integrate Button class.

This commit is contained in:
Nate 2019-10-12 01:12:59 -06:00
parent 157a5f9a66
commit 2678eb0bb1
11 changed files with 458 additions and 59 deletions

View File

@ -163,67 +163,36 @@
echo " document.getElementById('btn_check_none').style.display = 'none';\n"; echo " document.getElementById('btn_check_none').style.display = 'none';\n";
echo " }\n"; echo " }\n";
echo " }\n"; echo " }\n";
/*
echo " function check_all() {\n";
echo " var inputs = document.getElementsByTagName('input');\n";
echo " for (var i = 0, max = inputs.length; i < max; i++) {\n";
echo " if (inputs[i].type === 'checkbox') {\n";
echo " inputs[i].checked = true;\n";
echo " }\n";
echo " }\n";
echo " document.getElementById('btn_check_all').style.display = 'none';\n";
echo " document.getElementById('btn_check_none').style.display = '';\n";
echo " }\n";
echo " function check_none() {\n";
echo " var inputs = document.getElementsByTagName('input');\n";
echo " for (var i = 0, max = inputs.length; i < max; i++) {\n";
echo " if (inputs[i].type === 'checkbox') {\n";
echo " inputs[i].checked = false;\n";
echo " }\n";
echo " }\n";
echo " document.getElementById('btn_check_all').style.display = '';\n";
echo " document.getElementById('btn_check_none').style.display = 'none';\n";
echo " }\n";
*/
echo "</script>\n"; echo "</script>\n";
//show the content //show the content
echo "<div class='action_bar'>\n"; echo "<div class='action_bar'>\n";
echo " <b style='float: left;'>".$text['title-bridges']." (".$num_rows.")</b>\n"; echo " <b style='float: left;'>".$text['title-bridges']." (".$num_rows.")</b>\n";
if (permission_exists('bridge_add')) { if (permission_exists('bridge_add')) {
echo " <a href='bridge_edit.php' alt=\"".$text['button-add']."\"><button type='button' class='btn btn-default'>".$text['button-add']."</button></a>"; echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'link'=>'bridge_edit.php']);
} }
if (permission_exists('bridge_add') || permission_exists('bridge_edit') || permission_exists('bridge_delete')) { if (permission_exists('bridge_add')) {
/* echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'onclick'=>"if (confirm('".$text['confirm-copy']."')) { set_action('copy'); submit_form('form_list'); } else { this.blur(); return false; }"]);
echo " <button type='button' class='btn btn-default' id='btn_check_all' alt=\"".$text['button-check_all']."\" onclick='check_all();'>".$text['button-check_all']."</button>\n"; }
echo " <button type='button' class='btn btn-default' id='btn_check_none' alt=\"".$text['button-check_none']."\" onclick='check_none();' style='display: none;'>".$text['button-check_none']."</button>\n"; if (permission_exists('bridge_edit')) {
*/ echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'onclick'=>"if (confirm('".$text['confirm-toggle']."')) { set_action('toggle'); submit_form('form_list'); } else { this.blur(); return false; }"]);
if (permission_exists('bridge_add')) { }
echo " <button type='button' class='btn btn-default' alt=\"".$text['button-copy']."\" onclick=\"if (confirm('".$text['confirm-copy']."')) { set_action('copy'); submit_form('form_list'); } else { this.blur(); return false; }\">".$text['button-copy']."</button>"; if (permission_exists('bridge_delete')) {
} echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { set_action('delete'); submit_form('form_list'); } else { this.blur(); return false; }"]);
if (permission_exists('bridge_edit')) {
echo " <button type='button' class='btn btn-default' alt=\"".$text['button-toggle']."\" onclick=\"if (confirm('".$text['confirm-toggle']."')) { set_action('toggle'); submit_form('form_list'); } else { this.blur(); return false; }\">".$text['button-toggle']."</button>";
}
if (permission_exists('bridge_delete')) {
echo " <button type='button' class='btn btn-default' alt=\"".$text['button-delete']."\" onclick=\"if (confirm('".$text['confirm-delete']."')) { set_action('delete'); submit_form('form_list'); } else { this.blur(); return false; }\">".$text['button-delete']."</button>";
}
} }
echo " <span style='white-space: nowrap;'>\n";
if (permission_exists('bridge_all')) { if (permission_exists('bridge_all')) {
if ($_GET['show'] == 'all') { if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>"; echo " <input type='hidden' name='show' value='all'>";
} }
else { else {
echo " <a href='?show=all'><button type='button' class='btn btn-default' style='margin-left: 15px;'>".$text['button-show_all']."</button></a>\n"; echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
} }
} }
echo " <form id='form_search' class='inline' method='get'>\n"; echo "<form id='form_search' class='inline' method='get'>\n";
echo " <input type='text' class='txt' style='width: 150px; margin-left: 15px;' name='search' id='search' value='".escape($search)."' onkeypress='reset_search();'>\n"; echo "<input type='text' class='txt search' name='search' id='search' value='".escape($search)."' placeholder=\"".$text['label-search']."\" onkeydown='reset_search();'>";
echo " <input type='submit' class='btn' id='btn_search' value=\"".$text['button-search']."\" style='".($search != '' ? 'display: none;' : null)."'>\n"; echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
echo " <a href='bridges.php'><input type='button' class='btn' id='btn_reset' value=\"".$text['button-reset']."\" style='".($search == '' ? 'display: none;' : null)."'></a>\n"; echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'bridges.php','style'=>($search == '' ? 'display: none;' : null)]);
echo " </form>\n"; echo "</form>\n";
echo " </span>\n";
echo "</div>\n"; echo "</div>\n";
echo $text['title_description-bridge']."\n"; echo $text['title_description-bridge']."\n";
@ -242,7 +211,7 @@
} }
echo th_order_by('bridge_name', $text['label-bridge_name'], $order_by, $order); echo th_order_by('bridge_name', $text['label-bridge_name'], $order_by, $order);
echo th_order_by('bridge_destination', $text['label-bridge_destination'], $order_by, $order); echo th_order_by('bridge_destination', $text['label-bridge_destination'], $order_by, $order);
echo th_order_by('bridge_enabled', $text['label-bridge_enabled'], $order_by, $order); echo th_order_by('bridge_enabled', $text['label-bridge_enabled'], $order_by, $order, null, "style='text-align: center;'");
echo " <th>".$text['label-description']."</th>\n"; echo " <th>".$text['label-description']."</th>\n";
echo " <td style='width: 1px;'>&nbsp;</td>\n"; echo " <td style='width: 1px;'>&nbsp;</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@ -263,24 +232,22 @@
} }
echo " <td valign='top' class='".$row_style[$c]."'>"; echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('bridge_edit')) { if (permission_exists('bridge_edit')) {
echo " <a ".$tr_link.">".escape($row['bridge_name'])."</a>\n"; echo " <a ".$tr_link." title=\"".$text['button-edit']."\">".escape($row['bridge_name'])."</a>\n";
} }
else { else {
echo " ".escape($row['bridge_name'])."\n"; echo " ".escape($row['bridge_name'])."\n";
} }
echo " </td>\n"; echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['bridge_destination'])."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['bridge_destination'])."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-'.$row['bridge_enabled']]."</td>\n"; echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center;'>";
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['bridge_enabled']],'title'=>$text['button-toggle'],'onclick'=>"check_self('checkbox_".$x."'); set_action('toggle'); submit_form('form_list')"]);
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['bridge_description'])."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['bridge_description'])."</td>\n";
echo " <td style='width: 0;' class='tr_link_void'>"; echo " <td style='width: 0; white-space: nowrap;' class='tr_link_void'>";
/*
if (permission_exists('bridge_edit')) { if (permission_exists('bridge_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo "<a href='bridge_edit.php?id=".escape($row['bridge_uuid'])."' alt='".$text['button-edit']."'>".$v_button_icon_edit."</a>"; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>"bridge_edit.php?id=".escape($row['bridge_uuid'])]);
} }
if (permission_exists('bridge_delete')) {
echo "<button type='input' class='btn btn-default btn-icon' name='bridges[$x][checked]' value='true' alt='".$text['button-delete']."' onclick=\"if (confirm('".$text['confirm-delete']."')) { set_action('delete'); submit_form('form_list'); } else { this.blur(); return false; }\"><span class='fas fa-minus'></span></button>";
}
*/
echo " </td>\n"; echo " </td>\n";
echo "</tr>\n"; echo "</tr>\n";
$c = $c ? 0 : 1; $c = $c ? 0 : 1;
@ -300,6 +267,10 @@
//handle form actions //handle form actions
echo "<script type='text/javascript'>\n"; echo "<script type='text/javascript'>\n";
echo " function check_self(checkbox_id) {\n";
echo " document.getElementById(checkbox_id).checked = true;\n";
echo " }\n";
echo " function set_action(action) {\n"; echo " function set_action(action) {\n";
echo " document.getElementById('action').value = action;\n"; echo " document.getElementById('action').value = action;\n";
echo " }\n"; echo " }\n";

View File

@ -121,6 +121,86 @@ $text['option-voicemail_file_attach']['ru-ru'] = "Прикрепление ау
$text['option-voicemail_file_attach']['sv-se'] = "Ljudfil Bifogad"; $text['option-voicemail_file_attach']['sv-se'] = "Ljudfil Bifogad";
$text['option-voicemail_file_attach']['uk-ua'] = "Приєднати аудіофайл"; $text['option-voicemail_file_attach']['uk-ua'] = "Приєднати аудіофайл";
$text['option-button_icons_auto']['en-us'] = "Automatic";
$text['option-button_icons_auto']['ar-eg'] = "Automatic";
$text['option-button_icons_auto']['de-at'] = "Automatic";
$text['option-button_icons_auto']['de-ch'] = "Automatic";
$text['option-button_icons_auto']['de-de'] = "Automatic";
$text['option-button_icons_auto']['es-cl'] = "Automatic";
$text['option-button_icons_auto']['es-mx'] = "Automatic";
$text['option-button_icons_auto']['fr-ca'] = "Automatic";
$text['option-button_icons_auto']['fr-fr'] = "Automatic";
$text['option-button_icons_auto']['he-il'] = "Automatic";
$text['option-button_icons_auto']['it-it'] = "Automatic";
$text['option-button_icons_auto']['nl-nl'] = "Automatic";
$text['option-button_icons_auto']['pl-pl'] = "Automatic";
$text['option-button_icons_auto']['pt-br'] = "Automatic";
$text['option-button_icons_auto']['pt-pt'] = "Automatic";
$text['option-button_icons_auto']['ro-ro'] = "Automatic";
$text['option-button_icons_auto']['ru-ru'] = "Automatic";
$text['option-button_icons_auto']['sv-se'] = "Automatic";
$text['option-button_icons_auto']['uk-ua'] = "Automatic";
$text['option-button_icons_only']['en-us'] = "Only";
$text['option-button_icons_only']['ar-eg'] = "Only";
$text['option-button_icons_only']['de-at'] = "Only";
$text['option-button_icons_only']['de-ch'] = "Only";
$text['option-button_icons_only']['de-de'] = "Only";
$text['option-button_icons_only']['es-cl'] = "Only";
$text['option-button_icons_only']['es-mx'] = "Only";
$text['option-button_icons_only']['fr-ca'] = "Only";
$text['option-button_icons_only']['fr-fr'] = "Only";
$text['option-button_icons_only']['he-il'] = "Only";
$text['option-button_icons_only']['it-it'] = "Only";
$text['option-button_icons_only']['nl-nl'] = "Only";
$text['option-button_icons_only']['pl-pl'] = "Only";
$text['option-button_icons_only']['pt-br'] = "Only";
$text['option-button_icons_only']['pt-pt'] = "Only";
$text['option-button_icons_only']['ro-ro'] = "Only";
$text['option-button_icons_only']['ru-ru'] = "Only";
$text['option-button_icons_only']['sv-se'] = "Only";
$text['option-button_icons_only']['uk-ua'] = "Only";
$text['option-button_icons_always']['en-us'] = "Always";
$text['option-button_icons_always']['ar-eg'] = "Always";
$text['option-button_icons_always']['de-at'] = "Always";
$text['option-button_icons_always']['de-ch'] = "Always";
$text['option-button_icons_always']['de-de'] = "Always";
$text['option-button_icons_always']['es-cl'] = "Always";
$text['option-button_icons_always']['es-mx'] = "Always";
$text['option-button_icons_always']['fr-ca'] = "Always";
$text['option-button_icons_always']['fr-fr'] = "Always";
$text['option-button_icons_always']['he-il'] = "Always";
$text['option-button_icons_always']['it-it'] = "Always";
$text['option-button_icons_always']['nl-nl'] = "Always";
$text['option-button_icons_always']['pl-pl'] = "Always";
$text['option-button_icons_always']['pt-br'] = "Always";
$text['option-button_icons_always']['pt-pt'] = "Always";
$text['option-button_icons_always']['ro-ro'] = "Always";
$text['option-button_icons_always']['ru-ru'] = "Always";
$text['option-button_icons_always']['sv-se'] = "Always";
$text['option-button_icons_always']['uk-ua'] = "Always";
$text['option-button_icons_never']['en-us'] = "Never";
$text['option-button_icons_never']['ar-eg'] = "Never";
$text['option-button_icons_never']['de-at'] = "Never";
$text['option-button_icons_never']['de-ch'] = "Never";
$text['option-button_icons_never']['de-de'] = "Never";
$text['option-button_icons_never']['es-cl'] = "Never";
$text['option-button_icons_never']['es-mx'] = "Never";
$text['option-button_icons_never']['fr-ca'] = "Never";
$text['option-button_icons_never']['fr-fr'] = "Never";
$text['option-button_icons_never']['he-il'] = "Never";
$text['option-button_icons_never']['it-it'] = "Never";
$text['option-button_icons_never']['nl-nl'] = "Never";
$text['option-button_icons_never']['pl-pl'] = "Never";
$text['option-button_icons_never']['pt-br'] = "Never";
$text['option-button_icons_never']['pt-pt'] = "Never";
$text['option-button_icons_never']['ro-ro'] = "Never";
$text['option-button_icons_never']['ru-ru'] = "Never";
$text['option-button_icons_never']['sv-se'] = "Never";
$text['option-button_icons_never']['uk-ua'] = "Never";
$text['message-toggled']['en-us'] = "Toggle Completed"; $text['message-toggled']['en-us'] = "Toggle Completed";
$text['message-toggled']['ar-eg'] = "الانتهاء من تبديل"; $text['message-toggled']['ar-eg'] = "الانتهاء من تبديل";
$text['message-toggled']['de-at'] = "Toggle Completed"; //copied from de-de $text['message-toggled']['de-at'] = "Toggle Completed"; //copied from de-de

View File

@ -570,6 +570,14 @@
elseif ($category == "theme" && $subcategory == "custom_css_code" && $name == "text" ) { elseif ($category == "theme" && $subcategory == "custom_css_code" && $name == "text" ) {
echo " <textarea class='formfld' style='min-width: 100%; height: 300px; font-family: courier, monospace; overflow: auto; resize: vertical' id='default_setting_value' name='default_setting_value' wrap='off'>".$default_setting_value."</textarea>\n"; echo " <textarea class='formfld' style='min-width: 100%; height: 300px; font-family: courier, monospace; overflow: auto; resize: vertical' id='default_setting_value' name='default_setting_value' wrap='off'>".$default_setting_value."</textarea>\n";
} }
elseif ($category == "theme" && $subcategory == "button_icons" && $name == "text" ) {
echo " <select class='formfld' id='default_setting_value' name='default_setting_value'>\n";
echo " <option value='auto'>".$text['option-button_icons_auto']."</option>\n";
echo " <option value='only' ".($default_setting_value == "only" ? "selected='selected'" : null).">".$text['option-button_icons_only']."</option>\n";
echo " <option value='always' ".($default_setting_value == "always" ? "selected='selected'" : null).">".$text['option-button_icons_always']."</option>\n";
echo " <option value='never' ".($default_setting_value == "never" ? "selected='selected'" : null).">".$text['option-button_icons_never']."</option>\n";
echo " </select>\n";
}
elseif ($category == "voicemail" && $subcategory == "voicemail_file" && $name == "text" ) { elseif ($category == "voicemail" && $subcategory == "voicemail_file" && $name == "text" ) {
echo " <select class='formfld' id='default_setting_value' name='default_setting_value'>\n"; echo " <select class='formfld' id='default_setting_value' name='default_setting_value'>\n";
echo " <option value='listen' ".(($default_setting_value == "listen") ? "selected='selected'" : null).">".$text['option-voicemail_file_listen']."</option>\n"; echo " <option value='listen' ".(($default_setting_value == "listen") ? "selected='selected'" : null).">".$text['option-voicemail_file_listen']."</option>\n";

View File

@ -414,6 +414,9 @@
else if ($subcategory == 'password' || substr_count($subcategory, '_password') > 0 || $category == "login" && $subcategory == "password_reset_key" && $name == "text" || substr_count($subcategory, '_secret') > 0) { else if ($subcategory == 'password' || substr_count($subcategory, '_password') > 0 || $category == "login" && $subcategory == "password_reset_key" && $name == "text" || substr_count($subcategory, '_secret') > 0) {
echo " ".str_repeat('*', strlen($row['default_setting_value'])); echo " ".str_repeat('*', strlen($row['default_setting_value']));
} }
else if ($category == 'theme' && $subcategory == 'button_icons' && $name == 'text') {
echo " ".$text['option-button_icons_'.$row['default_setting_value']]."\n";
}
else { else {
if ($category == "theme" && substr_count($subcategory, "_color") > 0 && ($name == "text" || $name == 'array')) { if ($category == "theme" && substr_count($subcategory, "_color") > 0 && ($name == "text" || $name == 'array')) {
echo " ".(img_spacer('15px', '15px', 'background: '.escape($row['default_setting_value']).'; margin-right: 4px; vertical-align: middle; border: 1px solid '.(color_adjust($row['default_setting_value'], -0.18)).'; padding: -1px;')); echo " ".(img_spacer('15px', '15px', 'background: '.escape($row['default_setting_value']).'; margin-right: 4px; vertical-align: middle; border: 1px solid '.(color_adjust($row['default_setting_value'], -0.18)).'; padding: -1px;'));

View File

@ -654,6 +654,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " <option value='right' ".(($row['domain_setting_value'] == "right") ? "selected='selected'" : null).">".$text['label-right']."</option>\n"; echo " <option value='right' ".(($row['domain_setting_value'] == "right") ? "selected='selected'" : null).">".$text['label-right']."</option>\n";
echo " </select>\n"; echo " </select>\n";
} }
elseif ($category == "theme" && $subcategory == "custom_css_code" && $name == "text" ) {
echo " <textarea class='formfld' style='min-width: 100%; height: 300px; font-family: courier, monospace; overflow: auto; resize: vertical' id='domain_setting_value' name='domain_setting_value' wrap='off'>".$row['domain_setting_value']."</textarea>\n";
}
elseif ($category == "theme" && $subcategory == "button_icons" && $name == "text" ) {
echo " <select class='formfld' id='domain_setting_value' name='domain_setting_value'>\n";
echo " <option value='auto'>".$text['option-button_icons_auto']."</option>\n";
echo " <option value='only' ".($row['domain_setting_value'] == "only" ? "selected='selected'" : null).">".$text['option-button_icons_only']."</option>\n";
echo " <option value='always' ".($row['domain_setting_value'] == "always" ? "selected='selected'" : null).">".$text['option-button_icons_always']."</option>\n";
echo " <option value='never' ".($row['domain_setting_value'] == "never" ? "selected='selected'" : null).">".$text['option-button_icons_never']."</option>\n";
echo " </select>\n";
}
else { else {
echo " <input class='formfld' type='text' id='domain_setting_value' name='domain_setting_value' value=\"".escape($row['domain_setting_value'])."\">\n"; echo " <input class='formfld' type='text' id='domain_setting_value' name='domain_setting_value' value=\"".escape($row['domain_setting_value'])."\">\n";
} }

View File

@ -416,6 +416,9 @@
else if ($subcategory == 'password' || substr_count($subcategory, '_password') > 0 || $category == "login" && $subcategory == "password_reset_key" && $name == "text") { else if ($subcategory == 'password' || substr_count($subcategory, '_password') > 0 || $category == "login" && $subcategory == "password_reset_key" && $name == "text") {
echo " ".str_repeat('*', strlen(escape($row['domain_setting_value']))); echo " ".str_repeat('*', strlen(escape($row['domain_setting_value'])));
} }
else if ($category == 'theme' && $subcategory == 'button_icons' && $name == 'text') {
echo " ".$text['option-button_icons_'.$row['domain_setting_value']]."\n";
}
else { else {
if ($category == "theme" && substr_count($subcategory, "_color") > 0 && ($name == "text" || $name == 'array')) { if ($category == "theme" && substr_count($subcategory, "_color") > 0 && ($name == "text" || $name == 'array')) {
echo " ".(img_spacer('15px', '15px', 'background: '.escape($row['domain_setting_value']).'; margin-right: 4px; vertical-align: middle; border: 1px solid '.(color_adjust($row['domain_setting_value'], -0.18)).'; padding: -1px;')); echo " ".(img_spacer('15px', '15px', 'background: '.escape($row['domain_setting_value']).'; margin-right: 4px; vertical-align: middle; border: 1px solid '.(color_adjust($row['domain_setting_value'], -0.18)).'; padding: -1px;'));

View File

@ -101,6 +101,87 @@ $text['title-domain-add']['ru-ru'] = "Добавить домен";
$text['title-domain-add']['sv-se'] = "Lägg Till Domän"; $text['title-domain-add']['sv-se'] = "Lägg Till Domän";
$text['title-domain-add']['uk-ua'] = "Новий домен"; $text['title-domain-add']['uk-ua'] = "Новий домен";
$text['option-button_icons_auto']['en-us'] = "Automatic";
$text['option-button_icons_auto']['ar-eg'] = "Automatic";
$text['option-button_icons_auto']['de-at'] = "Automatic";
$text['option-button_icons_auto']['de-ch'] = "Automatic";
$text['option-button_icons_auto']['de-de'] = "Automatic";
$text['option-button_icons_auto']['es-cl'] = "Automatic";
$text['option-button_icons_auto']['es-mx'] = "Automatic";
$text['option-button_icons_auto']['fr-ca'] = "Automatic";
$text['option-button_icons_auto']['fr-fr'] = "Automatic";
$text['option-button_icons_auto']['he-il'] = "Automatic";
$text['option-button_icons_auto']['it-it'] = "Automatic";
$text['option-button_icons_auto']['nl-nl'] = "Automatic";
$text['option-button_icons_auto']['pl-pl'] = "Automatic";
$text['option-button_icons_auto']['pt-br'] = "Automatic";
$text['option-button_icons_auto']['pt-pt'] = "Automatic";
$text['option-button_icons_auto']['ro-ro'] = "Automatic";
$text['option-button_icons_auto']['ru-ru'] = "Automatic";
$text['option-button_icons_auto']['sv-se'] = "Automatic";
$text['option-button_icons_auto']['uk-ua'] = "Automatic";
$text['option-button_icons_only']['en-us'] = "Only";
$text['option-button_icons_only']['ar-eg'] = "Only";
$text['option-button_icons_only']['de-at'] = "Only";
$text['option-button_icons_only']['de-ch'] = "Only";
$text['option-button_icons_only']['de-de'] = "Only";
$text['option-button_icons_only']['es-cl'] = "Only";
$text['option-button_icons_only']['es-mx'] = "Only";
$text['option-button_icons_only']['fr-ca'] = "Only";
$text['option-button_icons_only']['fr-fr'] = "Only";
$text['option-button_icons_only']['he-il'] = "Only";
$text['option-button_icons_only']['it-it'] = "Only";
$text['option-button_icons_only']['nl-nl'] = "Only";
$text['option-button_icons_only']['pl-pl'] = "Only";
$text['option-button_icons_only']['pt-br'] = "Only";
$text['option-button_icons_only']['pt-pt'] = "Only";
$text['option-button_icons_only']['ro-ro'] = "Only";
$text['option-button_icons_only']['ru-ru'] = "Only";
$text['option-button_icons_only']['sv-se'] = "Only";
$text['option-button_icons_only']['uk-ua'] = "Only";
$text['option-button_icons_always']['en-us'] = "Always";
$text['option-button_icons_always']['ar-eg'] = "Always";
$text['option-button_icons_always']['de-at'] = "Always";
$text['option-button_icons_always']['de-ch'] = "Always";
$text['option-button_icons_always']['de-de'] = "Always";
$text['option-button_icons_always']['es-cl'] = "Always";
$text['option-button_icons_always']['es-mx'] = "Always";
$text['option-button_icons_always']['fr-ca'] = "Always";
$text['option-button_icons_always']['fr-fr'] = "Always";
$text['option-button_icons_always']['he-il'] = "Always";
$text['option-button_icons_always']['it-it'] = "Always";
$text['option-button_icons_always']['nl-nl'] = "Always";
$text['option-button_icons_always']['pl-pl'] = "Always";
$text['option-button_icons_always']['pt-br'] = "Always";
$text['option-button_icons_always']['pt-pt'] = "Always";
$text['option-button_icons_always']['ro-ro'] = "Always";
$text['option-button_icons_always']['ru-ru'] = "Always";
$text['option-button_icons_always']['sv-se'] = "Always";
$text['option-button_icons_always']['uk-ua'] = "Always";
$text['option-button_icons_never']['en-us'] = "Never";
$text['option-button_icons_never']['ar-eg'] = "Never";
$text['option-button_icons_never']['de-at'] = "Never";
$text['option-button_icons_never']['de-ch'] = "Never";
$text['option-button_icons_never']['de-de'] = "Never";
$text['option-button_icons_never']['es-cl'] = "Never";
$text['option-button_icons_never']['es-mx'] = "Never";
$text['option-button_icons_never']['fr-ca'] = "Never";
$text['option-button_icons_never']['fr-fr'] = "Never";
$text['option-button_icons_never']['he-il'] = "Never";
$text['option-button_icons_never']['it-it'] = "Never";
$text['option-button_icons_never']['nl-nl'] = "Never";
$text['option-button_icons_never']['pl-pl'] = "Never";
$text['option-button_icons_never']['pt-br'] = "Never";
$text['option-button_icons_never']['pt-pt'] = "Never";
$text['option-button_icons_never']['ro-ro'] = "Never";
$text['option-button_icons_never']['ru-ru'] = "Never";
$text['option-button_icons_never']['sv-se'] = "Never";
$text['option-button_icons_never']['uk-ua'] = "Never";
$text['message-delete_failed']['en-us'] = "No Settings Checked"; $text['message-delete_failed']['en-us'] = "No Settings Checked";
$text['message-delete_failed']['ar-eg'] = ""; $text['message-delete_failed']['ar-eg'] = "";
$text['message-delete_failed']['de-at'] = "Keine Einstellungen ausgewählt"; //copied from de-de $text['message-delete_failed']['de-at'] = "Keine Einstellungen ausgewählt"; //copied from de-de

View File

@ -0,0 +1,87 @@
<?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>
Copyright (C) 2010 - 2019
All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
if (!class_exists('button')) {
class button {
static function create($array) {
$button_icons = $_SESSION['theme']['button_icons']['text'] != '' ? $_SESSION['theme']['button_icons']['text'] : 'auto';
//button: open
$button = "<button ";
$button .= "type='".($array['type'] ? $array['type'] : 'button')."' ";
$button .= $array['name'] ? "name=\"".$array['name']."\" " : null;
$button .= $array['value'] ? "value=\"".$array['value']."\" " : null;
$button .= $array['id'] ? "id=\"".$array['id']."\" " : null;
$button .= $array['label'] ? "alt=\"".$array['label']."\" " : ($array['title'] ? "alt=\"".$array['title']."\" " : null);
if ($button_icons == 'only' || $button_icons == 'auto' || $array['title']) {
$button .= "title=\"".($array['title'] ? $array['title'] : $array['label'])."\" ";
}
$button .= $array['onclick'] ? "onclick=\"".$array['onclick']."\" " : null;
$button .= "class='btn btn-".($array['class'] ? $array['class'] : 'default')."' ";
$button .= "style='margin-left: 2px; margin-right: 2px; ".($array['style'] ? $array['style'] : null)."' ";
$button .= ">";
//icon
if ($array['icon'] && (
$button_icons == 'only' ||
$button_icons == 'always' ||
$button_icons == 'auto' ||
!$array['label']
)) {
$icon_class = is_array($array['icon']) ? $array['icon']['text'] : 'fas fa-'.$array['icon'];
$button .= "<span class='".$icon_class."'></span>";
}
//label
if ($array['label'] && (
$button_icons != 'only' ||
!$array['icon'] ||
$array['class'] == 'link'
)) {
$hide_class = $array['icon'] && $button_icons != 'always' && $button_icons != 'never' ? 'hide-sm' : null;
$pad_class = $array['icon'] ? 'pad' : null;
$button .= "<span class='button-label ".$hide_class." ".$pad_class."'>".$array['label']."</span>";
}
//button: close
$button .= "</button>";
//link
if ($array['link']) {
$button = "<a href='".$array['link']."' target=\"".($array['target'] ? $array['target'] : '_self')."\">".$button."</a>";
}
return $button;
unset($button);
}
}
}
/*
//usage example (all possible options)
echo button::create(['type'=>'button','label'=>$label,'icon'=>'icon','name'=>'btn','id'=>'btn','value'=>'value','link'=>'url','target'=>'_blank','onclick'=>'action','class'=>'name','style'=>'css','title'=>'title']);
*/
?>

View File

@ -1685,5 +1685,125 @@
$apps[$x]['default_settings'][$y]['default_setting_value'] = "rgba(255,255,255,0.9)"; $apps[$x]['default_settings'][$y]['default_setting_value'] = "rgba(255,255,255,0.9)";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Sets the background color/opacity/image of the Action Bar."; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Sets the background color/opacity/image of the Action Bar.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "529d314f-8ab6-44d0-9e51-b742d411b81c";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "list_row_edit_button";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Controls the visibility of the Edit button on record lists.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "f2e628e9-246b-4438-8fc6-4ffa6ff32bee";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icons";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "only";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Controls button icon visibility.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "69a90642-b96c-4442-9406-e6cf52ae5a86";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_add";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-plus";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5c4cea93-f7bf-43a7-814a-c85514dfd418";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_all";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-globe";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "323c6399-4b8c-4aad-899d-c9ff96431efc";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_copy";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-copy";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "05dc743a-fce4-4ef7-a9f5-fb183aeb956a";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_delete";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-trash";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "819b73bf-bb19-4949-b105-75e83915709f";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_download";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-cloud-download-alt";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a70c6ea6-3912-4f6a-8a22-6181df4bebc3";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_edit";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-pencil-alt";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "08c28cca-f73f-4e78-9832-dc22326953dd";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_pause";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-pause";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "38ed0366-c88f-407d-9060-72008cab351a";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_play";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-play";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7bab71e0-1f42-499d-9f13-0600c71f3f50";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_reset";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-undo-alt";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5c49d82e-f483-4b2a-b3af-6e8ba8cfa5db";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_search";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-search";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "ccfc5c6a-4946-496d-b1aa-45dfb35588f7";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_stop";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-stop";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "87576b6d-3971-47e9-a01c-b90636ef32dc";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_toggle";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-toggle-on";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "23866297-d0e4-4768-a843-4ac1cb4c23e8";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "theme";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "button_icon_view";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "fas fa-eye";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "";
?> ?>

View File

@ -637,6 +637,7 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
color: <?php echo ($_SESSION['theme']['button_text_color_hover']['text'] != '') ? $_SESSION['theme']['button_text_color_hover']['text'] : '#ffffff'; ?>; color: <?php echo ($_SESSION['theme']['button_text_color_hover']['text'] != '') ? $_SESSION['theme']['button_text_color_hover']['text'] : '#ffffff'; ?>;
} }
/* remove (along with icons in theme/default/config.php) after transition to button class */
button.btn-icon { button.btn-icon {
margin: 0 2px; margin: 0 2px;
white-space: nowrap; white-space: nowrap;
@ -697,6 +698,26 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
opacity: 1.0; opacity: 1.0;
} }
<?php if ($_SESSION['theme']['button_icons']['text'] == 'always' || $_SESSION['theme']['button_icons']['text'] == 'auto' || !$_SESSION['theme']['button_icons']['text']) { ?>
button:not(.btn-link) > span.button-label.pad {
margin-left: 6px;
}
<?php } ?>
/* small screen, hide button labels if icons present */
@media (max-width: 990px) {
button:not(.btn-link) > span.button-label.hide-sm {
display: none;
}
}
/* large screen show button labels if icons present */
@media (min-width: 991px) {
button:not(.btn-link) > span.button-label.hide-sm {
display: inline;
}
}
/* ICONS *********************************************************************/ /* ICONS *********************************************************************/
span.icon_body { span.icon_body {
@ -1210,6 +1231,20 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
display: none; display: none;
} }
/* expand search input on focus */
input[type=text].search {
width: 70px;
min-width: 70px;
margin-left: 15px;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
transition: all .5s ease;
}
input[type=text].search:focus {
width: 150px;
}
input.fileinput { input.fileinput {
padding: 1px; padding: 1px;
display: inline; display: inline;

View File

@ -217,7 +217,7 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
}); });
//autosize jquery autosize plugin on applicable input fields //autosize jquery autosize plugin on applicable input fields
$("input[type=text].txt,input[type=number].txt,input[type=password].txt,input[type=text].formfld,input[type=number].formfld,input[type=password].formfld").not('.datepicker,.datetimepicker,.datetimesecpicker').autosizeInput(); $("input[type=text].txt.auto-size,input[type=number].txt.auto-size,input[type=password].txt.auto-size,input[type=text].formfld.auto-size,input[type=number].formfld.auto-size,input[type=password].formfld.auto-size").autosizeInput();
//initialize bootstrap tempusdominus (calendar/datetime picker) plugin //initialize bootstrap tempusdominus (calendar/datetime picker) plugin
$(function() { $(function() {