[CMF-checkins] CVS: CMF - addtoFavorites.dtml:1.4

andrew@digicool.com andrew@digicool.com
Thu, 17 May 2001 17:06:47 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault/skins/control
In directory korak.digicool.com:/tmp/cvs-serv14649

Modified Files:
	addtoFavorites.dtml 
Log Message:

*Tracker #255 resolution
*Added a check for the portal_type, if it's a folder return the
absolute_url() otherwise return the /view on the absolute_url()



--- Updated File addtoFavorites.dtml in package CMF --
--- addtoFavorites.dtml	2001/03/27 17:26:41	1.3
+++ addtoFavorites.dtml	2001/05/17 21:06:46	1.4
@@ -10,6 +10,7 @@
   <dtml-let targetFolder="_.getattr( homeFolder, 'Favorites' )"
             new_id="'fav_' + _.str( _.int( ZopeTime() ) )"
             myPath="portal_url.getRelativeUrl( this() )"
+            objType="this().portal_type"
   >
     <dtml-call expr="targetFolder.invokeFactory( 'Favorite'
                                                , id=new_id
@@ -17,9 +18,14 @@
                                                , remote_url=myPath
                                                )">
 
-  </dtml-let>
 
-  <dtml-call expr="RESPONSE.redirect( absolute_url() + '/view')">
+<dtml-if expr="objType == 'Folder'">
+  <dtml-call expr="RESPONSE.redirect( absolute_url())">
+<dtml-else>
+  <dtml-call expr="RESPONSE.redirect( absolute_url()+ '/view')">
+</dtml-if>
+</dtml-let>
+
 </dtml-let>
 
 <dtml-var standard_html_footer>