mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 10:54:52 +00:00
Truncate Client Name on client side nav
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<aside class="main-sidebar sidebar-dark-<?php echo nullable_htmlentities($config_theme); ?> d-print-none">
|
||||
|
||||
<a class="brand-link pb-1 mt-1" href="clients.php">
|
||||
<p class="h5"><i class="nav-icon fas fa-arrow-left ml-3 mr-2"></i> Back | <strong><?php echo initials($client_name); ?></strong></p>
|
||||
<p class="h5"><i class="nav-icon fas fa-arrow-left ml-3 mr-2"></i> Back | <strong><?php echo truncate($client_name,11); ?></strong></p>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
|
||||
@@ -192,7 +192,10 @@ function truncate($text, $chars) {
|
||||
}
|
||||
$text = $text." ";
|
||||
$text = substr($text, 0, $chars);
|
||||
$text = substr($text, 0, strrpos($text, ' '));
|
||||
$lastSpacePos = strrpos($text, ' ');
|
||||
if ($lastSpacePos !== false) {
|
||||
$text = substr($text, 0, $lastSpacePos);
|
||||
}
|
||||
return $text."...";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user