http://TWiki.org/cgi-bin/view/Codev/FuncDotPm#expandCommonVariables_text_topic
describes the expandCommonVariables function as " Expand all common
%VARIABLES% ". This is not only insufficient, it is inaccurate.
expandCommonVariables calls
handleCommonTags, which expands:
- Preferences tags
- Internal tags (please, please, please let's get rid of these!)
- Include files
- TOC tags
All of which - with a considerable stretch of the imagination - could be classed as "Common Variables". However it
also calls
TWiki::Plugins::commonTagsHandler. Try as I might, I just can't perceive Plugins tags as "Common Variables".
Since I really, really want a function that really
does just expand variables, nothing else, I propose that this bug is fixed by the splitting of this function into "expandVariables" - which would handle only preferences tags - and "expandCommonTags" which would do the rest, including plugins tags. In the interim, I am once again going to have to ignore the plugins API and call
TWiki::Prefs::handlePreferencesTags and
TWiki::handleInternalTags directly.
expandCommonVariables should be maintained but deprecated.
Actually, I just realised that the function I require is the same function that has been begging to be abstracted from the
edit and
register- scripts for
ages viz. a function that expands simple variables, such as DATE and TIME, on topic creation. The name suggested for this function was
TWiki::expandVariablesOnTopicCreation, and I need it published to the plugins API. As well as the changes requested above.
--
CrawfordCurrie - 09 Mar 2004
CategoryPluginsAPI