Commit f3cc671e authored by Michel Pelletier's avatar Michel Pelletier

Improved Vocabulary selection UI

parent 40c1143f
...@@ -106,15 +106,14 @@ from AccessControl import getSecurityManager ...@@ -106,15 +106,14 @@ from AccessControl import getSecurityManager
manage_addZCatalogForm=HTMLFile('addZCatalog',globals()) manage_addZCatalogForm=HTMLFile('addZCatalog',globals())
def manage_addZCatalog(self, id, title, vocab='', vocab_id='', REQUEST=None): def manage_addZCatalog(self, id, title, vocab_id='', REQUEST=None):
"""Add a ZCatalog object """Add a ZCatalog object
""" """
id=str(id) id=str(id)
title=str(title) title=str(title)
vocab=str(vocab)
vocab_id=str(vocab_id) vocab_id=str(vocab_id)
c=ZCatalog(id, title, vocab, vocab_id, self) c=ZCatalog(id, title, vocab_id, self)
self._setObject(id, c) self._setObject(id, c)
if REQUEST is not None: if REQUEST is not None:
return self.manage_main(self, REQUEST) return self.manage_main(self, REQUEST)
...@@ -196,7 +195,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -196,7 +195,7 @@ class ZCatalog(Folder, Persistent, Implicit):
threshold=10000 threshold=10000
_v_total=0 _v_total=0
def __init__(self, id, title='', vocab=0, vocab_id='', container=None): def __init__(self, id, title='', vocab_id='', container=None):
self.id=id self.id=id
self.title=title self.title=title
self.vocab_id = vocab_id self.vocab_id = vocab_id
...@@ -204,7 +203,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -204,7 +203,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.threshold = 10000 self.threshold = 10000
self._v_total = 0 self._v_total = 0
if not vocab: if vocab_id == 'create_default_catalog_':
v = Vocabulary('Vocabulary', 'Vocabulary', globbing=1) v = Vocabulary('Vocabulary', 'Vocabulary', globbing=1)
self._setObject('Vocabulary', v) self._setObject('Vocabulary', v)
v = 'Vocabulary' v = 'Vocabulary'
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
<EM><STRONG>Vocabulary</STRONG></EM> <EM><STRONG>Vocabulary</STRONG></EM>
</TD> </TD>
<TD ALIGN="LEFT" VALIGN="TOP"> <TD ALIGN="LEFT" VALIGN="TOP">
<em>Select Vocabulary?</em> <input type="checkbox" name="vocab">
<select name="vocab_id"> <select name="vocab_id">
<option value="create_default_catalog_">Create one for me</option>
<dtml-in "superValues('Vocabulary')"> <dtml-in "superValues('Vocabulary')">
<option value="<dtml-var id html_quote>"> <option value="<dtml-var id html_quote>">
<dtml-var id> <dtml-var id>
......
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