PageRenderTime 277ms CodeModel.GetById 81ms app.highlight 20ms RepoModel.GetById 108ms app.codeStats 1ms

/components/com_newsfeeds/views/newsfeed/tmpl/default.php

https://github.com/joebushi/joomla
PHP | 88 lines | 73 code | 7 blank | 8 comment | 23 complexity | 716df0996862efd59c1a3b713234ad0a MD5 | raw file
 1<?php
 2/**
 3 * @version		$Id$
 4 * @package		Joomla.Site
 5 * @subpackage	com_newsfeeds
 6 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 7 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 8 */
 9
10// no direct access
11defined('_JEXEC') or die;
12?>
13<?php
14		$lang = &JFactory::getLanguage();
15		$myrtl =$this->newsfeed->rtl;
16		$direction = " ";
17
18		if ($lang->isRTL() && $myrtl==0){
19		   $direction= " redirect-rtl";
20		   }
21		else if ($lang->isRTL() && $myrtl==1){
22		   $direction= " redirect-ltr";
23		   }
24		else if ($lang->isRTL() && $myrtl==2){
25		   $direction= " redirect-rtl";
26		   }
27		else if ($myrtl==0) {
28			$direction= " redirect-ltr";
29		   }
30		else if ($myrtl==1) {
31			$direction= " redirect-ltr";
32		   }
33		else if ($myrtl==2) {
34		   $direction= " redirect-rtl";
35		   }
36?>
37
38<div class="newsfeed<?php echo $this->params->get('pageclass_sfx')?><?php echo $direction; ?>">
39
40<?php if ($this->params->get('show_page_title', 1)) : ?>
41	<h2 class="<?php echo $direction; ?>">
42		<?php if ($this->escape($this->params->get('page_heading'))) :?>
43			<?php echo $this->escape($this->params->get('page_heading')); ?>
44		<?php else : ?>
45			<?php echo $this->escape($this->params->get('page_title')); ?>
46		<?php endif; ?>
47	</h2>
48<?php endif; ?>
49
50	<h3 class="<?php echo $direction; ?>">
51		<a href="<?php echo $this->newsfeed->channel['link']; ?>" target="_blank">
52			<?php echo str_replace('&apos;', "'", $this->newsfeed->channel['title']); ?></a>
53	</h3>
54
55<!-- Show Description -->
56<?php if ($this->params->get('show_feed_description')) : ?>
57	<div>
58		<?php echo str_replace('&apos;', "'", $this->newsfeed->channel['description']); ?>
59	</div>
60<?php endif; ?>
61
62<!-- Show Image -->
63<?php if (isset($this->newsfeed->image['url']) && isset($this->newsfeed->image['title']) && $this->params->get('show_feed_image')) : ?>
64<div>
65		<img src="<?php echo $this->newsfeed->image['url']; ?>" alt="<?php echo $this->newsfeed->image['title']; ?>" />
66</div>
67<?php endif; ?>
68
69<!-- Show items -->
70<ol>
71	<?php foreach ($this->newsfeed->items as $item) :  ?>
72		<li>
73			<?php if (!is_null($item->get_link())) : ?>
74				<a href="<?php echo $item->get_link(); ?>" target="_blank">
75					<?php echo $item->get_title(); ?></a>
76			<?php endif; ?>
77			<?php if ($this->params->get('show_item_description') && $item->get_description()) : ?>
78				<div>
79				<?php $text = $this->limitText($item->get_description(), $this->params->get('feed_word_count'));
80					echo str_replace('&apos;', "'", $text);
81				?>
82				</div>
83			<?php endif; ?>
84			</li>
85		<?php endforeach; ?>
86		</ol>
87</div>
88