Commit f47ff3ec authored by webchick's avatar webchick

Issue #1911884 by quicksketch, Wim Leers: Enable CKEditor in the Standard install profile.

parent 47d90dce
......@@ -97,9 +97,9 @@ function hook_editor_default_settings_alter(&$default_settings, $editor) {
* The list of format objects for which settings are being added.
*/
function hook_editor_js_settings_alter(array &$settings, array $formats) {
if (isset($formats['filtered_html'])) {
$settings['filtered_html']['editor'][] = 'MyDifferentEditor';
$settings['filtered_html']['editorSettings']['buttons'] = array('strong', 'italic', 'underline');
if (isset($formats['basic_html'])) {
$settings['basic_html']['editor'][] = 'MyDifferentEditor';
$settings['basic_html']['editorSettings']['buttons'] = array('strong', 'italic', 'underline');
}
}
......
......@@ -33,11 +33,11 @@ function setUp() {
parent::setUp();
// Create users.
$filtered_html_format = filter_format_load('filtered_html');
$basic_html_format = filter_format_load('basic_html');
$full_html_format = filter_format_load('full_html');
$this->admin_user = $this->drupalCreateUser(array(
'administer filters',
filter_permission_name($filtered_html_format),
filter_permission_name($basic_html_format),
filter_permission_name($full_html_format),
));
......@@ -120,7 +120,7 @@ function testFilterAdmin() {
// Line filter.
$second_filter = 'filter_autop';
$filtered = 'filtered_html';
$basic = 'basic_html';
$full = 'full_html';
$plain = 'plain_text';
......@@ -138,9 +138,9 @@ function testFilterAdmin() {
// Add an additional tag.
$edit = array();
$edit['filters[filter_html][settings][allowed_html]'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <quote>';
$this->drupalPost('admin/config/content/formats/' . $filtered, $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->drupalGet('admin/config/content/formats/' . $filtered);
$this->drupalGet('admin/config/content/formats/' . $basic);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Allowed HTML tag added.');
$result = db_query('SELECT * FROM {cache_filter}')->fetchObject();
......@@ -158,7 +158,7 @@ function testFilterAdmin() {
$edit['filters[' . $first_filter . '][weight]'] = 2;
$this->drupalPost(NULL, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->drupalGet('admin/config/content/formats/' . $filtered);
$this->drupalGet('admin/config/content/formats/' . $basic);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', 1, 'Order saved successfully.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', 2, 'Order saved successfully.');
......@@ -168,13 +168,13 @@ function testFilterAdmin() {
));
$this->assertTrue(!empty($elements), 'Reorder confirmed in admin interface.');
$filter_format = entity_load('filter_format', $filtered);
$filter_format = entity_load('filter_format', $basic);
foreach ($filter_format->filters as $filter_name => $filter) {
if ($filter_name == $second_filter || $filter_name == $first_filter) {
$filters[] = $filter_name;
}
}
$this->assertTrue(($filters[0] == $second_filter && $filters[1] == $first_filter), t('Order confirmed in database.'));
$this->assertTrue($filter_format->filters['filter_autop']['weight'] + 1 == $filter_format->filters['filter_url']['weight'], t('Order confirmed in configuration.'));
// Add format.
$edit = array();
......@@ -216,7 +216,7 @@ function testFilterAdmin() {
$this->drupalGet('node/add/page');
$this->assertRaw('<option value="' . $full . '">Full HTML</option>', 'Full HTML filter accessible.');
// Use filtered HTML and see if it removes tags that are not allowed.
// Use basic HTML and see if it removes tags that are not allowed.
$body = '<em>' . $this->randomName() . '</em>';
$extra_text = 'text';
$text = $body . '<random>' . $extra_text . '</random>';
......@@ -225,7 +225,7 @@ function testFilterAdmin() {
$langcode = LANGUAGE_NOT_SPECIFIED;
$edit["title"] = $this->randomName();
$edit["body[$langcode][0][value]"] = $text;
$edit["body[$langcode][0][format]"] = $filtered;
$edit["body[$langcode][0][format]"] = $basic;
$this->drupalPost('node/add/page', $edit, t('Save'));
$this->assertRaw(t('Basic page %title has been created.', array('%title' => $edit["title"])), 'Filtered node created.');
......@@ -258,9 +258,9 @@ function testFilterAdmin() {
// Allowed tags.
$edit = array();
$edit['filters[filter_html][settings][allowed_html]'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>';
$this->drupalPost('admin/config/content/formats/' . $filtered, $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->drupalGet('admin/config/content/formats/' . $filtered);
$this->drupalGet('admin/config/content/formats/' . $basic);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Changes reverted.');
// Full HTML.
......@@ -276,9 +276,9 @@ function testFilterAdmin() {
$edit = array();
$edit['filters[' . $second_filter . '][weight]'] = 2;
$edit['filters[' . $first_filter . '][weight]'] = 1;
$this->drupalPost('admin/config/content/formats/' . $filtered, $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->drupalGet('admin/config/content/formats/' . $filtered);
$this->drupalGet('admin/config/content/formats/' . $basic);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]'], 'Changes reverted.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', $edit['filters[' . $first_filter . '][weight]'], 'Changes reverted.');
}
......@@ -291,7 +291,7 @@ function testUrlFilterAdmin() {
$edit = array(
'filters[filter_url][settings][filter_url_length]' => $this->randomName(4),
);
$this->drupalPost('admin/config/content/formats/filtered_html', $edit, t('Save configuration'));
$this->assertNoRaw(t('The text format %format has been updated.', array('%format' => 'Filtered HTML')));
$this->drupalPost('admin/config/content/formats/basic_html', $edit, t('Save configuration'));
$this->assertNoRaw(t('The text format %format has been updated.', array('%format' => 'Basic HTML')));
}
}
......@@ -56,12 +56,12 @@ function testSearchResultsComment() {
$comment_body = 'Test comment body';
variable_set('comment_preview_article', DRUPAL_OPTIONAL);
// Enable check_plain() for 'Filtered HTML' text format.
$filtered_html_format_id = 'filtered_html';
// Enable check_plain() for 'Basic HTML' text format.
$basic_html_format_id = 'basic_html';
$edit = array(
'filters[filter_html_escape][status]' => TRUE,
);
$this->drupalPost('admin/config/content/formats/' . $filtered_html_format_id, $edit, t('Save configuration'));
$this->drupalPost('admin/config/content/formats/' . $basic_html_format_id, $edit, t('Save configuration'));
// Allow anonymous users to search content.
$edit = array(
DRUPAL_ANONYMOUS_RID . '[search content]' => 1,
......
......@@ -162,7 +162,7 @@ function testBreadCrumbs() {
$this->assertBreadcrumb('admin/config/content/formats', $trail);
$trail += array(
'admin/config/content/formats' => t('Text formats'),
'admin/config/content/formats' => t('Text formats and editors'),
);
$this->assertBreadcrumb('admin/config/content/formats/add', $trail);
$this->assertBreadcrumb("admin/config/content/formats/$format_id", $trail);
......
......@@ -151,7 +151,7 @@ function testLength() {
for ($i = 0; $i <= 37; $i++) {
$this->callTextSummary($text, $expected[$i], NULL, $i);
$this->callTextSummary($text, $expected_lb[$i], 'plain_text', $i);
$this->callTextSummary($text, $expected_lb[$i], 'filtered_html', $i);
$this->callTextSummary($text, $expected_lb[$i], 'basic_html', $i);
}
}
......
......@@ -110,8 +110,8 @@ function testTextFieldFormatted() {
$this->drupalPost('node/add/article', $edit, t('Save'));
// Populate the body field: the first item gets the "Full HTML" input
// format, the second one "Filtered HTML".
$formats = array('full_html', 'filtered_html');
// format, the second one "Basic HTML".
$formats = array('full_html', 'basic_html');
$langcode = LANGUAGE_NOT_SPECIFIED;
foreach ($body as $delta => $value) {
$edit = array(
......
......@@ -86,7 +86,7 @@ display:
field: area
empty: '1'
content: 'No people available.'
format: filtered_html
format: plain_text
plugin_id: text
page_1:
display_plugin: page
......
format: filtered_html
name: 'Filtered HTML'
status: '1'
weight: '0'
roles:
- anonymous
- authenticated
cache: '1'
filters:
filter_url:
module: filter
status: '1'
filter_html:
module: filter
status: '1'
filter_autop:
module: filter
status: '1'
filter_htmlcorrector:
module: filter
status: '1'
langcode: en
......@@ -7,6 +7,7 @@ dependencies:
- history
- block
- breakpoint
- ckeditor
- color
- config
- comment
......@@ -15,6 +16,7 @@ dependencies:
- datetime
- custom_block
- edit
- editor
- help
- image
- menu
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment