It was Sam's comment https://tracker.moodle.org/browse/MDL-40065?focusedCommentId=230075&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-230075 and below. I had no choice!
'columns2rt.php' gets a little of the way but should break when used with 'side-pre' as 'side-post' is hard coded. Ok...
There is a two stage logic to deal with (I cannot believe I'm still having to explain it!!!)....
- If there is a 'side-pre' then put the blocks on the left otherwise must be 'side-post' then put the blocks on the right. That is stage one.
- Stage two is if we are using an RTL language, if so, then swap the side decision made in 1.
So, to repeat in case it was missed the first time...
- Test if using 'side-pre' to determine the side that the blocks should go on.
- Test if using RTL, if so, swap side decision made in 1.
This is all based upon the perceived notion that 'pre' means before and 'post' means after - which until I worked with this I assumed was fact. And secondly that in LTR the direction is from the left of the page to the right of the page and in RTL from the right to the left, so logically with LTR 'side-pre' is on the left and 'side-post' is on the right and with RTL, 'side-pre' is on the right and 'side-post' is on the left. I am NOT confused about this, it's just does not seem to be getting through as people keep telling me that I'm wrong when in fact they are missing the point that theme's need to support the ability to put blocks where they are desired and that 'pre' means before and 'post' means after. If this is not the case, then change them to something more meaningful before every theme designer goes nuts trying to solve the problem like supporting Internet Explorer.
I'm sorry if I'm sounding fed up, but that is the case. This is simple logic with only four states! How hard can that be to understand?
P.S. If 'side-pre' and 'side-post' are renamed to 'primary' and 'secondary' then we would loose the ability to conceptually place things where we wanted them to be. Lets leave it as is and provide the best possible API to theme designers so they can get on with creating wonderful stuff.
P.P.S. Even if I'm wrong and 'side-pre' and 'side-post' are just primary and secondary block locations then use my code as at least it gives the option of facilitating a switch in sides of the blocks just by changing the values in the 'config.php' file.