'Moodle - How to disable some of atto editor toolbar buttons in a specific form?

I'm new to Moodle development, and I'm kinda stuck on a problem at the moment and couldn't find help on the Documentation nor the Moodle Forums:

I'm creating a local plugin, and in the plugin there's a form to add/edit some stuff that is added to the homepage. My problem is that I need the Atto editor for one of the fields for the image insertion among the text,but I need to disable the text formatting options (e.g. Align text). I tried this:

$editoroptions = [
    'align' => ''
];
        
$mform->addElement('editor', 'description', get_string('desc', 'local_tutoriais'))->setValue($this->data('description'), $editoroptions);

but it doesn't work.

I did manage to disable the buttons I wanted going to the Atto editor options page on teh Site Administration, but that disables the button for all the Atto editors on the whole site.

Any ideas on how to disable these toolbar buttons only on the specific editor on my form? Thanks in advance for any answer!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source