Commit 5ed1a09a authored by Jim Fulton's avatar Jim Fulton

Added support for " Add and Edit "...

parent e7786abf
"""Document object"""
__version__='$Revision: 1.62 $'[11:-2]
__version__='$Revision: 1.63 $'[11:-2]
from Globals import HTML, HTMLFile, MessageDialog
from string import join,split,strip,rfind,atoi,lower
......@@ -248,7 +248,7 @@ the <!--#var title_and_id--> Folder.</P>
manage_addDocumentForm=HTMLFile('documentAdd', globals())
def manage_addDocument(self,id,title='',file='',REQUEST=None):
def manage_addDocument(self, id, title='',file='', REQUEST=None, submit=None):
"""
Add a Document object with the contents of file.
......@@ -259,7 +259,10 @@ def manage_addDocument(self,id,title='',file='',REQUEST=None):
i=Document(file, __name__=id)
i.title=title
self._setObject(id,i)
if REQUEST is not None: return self.manage_main(self,REQUEST)
if REQUEST is not None:
u=REQUEST['URL1']
if submit==" Add and Edit ": u="%s/%s" % (u,id)
REQUEST.RESPONSE.redirect(u+'/manage_main')
return ''
class DocumentHandler:
......
......@@ -13,37 +13,26 @@
ENCTYPE="multipart/form-data" TARGET="manage_main">
<TABLE CELLSPACING="2">
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<STRONG>Id</STRONG>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="id" SIZE="40">
</TD>
<TH ALIGN="LEFT" VALIGN="TOP">Id</TH>
<TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="id" SIZE="40"></TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<EM><STRONG>Title</STRONG></EM>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="title" SIZE="40">
</TD>
<TH ALIGN="LEFT" VALIGN="TOP"><EM>Title</EM></TH>
<TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="title" SIZE="40"></TD>
</TR>
<TR>
<TH ALIGN="LEFT" VALIGN="TOP"><EM><STRONG>File</STRONG></EM></TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<EM><STRONG>File</STRONG></EM>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="file" NAME="file:string" SIZE="25" VALUE="">
<INPUT TYPE="file" NAME="file:string" SIZE="25" VALUE="">
</TD>
</TR>
<TR>
<TD></TD>
<TD>
<BR><INPUT TYPE="SUBMIT" VALUE=" Add ">
</TD>
<TR><TH></TH>
<TD>
<INPUT TYPE="SUBMIT" VALUE=" Add ">
<INPUT TYPE="SUBMIT" VALUE=" Add and Edit " NAME="submit">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
</BODY></HTML>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment