Beispiel #1
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
Beispiel #2
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)