source: OWR/Includes/Themes/Original/tpl/blocks/post_tools.html @ f547f9

Revision f547f9, 3.5 KB checked in by pierre-alain <pierre-alain@…>, 11 months ago (diff)

displaying correct news count in post tools helper

  • Property mode set to 100644
Line 
1<?php
2    if(!$sort || 'news.pubDate' === $sort || 'news_relations.status' === $sort)
3    {
4        $nextdir = (!$dir || $dir === 'asc' ? 'desc' : 'asc');
5    }
6    else
7    {
8        $nextdir = (!$dir || $dir === 'desc' ? 'asc' : 'desc');
9    }
10?>
11<div id="news_ordering" class="shadow full_rounded opac verysmall">
12    <?php echo $this->_utilities->_('Order by');?> :
13        <a class="underlined" href="javascript:;" title="<?php echo $this->_utilities->_('Order by').' '.$this->_utilities->_('title');?>" onclick="rP.showStream(rP.currentId, rP.live, 'title', '<?php echo (($sort === 'news.title') ? $nextdir : 'asc');?>');"><?php echo (($sort === 'news.title') ? '<strong>'.$this->_utilities->_('title').'</strong>' : $this->_utilities->_('title'));?></a>&nbsp;-&nbsp;<a class="underlined" href="javascript:;" title="<?php echo $this->_utilities->_('Order by').' '.$this->_utilities->_('pubDate');?>" onclick="rP.showStream(rP.currentId, rP.live, 'pubDate', '<?php echo (($sort === 'news.pubDate') ? $nextdir : 'asc');?>');"><?php echo ((!$sort || $sort === 'news.pubDate') ? '<strong>'.$this->_utilities->_('pubDate').'</strong>' : $this->_utilities->_('pubDate'));?></a>&nbsp;-&nbsp;<a class="underlined" href="javascript:;" title="<?php echo $this->_utilities->_('Order by').' '.$this->_utilities->_('status');?>" onclick="rP.showStream(rP.currentId, rP.live, 'status', '<?php echo (($sort === 'news_relations.status') ? $nextdir : 'desc');?>');"><?php echo (($sort === 'news_relations.status') ? '<strong>'.$this->_utilities->_('status').'</strong>' : $this->_utilities->_('status'));?></a><?php echo '&nbsp;/&nbsp;'.(!$sort || !$dir || $nextdir === 'asc' ? '↓' : '↑');?>&nbsp;|&nbsp;<?php echo ((($offset+1) * $nbNewsByPage) > $nbNews ? $nbNews : ($offset+1) * $nbNewsByPage) . '/' . $nbNews; ?>&nbsp;<a href="javascript:;" class="read_page backgrounded opac" onclick="rP.updateNews('read');" title="<?php echo $this->_utilities->_('Mark all the news of this page as read');?>"></a>&nbsp;|&nbsp;
14    <a href="javascript:;" class="read_page backgrounded opac" onclick="rP.updateNews('page');" title="<?php echo $this->_utilities->_('Mark all the news of this page as read');?>"></a>
15<?php   if($nbNews > $nbNewsByPage) {
16            $nbPages = ceil($nbNews/$nbNewsByPage);
17                        $next_offset = $offset + 1;
18            if($offset > 0) {
19                    $prev_offset = $offset - 1;
20?>
21    <a class="pager pager_markleft backgrounded opac" href="javascript:;" onclick="rP.moveToPage('prev', 1);" title="<?php echo $this->_utilities->_('Mark all the news of this page as read').' '.$this->_utilities->_('And').' '.$this->_utilities->_('Move to page').' '.$offset.'/'.$nbPages; ?>"></a>
22    <a class="pager pager_left backgrounded opac" href="javascript:;" onclick="rP.moveToPage('prev');" title="<?php echo $this->_utilities->_('Move to page').' '.$offset.'/'.$nbPages; ?>"></a>
23<?php
24            }
25            if($next_offset < $nbPages) {
26                $next_next_offset = $next_offset + 1;
27?>
28    <a class="pager pager_right backgrounded opac" href="javascript:;" onclick="rP.moveToPage('next');" title="<?php echo $this->_utilities->_('Move to page').' '.$next_next_offset.'/'.$nbPages; ?>"></a>
29    <a class="pager pager_markright backgrounded opac" href="javascript:;" onclick="rP.moveToPage('next', 1);" title="<?php echo $this->_utilities->_('Mark all the news of this page as read').' '.$this->_utilities->_('And').' '.$this->_utilities->_('Move to page').' '.$next_next_offset.'/'.$nbPages; ?>">
30    </a>
31<?php       }
32        } ?>
33</div>
Note: See TracBrowser for help on using the repository browser.