[pLog-svn] r858 - in plugins/trunk/contentfilter: . class class/action class/view templates

mark at devel.plogworld.net mark at devel.plogworld.net
Thu Jan 27 07:55:59 GMT 2005


Author: mark
Date: 2005-01-27 07:55:58 +0000 (Thu, 27 Jan 2005)
New Revision: 858

Added:
   plugins/trunk/contentfilter/class/view/
   plugins/trunk/contentfilter/class/view/admineditfilteredcontentview.class.php
   plugins/trunk/contentfilter/class/view/adminfilteredcontentview.class.php
   plugins/trunk/contentfilter/class/view/adminnewfilteredcontentview.class.php
Modified:
   plugins/trunk/contentfilter/class/action/adminaddfilteredcontentaction.class.php
   plugins/trunk/contentfilter/class/action/admindeletefilteredcontentaction.class.php
   plugins/trunk/contentfilter/class/action/admineditfilteredcontentaction.class.php
   plugins/trunk/contentfilter/class/action/adminfilteredcontentaction.class.php
   plugins/trunk/contentfilter/class/action/adminnewfilteredcontentaction.class.php
   plugins/trunk/contentfilter/class/action/adminupdatefilteredcontentaction.class.php
   plugins/trunk/contentfilter/plugincontentfilter.class.php
   plugins/trunk/contentfilter/templates/addfilteredcontent.template
   plugins/trunk/contentfilter/templates/editfilteredcontent.template
   plugins/trunk/contentfilter/templates/filteredcontent.template
Log:
Update the contentfilter UI to follow the new UI guideline. Only SiteContentFilter complete.
To do:
1. BlogContentFilter
2. need to implement Process()

Modified: plugins/trunk/contentfilter/class/action/adminaddfilteredcontentaction.class.php
===================================================================
--- plugins/trunk/contentfilter/class/action/adminaddfilteredcontentaction.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/action/adminaddfilteredcontentaction.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,10 +1,10 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminerrorview.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminmessageview.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
     include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/dao/filteredcontents.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminnewfilteredcontentview.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminfilteredcontentview.class.php" );
 
     /**
      * Adds new blocked content to the blog
@@ -18,29 +18,21 @@
     	function AdminAddFilteredContentAction( $actionInfo, $request )
         {
         	$this->SiteAdminAction( $actionInfo, $request );
+			
+			// data validation
+			$this->registerFieldValidator( "filteredContent", new StringValidator());
+			$this->_form->registerField( "reason" );
+			$view = new AdminNewFilteredContentView( $this->_blogInfo );
+			$view->setErrorMessage( $this->_locale->tr("error_provide_content_to_block" ));
+			$this->setValidationErrorView( $view );        	
         }
 
-        function validate()
+        function perform()
         {
+            // fetch the data
         	$this->_newFilteredContent = $this->_request->getValue( "filteredContent" );
             $this->_reason = $this->_request->getValue( "reason" );
 
-            $val = new StringValidator();
-            if( !$val->validate( $this->_newFilteredContent )) {
-            	$this->_view = new AdminErrorView( $this->_blogInfo );
-				$message = $this->_locale->tr("error_provide_content_to_block");
-				$message .= "<br/><br/><a href=\"javascript:history.go(-1);\">".$this->_locale->tr("back")."</a>";
-                $this->_view->setMessage( $message );
-                $this->setCommonData();
-
-                return false;
-            }
-
-            return true;
-        }
-
-        function perform()
-        {
         	// create the dao object and add the info to the db
         	$filteredContents = new FilteredContents();
 			$filteredContent = new FilteredContent( $this->_newFilteredContent, 0, $this->_reason );
@@ -52,20 +44,23 @@
 
             // and give some feedback to the user
             if( !$result ) {
-            	$message = $this->_locale->tr("error_adding_blocked_content");
-				$message .= "<br/><br/><a href=\"javascript:history.go(-1);\">".$this->_locale->tr("back")."</a>";				
-                $this->_view = new AdminErrorView( $this->_blogInfo );
+                $this->_view = new AdminNewFilteredContentView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_adding_blocked_content"));
+                $this->setCommonData();							
+
+                return false;
             }
-            else {
-				$this->notifyEvent( EVENT_POST_FILTERED_CONTENT_ADD, Array( "content" => &$filteredContent ));			
-            	$message = $this->_locale->tr("blocked_content_added_ok");
-				$message .= "<br/><br/><a href=\"admin.php?op=filteredContent\">".$this->_locale->tr("view")."</a>";
-                $this->_view = new AdminMessageView( $this->_blogInfo );
-            }
 
-            $this->_view->setMessage( $message );
+			$this->notifyEvent( EVENT_POST_FILTERED_CONTENT_ADD, Array( "content" => &$filteredContent ));			
+
+            $this->_view = new AdminFilteredContentView( $this->_blogInfo );
+            $this->_view->setSuccessMessage( $this->_locale->tr("blocked_content_added_ok") );
             $this->setCommonData();
 
+			// clear the cache
+			CacheControl::resetBlogCache( $this->_blogInfo->getId());
+
+            // better to return true if everything fine
             return true;
         }
     }

Modified: plugins/trunk/contentfilter/class/action/admindeletefilteredcontentaction.class.php
===================================================================
--- plugins/trunk/contentfilter/class/action/admindeletefilteredcontentaction.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/action/admindeletefilteredcontentaction.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,9 +1,10 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminmessageview.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminerrorview.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );    
     include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/dao/filteredcontents.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminnewfilteredcontentview.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminfilteredcontentview.class.php" );    
 
     /**
      * removes globally filtered content
@@ -12,53 +13,76 @@
 	{
 
     	var $_deleteFilteredContents;
+    	var $_contentId;
+    	var $_op;
 
         function AdminDeleteFilteredContentAction( $actionInfo, $request )
         {
         	$this->SiteAdminAction( $actionInfo, $request );
-        }
 
-        function validate()
-        {
-        	$this->_deleteFilteredContents = $this->_request->getValue( "deleteFilteredContent" );
-
-            if( count($this->_deleteFilteredContents) == 0 ) {
-            	$this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setMessage( $this->_locale->tr("error_no_contents_selected_to_remove"));
-                $this->setCommonData();
-
-                return false;
-            }
-
-            return true;
+			$this->_op = $actionInfo->getActionParamValue();
+			
+			$view = new AdminFilteredContentView( $this->_blogInfo );			
+			if( $this->_op == "deleteFilteredContent" ) {
+				$this->registerFieldValidator( "contentId", new IntegerValidator());
+				$view->setErrorMessage( $this->_locale->tr("error_incorrect_content_id"));	
+			}
+			else {
+				$this->registerFieldValidator( "deleteFilteredContent", new ArrayValidator());
+				$view->setErrorMessage( $this->_locale->tr("error_no_block_content_selected"));
+			}
+			$this->setValidationErrorView( $view );        	
         }
 
         /**
          * Carries out the specified action
          */
-        function perform()
+		function perform()
+		{
+			if( $this->_op == "deleteFilteredContent" ) {
+				$this->_deleteFilteredContents = Array();
+				$this->_contentId = $this->_request->getValue( "contentId" );
+				$this->_deleteFilteredContents[] = $this->_contentId;
+			}
+			else
+				$this->_deleteFilteredContents = $this->_request->getValue( "deleteFilteredContent" );
+				
+			$this->_deleteFilteredContents();
+		}
+		       
+        function _deleteFilteredContents()
         {
         	// get the content that has been filtered by this blog
             $filteredContents = new FilteredContents();
 
             // loop through the array of things to remove
-            $message = "";
+            $errorMessage = "";
+			$successMessage = "";
+			$numOk = 0;
             foreach( $this->_deleteFilteredContents as $filteredContentId ) {
             	// fetch the content
                 $filteredContent = $filteredContents->getBlogFilteredContent( $filteredContentId, 0 );
 				$this->notifyEvent( EVENT_PRE_FILTERED_CONTENT_DELETE, Array( "content" => &$filteredContent ));				
                 // first remove it
                 if( !$filteredContents->removeBlogFilteredContent( $filteredContentId, $filteredContent->getBlogId()))
-                	$message .= $this->_locale->pr("error_deleting_content", $filteredContent->getRegExp(false))."<br/><br/>";
+                	$errorMessage .= $this->_locale->pr("error_deleting_content", $filteredContent->getRegExp(false))."<br/>";
                 else {
-                	$message .= $this->_locale->pr("content_deleted_ok", $filteredContent->getRegExp(false))."<br/><br/>";
+					$numOk++;
+					if( $numOk > 1 )
+						$successMessage = $this->_locale->pr("contents_deleted_ok", $numOk );
+					else
+						$successMessage = $this->_locale->pr("content_deleted_ok", $filteredContent->getRegExp(false));
 					$this->notifyEvent( EVENT_POST_FILTERED_CONTENT_DELETE, Array( "content" => &$filteredContent ));
 				}
             }
 
-            $this->_view = new AdminMessageView( $this->_blogInfo );
-            $this->_view->setMessage( $message );
+            $this->_view = new AdminFilteredContentView( $this->_blogInfo );
+            if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
+			if( $successMessage != "" ) $this->_view->setSuccessMessage( $successMessage );
             $this->setCommonData();
+       
+			// clear the cache
+			CacheControl::resetBlogCache( $this->_blogInfo->getId());
 
             // better to return true if everything fine
             return true;

Modified: plugins/trunk/contentfilter/class/action/admineditfilteredcontentaction.class.php
===================================================================
--- plugins/trunk/contentfilter/class/action/admineditfilteredcontentaction.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/action/admineditfilteredcontentaction.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,10 +1,10 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminerrorview.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
     include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/dao/filteredcontents.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/admineditfilteredcontentview.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminfilteredcontentview.class.php" );     
 
     /**
      * Shows a form to add a new blocked content to the blog
@@ -17,39 +17,32 @@
     	function AdminEditFilteredContentAction( $actionInfo, $request )
         {
         	$this->SiteAdminAction( $actionInfo, $request );
+        	
+			// data validation stuff
+			$this->registerFieldValidator( "contentId", new IntegerValidator());
+			$view = new AdminFilteredContentView( $this->_blogInfo );
+			$view->setErrorMessage( $this->_locale->tr("error_incorrect_content_id") );
+			$this->setValidationErrorView( $view );        	
         }
 
-        function validate()
+        function perform()
         {
+        	// fetch the data
         	$this->_contentId = $this->_request->getValue( "contentId" );
 
-            $val = new IntegerValidator();
-            if( !$val->validate( $this->_contentId )) {
-            	$this->_view = new AdminErrorView( $this->_locale->tr("error_incorrect_content_id"));
-                $this->setCommonData();
-
-                return false;
-            }
-
-            return true;
-        }
-
-        function perform()
-        {
         	// fetch the filtered content that we're going to edit
             $contents = new FilteredContents();
             $filteredContent = $contents->getBlogFilteredContent( $this->_contentId, 0 );
 
             if( !$filteredContent ) {
-            	$this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setMessage( $this->_locale->tr("error_fetching_filtered_content"));
+            	$this->_view = new AdminFilteredContentView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_filtered_content"));
                 $this->setCommonData();
 
             	return false;
             }
 
-        	$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "contentfilter", "editfilteredcontent" );
-            $this->_view->setValue( "filteredcontent", $filteredContent );
+        	$this->_view = new AdminEditFilteredContentView( $this->_blogInfo , $this->_contentId );
             $this->setCommonData();
 
             return true;

Modified: plugins/trunk/contentfilter/class/action/adminfilteredcontentaction.class.php
===================================================================
--- plugins/trunk/contentfilter/class/action/adminfilteredcontentaction.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/action/adminfilteredcontentaction.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,8 +1,7 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
-    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/dao/filteredcontents.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminfilteredcontentview.class.php" );
 
     /**
      * Shows the list of content that has been blocked by the current blog
@@ -20,12 +19,8 @@
          */
         function perform()
         {
-        	// get the content that has been filtered by this blog
-            $filteredContents = new FilteredContents();
-            $blogFilteredContents = $filteredContents->getAllFilteredContents();
-
-            $this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "contentfilter", "filteredcontent" );
-            $this->_view->setValue( "filteredcontent", $blogFilteredContents );
+            $this->_view = new AdminFilteredContentView( $this->_blogInfo );
+            
             $this->setCommonData();
 
             // better to return true if everything fine

Modified: plugins/trunk/contentfilter/class/action/adminnewfilteredcontentaction.class.php
===================================================================
--- plugins/trunk/contentfilter/class/action/adminnewfilteredcontentaction.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/action/adminnewfilteredcontentaction.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,7 +1,7 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminnewfilteredcontentview.class.php" );
 
     /**
      * Shows a form to add a new blocked content to the blog
@@ -15,7 +15,8 @@
 
         function perform()
         {
-        	$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "contentfilter", "addfilteredcontent" );
+        	$this->_view = new AdminNewFilteredContentView( $this->_blogInfo );
+        	
             $this->setCommonData();
 
             return true;

Modified: plugins/trunk/contentfilter/class/action/adminupdatefilteredcontentaction.class.php
===================================================================
--- plugins/trunk/contentfilter/class/action/adminupdatefilteredcontentaction.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/action/adminupdatefilteredcontentaction.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,10 +1,10 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/siteadminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminerrorview.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminmessageview.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
     include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/dao/filteredcontents.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/admineditfilteredcontentview.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/view/adminfilteredcontentview.class.php" ); 
 
     /**
      * Adds new blocked content to the blog
@@ -19,43 +19,37 @@
     	function AdminUpdateFilteredContentAction( $actionInfo, $request )
         {
         	$this->SiteAdminAction( $actionInfo, $request );
+			
+            // fetch the data
+            $this->_contentId = $this->_request->getValue( "contentId" );
+			
+			// set up the data validators
+			// data validation
+			$this->registerFieldValidator( "contentId", new IntegerValidator());
+			$this->registerFieldValidator( "filteredContent", new StringValidator());
+			$this->_form->registerField( "reason" );
+			$view = new AdminEditFilteredContentView( $this->_blogInfo, $this->_contentId );
+			$view->setErrorMessage( $this->_locale->tr("error_provide_content_to_block" ));
+			$this->setValidationErrorView( $view );        	
         }
 
-        function validate()
+        function perform()
         {
+        	// fetch the data
         	$this->_filteredContentRule = $this->_request->getValue( "filteredContent" );
             $this->_reason = $this->_request->getValue( "reason" );
-            $this->_contentId = $this->_request->getValue( "contentId" );
 
-            $val = new StringValidator();
-            if( !$val->validate( $this->_filteredContentRule )) {
-            	$this->_view = new AdminErrorView( $this->_blogInfo );
-            	$this->_view = new AdminErrorView( $this->_blogInfo );
-				$message = $this->_locale->tr("error_provide_content_to_block");
-				$message .= "<br/><br/><a href=\"javascript:history.go(-1);\">".$this->_locale->tr("back")."</a>";				
-                $this->_view->setMessage( $message );
-
-                $this->setCommonData();
-
-                return false;
-            }
-
-            return true;
-        }
-
-        function perform()
-        {
         	// create the dao object and add the info to the db
         	$filteredContents = new FilteredContents();
             $content = $filteredContents->getBlogFilteredContent( $this->_contentId, 0 );
 
             // check if we could find the information, or give up otherwise...
             if( !$content ) {
-            	$this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setMessage( $this->_locale->tr("error_fetching_filtered_content"));
+            	$this->_view = new AdminFilteredContentView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_filtered_content") );
                 $this->setCommonData();
 
-            	return false;
+                return false;            	
             }
 
             $content->setRegExp( $this->_filteredContentRule );
@@ -67,16 +61,16 @@
 
             // and give some feedback to the user
             if( !$result ) {
-            	$message = $this->_locale->tr("error_updating_blocked_content");
-                $this->_view = new AdminErrorView( $this->_blogInfo );
+            	$this->_view = new AdminFilteredContentView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_blocked_content") );
+                $this->setCommonData();
+
+                return false;   
             }
-            else {
-            	$message = $this->_locale->tr("blocked_content_updated_ok");
-				$this->notifyEvent( EVENT_POST_FILTERED_CONTENT_UPDATE, Array( "content" => &$content ));
-                $this->_view = new AdminMessageView( $this->_blogInfo );
-            }
 
-            $this->_view->setMessage( $message );
+			$this->notifyEvent( EVENT_POST_FILTERED_CONTENT_UPDATE, Array( "content" => &$content ));
+          	$this->_view = new AdminFilteredContentView( $this->_blogInfo );
+            $this->_view->setSuccessMessage( $this->_locale->tr("blocked_content_updated_ok") );
             $this->setCommonData();
 
             return true;

Added: plugins/trunk/contentfilter/class/view/admineditfilteredcontentview.class.php
===================================================================
--- plugins/trunk/contentfilter/class/view/admineditfilteredcontentview.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/view/admineditfilteredcontentview.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -0,0 +1,30 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/dao/filteredcontents.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class AdminEditFilteredContentView extends AdminPluginTemplatedView
+	{
+        var $_contentId;
+		
+		function AdminEditFilteredContentView( $blogInfo, $contentId )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "contentfilter", "editfilteredcontent" );
+			
+			$this->_contentId = $contentId;
+		}
+		
+		function render()
+		{
+		    $contents = new FilteredContents();
+            $filteredContent = $contents->getBlogFilteredContent( $this->_contentId, 0 );
+            
+            $this->setValue( "filteredcontent", $filteredContent ); 
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/contentfilter/class/view/adminfilteredcontentview.class.php
===================================================================
--- plugins/trunk/contentfilter/class/view/adminfilteredcontentview.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/view/adminfilteredcontentview.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -0,0 +1,28 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+    include_once( PLOG_CLASS_PATH."plugins/contentfilter/class/dao/filteredcontents.class.php" );	
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class AdminFilteredContentView extends AdminPluginTemplatedView
+	{
+
+		function AdminFilteredContentView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "contentfilter", "filteredcontent" );
+		}
+		
+		function render()
+		{
+        	// get the content that has been filtered by this blog
+            $filteredContents = new FilteredContents();
+            $blogFilteredContents = $filteredContents->getAllFilteredContents();
+
+            $this->setValue( "filteredcontent", $blogFilteredContents );	
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/contentfilter/class/view/adminnewfilteredcontentview.class.php
===================================================================
--- plugins/trunk/contentfilter/class/view/adminnewfilteredcontentview.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/class/view/adminnewfilteredcontentview.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -0,0 +1,22 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class AdminNewFilteredContentView extends AdminPluginTemplatedView
+	{
+
+		function AdminNewFilteredContentView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "contentfilter", "addfilteredcontent" );
+		}
+		
+		function render()
+		{
+        	// get the content that has been filtered by this blog
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/trunk/contentfilter/plugincontentfilter.class.php
===================================================================
--- plugins/trunk/contentfilter/plugincontentfilter.class.php	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/plugincontentfilter.class.php	2005-01-27 07:55:58 UTC (rev 858)
@@ -46,6 +46,7 @@
 			$this->registerAdminAction( "editFilteredContent", "AdminEditFilteredContentAction" );
 			$this->registerAdminAction( "updateFilteredContent", "AdminUpdateFilteredContentAction" );
 			$this->registerAdminAction( "deleteFilteredContent", "AdminDeleteFilteredContentAction" );
+			$this->registerAdminAction( "deleteFilteredContents", "AdminDeleteFilteredContentAction" );
 			
 			// register the blog owner actions
 			$this->registerAdminAction( "blogFilteredContent", "AdminBlogFilteredContentsAction" );
@@ -53,7 +54,7 @@
 			$this->registerAdminAction( "addBlogFilteredContent", "AdminAddBlogFilteredContentAction" );
 			$this->registerAdminAction( "editBlogFilteredContent", "AdminEditBlogFilteredContentAction" );
 			$this->registerAdminAction( "updateBlogFilteredContent", "AdminUpdateBlogFilteredContentAction" );
-			$this->registerAdminAction( "deleteBlogFilteredContent", "AdminDeleteBlogFilteredContent" );
+			$this->registerAdminAction( "deleteBlogFilteredContent", "AdminDeleteBlogFilteredContentAction" );
 			
 			$menu =& Menu::getMenu();
 			if( !$menu->entryExists( "/menu/Manage/blogSecurity" ))

Modified: plugins/trunk/contentfilter/templates/addfilteredcontent.template
===================================================================
--- plugins/trunk/contentfilter/templates/addfilteredcontent.template	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/templates/addfilteredcontent.template	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,24 +1,33 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=newFilteredContent title=$locale->tr("newFilteredContent")}
-<p>{$locale->tr("global_add_filtered_content_intro")}</p>
 <form name="newBlogFilteredContent" action="admin.php" method="post">
- <table width="100%">
-  <tr>
-   <td class="alignright" width="25%">{$locale->tr("content_to_block")}: </td>
-   <td><input style="width:100%" type="text" name="filteredContent" value=""/></td>
-  </tr>
-  <tr>
-   <td class="alignright">{$locale->tr("reason")}: </td>
-   <td><input type="text" style="width:100%" name="reason" value=""/></td>
-  </tr>
-  <tr>
-   <td>&nbsp;</td>
-   <td>
-    <input type="hidden" name="op" value="addFilteredContent" />
-    <input type="submit" name="Add" value="{$locale->tr("block_this")}"/>
-   </td>
-  </tr>
- </table>
+ <fieldset class="inputField">
+ <legend>{$locale->tr("addFilteredContent")}</legend>
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"} 
+  <div class="field">
+   <label for="filteredContent">{$locale->tr("content_to_block")}</label>
+   <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("content_to_block_help")}</div>
+   <input type="text" name="filteredContent" id="filteredContent" value=""/>
+   {include file="$admintemplatepath/validate.template" field=filteredContent message=$locale->tr("error_provide_content_to_block")}
+  </div>
+
+  <div class="field">
+   <label for="reason">{$locale->tr("reason")}</label>
+   <span class="required"></span>
+   <div class="formHelp">{$locale->tr("reason_help")}</div>
+   <input type="text" name="reason" id="reason" value=""/>
+  </div>
+
+ </fieldset>
+
+ <div class="buttons">
+  <input type="hidden" name="op" value="addFilteredContent" />
+  <input type="reset" value="{$locale->tr("reset")}" name="reset"/>	
+  <input type="submit" name="Add" value="{$locale->tr("add")}"/>
+ </div>    
+
 </form>
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Modified: plugins/trunk/contentfilter/templates/editfilteredcontent.template
===================================================================
--- plugins/trunk/contentfilter/templates/editfilteredcontent.template	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/templates/editfilteredcontent.template	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,29 +1,34 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=filteredContent title=$locale->tr("filteredContent")}
-<p>Anything added here will not be allowed as valid text in a comment, and any attempt
-by a casual user to post a comment with blocked content will block the comment. Regular
-expressions or a simple string can be used. Regular expressions are much more powerful
-but they're also much more complex and you should be careful with them, because you
-could potentially block all content with the wrong regular expression.</p>
 <form name="editFilteredContent" action="admin.php" method="post">
- <table width="100%">
-  <tr>
-   <td class="alignright" width="25%">{$locale->tr("content_to_block")}: </td>
-   <td><input style="width:100%" type="text" name="filteredContent" value="{$filteredcontent->getRegExp()}"/></td>
-  </tr>
-  <tr>
-   <td class="alignright">{$locale->tr("reason")}: </td>
-   <td><input type="text" style="width:100%" name="reason" value="{$filteredcontent->getReason()}"/></td>
-  </tr>
-  <tr>
-   <td>&nbsp;</td>
-   <td>
-    <input type="hidden" name="op" value="updateFilteredContent" />
-    <input type="hidden" name="contentId" value="{$filteredcontent->getId()}" />
-    <input type="submit" name="Add" value="{$locale->tr("update")}"/>
-   </td>
-  </tr>
- </table>
+ <fieldset class="inputField">
+ <legend>{$locale->tr("editFilteredContent")}</legend>
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"} 
+  <div class="field">
+   <label for="filteredContent">{$locale->tr("content_to_block")}</label>
+   <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("content_to_block_help")}</div>
+   <input type="text" name="filteredContent" id="filteredContent" value="{$filteredcontent->getRegExp()}"/>
+   {include file="$admintemplatepath/validate.template" field=filteredContent message=$locale->tr("error_provide_content_to_block")}
+  </div>
+
+  <div class="field">
+   <label for="reason">{$locale->tr("reason")}</label>
+   <span class="required"></span>
+   <div class="formHelp">{$locale->tr("reason_help")}</div>
+   <input type="text" name="reason" id="reason" value="{$filteredcontent->getReason()}"/>
+  </div>
+
+ </fieldset>
+
+ <div class="buttons">
+  <input type="hidden" name="op" value="updateFilteredContent" />
+  <input type="hidden" name="contentId" value="{$filteredcontent->getId()}" />
+  <input type="reset" value="{$locale->tr("reset")}" name="reset"/>
+  <input type="submit" name="Add" value="{$locale->tr("update")}"/>
+ </div>   
+
 </form>
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Modified: plugins/trunk/contentfilter/templates/filteredcontent.template
===================================================================
--- plugins/trunk/contentfilter/templates/filteredcontent.template	2005-01-27 00:53:22 UTC (rev 857)
+++ plugins/trunk/contentfilter/templates/filteredcontent.template	2005-01-27 07:55:58 UTC (rev 858)
@@ -1,28 +1,40 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=filteredContent title=$locale->tr("filteredContent")}
-<p>{$locale->tr("global_filtered_content_intro")}</p>
 <form name="filteredContent" action="admin.php" method="post">
-<table width="100%" border="1">
- <tr>
-  <th width="40%">{$locale->tr("content")}</th>
-  <th>{$locale->tr("reason")}</th>
-  <th>{$locale->tr("date")}</th>
-  <th>{$locale->tr("type")}</th>
-  <th>{$locale->tr("delete")}</th>
- </tr>
-{foreach from=$filteredcontent item=content}
- <tr>
-  <td valign="top"><a href="admin.php?op=editFilteredContent&amp;contentId={$content->getId()}">{$content->getRegExp(true)}</a></td>
-  <td valign="top">{$content->getReason()}</td>
-  {assign var=contentDate value=$content->getDateObject()}
-  <td valign="top">{$locale->formatDate($contentDate,"%d/%m/%Y %H:%M")}</td>
-  <td valign="top">{if $content->isGlobal()}<b>{$locale->tr("global")}</b>{/if}</td>
-  <td valign="top" align="center"><input type="checkbox" name="deleteFilteredContent[{$content->getId()}]" value="{$content->getId()}"/></td>
- </tr>
-{/foreach}
-</table>
-<input type="hidden" name="op" value="deleteFilteredContent" />
-<input type="submit" value="{$locale->tr("delete_selected")}" name="deleteSelected" />
+ <div id="list">
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}
+  <table class="info">
+   <tr>
+    <th style="width:10px;"><input class="checkbox" type="checkbox" class="check" name="all" id="all" value="1" onclick="toggleAllChecks('filteredContent');" /></th>
+    <th style="width:150px;">{$locale->tr("content")}</th>
+    <th style="width:270px;">{$locale->tr("reason")}</th>
+    <th style="width:150px;">{$locale->tr("date")}</th>
+    <th style="width:80px;">{$locale->tr("type")}</th>
+    <th style="width:95px;">{$locale->tr("actions")}</th>
+   </tr>
+   {foreach from=$filteredcontent item=content}
+   <tr>
+     <td align="center"><input class="checkbox" type="checkbox" name="deleteFilteredContent[{$content->getId()}]" value="{$content->getId()}"/></td>
+     <td class="col_highlighted"><a href="admin.php?op=editFilteredContent&amp;contentId={$content->getId()}">{$content->getRegExp(true)}</a></td>
+     <td>{$content->getReason()}</td>
+     {assign var=contentDate value=$content->getDateObject()}
+     <td>{$locale->formatDate($contentDate,"%d/%m/%Y %H:%M")}</td>
+     <td>{if $content->isGlobal()}<b>{$locale->tr("global")}</b>{/if}</td>
+     <td>
+      <div class="list_action_button">
+       <a href="?op=editFilteredContent&amp;contentId={$content->getId()}"><img src="imgs/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
+       <a href="?op=deleteFilteredContent&amp;contentId={$content->getId()}"><img src="imgs/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+      </div>
+    </td>     
+    </tr>
+   {/foreach}
+  </table>
+  <div id="list_action_bar">
+   <input type="hidden" name="op" value="deleteFilteredContents" />
+   <input type="submit" value="{$locale->tr("delete")}" name="deleteSelected" />
+  </div> 
+ </div>
 </form>
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file




More information about the pLog-svn mailing list