diff --git a/library/Class/Calendar.php b/library/Class/Calendar.php index cf329ae6408fee8b32c8d91519465ae24bfae9a2..ba42b8aa436a21b323483cebe2fa8614018d1286 100644 --- a/library/Class/Calendar.php +++ b/library/Class/Calendar.php @@ -417,7 +417,7 @@ class Class_Calendar { // Filtre titre $libelle = $news->getTitre(); - $news_li_html.='<li>'.$this->formateDateZend($news).' '. + $news_li_html.='<li>'.$this->_view->tagArticleEvent($news).' '. $event_info. '<br />'. '<a class="calendar_event_title" href="'.BASE_URL.'/opac/cms/articleview/id/'.$news->getId().'" target="_parent">'.$libelle.'</a></li>'; @@ -431,15 +431,6 @@ class Class_Calendar { } - // Pour l'affichage - public function formateDateZend($news) { - if (!isset($this->_article_event_helper)) { - $this->_article_event_helper = $this->_view->getHelper('TagArticleEvent'); - } - return $this->_article_event_helper->tagArticleEvent($news); - } - - function getURL($type,$jour = "") { switch($type) { case "LAST_MONTH" : diff --git a/library/ZendAfi/View/Helper/Accueil/Base.php b/library/ZendAfi/View/Helper/Accueil/Base.php index 05178542fe6891e0c01b0707b21fcbcb199c55fe..ce31a05af710926b133b2f43d46c20d10e43ada8 100644 --- a/library/ZendAfi/View/Helper/Accueil/Base.php +++ b/library/ZendAfi/View/Helper/Accueil/Base.php @@ -173,16 +173,6 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac } -//--------------------------------------------------------------------- -// Réduit la largeur du titre pour une boite à gauche -//--------------------------------------------------------------------- - protected function fixLibelleBoiteGauche($libelle) - { - if(strlen($libelle) > 35) $titre_fix = substr($libelle,0,35).'...'; - else $titre_fix = $libelle; - return ($titre_fix); - } - //--------------------------------------------------------------------- // Rend l'objet d'acces aux proprietes //--------------------------------------------------------------------- diff --git a/library/ZendAfi/View/Helper/Accueil/News.php b/library/ZendAfi/View/Helper/Accueil/News.php index c41ee9e5382044f0c1aa8b9ed34bb41ec2353b4a..f9bdb65350602d99514294cdf352e8d3a72eebae 100644 --- a/library/ZendAfi/View/Helper/Accueil/News.php +++ b/library/ZendAfi/View/Helper/Accueil/News.php @@ -58,10 +58,10 @@ class ZendAfi_View_Helper_Accueil_News extends ZendAfi_View_Helper_Accueil_Base $this->id_module, $this->getArticles(Class_Article::filterByLocaleAndWorkflow($articles, $this->preferences['status']))); - $this->titre = $this->getHtmlTitre(); + $this->titre = $this->getHtmlTitre(); - if ($this->preferences['rss_avis']) - $this->rss_interne = $this->_getRSSurl('cms', 'rss'); + if ($this->preferences['rss_avis']) + $this->rss_interne = $this->_getRSSurl('cms', 'rss'); return $this->getHtmlArray(); } @@ -69,23 +69,22 @@ class ZendAfi_View_Helper_Accueil_News extends ZendAfi_View_Helper_Accueil_Base protected function addNewsAddButton($articles) { return $this->view->tagAnchor($this->view->url(['module' => 'admin', - 'controller' => 'cms', + 'controller' => 'cms', 'action' => 'newsadd', 'id_module' => $this->id_module, - 'id_cat' => $this->getArticleCategorie($articles)]), + 'id_cat' => $this->getFirstArticleCategorie($articles)]), $this->view->tagImg(URL_ADMIN_IMG.'ico/add.gif',['title' => $this->view->_('Ajouter un nouvel article')]), ['data-popup' => 'true', 'class' => 'newsadd']); - } + } - protected function getArticleCategorie($articles) { - if (!$articles) return ''; - if(is_array($articles)){ - foreach($articles as $article) { - if($id_cat = $article->getIdCat()) - return $id_cat; - } + protected function getFirstArticleCategorie($articles) { + if (!$articles || !is_array($articles)) return ''; + + foreach($articles as $article) { + if($id_cat = $article->getIdCat()) + return $id_cat; } } @@ -94,13 +93,12 @@ class ZendAfi_View_Helper_Accueil_News extends ZendAfi_View_Helper_Accueil_Base if (strlen(trim($this->preferences['titre']))==0) return ''; - $titre = sprintf('<a href="%s">%s</a>', - $this->view->url(['controller' => 'cms', - 'action' => 'articleviewselection', - 'id_module' => $this->id_module]), - $this->preferences['titre']); + return sprintf('<a href="%s">%s</a>', + $this->view->url(['controller' => 'cms', + 'action' => 'articleviewselection', + 'id_module' => $this->id_module]), + $this->preferences['titre']); - return $titre; } //--------------------------------------------------------------------- @@ -144,9 +142,6 @@ class ZendAfi_View_Helper_Accueil_News extends ZendAfi_View_Helper_Accueil_Base $content = $article->getFullContent(); } - if ($this->division==1) - $title = $this->fixLibelleBoiteGauche($title); - $html .= '<h2>'; if (!$article->getCacherTitre() or $this->preferences["display_titles_only"]) $html .= $this->view->tagAnchor($this->view->url($article->getUrl()), $title); diff --git a/library/ZendAfi/View/Helper/Accueil/Rss.php b/library/ZendAfi/View/Helper/Accueil/Rss.php index 7e2af5676ef7af5bdd6fec69a596e8f99a430546..1cb6721bab045e65e9c5176c28126e983e1b5afc 100644 --- a/library/ZendAfi/View/Helper/Accueil/Rss.php +++ b/library/ZendAfi/View/Helper/Accueil/Rss.php @@ -109,7 +109,6 @@ class ZendAfi_View_Helper_Accueil_Rss extends ZendAfi_View_Helper_Accueil_Base { */ protected function _getOneRssHtml($channel) { if (1 == $this->division) { - $channel->setTitre($this->fixLibelleBoiteGauche($channel->getTitre())); $channel->setDescription($this->extractHeader($channel->getDescription())); } diff --git a/library/ZendAfi/View/Helper/Accueil/Sito.php b/library/ZendAfi/View/Helper/Accueil/Sito.php index 758934416c6a5ff9832493aec2c02bdf5b2561f1..e80eb4694d38547d0e5d6447ab5be062abf8315d 100644 --- a/library/ZendAfi/View/Helper/Accueil/Sito.php +++ b/library/ZendAfi/View/Helper/Accueil/Sito.php @@ -138,7 +138,6 @@ class ZendAfi_View_Helper_Accueil_Sito extends ZendAfi_View_Helper_Accueil_Base protected function renderSite($site) { if($this->division == 1) { - $site->setTitre($this->fixLibelleBoiteGauche($site->getTitre())); $site->setDescription($this->extractHeader($site->getDescription())); } diff --git a/library/ZendAfi/View/Helper/CalendarContent.php b/library/ZendAfi/View/Helper/CalendarContent.php index ea62ae15dae5b4ae0a6dd6e8e8cac719cd63d707..6d6584aef9296608df904979db722a45d3847ef7 100644 --- a/library/ZendAfi/View/Helper/CalendarContent.php +++ b/library/ZendAfi/View/Helper/CalendarContent.php @@ -65,7 +65,7 @@ class ZendAfi_View_Helper_CalendarContent extends Zend_View_Helper_HtmlElement { foreach($articles as $article){ $options = $this->class_calendar->getArticleEventInfo($article). - $this->class_calendar->formateDateZend($article); + $this->view->tagArticleEvent($article); $html.=$this->view->summaryArticle($article, $options); } return $html.='</div>';