Support Forum

Moving buttons around integrated toolbar

JS js
js
Member

I am trying to figure out how to move the ‘submit topic’ button to the right of ‘cancel’ in the integrated toolbar, which is pretty sweet btw, have had no luck finding where to… any guidance will be much appreciated :)

5 Answers

New Answer

MP Mr Papa
Mr Papa
Member

might need Andy to weigh in here since he wrote the integrated toolbar stuff… but not sure there is an easy way to do that…

think you will need to hook into the filter ‘sph_post_editor_controls’ and manually rearrange them…  by that I mean do some string replacements to get the order you want…

MP Mr Papa
Mr Papa
Member

should have added you can look at the filter arguments and details in simple-press/forum/content/forms/sp-form-components.php

YS Yellow Swordfish
Yellow Swordfish
Member

mmmm. Need to give some serious thought to this one. This is one of the very small areas of SP not served by simple templates but we have managed to work around most issues to allow for customisation… but not this one.

let me think on it and come up with a plan for the next release if possible.

JS js
js
Member

simple-press/forum/content/forms/sp-form-components.php

Following that path and manually arranging them worked for me, thanks, in the Topic Form Submit section, Post Form Submit section, and Post Edit Form Submit section I switched these two lines to

$out.= "<input type='button' tabindex='107' class='$controlSubmit vtip' title='$tipCancelButton' id='sfcancel' name='cancel' value='$labelPostCancel' onclick='spjEdCancelEditor();' />n";
 $out.= "<input type='submit' $enabled tabindex='106' class='$controlSubmit vtip' title='$tipSubmitButton' name='newpost' id='sfsave' value='$buttontext' />n";
MP Mr Papa
Mr Papa
Member

so you edited the core code instead of using the filter?? you will lose your changes on an upgrade if you modified core…

a ticket is open to allow more direct control in theme than a filter…