Open WolfgangFahl opened 9 years ago
This indeed looks like a cool option to have on a wiki. Once this runs smooth a full request should do a world of good. Thumbs up. :+1:
Cool, thanks for the contribution!
You know, from this issue description, I thought the format did something special with each "word". Realized this was about MS Word only when looking at the php file :)
As kgh noted, feel free to submit this as a pull request. Though please do fix that indenting (we use tabs). Other superficial things are wrong @since tags (just delete them, except the one for the class itself), commented out code (please remove) and use protected (please use private where possible). Once the code is a bit more readable and submitted as a PR, it'll be easier to do a more thorough review.
Also, please consider writing some tests.
tabs, @since, protected have been modified and in one case commented out code is put in an if (debug) context. The other commented out code would be nice to have or is not understood by me that's why I am keeping it to make it work or delete if it is truely unnecessary. I'd be happy to add tests if i'd know how to.
private is not o.k. as it seems for Fatal error: Access level to SRF\SRFWord::getResultText() must be protected (as in class SMW\ResultPrinter) or weaker in /var/www/source/php/mediawiki/extensions/SemanticResultFormats/formats/word/SRF_Word.php on line 291
Can you submit the new code as a pull request?
As an enhancement I'd like to add a word format. I have started by forking SemanticResultFormats and made some progress see
https://github.com/BITPlan/SemanticResultFormats/blob/6ac8769ea7ba5b22abfaa504afc015cbe3dc474c/formats/word/SRF_Word.php
I am having trouble looping over the DataItems and Values - my example has some Date values in it and they are not catched in the field loop yet.
There are a few different ways i have seen to do this:
and all work slightly different.