PageRenderTime 48ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1, Apache-2.0
  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. // no direct access
  10. defined('_JEXEC') or die;
  11. ?>
  12. <?php
  13. $lang = &JFactory::getLanguage();
  14. $myrtl =$this->newsfeed->rtl;
  15. $direction = " ";
  16. if ($lang->isRTL() && $myrtl==0){
  17. $direction= " redirect-rtl";
  18. }
  19. else if ($lang->isRTL() && $myrtl==1){
  20. $direction= " redirect-ltr";
  21. }
  22. else if ($lang->isRTL() && $myrtl==2){
  23. $direction= " redirect-rtl";
  24. }
  25. else if ($myrtl==0) {
  26. $direction= " redirect-ltr";
  27. }
  28. else if ($myrtl==1) {
  29. $direction= " redirect-ltr";
  30. }
  31. else if ($myrtl==2) {
  32. $direction= " redirect-rtl";
  33. }
  34. ?>
  35. <div class="newsfeed<?php echo $this->params->get('pageclass_sfx')?><?php echo $direction; ?>">
  36. <?php if ($this->params->get('show_page_title', 1)) : ?>
  37. <h2 class="<?php echo $direction; ?>">
  38. <?php if ($this->escape($this->params->get('page_heading'))) :?>
  39. <?php echo $this->escape($this->params->get('page_heading')); ?>
  40. <?php else : ?>
  41. <?php echo $this->escape($this->params->get('page_title')); ?>
  42. <?php endif; ?>
  43. </h2>
  44. <?php endif; ?>
  45. <h3 class="<?php echo $direction; ?>">
  46. <a href="<?php echo $this->newsfeed->channel['link']; ?>" target="_blank">
  47. <?php echo str_replace('&apos;', "'", $this->newsfeed->channel['title']); ?></a>
  48. </h3>
  49. <!-- Show Description -->
  50. <?php if ($this->params->get('show_feed_description')) : ?>
  51. <div>
  52. <?php echo str_replace('&apos;', "'", $this->newsfeed->channel['description']); ?>
  53. </div>
  54. <?php endif; ?>
  55. <!-- Show Image -->
  56. <?php if (isset($this->newsfeed->image['url']) && isset($this->newsfeed->image['title']) && $this->params->get('show_feed_image')) : ?>
  57. <div>
  58. <img src="<?php echo $this->newsfeed->image['url']; ?>" alt="<?php echo $this->newsfeed->image['title']; ?>" />
  59. </div>
  60. <?php endif; ?>
  61. <!-- Show items -->
  62. <ol>
  63. <?php foreach ($this->newsfeed->items as $item) : ?>
  64. <li>
  65. <?php if (!is_null($item->get_link())) : ?>
  66. <a href="<?php echo $item->get_link(); ?>" target="_blank">
  67. <?php echo $item->get_title(); ?></a>
  68. <?php endif; ?>
  69. <?php if ($this->params->get('show_item_description') && $item->get_description()) : ?>
  70. <div>
  71. <?php $text = $this->limitText($item->get_description(), $this->params->get('feed_word_count'));
  72. echo str_replace('&apos;', "'", $text);
  73. ?>
  74. </div>
  75. <?php endif; ?>
  76. </li>
  77. <?php endforeach; ?>
  78. </ol>
  79. </div>