[CMF-checkins] CVS: CMF/CMFWiki - CMFWikiPage.py:1.20
Tres Seaver
tseaver@zope.com
Mon, 3 Dec 2001 09:25:55 -0500
Update of /cvs-repository/CMF/CMFWiki
In directory cvs.zope.org:/tmp/cvs-serv31761
Modified Files:
CMFWikiPage.py
Log Message:
- Make title of wiki page editable, and make the wiki borrow the
Title() from its front page (thanks to Joseph Wayne Norton for
the patch).
=== CMF/CMFWiki/CMFWikiPage.py 1.19 => 1.20 ===
else:
self.last_log = None
+ self.title=title
if text is not None:
self.username = username
t = text
@@ -1276,6 +1277,8 @@
security.declarePublic('title_or_id')
def title_or_id(self):
+ if self.title:
+ return self.title
fid = self._my_folder().getId()
return "%s of %s" % (self.getId(), fid)
@@ -1870,6 +1873,10 @@
def PUT_factory(self, name, typ, body):
if find(typ, 'text') != -1:
return makeCMFWikiPage(name, '', body)
+
+ def Title(self): # for CMFCatalog
+ fp = getattr( self, 'FrontPage', None )
+ return fp and fp.Title() or self.title_or_id()
def makeCMFWikiPage(id, title, file):
ob = CMFWikiPage(source_string=file, __name__=id)