{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=feedReader title=$locale->tr("feedReader")}
<script type="text/javascript">
{literal}
function toggleArticle(articleId)
{
    // get the item from the DOM
    rssItem = document.getElementById( articleId );
    
    // if nothing found, let's get out of here
    if( !rssItem )
        return false;
        
    // get the icon
    icon = document.getElementById( 'img_'+articleId );        
        
    // toggle the whole thing
    if( rssItem.style.display == 'block' ) {
        rssItem.style.display = 'none';
        icon.src = "plugins/feedreader/imgs/left.gif";
    }
    else {
        rssItem.style.display = 'block';
        icon.src = "plugins/feedreader/imgs/down.gif";        
    }
    
    return true;
}
{/literal}
</script>
<div id="feed" style="margin-left: 15px; margin-right: 15px">
{assign var=channel value=$rss->getChannel()}
<h4>&raquo; {$channel->getTitle()}</h4>
{if $channel->getDescription()}
  <p>{$channel->getDescription()}</p>
{/if}  
<ul style="list-style: none;">
{foreach from=$rss->getItems() item=rssItem}
  <li>
    <a onClick="javascript:toggleArticle('{$rssItem->getUniqueId()}');"><img id="img_{$rssItem->getUniqueId()}" src="plugins/feedreader/imgs/left.gif" alt="+" /></a>&nbsp;
    {if $rssItem->hasEnclosures()}
     <img src="plugins/feedreader/imgs/clip.gif" alt="RSS Enclosure" />
    {/if}
    <a href="{$rssItem->getLink()}">{$rssItem->getTitle()}</a><br/>
    <div style="display:none;padding-bottom: 5px;" id="{$rssItem->getUniqueId()}">
     <span style="font-size:small;color:red">
      {foreach from=$rssItem->getEnclosures() item=rssEnc}
       <a href="{$rssEnc->getUrl()}">{$rssEnc->getUrl()}</a> ({$rssEnc->getLength()})<br/>
      {/foreach}
     </span>
     {$rssItem->getDescription()}
    </div>
  </li>
{/foreach}
</ul>
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}