Exemple #1
0
 def __call__(_next, self, model, request):
     ajax_form_fiddle(request, '#content', 'inner')
     info = getNodeInfo(model.node_info_name)
     heading = u'<h1>Add %s</h1>' % info.title
     form = _next(self, model, request)
     if form is None:
         form = u''
     rendered = self.show_heading and heading + form or form
     return u'<div class="box">%s</div>' % rendered
Exemple #2
0
 def items(self):
     ret = list()
     addables = self.model.nodeinfo.addables
     if not addables:
         return ret
     for addable in addables:
         info = getNodeInfo(addable)
         if not info:
             continue
         query = make_query(factory=addable)
         url = make_url(self.request, node=self.model,
                        resource='add', query=query)
         target = make_url(self.request, node=self.model, query=query)
         props = Properties()
         props.url = url
         props.target = target
         props.title = info.title
         props.icon = info.icon
         ret.append(props)
     return ret
Exemple #3
0
 def info(self):
     factory = self.request.params.get('factory')
     allowed = self.model.nodeinfo.addables
     if not factory or not allowed or not factory in allowed:
         return None
     return getNodeInfo(factory)