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
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
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)