[pLog-svn] r4174 - in plog/trunk: class/summary/action locale templates/summary

oscar at devel.lifetype.net oscar at devel.lifetype.net
Mon Oct 23 12:06:08 GMT 2006


Author: oscar
Date: 2006-10-23 12:06:07 +0000 (Mon, 23 Oct 2006)
New Revision: 4174

Modified:
   plog/trunk/class/summary/action/bloglistaction.class.php
   plog/trunk/class/summary/action/blogprofileaction.class.php
   plog/trunk/class/summary/action/postlistaction.class.php
   plog/trunk/class/summary/action/summaryaction.class.php
   plog/trunk/class/summary/action/summarydefaultaction.class.php
   plog/trunk/class/summary/action/summaryrssaction.class.php
   plog/trunk/class/summary/action/userlistaction.class.php
   plog/trunk/class/summary/action/userprofileaction.class.php
   plog/trunk/locale/locale_en_UK.php
   plog/trunk/templates/summary/index.template
Log:
now the summary page is also able to recognize logged-in users and display a welcome message instead of the same login box


Modified: plog/trunk/class/summary/action/bloglistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/bloglistaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/bloglistaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -36,6 +36,7 @@
 			
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
+				$this->setCommonData();				
 				return true;
 			}
 			

Modified: plog/trunk/class/summary/action/blogprofileaction.class.php
===================================================================
--- plog/trunk/class/summary/action/blogprofileaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/blogprofileaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -39,6 +39,7 @@
 			                                                            "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
+				$this->setCommonData();
 				return true;
 			}
 			

Modified: plog/trunk/class/summary/action/postlistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/postlistaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/postlistaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -36,6 +36,7 @@
 			
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
+				$this->setCommonData();
 				return true;
 			}
 			

Modified: plog/trunk/class/summary/action/summaryaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summaryaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/summaryaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -12,11 +12,18 @@
 	class SummaryAction extends Action
 	{
 		
+		var $_config;
+		var $_locale;
+		var $_userInfo;
+		
 		function SummaryAction( $actionInfo, $request )
 		{
 			$this->Action( $actionInfo, $request );
 			$this->_config   =& Config::getConfig();
 			$this->_locale   =& $this->_loadLocale();
+			
+			// load userinfo data if any
+			$this->_userInfo = SessionManager::getUserInfoFromSession();
 		}
 		
 		/**
@@ -78,6 +85,7 @@
 		    parent::setCommonData( $copyFormValues );
 		    
 		    $this->_view->setValue( "locale", $this->_locale );
+		    $this->_view->setValue( "authuser", $this->_userInfo );
 		}
 		
 		/**

Modified: plog/trunk/class/summary/action/summarydefaultaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summarydefaultaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/summarydefaultaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -35,6 +35,7 @@
 												
 			if( $this->_view->isCached()) {
 				// if the view is already cached... move along! nothing to see here
+				$this->setCommonData();
 				return true;
 			}
 

Modified: plog/trunk/class/summary/action/summaryrssaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summaryrssaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/summaryrssaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -73,6 +73,7 @@
 			                                       "mode" => $this->_mode,
 												   "profile" => $this->_profile ));
 				if( $this->_view->isCached()) {
+					$this->setCommonData();
 					return true;
 				}
 		
@@ -136,6 +137,7 @@
 			                                       "mode" => $this->_mode,
 												   "profile" => $this->_profile ));
 				if( $this->_view->isCached()) {
+					$this->setCommonData();
 					return true;
 				}
 				

Modified: plog/trunk/class/summary/action/userlistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/userlistaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/userlistaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -24,6 +24,7 @@
 			                                               "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
+				$this->setCommonData();
 				return true;
 			}
 			

Modified: plog/trunk/class/summary/action/userprofileaction.class.php
===================================================================
--- plog/trunk/class/summary/action/userprofileaction.class.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/class/summary/action/userprofileaction.class.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -31,6 +31,7 @@
 			$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
+				$this->setCommonData();
 				return true;
 			}
 			

Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/locale/locale_en_UK.php	2006-10-23 12:06:07 UTC (rev 4174)
@@ -1142,4 +1142,7 @@
 $messages['view_posts_desc'] = 'View the blog posts';
 $messages['view_resources_desc'] = 'View the blog resources';
 $messages['view_trackbacks_desc'] = 'View the blog trackbacks';
+
+$messages['summary_welcome_msg'] = 'Welcome, %s!';
+$messages['summary_go_to_admin'] = 'Go to admin interface';
 ?>
\ No newline at end of file

Modified: plog/trunk/templates/summary/index.template
===================================================================
--- plog/trunk/templates/summary/index.template	2006-10-23 11:11:17 UTC (rev 4173)
+++ plog/trunk/templates/summary/index.template	2006-10-23 12:06:07 UTC (rev 4174)
@@ -4,6 +4,12 @@
     <form id="loginForm" method="post" action="admin.php">
     <fieldset class="inputField">
         <h4>{$locale->tr("login")}</h4>
+        {dynamic}
+        {if $authuser}
+          {assign var=userName value=$authuser->getUsername()}
+          {$locale->pr("summary_welcome_msg", $userName)}<br/>
+          <a href="admin.php?op=blogSelect">{$locale->tr("summary_go_to_admin")}</a>
+        {else}        
         <div class="field">
             <label for="userName">{$locale->tr("username")}</label>
             <input type="text" tabindex="10" name="userName" id="userName" value="" maxlength="50" />
@@ -14,8 +20,11 @@
         </div>
         <input type="submit" class="button" name="Login" value="{$locale->tr("login")}" tabindex="12" />
         <input type="hidden" name="op" value="Login" />
+       	<a href="?op=resetPasswordForm">{$locale->tr("password_forgotten")}</a>			    
+        {/if}
+        {/dynamic}
 		<br/>
-	    <a href="?op=resetPasswordForm">{$locale->tr("password_forgotten")}</a>		
+	    
     </fieldset>
     </form>
     {assign var=recentBlogs value=$summaryStats->getRecentBlogs()}



More information about the pLog-svn mailing list