diff --git a/lib/editor/atto/db/install.php b/lib/editor/atto/db/install.php new file mode 100644 index 00000000000..6fd16b58178 --- /dev/null +++ b/lib/editor/atto/db/install.php @@ -0,0 +1,49 @@ +. + +/** + * Atto text editor installation steps. + * + * @package editor_atto + * @copyright 2013 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +/** + * Enable this text editor by default. + * + * @return bool + */ +function xmldb_editor_atto_install() { + global $CFG; + // Get the current list of editors. + $currentconfig = $CFG->texteditors; + if (is_null($currentconfig)) { + $currentconfig = ''; + } + $editors = explode(',', $currentconfig); + // Insert atto in the second position. + array_splice($editors, 1, 0, array('atto')); + // Remove duplicates. + $editors = array_unique($editors); + // Set the new config. + unset_config('texteditors'); + set_config('texteditors', implode(',', $editors)); + + return true; +}