n1ed.install in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7
Same filename and directory in other branches
Installation hooks for N1ED module.
File
n1ed.installView source
<?php
/**
* @file
* Installation hooks for N1ED module.
*/
/**
* Called when installed: attaches N1ED to appropriate formats.
*/
function n1ed_install() {
variable_set('n1edApiKey', "N1D7DFLT");
variable_set('n1edToken', NULL);
$ckeditor_settings = db_select('ckeditor_settings', 'cs')
->condition('name', 'Full')
->fields('cs')
->execute()
->fetchAll();
$plugins = unserialize($ckeditor_settings[0]->settings);
$plugins['loadPlugins']['n1ed'] = [
'name' => 'N1ED',
'desc' => 'N1ED - visual editor with Bootstrap support',
'path' => '%base_path%modules/n1ed/plugins/n1ed/',
];
$plugins['allowed_content'] = 'f';
db_update('ckeditor_settings')
->fields([
'settings' => serialize($plugins),
])
->condition('name', 'Full')
->execute();
db_update('filter_format')
->fields([
'weight' => -1,
])
->condition('format', 'full_html')
->execute();
db_update('filter')
->fields([
'status' => 0,
])
->condition('format', 'full_html')
->execute();
}
Functions
Name | Description |
---|---|
n1ed_install | Called when installed: attaches N1ED to appropriate formats. |