We are using a custommade editor with a few extra buttons together with the default ones, is there a way to programmatically import and enable that editor in our installation profile? That would make our deployment process quite a lot easier.

Comments

ufku’s picture

Besides manually populating bueditor_editors/buttons tables, you may consider importing editor code. In bueditor.admin.inc, bueditor_varexport_editor() generates importable editor code which then can be converted back to editor variable by using bueditor_exec_editor_code(). Finally the resulting object can be saved to the database using bueditor_save_import().

// Export
$editor = bueditor_editor_load(ID);
$editor_code_including_buttons = bueditor_varexport_editor($editor);
// Import
$imported_editor_with_buttons = bueditor_exec_editor_code($editor_code_including_buttons);
$saved_editor_clone = bueditor_save_import($imported_editor_with_buttons);

For importing also the non-default libraries or icons, see bueditor_editor_import_form's validate and submit handlers.

granholm’s picture

Thank you, that seems to work perfectly :)

ufku’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.