Moodle 3.7 - Reply inline and "Advanced" editor mode

Re: Moodle 3.7 - Reply inline and "Advanced" editor mode

by Andrew Hancox -
Number of replies: 5
Picture of Core developers Picture of Plugin developers
For anyone looking for a quick patch for this I've written an incredibly grim hack to make the add a post/reply buttons go straight to the advanced editor screen skipping the in-line editor entirely.
It's a tour de force of how not to do JS in Moodle so YMMV but is working for my client until something better comes up.

<script type="text/javascript">
$(document).ready(function () {
$('div.p-t-1.p-b-1 a').click(function () {
$('#id_advancedadddiscussion').click();
});
$('div[data-region="post-actions-container"] a[data-action="collapsible-link"]').click(function (e) {
window.location.replace($(e.target).attr('href'));
});
});
</script>

Average of ratings: Useful (1)
In reply to Andrew Hancox

Re: Moodle 3.7 - Reply inline and "Advanced" editor mode

by Irfad Razick -

Hi Andrew,

Could you please let me know in which file to add this script?

In reply to Irfad Razick

Re: Moodle 3.7 - Reply inline and "Advanced" editor mode

by Andrew Hancox -
Picture of Core developers Picture of Plugin developers

Some themes allow you to inject custom javascript onto pages, you could do this, alternatively you could edit your theme and put it in there.

In reply to Irfad Razick

Re: Moodle 3.7 - Reply inline and "Advanced" editor mode

by Héctor Terán -
hi there, don't know if you already solved your issue, but i used this hack and it worked by adding the code in the Before BODY is closed box available here: /admin/settings.php?section=additionalhtml (add your moodle domain before the line).
In reply to Andrew Hancox

Re: Moodle 3.7 - Reply inline and "Advanced" editor mode

by James Cruickshank -

Hi Andrew 

I tried putting your script in the Additional HTML head section but that had no apparent effect. 

On another point, I wonder why the "Advanced" string is not customisable via the language pack? This seems to break a basic moodle principle of language customisations?

Jim Cruickshank

In reply to James Cruickshank

Re: Moodle 3.7 - Reply inline and "Advanced" editor mode

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi James,

For what i remember, the "Advanced" word used is a common one defined globally for Moodle ("advanced" string in /lang/en/moodle.php).

It could/should be changed for a dedicated string, allowing it to be customized with no risk to break things elsewhere.

I'm really not a specialist, but i think used string is defined in /mod/forum/templates/inpage_reply.mustache

Séverin