[pLog-svn] r1861 - plog/trunk/class/security

oscar at devel.plogworld.net oscar at devel.plogworld.net
Sun Apr 17 20:50:38 GMT 2005


Author: oscar
Date: 2005-04-17 20:50:38 +0000 (Sun, 17 Apr 2005)
New Revision: 1861

Modified:
   plog/trunk/class/security/pipelineresult.class.php
Log:
added the hasView(),  getView() and setView() methods that allow PipelineResult objects to provide their own views instead of relying on the ErrorView. I think Mark requested something like this a while ago :), and basically it could be used by plugins that register their custom filters to show their own views to do cooler things instead of as it is done now.

Modified: plog/trunk/class/security/pipelineresult.class.php
===================================================================
--- plog/trunk/class/security/pipelineresult.class.php	2005-04-17 20:46:58 UTC (rev 1860)
+++ plog/trunk/class/security/pipelineresult.class.php	2005-04-17 20:50:38 UTC (rev 1861)
@@ -29,6 +29,7 @@
         	$this->_valid = $valid;
             $this->_errorCode = $errorCode;
             $this->_errorMessage = $errorMessage;
+			$this->_view = null;
         }
 
         /**
@@ -97,5 +98,38 @@
             
             return true;
         }
+		
+		/**
+		 * Whether this result object has a custom view or not
+		 *
+		 * @return True if there is a custom view object that should be shown instead of the
+		 * default one or false otherwise
+		 */
+		function hasView()
+		{
+			return( $this->_view != null );
+		}	
+		
+		/**
+		 * Returns a custom view that can be used instead of the default
+		 * ErrorView
+		 *
+		 * @param view A valid View, or a class extending from the base View
+		 * @return nothing
+		 */
+		function setView( $view )
+		{
+			$this->_view = $view;
+		}
+		
+		/**
+		 * returns the custom view, if any
+		 *
+		 * @return A valid View, or a class extending from the base View
+		 */
+		function getView()
+		{
+			return( $this->_view );
+		}
     }
 ?>
\ No newline at end of file




More information about the pLog-svn mailing list