luitzen
IWhen I make a _template.txt for a namespace I'd like to add extra variables not supported by DokuWiki.
A Plugin searching the template for all not resolved @<VAR>@ variables and requesting userinput for those variables could solve this. Is this a difficult plugin to write or is there an other possible way to go?
I can try to make this myself, please send me some examples to show me the direction to go (I've never programmed in PHP before). I allready found out that the function pageTemplate in inc/common.php has to be extended. Befor return $tpl this could be included:
--- code extract
/**
* find all remaining variables not replaced in the preceding lines
*/
preg_match_all("/@[A-Za-z]*@/",$tpl,$tpl_matches);
$unique_tpl_matches = array_unique($tpl_matches[0]);
/**
* $unique_tpl_matches contains all not replaced variables for which a query should be started.
* to display them:
*
* foreach($unique_tpl_matches as $key => $value)
* {
* printf("%s<BR>",$value);
* }
*
*/
--- end code extract
Now, how do I make a popup or form to ask for the remaining variables???