diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php
index bbc7731336..017f262032 100644
--- a/app/dialplan/dialplan_edit.php
+++ b/app/dialplan/dialplan_edit.php
@@ -682,7 +682,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
unset ($prep_statement, $sql);
}
$dialplan_detail_data_mod = ($gateway_name != '') ? str_replace($gateway_uuid, $gateway_name, $dialplan_detail_data) : $dialplan_detail_data;
- echo " \n";
+ echo " \n";
}
echo " \n";
echo "\n";
diff --git a/resources/functions.php b/resources/functions.php
index 0ea7383b51..4acbd5d72c 100644
--- a/resources/functions.php
+++ b/resources/functions.php
@@ -999,4 +999,22 @@ if(!function_exists('validate_email')) {
}
}
}
+
+// ellipsisnicely truncate long text
+if(!function_exists('ellipsis')) {
+ function ellipsis($string, $max_characters, $preserve_word = true) {
+ if ($max_characters+$x >= strlen($string)) { return $string; }
+ if ($preserve_word) {
+ for ($x = 0; $x < strlen($string); $x++) {
+ if ($string{$max_characters+$x} == " ") {
+ return substr($string,0,$max_characters+$x)." ...";
+ }
+ else { continue; }
+ }
+ }
+ else {
+ return substr($string,0,$max_characters)." ...";
+ }
+ }
+}
?>