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">
|
<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">
|
<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>
|
</a>
|
||||||
|
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
|
|||||||
@@ -192,7 +192,10 @@ function truncate($text, $chars) {
|
|||||||
}
|
}
|
||||||
$text = $text." ";
|
$text = $text." ";
|
||||||
$text = substr($text, 0, $chars);
|
$text = substr($text, 0, $chars);
|
||||||
$text = substr($text, 0, strrpos($text, ' '));
|
$lastSpacePos = strrpos($text, ' ');
|
||||||
|
if ($lastSpacePos !== false) {
|
||||||
|
$text = substr($text, 0, $lastSpacePos);
|
||||||
|
}
|
||||||
return $text."...";
|
return $text."...";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user