mirror of https://github.com/itflow-org/itflow
Truncate Client Name on client side nav
This commit is contained in:
parent
21a60c0619
commit
6cb3d8f9d0
|
|
@ -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."...";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue