{* get a list of feeds in the database and put them into smarty varliable "FeedList" *}
{feedsListFeeds varname=FeedList}

{literal}
	<style type="text/css">
		.eip_editable { background-color: #ff9; padding: 3px; }
		.eip_savebutton { background-color: #36f; color: #fff; }
		.eip_cancelbutton { background-color: #000; color: #fff; }
		.eip_saving { background-color: #903; color: #fff; padding: 3px; }
		.eip_empty { color: #afafaf; }
	</style>
{/literal}

<fieldset><legend><img src="{$my_pligg_base}/templates/{$the_template}/images/manage_rss.png" align="absmiddle"/> {#PLIGG_Visual_Header_AdminPanel_RSSImport#}</legend>

<img src="{$my_pligg_base}/templates/{$the_template}/images/feed_go.png" align="absmiddle"/> <a href="module.php?module=rss_import_do_import"><strong>Import the feeds</strong></a>
<hr>
<img src="{$my_pligg_base}/templates/{$the_template}/images/feed_add.png" align="absmiddle"/> <a href="module.php?module=rss_import&action=addnewfeed"><strong>Add a new feed</strong></a>
<br />
<img src="{$my_pligg_base}/templates/{$the_template}/images/feed_add.png" align="absmiddle"/> 
{php} echo "<a href=\"#\" onclick=\"new Effect.toggle('import','appear', {queue: 'end'});\"><strong>Import pre-built feed</strong></a>";{/php}

<div id="import" style="display:none">
	<br/>
	<form>
		<textarea rows=10 cols=70 name="prebuiltfeed"></textarea>
		<input type = "hidden" name="module" value="rss_import">
		<input type = "hidden" name="action" value="importprebuiltfeed_go">
		<br /><input type = "submit" value="Import Feed" class="log2">
	</form>
</div>

<hr/>

{foreach from=$FeedList item=feed_id}
	
  <b><img src="{$my_pligg_base}/templates/{$the_template}/images/feed_bullet.png" align="absmiddle"/> Feed Name: </b>{eipItem item=qeip_FeedName unique=$feed_id ShowJS=TRUE}<br>
	<div style="margin-left:30px">
	<b>Feed URL: </b>{eipItem item=qeip_FeedURL unique=$feed_id ShowJS=TRUE}<br>
	<img src="{$my_pligg_base}/templates/{$the_template}/images/feed_delete.png" align="absmiddle"/> <a href = "module.php?module=rss_import&action=dropfeed&feed_id={$feed_id}">Delete this feed</a>
	<br />
	<img src="{$my_pligg_base}/templates/{$the_template}/images/feed_go.png" align="absmiddle"/> <a href = "module.php?module=rss_import&action=exportfeed&feed_id={$feed_id}">Export this feed</a>
	<br />
	<img src="{$my_pligg_base}/templates/{$the_template}/images/feed_go.png" align="absmiddle"/> <a href = "module.php?module=rss_import&action=examinefeed&feed_id={$feed_id}">Examine this feed</a>
	<br><br>
	- <b>Feed Frequency (hours): </b>{eipItem item=qeip_FeedFreqHours unique=$feed_id ShowJS=TRUE} -- how often to check for new items.<br>
	<br />
	- <b>Feed Order: </b>{eipItem item=qeip_FeedLastItemFirst unique=$feed_id ShowJS=TRUE} -- Do we start with the last items first? 0 = no, 1 = yes<br>
	<br />	
	- <b>Feed Random Votes: </b>{eipItem item=qeip_FeedRandomVoteEnable unique=$feed_id ShowJS=TRUE} -- Do we use a random number of votes? 0 = no, 1 = yes<br>
	<br />	
	- <b>Feed Votes (if not random): </b>{eipItem item=qeip_FeedVotes unique=$feed_id ShowJS=TRUE} -- how many votes new items recieve (limit 200)<br>
	<br />
	- <b>Feed Votes Minimum (if random): </b>{eipItem item=qeip_FeedRandomVotesMin unique=$feed_id ShowJS=TRUE} -- how many votes new items recieve (limit 200)<br>
	- <b>Feed Votes Maximum (if random): </b>{eipItem item=qeip_FeedRandomVotesMax unique=$feed_id ShowJS=TRUE} -- how many votes new items recieve (limit 200)<br>
	<br />
	- <b>Feed Items Limit: </b>{eipItem item=qeip_FeedItemLimit unique=$feed_id ShowJS=TRUE} -- how many new items to take from the feed when it's checked<br>
	- <b>Feed URL Dupes: </b>{eipItem item=qeip_FeedURLDupe unique=$feed_id ShowJS=TRUE} -- Allow duplicate URL's 0=No, 1=Yes, Allow<br>
	- <b>Feed Title Dupes: </b>{eipItem item=qeip_FeedTitleDupe unique=$feed_id ShowJS=TRUE} -- Allow duplicate Title's 0=No, 1=Yes, Allow<br>
	- <b>Feed Submitter Id (number): </b>{eipItem item=qeip_FeedSubmitter unique=$feed_id ShowJS=TRUE} -- The ID of the person who will be listed as the submitter<br>
	- <b>Feed Category Id (number): </b>{eipItem item=qeip_FeedCategory unique=$feed_id ShowJS=TRUE} -- The ID of the category to place these items into<br>
	
	<br>
	{* get a list of all field_links where `feed_id` = $feed_id and put them into the smarty variable "FeedLinks" *}
		{feedsListFeedLinks varname=FeedLinks feedid=$feed_id}
		
	{foreach from=$FeedLinks item=feed_link_id}
		{* get a list of fields in the RSS feed and put them into the smarty variable "eip_select" for the EIP selectbox to use *}
			{feedsListFeedFields feed_id=$feed_id}
	
		-- <b>feed field name</b>: {eipItem item=qeip_FeedLink_FeedField unique=$feed_link_id ShowJS=TRUE}

		{* get a list of pligg fields and put them into the smarty variable "eip_select" for the EIP selectbox to use *}
			{feedsListPliggLinkFields}
			
		--- <b>pligg field name</b>: {eipItem item=qeip_FeedLink_PliggField unique=$feed_link_id ShowJS=TRUE}

		--- <a href = "module.php?module=rss_import&action=dropfieldlink&FeedLinkId={$feed_link_id}">Remove this link</a>
 		<br>

	{/foreach}
	
	-- <a href = "module.php?module=rss_import&action=addnewfieldlink&FeedLinkId={$feed_id}">Add a new field link</a>
	</div>
	<hr>
	
{/foreach}
<br/>
</fieldset>