[pLog-svn] r3242 - plog/trunk/class/view/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Apr 12 19:49:12 GMT 2006


Author: oscar
Date: 2006-04-12 19:49:12 +0000 (Wed, 12 Apr 2006)
New Revision: 3242

Modified:
   plog/trunk/class/view/admin/adminresourceslistview.class.php
Log:
fixed an issue where it was not possible to browse albums correctly


Modified: plog/trunk/class/view/admin/adminresourceslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminresourceslistview.class.php	2006-04-12 09:16:45 UTC (rev 3241)
+++ plog/trunk/class/view/admin/adminresourceslistview.class.php	2006-04-12 19:49:12 UTC (rev 3242)
@@ -19,17 +19,23 @@
 		var $_albumId;
 		var $_page;
 		var $_resourceType;
-
+		var $_viewParams;
 	
 		function AdminResourcesListView( $blogInfo, $params = Array())
 		{
 			$this->AdminTemplatedView( $blogInfo, "resources" );
 			
+			$this->_viewParams = $params;
+		}
+		
+		function render()
+		{
+			
 			// fetch and save the albumId parameter in the request, if not available as a
 			// constructor parameter
-			if( isset( $params["albumId"] ) )
-				$this->_albumId = $params["albumId"];
-			if( empty( $this->_albumId ) ) 
+			isset( $this->_viewParams["albumId"] ) ? $this->_albumId = $this->_viewParams["albumId"] : $this->_albumId = null;
+				
+			if( $this->_albumId == null )
 				$this->_albumId = $this->getSessionValue( "albumId", ROOT_ALBUM_ID );
 
 			// in case we didn't get any album id at all!
@@ -38,8 +44,8 @@
 				
 			// search terms
 			$this->_searchTerms = "";
-			if( isset( $params['searchTerms'] ))
-				$this->_searchTerms = $params['searchTerms'];
+			if( isset( $this->_viewParams['searchTerms'] ))
+				$this->_searchTerms = $this->_viewParams['searchTerms'];
 				
 			$this->setSessionValue( "albumId", $this->_albumId );
 
@@ -48,10 +54,8 @@
 			// base url for the pager so that it can be changed by parent classes
 			// such as AdminSimpleResourcesListView
 			$this->_pagerUrl = "?op=resources&albumId=".$this->_albumId."&page=";
-		}
 		
-		function render()
-		{
+		
 			// get the page from the request
 			$this->_page = $this->getCurrentPageFromRequest();
 			
@@ -62,7 +66,7 @@
 			$galleryResources = new GalleryResources();
 
 			$numResources = 0;
-			if( $this->_albumId > ROOT_ALBUM_ID && $this->_page > 0 ) {
+			if( $this->_albumId > ROOT_ALBUM_ID && $this->_page > 0 ) {			
         	    $album = $galleryAlbums->getAlbum( $this->_albumId, $this->_blogInfo->getId());
 				if( !$album || empty($album) ) {
 					$this->_albumId = ROOT_ALBUM_ID;



More information about the pLog-svn mailing list