FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 4e2230cb authored by thewilkybarkid's avatar thewilkybarkid
Browse files

Add and enable the CKEditor Link module

parent 41de49bd
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ dependencies[] = taxonomy ...@@ -27,6 +27,7 @@ dependencies[] = taxonomy
dependencies[] = admin_menu dependencies[] = admin_menu
dependencies[] = admin_menu_toolbar dependencies[] = admin_menu_toolbar
dependencies[] = ckeditor dependencies[] = ckeditor
dependencies[] = ckeditor_link
dependencies[] = date dependencies[] = date
dependencies[] = email dependencies[] = email
dependencies[] = features dependencies[] = features
......
...@@ -244,12 +244,29 @@ function cambridge_install() { ...@@ -244,12 +244,29 @@ function cambridge_install() {
// Turn off Advanced Content Filter. // Turn off Advanced Content Filter.
$settings['js_conf'] = 'config.allowedContent = true;'; $settings['js_conf'] = 'config.allowedContent = true;';
$plugins = ckeditor_load_plugins();
// Enable CKEditor Link plugin.
$settings['loadPlugins']['ckeditor_link'] = $plugins['ckeditor_link'];
db_update('ckeditor_settings') db_update('ckeditor_settings')
->fields(array('settings' => serialize($settings))) ->fields(array('settings' => serialize($settings)))
->condition('name', $name) ->condition('name', $name)
->execute(); ->execute();
} }
// Add the CKEditor Link filter.
foreach (array('filtered_html', 'full_html') as $format_name) {
$format = filter_format_load($format_name);
$format->filters = filter_list_format($format_name);
foreach ($format->filters as $key => $filter) {
$format->filters[$key] = (array) $filter;
}
$format->filters['ckeditor_link_filter']['status'] = 1;
filter_format_save($format);
}
filter_formats_reset();
// Fix usernames in emails // Fix usernames in emails
cambridge_update_7101(); cambridge_update_7101();
} }
...@@ -401,3 +418,57 @@ function cambridge_update_7105() { ...@@ -401,3 +418,57 @@ function cambridge_update_7105() {
throw new DrupalUpdateException('Failed to install Pathauto Persistent State module'); throw new DrupalUpdateException('Failed to install Pathauto Persistent State module');
} }
} }
/**
* Enable the CKEditor Link module
*/
function cambridge_update_7106() {
if (module_exists('ckeditor_link') || FALSE === module_exists('ckeditor')) {
return;
}
if (FALSE === module_enable(array('ckeditor_link'))) {
throw new DrupalUpdateException('Failed to install CKEditor link module');
}
$profiles = db_select('ckeditor_settings', 's')
->fields('s')
->condition('name', array('Advanced', 'Full'), 'IN')
->execute()
->fetchAllAssoc('name');
if (0 === count($profiles)) {
// Profiles have changed.
return;
}
foreach ($profiles as $name => $profile) {
$settings = unserialize($profile->settings);
$plugins = ckeditor_load_plugins();
// Enable CKEditor Link plugin.
$settings['loadPlugins']['ckeditor_link'] = $plugins['ckeditor_link'];
db_update('ckeditor_settings')
->fields(array('settings' => serialize($settings)))
->condition('name', $name)
->execute();
}
// Add the CKEditor Link filter.
foreach (array('filtered_html', 'full_html') as $format_name) {
$format = filter_format_load($format_name);
if (FALSE === $format) {
// Text format no longer exists.
continue;
}
$format->filters = filter_list_format($format_name);
foreach ($format->filters as $key => $filter) {
$format->filters[$key] = (array) $filter;
}
$format->filters['ckeditor_link_filter']['status'] = 1;
filter_format_save($format);
}
filter_formats_reset();
}
...@@ -10,6 +10,7 @@ projects[advanced_help] = "1.1" ...@@ -10,6 +10,7 @@ projects[advanced_help] = "1.1"
projects[ckeditor] = "1.15" projects[ckeditor] = "1.15"
libraries[ckeditor][download][type] = "file" libraries[ckeditor][download][type] = "file"
libraries[ckeditor][download][url] = "http://download.cksource.com/CKEditor/CKEditor/CKEditor%204.4.4/ckeditor_4.4.4_full.tar.gz" libraries[ckeditor][download][url] = "http://download.cksource.com/CKEditor/CKEditor/CKEditor%204.4.4/ckeditor_4.4.4_full.tar.gz"
projects[ckeditor_link] = "2.3"
projects[context] = "3.2" projects[context] = "3.2"
projects[date] = "2.8" projects[date] = "2.8"
projects[delta] = "3.0-beta11" projects[delta] = "3.0-beta11"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment