[pLog-svn] r757 - in plugins/trunk/feedreader: class/action class/dao class/view templates

oscar at devel.plogworld.net oscar at devel.plogworld.net
Tue Jan 18 21:20:59 GMT 2005


Author: oscar
Date: 2005-01-18 21:20:59 +0000 (Tue, 18 Jan 2005)
New Revision: 757

Modified:
   plugins/trunk/feedreader/class/action/feedreaderaction.class.php
   plugins/trunk/feedreader/class/dao/feedreaderdata.class.php
   plugins/trunk/feedreader/class/view/feedlistview.class.php
   plugins/trunk/feedreader/templates/feed.template
   plugins/trunk/feedreader/templates/feedlist.template
Log:
added support for filtering based on link category names


Modified: plugins/trunk/feedreader/class/action/feedreaderaction.class.php
===================================================================
--- plugins/trunk/feedreader/class/action/feedreaderaction.class.php	2005-01-18 20:45:26 UTC (rev 756)
+++ plugins/trunk/feedreader/class/action/feedreaderaction.class.php	2005-01-18 21:20:59 UTC (rev 757)
@@ -2,7 +2,10 @@
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
 	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/view/feedlistview.class.php" );
-	
+
+	/**
+	 * main action that shows our list of links
+	 */
 	class FeedReaderAction extends AdminAction
 	{
 	
@@ -13,7 +16,9 @@
 		
 		function perform()
 		{
-			$this->_view = new FeedListView( $this->_blogInfo );
+			$this->_categoryId = $this->_request->getValue( "showCategory", -1 );		
+		
+			$this->_view = new FeedListView( $this->_blogInfo, $this->_categoryId );
 			$this->setCommonData();
 			
 			return true;

Modified: plugins/trunk/feedreader/class/dao/feedreaderdata.class.php
===================================================================
--- plugins/trunk/feedreader/class/dao/feedreaderdata.class.php	2005-01-18 20:45:26 UTC (rev 756)
+++ plugins/trunk/feedreader/class/dao/feedreaderdata.class.php	2005-01-18 21:20:59 UTC (rev 757)
@@ -133,7 +133,7 @@
 		{
 			// get the mylinks objects for the blog
 			$myLinks = new MyLinks();
-			$blogLinks = $myLinks->getLinks( $blogId );
+			$blogLinks = $myLinks->getLinks( $blogId, $linkCategoryId );
 			
 			// if error, return an empty array
 			if( !$blogLinks )

Modified: plugins/trunk/feedreader/class/view/feedlistview.class.php
===================================================================
--- plugins/trunk/feedreader/class/view/feedlistview.class.php	2005-01-18 20:45:26 UTC (rev 756)
+++ plugins/trunk/feedreader/class/view/feedlistview.class.php	2005-01-18 21:20:59 UTC (rev 757)
@@ -2,25 +2,34 @@
 	
 	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
 	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/dao/feedreaderdata.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/mylinkscategories.class.php" );
 
 	/**
 	 * implements the main view of the feed reader plugin
 	 */
 	class FeedListView extends AdminPluginTemplatedView
 	{
+		var $_categoryId;
 	
-		function FeedListView( $blogInfo )
+		function FeedListView( $blogInfo, $categoryId = -1 )
 		{
 			$this->AdminPluginTemplatedView( $blogInfo, "feedreader", "feedlist" );
 		}
 		
 		function render()
 		{
+			// get the feeds based on the chosen category
 			$feedData = new FeedReaderData();
-			$feeds = $feedData->getBlogFeeds( $this->_blogInfo->getId());
+			$feeds = $feedData->getBlogFeeds( $this->_blogInfo->getId(), $this->_categoryId );
 			
+			// get the link categories
+			$linkCategories = new MyLinksCategories();
+			$blogLinkCategories = $linkCategories->getMyLinksCategories( $this->_blogInfo->getId());
+			
 			// show the list with the categories available
 			$this->setValue( "feeds", $feeds );
+			$this->setValue( "linkscategories", $blogLinkCategories );
+			$this->setValue( "currentcategory", $this->_categoryId );
 			
 			parent::render();
 		}

Modified: plugins/trunk/feedreader/templates/feed.template
===================================================================
--- plugins/trunk/feedreader/templates/feed.template	2005-01-18 20:45:26 UTC (rev 756)
+++ plugins/trunk/feedreader/templates/feed.template	2005-01-18 21:20:59 UTC (rev 757)
@@ -39,9 +39,9 @@
   <li>
     <a onClick="javascript:toggleArticle('{$rssItem->getUniqueId()}');"><img id="img_{$rssItem->getUniqueId()}" src="plugins/feedreader/imgs/left.gif" alt="+" /></a>&nbsp;
     <a href="{$rssItem->getLink()}">{$rssItem->getTitle()}</a><br/>
-    <p style="display:none" id="{$rssItem->getUniqueId()}">
+    <div style="display:none" id="{$rssItem->getUniqueId()}">
      {$rssItem->getDescription()}
-    </p>
+    </div>
   </li>
 {/foreach}
 </ul>

Modified: plugins/trunk/feedreader/templates/feedlist.template
===================================================================
--- plugins/trunk/feedreader/templates/feedlist.template	2005-01-18 20:45:26 UTC (rev 756)
+++ plugins/trunk/feedreader/templates/feedlist.template	2005-01-18 21:20:59 UTC (rev 757)
@@ -1,5 +1,30 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=feedReader title=$locale->tr("feedReader")}
+<div id="list_nav_bar">
+<div id="list_nav_select">
+<form id="viewLinks" action="admin.php" method="post">
+ <fieldset>
+  <legend>{$locale->tr("show_by")}</legend>
+   <div class="list_nav_option">
+    <label for="showCategory">{$locale->tr("category")}</label>
+	<br />
+	 <select name="showCategory" id="showCategory">
+      <option value="-1">{$locale->tr("category_all")}</option>
+      {foreach from=$linkscategories item=category}
+      <option value="{$category->getId()}" {if $currentcategory == $category->getId()} selected="selected" {/if}>{$category->getName()}</option>
+      {/foreach}
+    </select>
+   </div>
+   <div class="list_nav_option">
+    <br />
+    <input type="hidden" name="op" value="feedReader">
+    <input type="submit" name="Show" value="{$locale->tr("show")}">
+   </div>
+  </fieldset> 
+ </form> 
+ </div>
+ <br style="clear:both">
+ </div>
 <div id="list">
  {if $viewIsSuccess}
   {include file="$admintemplatepath/successmessage.template" message=$viewSuccessMessage}<br/>
@@ -11,8 +36,8 @@
  <thead>
   <tr>
    <th style="width:20px;">{$locale->tr("read")}</th>
-   <th style="width:430px;">{$locale->tr("name")}</th>
-   <th style="widht:300px";>{$locale->tr("last_read")}</th>
+   <th style="width:570px;">{$locale->tr("name")}</th>
+   <th style="widht:185px";>{$locale->tr("last_read")}</th>
   </tr>
  </thead>
  <tbody>




More information about the pLog-svn mailing list