Issue description
It should be possible to define names as a function of the properties of a topic.
Developer comments
There is two options here:
* the name is not a real (persisted) statement, but is added to the topic on demand (which item identifier does the name get?), then it is hard to search for it
* at some point (when?) the name is persisted and added to the topic
I think searchability is in this case not essential. A topic that cannot be named easily will probably not be searched for by name, but rather by its properties.
It is more important that when the name is given the subject can be recognized by the user (e.g. in a select box), so the statement should not be persisted.
The definition of the naming rule is best formulated as a TMQL query, but for now some other way has to do.
It is now possible to create label rules for topic types. The rules are formulated in PHP, and can use the following interface:
* $this->ovalue($ot_tr): get an occurrence value
* $this->nvalue($nt_tr): get a name value
* $this->cplayer($at_tr): get label of one counter player
* $this->cplayers($at_tr): get labels of all counter players
Return type is string except for cplayers which returns an array.
%ot_tr%, %nt_tr%, %at_tr% are references to statement types.
|
|