[CMF-checkins] CVS: CMF/CMFDefault/skins/zpt_generic - join_control.py:1.4 login_form.pt:1.7 members_manage_control.py:1.4 registered_notify_control.py:1.3

Yvo Schubbe schubbe at web.de
Sun Jan 11 07:59:04 EST 2004


Update of /cvs-repository/CMF/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv12135/CMFDefault/skins/zpt_generic

Modified Files:
	join_control.py login_form.pt members_manage_control.py 
	registered_notify_control.py 
Log Message:
- replaced some hard-coded urls using getActionInfo


=== CMF/CMFDefault/skins/zpt_generic/join_control.py 1.3 => 1.4 ===
--- CMF/CMFDefault/skins/zpt_generic/join_control.py:1.3	Wed Nov 26 05:08:51 2003
+++ CMF/CMFDefault/skins/zpt_generic/join_control.py	Sun Jan 11 07:59:02 2004
@@ -50,7 +50,7 @@
 
 elif cancel:
     if is_usermanager:
-        target = '%s/members_manage_form' % portal_url
+        target = mtool.getActionInfo('global/manage_members')['url']
     else:
         target = portal_url
     context.REQUEST.RESPONSE.redirect(target)
@@ -76,10 +76,10 @@
 
 buttons = []
 if is_newmember:
-    target = '%s/logged_in' % portal_url
+    target = mtool.getActionInfo('user/logged_in')['url']
     buttons.append( {'name': 'login', 'value': 'Log in'} )
 else:
-    target = '%s/join_form' % portal_url
+    target = rtool.getActionInfo('user/join')['url']
     buttons.append( {'name': 'add', 'value': 'Register'} )
     buttons.append( {'name': 'cancel', 'value': 'Cancel'} )
 control['form'] = { 'action': target,


=== CMF/CMFDefault/skins/zpt_generic/login_form.pt 1.6 => 1.7 ===
--- CMF/CMFDefault/skins/zpt_generic/login_form.pt:1.6	Fri Jun 13 13:12:15 2003
+++ CMF/CMFDefault/skins/zpt_generic/login_form.pt	Sun Jan 11 07:59:02 2004
@@ -2,13 +2,15 @@
       xmlns:metal="http://xml.zope.org/namespaces/metal"
       metal:use-macro="here/main_template/macros/master">
 <body>
-<div metal:fill-slot="main" i18n:domain="cmf_default">
+<div metal:fill-slot="main" i18n:domain="cmf_default"
+   tal:define="mtool here/portal_membership">
 <div class="Desktop">
-<h1 class="Desktop" i18n:translate="">Log in</h1>
+
+<h2 i18n:translate="">Log in</h2>
 
 <form action="" method="post"
-      tal:attributes="action string:${here/portal_url}/logged_in"
->
+   tal:attributes="action python: mtool.getActionInfo(
+                                                    'user/logged_in')['url']">
 
 <!-- ****** Enable the automatic redirect ***** -->
 <span tal:condition="exists: request/came_from">


=== CMF/CMFDefault/skins/zpt_generic/members_manage_control.py 1.3 => 1.4 ===
--- CMF/CMFDefault/skins/zpt_generic/members_manage_control.py:1.3	Wed Nov 26 05:08:51 2003
+++ CMF/CMFDefault/skins/zpt_generic/members_manage_control.py	Sun Jan 11 07:59:02 2004
@@ -10,8 +10,7 @@
 from ZTUtils import Batch
 from Products.CMFCore.utils import getToolByName
 mtool = getToolByName(script, 'portal_membership')
-utool = getToolByName(script, 'portal_url')
-portal_url = utool()
+rtool = getToolByName(script, 'portal_registration')
 message = ''
 
 
@@ -23,7 +22,7 @@
         message = 'Please select one or more members to delete first.'
 
 elif members_new:
-    target = '%s/join_form' % portal_url
+    target = rtool.getActionInfo('user/join')['url']
     context.REQUEST.RESPONSE.redirect(target)
     return None
 
@@ -33,7 +32,7 @@
 
 control = {}
 
-target = '%s/members_manage_form' % portal_url
+target = mtool.getActionInfo('global/manage_members')['url']
 members = mtool.listMembers()
 batch_obj = Batch(members, 25, b_start, orphan=0)
 items = []


=== CMF/CMFDefault/skins/zpt_generic/registered_notify_control.py 1.2 => 1.3 ===
--- CMF/CMFDefault/skins/zpt_generic/registered_notify_control.py:1.2	Thu Oct 30 13:23:18 2003
+++ CMF/CMFDefault/skins/zpt_generic/registered_notify_control.py	Sun Jan 11 07:59:02 2004
@@ -9,9 +9,13 @@
 ##
 from ZTUtils import make_query
 from Products.CMFCore.utils import getToolByName
+mtool = getToolByName(script, 'portal_membership')
 ptool = getToolByName(script, 'portal_properties')
 utool = getToolByName(script, 'portal_url')
+portal_url = utool()
 member_id = member and member.getId() or 'foo'
+
+
 control = {}
 
 control['member_email'] = '<%s>' % email
@@ -20,10 +24,10 @@
                                                   'email_from_address')
 control['portal_title'] = ptool.title()
 control['portal_description'] = ptool.getProperty('description')
-control['portal_url'] = '<%s>' % utool()
+control['portal_url'] = '<%s>' % portal_url
 control['member_id'] = member_id
 control['password'] = password
-target = '%s/logged_in' % utool()
+target = mtool.getActionInfo('user/logged_in')['url']
 query = make_query(__ac_name=member_id, __ac_password=password)
 control['login_url'] = '<%s?%s>' % (target, query)
 




More information about the CMF-checkins mailing list