- def __init__ (self, visible=True, hidable=True, hidden_by_default=False, **settings):
- # xxx should generate some random id
+ ##########
+ # Constructor
+ #### mandatory
+ # . title: is used visually for displaying the widget
+ # . name: a simple id suitable for forging css names
+ #### optional
+ # . hidable: whether it can be turned on and off from the UI
+ # like e.g. PleKitToggle
+ # . hidden_by_default: if hidable, what's the initial status
+ # . visible: if not set the plugin does not show up at all,
+ # not quite sure what this was for
+ #### internal data
+ # . uuid: created internally
+ # . rank: this is for plugins sons of a composite plugin
+ #### custom
+ # any other setting can also be set when creating the object, like
+ # p=Plugin(foo='bar')
+ # which will result in 'foo' being accessible to the template engine
+ #
+ def __init__ (self, title, name,
+ visible=True, hidable=True, hidden_by_default=False, **settings):
+ # what is in this dictionary will get exposed to template and to javascript
+ self._settings=settings
+ self.title=title
+ self.name=name
+ self.add_to_settings ( ['title','name'] )