[pLog-svn] r1948 - in plog/branches/plog-1.0.1/class/summary: action view

oscar at devel.plogworld.net oscar at devel.plogworld.net
Thu May 5 23:07:11 GMT 2005


Author: oscar
Date: 2005-05-05 23:07:10 +0000 (Thu, 05 May 2005)
New Revision: 1948

Modified:
   plog/branches/plog-1.0.1/class/summary/action/bloglistaction.class.php
   plog/branches/plog-1.0.1/class/summary/action/blogprofileaction.class.php
   plog/branches/plog-1.0.1/class/summary/action/summarycustompageaction.class.php
   plog/branches/plog-1.0.1/class/summary/action/summarydefaultaction.class.php
   plog/branches/plog-1.0.1/class/summary/action/userlistaction.class.php
   plog/branches/plog-1.0.1/class/summary/action/userprofileaction.class.php
   plog/branches/plog-1.0.1/class/summary/view/summarybloglistview.class.php
   plog/branches/plog-1.0.1/class/summary/view/summarycachedview.class.php
   plog/branches/plog-1.0.1/class/summary/view/summaryuserlistview.class.php
Log:
Added support for multi-language summary even when caching is enabled (I somehow forgot it before)

Modified: plog/branches/plog-1.0.1/class/summary/action/bloglistaction.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/action/bloglistaction.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/action/bloglistaction.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -22,7 +22,14 @@
          */
         function perform()
         {
-			$this->_view = new SummaryBlogListView();
+            // this is a bit hackish but it works...
+            $page = View::getCurrentPageFromRequest();
+            
+            // create the view
+			$this->_view = new SummaryBlogListView( Array( "summary" => "BlogList", 
+			                                        "page" => $this->_page, 
+			                                        "locale" => $this->_locale->getLocaleCode()));
+			
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;

Modified: plog/branches/plog-1.0.1/class/summary/action/blogprofileaction.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/action/blogprofileaction.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/action/blogprofileaction.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -36,7 +36,9 @@
         {
 			$this->_blogId = $this->_request->getValue( "blogId" );	        
 	        
-			$this->_view = new SummaryCachedView( "blogprofile", Array( "summary" => "BlogProfile", "blogId" => $this->_blogId ));
+			$this->_view = new SummaryCachedView( "blogprofile", Array( "summary" => "BlogProfile", 
+			                                                            "blogId" => $this->_blogId,
+			                                                            "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;

Modified: plog/branches/plog-1.0.1/class/summary/action/summarycustompageaction.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/action/summarycustompageaction.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/action/summarycustompageaction.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -29,7 +29,7 @@
 			}
 			else {
 				// let's cache the page... After all, we're not expecting much dynamic context in here!
-				$this->_view = new SummaryCachedView( $this->_page, Array( "page" => $this->_page ));
+				$this->_view = new SummaryCachedView( $this->_page, Array( "page" => $this->_page, "locale" => $this->_locale->getLocaleCode()));
 				$this->setCommonData();
 			}
 			

Modified: plog/branches/plog-1.0.1/class/summary/action/summarydefaultaction.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/action/summarydefaultaction.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/action/summarydefaultaction.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -28,7 +28,7 @@
          */
         function perform()
         {
-			$this->_view = new SummaryCachedView( "index", Array( "summary" => "default" ));
+			$this->_view = new SummaryCachedView( "index", Array( "summary" => "default", "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// if the view is already cached... move along! nothing to see here
 				return true;

Modified: plog/branches/plog-1.0.1/class/summary/action/userlistaction.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/action/userlistaction.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/action/userlistaction.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -24,7 +24,10 @@
          */
         function perform()
         {
-			$this->_view = new SummaryUserListView();
+            $page = View::getCurrentPageFromRequest();
+			$this->_view = new SummaryUserListView( Array( "summary" => "UserList", 
+			                                               "page" => $page,
+			                                               "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;

Modified: plog/branches/plog-1.0.1/class/summary/action/userprofileaction.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/action/userprofileaction.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/action/userprofileaction.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -19,7 +19,7 @@
             
             // data validaiton
             $this->registerFieldValidator( "userId", new IntegerValidator());
-            $this->setValidationErrorView( new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1 )));
+            $this->setValidationErrorView( new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1, "locale" => $this->_locale->getLocaleCode())));
         }
 		
         /**
@@ -29,7 +29,7 @@
         {
 			$this->_userId = $this->_request->getValue( "userId" );	        
 	        
-			$this->_view = new SummaryCachedView( "userprofile", Array( "summary" => "userProfile", "userId" => $this->_userId ));
+			$this->_view = new SummaryCachedView( "userprofile", Array( "summary" => "userProfile", "userId" => $this->_userId, "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;
@@ -40,7 +40,7 @@
 			$userInfo = $users->getUserInfoFromId( $this->_userId, true );
 			
 			if( !$userInfo ) {
-				$this->_view = new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1 ));
+				$this->_view = new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1, "locale" => $this->_locale->getLocaleCode()));
 				$this->setCommonData();
 				return false;			
 			}

Modified: plog/branches/plog-1.0.1/class/summary/view/summarybloglistview.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/view/summarybloglistview.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/view/summarybloglistview.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -14,12 +14,12 @@
 		var $_numBlogs;
 		var $_numBlogsPerPage;
 	
-		function SummaryBlogListView()
+		function SummaryBlogListView( $data = Array())
 		{
 			// get the page
 			$this->_page = $this->getCurrentPageFromRequest();
 			
-			$this->SummaryCachedView( "blogslist",  Array( "summary" => "BlogList", "page" => $this->_page ) );
+			$this->SummaryCachedView( "blogslist", $data );
 			
 			// items per page
             //$this->_numUsers = $this->_config->getValue( "summary_page_show_max" );

Modified: plog/branches/plog-1.0.1/class/summary/view/summarycachedview.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/view/summarycachedview.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/view/summarycachedview.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -46,6 +46,8 @@
 			$cacheId .= "$key=$value";
 			$cacheId = md5($cacheId);
 			
+			print("cache id = $cacheId<br/>");
+			
 			return $cacheId;
 		}
 		

Modified: plog/branches/plog-1.0.1/class/summary/view/summaryuserlistview.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/summary/view/summaryuserlistview.class.php	2005-05-05 22:38:49 UTC (rev 1947)
+++ plog/branches/plog-1.0.1/class/summary/view/summaryuserlistview.class.php	2005-05-05 23:07:10 UTC (rev 1948)
@@ -14,13 +14,13 @@
 		var $_numUsers;
 		var $_numUsersPerPage;
 	
-		function SummaryUserListView()
+		function SummaryUserListView( $data = Array())
 		{
 			// get the page id
 			$this->_page = $this->getCurrentPageFromRequest();		
 			
 			// and initialize the cached view
-			$this->SummaryCachedView( "userlist",  Array( "summary" => "UserList", "page" => $this->_page ));
+			$this->SummaryCachedView( "userlist", $data );
 			
 			// items per page
             $config =& Config::getConfig();




More information about the pLog-svn mailing list