Documentation
This is a "getter"
TopicFunction that returns a list of known
TopicTypes
in a given web. Use it to create a selection in
DataForms for the TopicType formfield.
It adds the "none" type so that you can have (temporarily) un-typed topics. The
type "TopicType" is added
hardcoded so that you don't have to rely on that type
being present in your web and to allow bootstrapping a type system in a web from
scratch on as you will be able to create an initial TopicType TopicType this way.
Parameters
- WEBS: list of webs to search for TopicTypes, defaults to BASEWEB
- EXCLUDE: expression to exclude types (optional)
- ADDITION: types that are listed additionally (optional)
Implementation
%STARTINCLUDE%none, %FORMATLIST{
"TopicType, %IF{"defined ADDITION" then="%ADDITION%, "}% %FORMATLIST{
"%WEBS{default="%BASEWEB%"}%"
format="$percntDBQUERY{\"TopicType=~'\bTopicType\b' OR@Target.TopicType=~'\bTopicType\b'\"
web=\"$1\"
hidenull=\"on\"
separator=\", \"
format=\"$dollartopic\"
}$percnt"
}%"
%IF{"defined EXCLUDE" then="exclude=\"%EXCLUDE%\""}%
format="$1"
separator=", "
sort="on"
unique="on"
}%%STOPINCLUDE%
Test
none, DataForm, DataFormAttribute, DocuTopic, FooBar, TopicFunction, TopicStub, TopicTemplate, TopicType, TopicView, WebTool, WikiApplication, WikiTopic
none, ApplicationLicense, ApplicationTopic, CategorizedTopic, Category, ClassifiedControlledTopic, ClassifiedTopic, ControlledTopic, DataForm, DataFormAttribute, DocuTopic, SeoTopic, TaggedTopic, TopicFunction, TopicStub, TopicTemplate, TopicType, TopicView, WebTool, WikiApplication, WikiTopic, WorkflowDefinition, WorkflowEmailTemplate
Copyright
© 2006-2019 Michael Daum
http://michaeldaumconsulting.com
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read the
LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.