diff --git a/.gitattributes b/.gitattributes index a811e1115957f537df8e5a50c32073c6ecc5a85b..abccaa744fa1ca06a47781078f9c377c6eca0a5c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2462,6 +2462,7 @@ library/ZendAfi/View/Helper/ShareByMail.php -text library/ZendAfi/View/Helper/SocialShare.php -text library/ZendAfi/View/Helper/Subwords.php -text library/ZendAfi/View/Helper/SuggestionAchat.php -text +library/ZendAfi/View/Helper/SummaryArticle.php -text library/ZendAfi/View/Helper/TagAlbumMediaList.php -text library/ZendAfi/View/Helper/TagAnchor.php -text library/ZendAfi/View/Helper/TagArticleEvent.php -text diff --git a/library/ZendAfi/View/Helper/SummaryArticle.php b/library/ZendAfi/View/Helper/SummaryArticle.php new file mode 100644 index 0000000000000000000000000000000000000000..0b0715b0d8ae101a2552f5ffcbe33c75da4533a2 --- /dev/null +++ b/library/ZendAfi/View/Helper/SummaryArticle.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. + * + * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * AFI-OPAC 2.0 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with AFI-OPAC 2.0; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +class ZendAfi_View_Helper_SummaryArticle extends Zend_View_Helper_HtmlElement { + + public function summaryArticle($article, $options = '') { + + $titre = $this->view->tagAnchor($this->view->url($article->getUrl()), + $article->getTitre()); + + $admin_cfg = $this->view->tagEditArticle($article); + + $readspeaker = $this->view->readSpeaker( + 'cms', + 'articleread', + array('id' => $article->getId()) + ); + + $content_summary = $article->getSummary(); + + $url_to_article = + $this->view->tagAnchor( + $this->view->url($article->getUrl()), + $this->view->_("Lire l'article complet")); + + $reseaux_sociaux = '<div id="reseaux-sociaux-'.$article->getId().'"></div>'; + + $url = $this->view->url(['controller' => 'cms', + 'action' => 'reseau', + 'id_article' => $article->getId()],null,true); + + Class_ScriptLoader::getInstance() + ->addJQueryReady("$('#reseaux-sociaux-".$article->getId()."').load('".$url."');"); + + return + $titre. + $options. + $admin_cfg. + $readspeaker. + $content_summary. + $url_to_article. + $reseaux_sociaux; + } + +} + +?> \ No newline at end of file