diff --git a/app/Helper/Text.php b/app/Helper/Text.php index 790fc411b..4b8e99bd3 100644 --- a/app/Helper/Text.php +++ b/app/Helper/Text.php @@ -41,25 +41,6 @@ class Text extends \Core\Base return round(pow(1024, $base - floor($base)), $precision).$suffixes[(int)floor($base)]; } - /** - * Truncate a long text - * - * @param string $value Text - * @param integer $max_length Max Length - * @param string $end Text end - * @return string - */ - public function truncate($value, $max_length = 85, $end = '[...]') - { - $length = mb_strlen($value); - - if ($length > $max_length) { - return mb_substr($value, 0, $max_length).' '.$end; - } - - return $value; - } - /** * Return true if needle is contained in the haystack * diff --git a/app/Template/user/last.php b/app/Template/user/last.php index ab25f79b9..8097d6f1e 100644 --- a/app/Template/user/last.php +++ b/app/Template/user/last.php @@ -5,11 +5,11 @@
= t('Never connected.') ?>
-| = t('Login date') ?> | -= t('Authentication method') ?> | -= t('IP address') ?> | += t('Login date') ?> | += t('Authentication method') ?> | += t('IP address') ?> | = t('User agent') ?> | = dt('%B %e, %Y at %k:%M %p', $login['date_creation']) ?> | = $this->e($login['auth_type']) ?> | = $this->e($login['ip']) ?> | -= $this->e($this->text->truncate($login['user_agent'])) ?> | += $this->e($login['user_agent']) ?> |
|---|
= t('No session.') ?>
-| = t('Creation date') ?> | -= t('Expiration date') ?> | -= t('IP address') ?> | += t('Creation date') ?> | += t('Expiration date') ?> | += t('IP address') ?> | = t('User agent') ?> | -= t('Action') ?> | += t('Action') ?> |
|---|---|---|---|---|---|---|---|---|
| = dt('%B %e, %Y at %k:%M %p', $session['date_creation']) ?> | = dt('%B %e, %Y at %k:%M %p', $session['expiration']) ?> | = $this->e($session['ip']) ?> | -= $this->e($this->text->truncate($session['user_agent'])) ?> | += $this->e($session['user_agent']) ?> | = $this->url->link(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?> |