Skip to content
Snippets Groups Projects
Commit 4fc81c9a authored by Laurent's avatar Laurent
Browse files

hotline #38468: phone article views refactoring

parent 540fcc89
Branches
Tags
3 merge requests!1659Master,!1587Master,!1540Hotline#38468 version mobile clic sur rebond mediatheque inactif
......@@ -5,27 +5,8 @@ echo $this->toolbar($this->_('Articles'),
<?php if (0 < count($this->articles)) { ?>
<div class="liste"><ul>
<?php
foreach ($this->articles as $article) {
?>
<li class="lien">
<?php echo $this->tagArticleEvent($article);?>
<span><?php
echo $this->tagAnchor(
$this->url(array('cat' => $article->getIdCat())),
$article->getCategorie()->getLibelle(),
array('class' => 'calendar_event_info')
);?> - <?php
echo $this->tagAnchor(
$article->getUrl(),
$article->getTitre(),
array('class' => 'calendar_event_title')
); ?>
</span>
</li>
<?php } ?>
</ul>
<div class="liste">
<?php echo $this->articleEventList($this->articles); ?>
</div>
<?php
......
......@@ -8,27 +8,8 @@ echo $this->toolbar($this->_('Articles'),
<div class="liste">
<?php foreach ($this->articles as $bibliotheque => $articles) { ?>
<h2><?php echo ('' == $bibliotheque) ? $this->_('Portail') : $this->libelle_bibs[$bibliotheque];?></h2>
<ul>
<?php
foreach ($articles as $article) { ?>
<li class="lien">
<?php echo $this->tagArticleEvent($article);?>
<span><?php
echo $this->tagAnchor(
$this->url(array('cat' => $article->getIdCat())),
$article->getCategorie()->getLibelle(),
array('class' => 'calendar_event_info')
);?> - <?php
echo $this->tagAnchor(
$article->getUrl(),
$article->getTitre(),
array('class' => 'calendar_event_title')
); ?>
</span>
</li>
<?php } ?>
</ul>
<?php } ?>
<?php echo $this->articleEventList($articles); ?>
<?php } ?>
</div>
<?php
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH 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).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Telephone_ArticleEventList extends ZendAfi_View_Helper_BaseHelper {
public function articleEventList($articles) {
if (!$articles)
return '';
return $this->_tag('ul',
$this->_renderArticles($articles));
}
protected function _renderArticles($articles) {
return implode('',
array_map([$this, '_renderArticle'],
$articles));
}
protected function _renderArticle($article) {
return $this->_tag(
'li',
$this->view->tagArticleEvent($article)
. $this->_tag('span',
$this->_renderArticleLinks($article)
),
['class' => 'lien']);
}
protected function _renderArticleLinks($article) {
return
$this->view->tagAnchor(
$this->view->url(['cat' => $article->getIdCat()]),
$article->getCategorie()->getLibelle(),
['class' => 'calendar_event_info'])
. ' - '
. $this->view->tagAnchor(
$article->getUrl(),
$article->getTitre(),
['class' => 'calendar_event_title']);
}
}
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