Skip to content
Snippets Groups Projects
Commit 6a3954b0 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

remove adminFormat text and use standart format

parent b2cb24f6
Branches
Tags
3 merge requests!999Master,!998Stable,!993Hotline #23975 cut rating comments
......@@ -284,30 +284,19 @@ class ZendAfi_View_Helper_Avis extends ZendAfi_View_Helper_BaseHelper {
protected function _formatTextAvis($avis) {
return $avis->getAbonOuBib() ?
$this->_formatAdminText($avis) :
$this->_formatWithTruncate($this->view->escape($avis->getAvis()));
}
protected function _formatAdminText($avis) {
$value = $avis->getAvis();
if ($this->_is_html($value) && $this->_limit_nb_word) {
$value = str_replace(['<br>', '<br/>', '<br />'], "\n", $value);
return $this->_formatWithTruncate(strip_tags($value));
}
return ['text_avis' => nl2br($value), 'lire_la_suite' => false];
return $this->_formatWithTruncate($this->view->escape(strip_tags($avis->getAvis())));
}
protected function _formatWithTruncate($txt_avis) {
if (($this->_limit_nb_word <= 0)
|| count($words = explode(' ', $txt_avis)) <= $this->_limit_nb_word)
return ['text_avis' => nl2br($txt_avis), 'lire_la_suite' => false];
return ['text_avis' => nl2br($txt_avis),
'lire_la_suite' => false];
$txt_avis = implode(' ', array_slice($words, 0, $this->_limit_nb_word));
return ['text_avis' => nl2br($txt_avis) . ' [...]', 'lire_la_suite' => true];
return ['text_avis' => nl2br($txt_avis) . ' [...]',
'lire_la_suite' => true];
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment